1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-13 19:25:38 +02:00

Fix when rcbs calls for a build.

Fix when only the rcbs property page is displayed
This commit is contained in:
Leo Treggiari 2005-07-07 01:00:22 +00:00
parent 0d1723da41
commit b4926ba45a
2 changed files with 43 additions and 4 deletions

View file

@ -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,10 +515,23 @@ 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);
}

View file

@ -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)