1 11 package org.eclipse.team.internal.ccvs.ui.repo; 12 13 import org.eclipse.jface.viewers.ISelection; 14 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; 15 import org.eclipse.team.internal.ui.actions.TeamAction; 16 import org.eclipse.ui.IWorkbenchPart; 17 18 19 22 public class RemoteTagsView extends RemoteViewPart { 23 24 public static final String VIEW_ID = "org.eclipse.team.ccvs.ui.RemoteTagsView"; 26 30 public RemoteTagsView() { 31 super(VIEW_ID); 32 } 33 34 37 protected Object getTreeInput() { 38 return null; 39 } 40 41 protected void initializeListeners() { 42 getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(RepositoriesView.VIEW_ID, this); 44 } 45 46 49 public void dispose() { 50 getSite().getWorkbenchWindow().getSelectionService().removePostSelectionListener(RepositoriesView.VIEW_ID, this); 51 super.dispose(); 52 } 53 54 57 public void selectionChanged(IWorkbenchPart part, ISelection selection) { 58 Object [] selected = TeamAction.getSelectedAdaptables(selection, ICVSRepositoryLocation.class); 59 if (selected.length == 0) { 60 getViewer().setInput(null); 61 } else { 62 getViewer().setInput((ICVSRepositoryLocation)selected[0]); 63 }; 64 refreshViewer(); 65 } 66 } 67 | Popular Tags |