Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-01-29 21:24:05 +0000
committerMichael Valenta2003-01-29 21:24:05 +0000
commit99cdb843c3e66e9d9ed841533fd211b3ea584353 (patch)
tree9503d239d279e6e18c18afb52e09a6f76b3b66d8
parent0d413954e8d8d6323d0e452bcbb86cc9b25dbc17 (diff)
downloadeclipse.platform.team-99cdb843c3e66e9d9ed841533fd211b3ea584353.tar.gz
eclipse.platform.team-99cdb843c3e66e9d9ed841533fd211b3ea584353.tar.xz
eclipse.platform.team-99cdb843c3e66e9d9ed841533fd211b3ea584353.zip
30529: Support for Show In... in Team support
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncView.java20
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java12
2 files changed, 29 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncView.java
index d634a4495..065cbf826 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/SyncView.java
@@ -21,7 +21,6 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -41,6 +40,8 @@ import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.help.WorkbenchHelp;
+import org.eclipse.ui.part.IShowInSource;
+import org.eclipse.ui.part.ShowInContext;
import org.eclipse.ui.part.ViewPart;
/**
@@ -56,7 +57,6 @@ import org.eclipse.ui.part.ViewPart;
public class SyncView extends ViewPart {
public static final String VIEW_ID = "org.eclipse.team.ui.sync.SyncView"; //$NON-NLS-1$
private SyncCompareInput input;
- private TreeViewer viewer;
private Composite top;
// The possible sync modes
@@ -419,4 +419,20 @@ public class SyncView extends ViewPart {
menu.update(false);
bars.updateActionBars();
}
+
+ /**
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class key) {
+ if (key == IShowInSource.class) {
+ return new IShowInSource() {
+ public ShowInContext getShowInContext() {
+ if (input == null || input.getViewer() == null) return null;
+ return new ShowInContext(null, input.getViewer().getSelection());
+ }
+ };
+ }
+ return super.getAdapter(key);
+ }
+
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java
index 193c5b3fe..7d1be48ad 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/TeamFile.java
@@ -21,6 +21,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -47,7 +48,7 @@ import org.eclipse.team.internal.ui.TeamUIPlugin;
* side is the local file, the right side is the remote file,
* and the ancestor is the common file.
*/
-public class TeamFile extends DiffElement implements ICompareInput, ITeamNode {
+public class TeamFile extends DiffElement implements ICompareInput, ITeamNode, IAdaptable {
private MergeResource mergeResource;
@@ -365,4 +366,13 @@ public class TeamFile extends DiffElement implements ICompareInput, ITeamNode {
public boolean hasBeenSaved() {
return hasBeenSaved;
}
+
+ /**
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter == IResource.class)
+ return mergeResource.getResource();
+ return null;
+ }
}

Back to the top