Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2003-08-19 15:04:45 -0400
committerJean Michel-Lemieux2003-08-19 15:04:45 -0400
commit129851dd36f96d38e80b599b1d23f2c7d4339129 (patch)
tree5ccd58217ecf5c933f96f47e12193c6a93c9b973
parent57565cccfd4559815cc13e91c562e7b27c8751c0 (diff)
downloadeclipse.platform.team-129851dd36f96d38e80b599b1d23f2c7d4339129.tar.gz
eclipse.platform.team-129851dd36f96d38e80b599b1d23f2c7d4339129.tar.xz
eclipse.platform.team-129851dd36f96d38e80b599b1d23f2c7d4339129.zip
Open in compare editor action moved to open action group and made enablement consistent.
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java10
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java8
2 files changed, 11 insertions, 7 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java
index f4be4315f..2883bb9f1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/OpenWithActionGroup.java
@@ -28,6 +28,7 @@ import org.eclipse.ui.views.navigator.ResourceNavigatorMessages;
public class OpenWithActionGroup extends SyncViewerActionGroup {
private OpenFileAction openFileAction;
+ private OpenInCompareAction openInCompareAction;
public OpenWithActionGroup(SynchronizeView viewer) {
super(viewer);
@@ -35,7 +36,8 @@ public class OpenWithActionGroup extends SyncViewerActionGroup {
}
protected void makeActions() {
- openFileAction = new OpenFileAction(getSyncView().getSite().getPage());
+ openFileAction = new OpenFileAction(getSyncView().getSite().getPage());
+ openInCompareAction = new OpenInCompareAction(getSyncView());
}
public void fillContextMenu(IMenuManager menu) {
@@ -67,6 +69,8 @@ public class OpenWithActionGroup extends SyncViewerActionGroup {
return;
}
+ menu.add(openInCompareAction);
+
openFileAction.selectionChanged(selection);
menu.add(openFileAction);
@@ -90,4 +94,8 @@ public class OpenWithActionGroup extends SyncViewerActionGroup {
private IResource getResource(Object obj) {
return (IResource)TeamAction.getAdapter(obj, IResource.class);
}
+
+ public void openInCompareEditor() {
+ openInCompareAction.run();
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java
index 1b9ccc68e..907cb5f9d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/SyncViewerActions.java
@@ -53,7 +53,6 @@ public class SyncViewerActions extends SyncViewerActionGroup {
private Action collapseAll;
private Action refreshSelectionAction;
private Action toggleViewerType;
- private Action open;
private Action refreshViewContents;
private ExpandAllAction expandAll;
private SelectAllAction selectAllAction;
@@ -140,7 +139,6 @@ public class SyncViewerActions extends SyncViewerActionGroup {
toggleViewerType = new ToggleViewAction(getSyncView(), getSyncView().getCurrentViewType());
- open = new OpenInCompareAction(syncView);
IPropertyChangeListener workingSetUpdater = new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
@@ -189,9 +187,7 @@ public class SyncViewerActions extends SyncViewerActionGroup {
* @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
public void fillContextMenu(IMenuManager manager) {
- super.fillContextMenu(manager);
-
- manager.add(open);
+ super.fillContextMenu(manager);
openWithActionGroup.fillContextMenu(manager);
manager.add(new Separator());
manager.add(expandAll);
@@ -218,7 +214,7 @@ public class SyncViewerActions extends SyncViewerActionGroup {
}
public void open() {
- open.run();
+ openWithActionGroup.openInCompareEditor();
}
/* (non-Javadoc)

Back to the top