diff options
author | Mike Rennie | 2012-10-02 16:30:42 +0000 |
---|---|---|
committer | Mike Rennie | 2012-10-02 16:30:42 +0000 |
commit | b6226f111ef84cbbed0a3c64ad78e572bab04500 (patch) | |
tree | 0310a32d06e8b4727a88a6a7c5bd98ddb9b75b76 /org.eclipse.ui.externaltools | |
parent | 82015c577ff5e8dce7172b91f80218760f027bfa (diff) | |
download | eclipse.platform.debug-b6226f111ef84cbbed0a3c64ad78e572bab04500.tar.gz eclipse.platform.debug-b6226f111ef84cbbed0a3c64ad78e572bab04500.tar.xz eclipse.platform.debug-b6226f111ef84cbbed0a3c64ad78e572bab04500.zip |
Bug 386820 - Double-clicking on a disabled builder in Builders Propertyv20121002-163042
page leads to a DebugException
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r-- | org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java index 67c457c8c..0d837d653 100644 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java +++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 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 @@ -104,6 +104,10 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta private CheckboxTableViewer viewer= null; private boolean fWarned = false; + /** + * Flag to know if we can perform an edit of the selected element(s) + */ + private boolean fCanEdit = false; private ILabelProvider labelProvider= new BuilderLabelProvider(); @@ -331,7 +335,11 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta builderTable.addListener(SWT.MouseDoubleClick, new Listener() { public void handleEvent(Event event) { - handleEditButtonPressed(); + //we must not allow editing of elements that cannot be edited via the selection changed logic + //https://bugs.eclipse.org/bugs/show_bug.cgi?id=386820 + if(fCanEdit) { + handleEditButtonPressed(); + } } }); @@ -790,18 +798,18 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta newButton.setEnabled(true); Table builderTable= viewer.getTable(); TableItem[] items = builderTable.getSelection(); - boolean enableEdit = false; + fCanEdit = false; boolean enableRemove = false; boolean enableUp = false; boolean enableDown = false; if(items != null) { boolean validSelection = items.length > 0; - enableEdit = validSelection; + fCanEdit = validSelection; enableRemove = validSelection; enableUp = validSelection; enableDown = validSelection; if (items.length > 1) { - enableEdit= false; + fCanEdit= false; } int indices[]= builderTable.getSelectionIndices(); int max = builderTable.getItemCount(); @@ -822,23 +830,23 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta if (builderName != null) { //do not allow "wrapped" builders to be removed or edited if they are valid IExtension ext= Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, builderName); - enableEdit= false; + fCanEdit= false; enableRemove= ext == null; } } else { if (data instanceof ErrorConfig) { - enableEdit= false; + fCanEdit= false; continue; } ICommand command= (ICommand) data; - enableEdit= command.isConfigurable(); + fCanEdit= command.isConfigurable(); IExtension ext= Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, command.getBuilderName()); enableRemove= ext == null; break; } } } - editButton.setEnabled(enableEdit); + editButton.setEnabled(fCanEdit); removeButton.setEnabled(enableRemove); upButton.setEnabled(enableUp); downButton.setEnabled(enableDown); @@ -1119,7 +1127,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta } return null; } - + private void deleteConfigurations() { boolean wasAutobuilding= ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); try { |