Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ResourceCustomBuildStepBlock.java28
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ToolsSettingsBlock.java19
2 files changed, 43 insertions, 4 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ResourceCustomBuildStepBlock.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ResourceCustomBuildStepBlock.java
index 40b635980e..70569f1ce9 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ResourceCustomBuildStepBlock.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ResourceCustomBuildStepBlock.java
@@ -414,6 +414,7 @@ public class ResourceCustomBuildStepBlock extends AbstractCOptionPage {
* There should be at most one tool defined for a custom build step which was not an
* extension element (not defined by a tool integrator in a manifest).
* If the rcbs tool has been defined, remove the tool from the resource configuration.
+ * If the rcbs tool was not disabled before now, indicate that a rebuild will be needed.
* Set the rcbsApplicability in the resource configuration to "disabled" by default.
* Update the field values.
*/
@@ -426,6 +427,14 @@ public class ResourceCustomBuildStepBlock extends AbstractCOptionPage {
break;
}
}
+
+ /*
+ * If the rcbs tool was not disabled, it will be after restoring defaults.
+ * This transition implies a rebuild is needed.
+ */
+ if(resConfig.getRcbsApplicability() != IResourceConfiguration.KIND_DISABLE_RCBS_TOOL){
+ resConfig.getParent().setRebuildState(true);
+ }
resConfig.setRcbsApplicability(IResourceConfiguration.KIND_DISABLE_RCBS_TOOL);
setValues();
setDirty(false);
@@ -438,6 +447,8 @@ public class ResourceCustomBuildStepBlock extends AbstractCOptionPage {
public void performApply(IProgressMonitor monitor) throws CoreException {
IResourceConfiguration resConfig;
boolean foundRcbsTool = false;
+ boolean rebuildNeeded = false;
+ boolean rcbsStillDisabledSoNoRebuild = false;
int idx;
/*
@@ -467,6 +478,9 @@ public class ResourceCustomBuildStepBlock extends AbstractCOptionPage {
tool.getOutputTypes()[0].setOutputNames(resBuildOutputs);
tool.setToolCommand(resBuildCommand);
tool.setAnnouncement(resBuildAnnouncement);
+ if (tool.isDirty()) {
+ rebuildNeeded = true;
+ }
foundRcbsTool = true;
break;
}
@@ -486,6 +500,7 @@ public class ResourceCustomBuildStepBlock extends AbstractCOptionPage {
rcbsTool.setCustomBuildStep(true);
rcbsTool.setToolCommand(resBuildCommand);
rcbsTool.setAnnouncement(resBuildAnnouncement);
+ rebuildNeeded = true;
}
/*
@@ -500,11 +515,24 @@ public class ResourceCustomBuildStepBlock extends AbstractCOptionPage {
resConfig.setRcbsApplicability(IResourceConfiguration.KIND_APPLY_RCBS_TOOL_BEFORE);
} else
if (idx == rcbsApplicabilitySelector.indexOf(ManagedBuilderUIMessages.getResourceString(RCBS_DISABLE))) {
+ /*
+ * If the rcbs tool was disabled and will remain disabled, no rebuild is required.
+ */
+ if(resConfig.getRcbsApplicability() == IResourceConfiguration.KIND_DISABLE_RCBS_TOOL){
+ rcbsStillDisabledSoNoRebuild = true;
+ }
resConfig.setRcbsApplicability(IResourceConfiguration.KIND_DISABLE_RCBS_TOOL);
} else {
resConfig.setRcbsApplicability(IResourceConfiguration.KIND_APPLY_RCBS_TOOL_AS_OVERRIDE);
}
+ if (resConfig.isDirty()) {
+ rebuildNeeded = true;
+ }
+ if (rebuildNeeded && !rcbsStillDisabledSoNoRebuild) {
+ resConfig.getParent().setRebuildState(true);
+ }
+
setDirty(false);
}
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ToolsSettingsBlock.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ToolsSettingsBlock.java
index e78004dd66..58208cece9 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ToolsSettingsBlock.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ToolsSettingsBlock.java
@@ -49,6 +49,8 @@ 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.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
@@ -59,7 +61,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Shell;
@@ -71,8 +72,8 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
private static final String PREFIX = "ToolsSettingsBlock"; //$NON-NLS-1$
private static final String LABEL = PREFIX + ".label"; //$NON-NLS-1$
private static final String SETTINGS_LABEL = LABEL + ".Settings"; //$NON-NLS-1$
- private static final String TREE_LABEL = LABEL + ".ToolTree"; //$NON-NLS-1$
- private static final String OPTIONS_LABEL = LABEL + ".ToolOptions"; //$NON-NLS-1$
+ //private static final String TREE_LABEL = LABEL + ".ToolTree"; //$NON-NLS-1$
+ //private static final String OPTIONS_LABEL = LABEL + ".ToolOptions"; //$NON-NLS-1$
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 20, 30 };
private static final String EMPTY_STRING = new String();
@@ -82,7 +83,6 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
*/
private TreeViewer optionList;
private SashForm sashForm;
- private Group sashGroup;
private Composite settingsPageContainer;
private ScrolledComposite containerSC;
@@ -194,6 +194,17 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
});
optionList.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
optionList.setLabelProvider(new ToolListLabelProvider());
+ optionList.addFilter(new ViewerFilter() {
+ public boolean select(Viewer viewer,
+ Object parent,
+ Object element) {
+ if(parent instanceof IResourceConfiguration && element instanceof ITool) {
+ return !((ITool)element).getCustomBuildStep();
+ } else {
+ return true;
+ }
+ }
+ });
}
/* (non-Javadoc)

Back to the top