1 11 package org.eclipse.debug.internal.ui.launchConfigurations; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.core.DebugPlugin; 15 import org.eclipse.debug.core.ILaunchConfigurationType; 16 import org.eclipse.debug.ui.DebugUITools; 17 import org.eclipse.debug.ui.ILaunchGroup; 18 import org.eclipse.jface.viewers.IStructuredContentProvider; 19 import org.eclipse.jface.viewers.TableViewer; 20 import org.eclipse.jface.viewers.Viewer; 21 import org.eclipse.jface.viewers.ViewerSorter; 22 import org.eclipse.swt.SWT; 23 import org.eclipse.swt.widgets.Composite; 24 25 31 public class LaunchConfigurationsViewer extends TableViewer { 32 33 class ContentProvider implements IStructuredContentProvider { 34 35 38 public Object [] getElements(Object inputElement) { 39 if (inputElement instanceof ILaunchConfigurationType) { 40 try { 41 return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations((ILaunchConfigurationType) inputElement); 42 } catch (CoreException e) { 43 } 44 } 45 return new Object [0]; 46 } 47 48 51 public void dispose() { 52 } 53 54 57 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 58 } 59 60 } 61 62 68 public LaunchConfigurationsViewer(Composite parent, ILaunchGroup launchGroup) { 69 super(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); 70 setContentProvider(new ContentProvider()); 71 setLabelProvider(DebugUITools.newDebugModelPresentation()); 72 setSorter(new ViewerSorter()); 73 addFilter(new LaunchGroupFilter(launchGroup)); 74 } 75 76 } 77 | Popular Tags |