-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to switch between files in Git Diff widget (#5965)
* Performs small refactoring of git-compare-related functionality. * Adds ability to switch to the next/previous file in git compare widget. * Adds hotkeys for next and previous diff * Adds Save Changes button for git compare widget. * Fixes compare with deleted file bug. * Moves Git Diff widget from iframe to IDE.
- Loading branch information
Showing
33 changed files
with
949 additions
and
485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ide/che-core-ide-ui/src/main/java/org/eclipse/che/ide/ui/button/ButtonAlignment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) 2012-2017 Red Hat, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.che.ide.ui.button; | ||
|
||
/** | ||
* Describes button alignment in a horizontal container. | ||
* | ||
* @author Mykola Morhun | ||
*/ | ||
public enum ButtonAlignment { | ||
LEFT, | ||
RIGHT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...n-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/action/NextDiffAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2012-2017 Red Hat, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.che.ide.ext.git.client.action; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
import org.eclipse.che.ide.api.action.Action; | ||
import org.eclipse.che.ide.api.action.ActionEvent; | ||
import org.eclipse.che.ide.ext.git.client.compare.ComparePresenter; | ||
|
||
/** @author Mykola Morhun */ | ||
@Singleton | ||
public class NextDiffAction extends Action { | ||
|
||
private final ComparePresenter comparePresenter; | ||
|
||
@Inject | ||
public NextDiffAction(ComparePresenter comparePresenter) { | ||
this.comparePresenter = comparePresenter; | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
if (comparePresenter.isShown()) { | ||
comparePresenter.onNextDiffClicked(); | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...t-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/action/PreviousDiffAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2012-2017 Red Hat, Inc. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.che.ide.ext.git.client.action; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
import org.eclipse.che.ide.api.action.Action; | ||
import org.eclipse.che.ide.api.action.ActionEvent; | ||
import org.eclipse.che.ide.ext.git.client.compare.ComparePresenter; | ||
|
||
/** @author Mykola Morhun */ | ||
@Singleton | ||
public class PreviousDiffAction extends Action { | ||
|
||
private final ComparePresenter comparePresenter; | ||
|
||
@Inject | ||
public PreviousDiffAction(ComparePresenter comparePresenter) { | ||
super(null, null); | ||
this.comparePresenter = comparePresenter; | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) { | ||
if (comparePresenter.isShown()) { | ||
comparePresenter.onPreviousDiffClicked(); | ||
} | ||
} | ||
} |
Oops, something went wrong.