Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 56341 Details for
Bug 74480
[launching] Simplify the launch experience for less technical users of Eclipse
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
run-properties.patch (text/plain), 25.36 KB, created by
Darin Wright
on 2007-01-03 13:00:56 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2007-01-03 13:00:56 EST
Size:
25.36 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.debug.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/plugin.xml,v >retrieving revision 1.386 >diff -u -r1.386 plugin.xml >--- plugin.xml 20 Dec 2006 17:13:37 -0000 1.386 >+++ plugin.xml 3 Jan 2007 17:55:18 -0000 >@@ -1394,6 +1394,13 @@ > </or> > </enabledWhen> > </page> >+ <page >+ adaptable="true" >+ class="org.eclipse.debug.internal.ui.launchConfigurations.properties.ExecutionPropertiesPage" >+ id="org.eclipse.debug.ui.properties.execution" >+ name="Execution" >+ objectClass="org.eclipse.core.resources.IResource"> >+ </page> > </extension> > <!-- commands and their bindings > NOTE: >Index: ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java,v >retrieving revision 1.62 >diff -u -r1.62 IDebugHelpContextIds.java >--- ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java 7 Dec 2006 18:33:34 -0000 1.62 >+++ ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java 3 Jan 2007 17:55:18 -0000 >@@ -115,6 +115,7 @@ > // Property pages > public static final String PROCESS_PROPERTY_PAGE = PREFIX + "process_property_page_context"; //$NON-NLS-1$ > public static final String PROCESS_PAGE_RUN_AT = PREFIX + "process_page_run_at_time_widget"; //$NON-NLS-1$ >+ public static final String EXECUTION_PROPERTY_PAGE = PREFIX + "execution_property_page"; //$NON-NLS-1$ > > // Launch configuration dialog pages > public static final String LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB = PREFIX + "launch_configuration_dialog_common_tab"; //$NON-NLS-1$ >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/CategoryFilter.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/CategoryFilter.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/CategoryFilter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/CategoryFilter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,39 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.debug.internal.ui.launchConfigurations.properties; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.jface.viewers.ViewerFilter; >+ >+/** >+ * Filters configurations in non-default launch categories. >+ * >+ * @since 3.3 >+ */ >+public class CategoryFilter extends ViewerFilter { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) >+ */ >+ public boolean select(Viewer viewer, Object parentElement, Object element) { >+ if (element instanceof ILaunchConfiguration) { >+ try { >+ return ((ILaunchConfiguration)element).getType().getCategory() == null; >+ } catch (CoreException e) { >+ return false; >+ } >+ } >+ return true; >+ } >+ >+} >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/LaunchConfigurationComparator.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/LaunchConfigurationComparator.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/LaunchConfigurationComparator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/LaunchConfigurationComparator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,78 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.debug.internal.ui.launchConfigurations.properties; >+ >+import java.util.ArrayList; >+import java.util.Collections; >+import java.util.Comparator; >+import java.util.HashMap; >+import java.util.Iterator; >+import java.util.List; >+import java.util.Map; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.debug.core.DebugPlugin; >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.core.ILaunchConfigurationType; >+import org.eclipse.ui.model.WorkbenchViewerComparator; >+ >+/** >+ * Groups configurations by type. >+ * >+ * @since 3.3 >+ */ >+public class LaunchConfigurationComparator extends WorkbenchViewerComparator { >+ >+ private static Map categories; >+ >+ public int category(Object element) { >+ Map map = getCategories(); >+ if (element instanceof ILaunchConfiguration) { >+ ILaunchConfiguration configuration = (ILaunchConfiguration) element; >+ try { >+ Integer i = (Integer) map.get(configuration.getType()); >+ if (i != null) { >+ return i.intValue(); >+ } >+ } catch (CoreException e) { >+ } >+ } >+ return map.size(); >+ } >+ >+ private Map getCategories() { >+ if (categories == null) { >+ categories = new HashMap(); >+ ILaunchConfigurationType[] lcts = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); >+ List types = new ArrayList(lcts.length); >+ for (int i = 0; i < lcts.length; i++) { >+ types.add(lcts[i]); >+ } >+ Collections.sort(types, new Comparator() { >+ public int compare(Object o1, Object o2) { >+ ILaunchConfigurationType t1 = (ILaunchConfigurationType) o1; >+ ILaunchConfigurationType t2 = (ILaunchConfigurationType) o2; >+ return t1.getName().compareTo(t2.getName()); >+ } >+ >+ }); >+ Iterator iterator = types.iterator(); >+ int i = 0; >+ while (iterator.hasNext()) { >+ categories.put(iterator.next(), new Integer(i)); >+ i++; >+ } >+ } >+ return categories; >+ } >+ >+ >+} >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/ExecutionPropertiesPage.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/ExecutionPropertiesPage.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/ExecutionPropertiesPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/ExecutionPropertiesPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,449 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.debug.internal.ui.launchConfigurations.properties; >+ >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.Collections; >+import java.util.Comparator; >+import java.util.Iterator; >+import java.util.List; >+ >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.debug.core.DebugPlugin; >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.core.ILaunchConfigurationType; >+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; >+import org.eclipse.debug.core.ILaunchManager; >+import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.debug.internal.ui.DefaultLabelProvider; >+import org.eclipse.debug.internal.ui.IDebugHelpContextIds; >+import org.eclipse.debug.internal.ui.SWTUtil; >+import org.eclipse.debug.ui.DebugUITools; >+import org.eclipse.debug.ui.ILaunchGroup; >+import org.eclipse.jface.viewers.ArrayContentProvider; >+import org.eclipse.jface.viewers.CheckStateChangedEvent; >+import org.eclipse.jface.viewers.CheckboxTableViewer; >+import org.eclipse.jface.viewers.ICheckStateListener; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.ISelectionChangedListener; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jface.viewers.SelectionChangedEvent; >+import org.eclipse.jface.viewers.StructuredSelection; >+import org.eclipse.jface.window.Window; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Table; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.dialogs.ListDialog; >+import org.eclipse.ui.dialogs.PropertyPage; >+ >+import com.ibm.icu.text.MessageFormat; >+ >+/** >+ * Displays execution settings for a resource - associated launch configurations. >+ * >+ * @since 3.3 >+ */ >+public class ExecutionPropertiesPage extends PropertyPage implements ICheckStateListener, ISelectionChangedListener, SelectionListener { >+ >+ private CheckboxTableViewer viewer; >+ private Button newButton; >+ private Button copyButton; >+ private Button editButton; >+ private Button deleteButton; >+ >+ /** >+ * List of configurations to be deleted >+ */ >+ private List deletedConfigurations = new ArrayList(); >+ >+ /** >+ * List of original default candidates for the resource >+ */ >+ private List originalCandidates; >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createContents(Composite parent) { >+ // TODO: add help to documentation >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.EXECUTION_PROPERTY_PAGE); >+ >+ Composite composite = new Composite(parent, SWT.NONE); >+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ GridLayout layout = new GridLayout(); >+ layout.marginHeight = 0; >+ layout.marginWidth = 0; >+ composite.setLayout(layout); >+ >+ SWTUtil.createLabel(composite, MessageFormat.format("&Select default launch settings for {0}:", new String[]{getResource().getName()}), 2); >+ >+ Composite tableAndButtons = new Composite(composite, SWT.NONE); >+ tableAndButtons.setLayoutData(new GridData(GridData.FILL_BOTH)); >+ layout = new GridLayout(); >+ layout.marginHeight = 0; >+ layout.marginWidth = 0; >+ layout.numColumns = 2; >+ tableAndButtons.setLayout(layout); >+ >+ viewer= CheckboxTableViewer.newCheckList(tableAndButtons, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); >+ viewer.setLabelProvider(new DefaultLabelProvider()); >+ viewer.setContentProvider(new ArrayContentProvider()); >+ viewer.setComparator(new LaunchConfigurationComparator()); >+ viewer.addCheckStateListener(this); >+ // Only filter private configurations and external tools to avoid filtering a default >+ viewer.addFilter(new PrivateConfigurationFilter()); >+ viewer.addFilter(new CategoryFilter()); >+ Table builderTable= viewer.getTable(); >+ GridData gridData = new GridData(GridData.FILL_BOTH); >+ gridData.heightHint = 300; >+ builderTable.setLayoutData(gridData); >+ >+ IResource resource = getResource(); >+ originalCandidates = getDefaultCandidates(resource); >+ viewer.setInput(originalCandidates); >+ try { >+ ILaunchConfiguration configuration = DebugPlugin.getDefault().getLaunchManager().getDefaultConfiguration(resource); >+ if (configuration != null) { >+ Iterator iterator = originalCandidates.iterator(); >+ while (iterator.hasNext()) { >+ ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) iterator.next(); >+ if (configuration.equals(wc.getOriginal())) { >+ viewer.setChecked(wc, true); >+ break; >+ } >+ } >+ } >+ } catch (CoreException e) { >+ setErrorMessage(e.getMessage()); >+ } >+ >+ Composite buttonArea = new Composite(tableAndButtons, SWT.NONE); >+ layout = new GridLayout(); >+ layout.marginHeight = 0; >+ layout.marginWidth = 0; >+ buttonArea.setLayout(layout); >+ buttonArea.setLayoutData(new GridData(GridData.FILL_VERTICAL)); >+ newButton = SWTUtil.createPushButton(buttonArea, "New...", null); >+ newButton.addSelectionListener(this); >+ copyButton = SWTUtil.createPushButton(buttonArea, "Copy...", null); >+ copyButton.addSelectionListener(this); >+ editButton = SWTUtil.createPushButton(buttonArea, "Edit...", null); >+ editButton.addSelectionListener(this); >+ deleteButton = SWTUtil.createPushButton(buttonArea, "Delete", null); >+ deleteButton.addSelectionListener(this); >+ >+ viewer.addSelectionChangedListener(this); >+ applyDialogFont(composite); >+ updateButtons(new StructuredSelection()); >+ return composite; >+ } >+ >+ /** >+ * Returns the resource this property page is open on. >+ * >+ * @return resource >+ */ >+ protected IResource getResource() { >+ Object element = getElement(); >+ IResource resource = null; >+ if (element instanceof IResource) { >+ resource = (IResource) element; >+ } else if (element instanceof IAdaptable) { >+ resource = (IResource) ((IAdaptable)element).getAdapter(IResource.class); >+ } >+ return resource; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent) >+ */ >+ public void checkStateChanged(CheckStateChangedEvent event) { >+ ILaunchConfiguration configuration = (ILaunchConfiguration) event.getElement(); >+ // only allow one check >+ viewer.setCheckedElements(new Object[]{configuration}); >+ // validate >+ if (!configuration.isLocal()) { >+ if (!getResource().getProject().equals(configuration.getFile().getProject())) { >+ // a config must be stored in the same project that it is a default config for >+ setErrorMessage(MessageFormat.format("Configuration must be located in project {0}", new String[]{getResource().getProject().getName()})); >+ setValid(false); >+ return; >+ } >+ } >+ setErrorMessage(null); >+ setValid(true); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#performOk() >+ */ >+ public boolean performOk() { >+ Object[] checked = viewer.getCheckedElements(); >+ try { >+ ILaunchConfiguration def = null; >+ if (checked.length == 1) { >+ def = (ILaunchConfiguration) checked[0]; >+ } >+ DebugPlugin.getDefault().getLaunchManager().setDefaultConfiguration(getResource(), def); >+ } catch (CoreException e) { >+ setErrorMessage(e.getMessage()); >+ return false; >+ } >+ return super.performOk(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults() >+ */ >+ protected void performDefaults() { >+ viewer.setAllChecked(false); >+ setErrorMessage(null); >+ setValid(true); >+ super.performDefaults(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) >+ */ >+ public void selectionChanged(SelectionChangedEvent event) { >+ ISelection s = event.getSelection(); >+ if (s instanceof IStructuredSelection) { >+ updateButtons((IStructuredSelection) s); >+ } >+ >+ } >+ >+ /** >+ * Update buttons based on the given selection. >+ * >+ * @param selection >+ */ >+ private void updateButtons(IStructuredSelection selection) { >+ if (selection.size() == 0) { >+ editButton.setEnabled(false); >+ copyButton.setEnabled(false); >+ deleteButton.setEnabled(false); >+ } else if (selection.size() == 1) { >+ editButton.setEnabled(true); >+ copyButton.setEnabled(true); >+ deleteButton.setEnabled(true); >+ } else { >+ editButton.setEnabled(false); >+ copyButton.setEnabled(false); >+ deleteButton.setEnabled(true); >+ } >+ } >+ >+ /** >+ * Returns a list of potential default configurations candidates for the given >+ * resource. The configurations are working copies. >+ * >+ * @param resource resource >+ * @return list of default candidates >+ */ >+ private List getDefaultCandidates(IResource resource) { >+ IPath resourcePath = resource.getFullPath(); >+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); >+ List list = new ArrayList(); >+ try { >+ ILaunchConfiguration[] configurations = manager.getLaunchConfigurations(); >+ for (int i = 0; i < configurations.length; i++) { >+ ILaunchConfiguration configuration = configurations[i]; >+ IResource[] resources = configuration.getMappedResources(); >+ if (resources != null) { >+ for (int j = 0; j < resources.length; j++) { >+ IResource mappedResource = resources[j]; >+ if (resource.equals(mappedResource) || >+ resourcePath.isPrefixOf(mappedResource.getFullPath())) { >+ list.add(configuration.getWorkingCopy()); >+ break; >+ } >+ } >+ } else { >+ // 1. similar to launch dialog - if no resource mapping, display the config >+ // 2. only consider the default launch category (applications, *not* external tools) >+ if (configuration.getType().getCategory() == null) { >+ list.add(configuration.getWorkingCopy()); >+ } >+ } >+ } >+ } catch (CoreException e) { >+ list.clear(); >+ DebugUIPlugin.log(e); >+ } >+ return list; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) >+ */ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent) >+ */ >+ public void widgetSelected(SelectionEvent e) { >+ if (e.widget == newButton) { >+ handleNew(); >+ } else if (e.widget == copyButton) { >+ handleCopy(); >+ } else if (e.widget == deleteButton) { >+ handleDelete(); >+ } else if (e.widget == editButton) { >+ handleEdit(); >+ } >+ } >+ >+ /** >+ * Returns selected configurations. >+ * >+ * @return selected configurations >+ */ >+ private ILaunchConfigurationWorkingCopy[] getSelectedConfigurations() { >+ Object[] array = ((IStructuredSelection)viewer.getSelection()).toArray(); >+ ILaunchConfigurationWorkingCopy[] lcs = new ILaunchConfigurationWorkingCopy[array.length]; >+ System.arraycopy(array, 0, lcs, 0, array.length); >+ return lcs; >+ } >+ >+ /** >+ * Copy the selection >+ */ >+ private void handleCopy() { >+ ILaunchConfigurationWorkingCopy configuration = getSelectedConfigurations()[0]; >+ try { >+ ILaunchConfigurationWorkingCopy copy = configuration.copy( >+ DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configuration.getName())); >+ copy.setAttributes(configuration.getAttributes()); >+ int code = edit(copy); >+ if (code == Window.OK) { >+ originalCandidates.add(copy); >+ viewer.refresh(); >+ viewer.setSelection(new StructuredSelection(copy)); >+ } >+ } catch (CoreException e) { >+ setErrorMessage(e.getMessage()); >+ } >+ } >+ >+ /** >+ * Delete the selection >+ */ >+ private void handleDelete() { >+ Table table = viewer.getTable(); >+ int[] indices = table.getSelectionIndices(); >+ Arrays.sort(indices); >+ ILaunchConfiguration[] configurations = getSelectedConfigurations(); >+ for (int i = 0; i < configurations.length; i++) { >+ deletedConfigurations.add(configurations[i]); >+ originalCandidates.remove(configurations[i]); >+ } >+ viewer.refresh(); >+ if (indices[0] < table.getItemCount()) { >+ viewer.setSelection(new StructuredSelection(table.getItem(indices[0]).getData())); >+ } else if (table.getItemCount() > 0) { >+ viewer.setSelection(new StructuredSelection(table.getItem(table.getItemCount() - 1).getData())); >+ } >+ } >+ >+ /** >+ * Edit the selection >+ */ >+ private void handleEdit() { >+ edit(getSelectedConfigurations()[0]); >+ viewer.refresh(); >+ } >+ >+ /** >+ * Edits the given configuration as a nested working copy. >+ * Returns the code from the dialog used to edit the configuration. >+ * >+ * @param configuration >+ * @return dialog return code - OK or CANCEL >+ */ >+ private int edit(ILaunchConfigurationWorkingCopy configuration) { >+ try { >+ ILaunchConfigurationWorkingCopy copy = configuration.getNestedWorkingCopy(); >+ ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, ILaunchManager.RUN_MODE); >+ if (group == null) { >+ group = DebugUITools.getLaunchGroup(configuration, ILaunchManager.DEBUG_MODE); >+ } >+ int code = DebugUITools.openLaunchConfigurationPropertiesDialog(getShell(), copy, group.getIdentifier()); >+ if (code == Window.OK) { >+ copy.doSave(); >+ } >+ return code; >+ } catch (CoreException e) { >+ setErrorMessage(e.getMessage()); >+ } >+ return Window.CANCEL; >+ } >+ >+ /** >+ * Create a new configuration >+ */ >+ private void handleNew() { >+ ILaunchConfigurationType[] types = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); >+ List avail = new ArrayList(types.length); >+ for (int i = 0; i < types.length; i++) { >+ ILaunchConfigurationType type = types[i]; >+ if (type.getCategory() == null) { >+ // TODO: external tools? >+ avail.add(type); >+ } >+ } >+ Collections.sort(avail, new Comparator() { >+ public int compare(Object o1, Object o2) { >+ ILaunchConfigurationType t1 = (ILaunchConfigurationType) o1; >+ ILaunchConfigurationType t2 = (ILaunchConfigurationType) o2; >+ return t1.getName().compareTo(t2.getName()); >+ } >+ >+ }); >+ ListDialog dialog = new ListDialog(getShell()); >+ dialog.setTitle("Selection Configuration Type"); >+ dialog.setContentProvider(new ArrayContentProvider()); >+ dialog.setLabelProvider(new DefaultLabelProvider()); >+ dialog.setAddCancelButton(true); >+ dialog.setMessage("&Select the kind of configuration to create:"); >+ dialog.setInput(avail); >+ if (dialog.open() == Window.OK) { >+ Object[] result = dialog.getResult(); >+ if (result.length == 1) { >+ ILaunchConfigurationType type = (ILaunchConfigurationType) result[0]; >+ try { >+ ILaunchConfigurationWorkingCopy wc = type.newInstance(null, DebugPlugin.getDefault().getLaunchManager(). >+ generateUniqueLaunchConfigurationNameFrom("New Configuration")); >+ if (edit(wc) == Window.OK) { >+ originalCandidates.add(wc); >+ viewer.refresh(); >+ viewer.setSelection(new StructuredSelection(wc)); >+ } >+ } catch (CoreException e) { >+ setErrorMessage(e.getMessage()); >+ } >+ } >+ } >+ } >+ >+} >Index: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/PrivateConfigurationFilter.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/PrivateConfigurationFilter.java >diff -N ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/PrivateConfigurationFilter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/launchConfigurations/properties/PrivateConfigurationFilter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.debug.internal.ui.launchConfigurations.properties; >+ >+import org.eclipse.debug.core.ILaunchConfiguration; >+import org.eclipse.debug.ui.DebugUITools; >+import org.eclipse.jface.viewers.Viewer; >+import org.eclipse.jface.viewers.ViewerFilter; >+ >+/** >+ * Filters private configurations. >+ * >+ * @since 3.3 >+ */ >+public class PrivateConfigurationFilter extends ViewerFilter { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) >+ */ >+ public boolean select(Viewer viewer, Object parentElement, Object element) { >+ if (element instanceof ILaunchConfiguration) { >+ return !DebugUITools.isPrivate((ILaunchConfiguration) element); >+ } >+ return true; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 74480
:
53335
|
54442
|
54503
|
55420
|
56341
|
56426
|
56666
|
56675
|
56736
|
56804
|
56849
|
56854
|
57047
|
57181
|
57350
|
58480
|
58788
|
58895