1 11 package org.eclipse.debug.internal.ui.sourcelookup; 12 13 import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector; 14 import org.eclipse.jface.viewers.IStructuredSelection; 15 16 21 public class AddContainerAction extends SourceContainerAction { 22 23 private ISourceLookupDirector fDirector; 24 25 public AddContainerAction() { 26 super(SourceLookupUIMessages.sourceTab_addButton); 27 } 28 29 34 public void run() { 35 AddSourceContainerDialog dialog = new AddSourceContainerDialog(getShell(), getViewer(), fDirector); 36 dialog.open(); 37 } 38 39 public void setSourceLookupDirector(ISourceLookupDirector director) { 40 fDirector = director; 41 } 42 43 46 protected boolean updateSelection(IStructuredSelection selection) { 47 if(selection == null || selection.isEmpty()) { 48 return true; 49 } 50 return getViewer().getTree().getSelection()[0].getParentItem()==null; 51 } 52 } 53 | Popular Tags |