Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-11-04 16:56:27 +0000
committerSean Evoy2004-11-04 16:56:27 +0000
commite70d996fd9928fc09f2bcb1788afe8caca04779e (patch)
tree025d3d015d3d03a18a02ad9c2af3bc22cb806360 /build/org.eclipse.cdt.managedbuilder.ui/src
parentb38be153355db3e177d6dc833e0200ae5faf4f2b (diff)
downloadorg.eclipse.cdt-e70d996fd9928fc09f2bcb1788afe8caca04779e.tar.gz
org.eclipse.cdt-e70d996fd9928fc09f2bcb1788afe8caca04779e.tar.xz
org.eclipse.cdt-e70d996fd9928fc09f2bcb1788afe8caca04779e.zip
Commit for Leo Treggiari:
The majority of the code changes were for dealing with the Java class attributes (buildfileGenerator, etc…). The other bug fixes were: When the user displays the properties of a file in a standard make file, the “C/C++” category is displayed in the left pane – I couldn’t figure out a way to “filter” it out. Before the fix, the Managed Make property page was displayed and would then crash when the user selected OK. Now, it displays a label saying that this page only applies to Managed Make projects. When the user has automatic build set, edits the properties of a configuration, selects a different configuration, selects OK when asked to save the changes, a build for the proper configuration would start but it would pick up the tool settings from the wrong configuration (the newly selected one). There was a bug in the Option.onlyOverridesValue method where it wasn’t checking for a zero-length built-ins list, and therefore returning the wrong answer. There was a bug in adding a Tool to a ToolChain where the new Tool was added to the toolList but not the toolMap.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties1
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ToolsSettingsBlock.java11
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java53
3 files changed, 49 insertions, 16 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
index 706c7b43a4..0b4fba31e9 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
@@ -86,6 +86,7 @@ ResourceBuildPropertyPage.label.ExcludeCheckBox= Exclude from build
ResourceBuildPropertyPage.selection.configuration.all=All configurations
ResourceBuildPropertyPage.label.ToolTree=Tools
ResourceBuildPropertyPage.label.ToolOptions=Options
+ResourceBuildPropertyPage.label.NotMBSFile=The project is closed or the file is not contained within a Managed Make project.
# ----------- Entry Dialog -----------
BrowseEntryDialog.error.Folder_name_invalid = Folder name invalid
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 2da2a71f42..987f035ca4 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
@@ -189,8 +189,8 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
}
/* (non-Javadoc)
- * Method displayOptionsForTool.
- * @param toolReference
+ * Method displayOptionsForCategory
+ * @param category
*/
private void displayOptionsForCategory(IOptionCategory category) {
// Do nothing if the selected category is is unchanged
@@ -264,6 +264,7 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
}
/* (non-Javadoc)
+ * Method displayOptionsForTool
* @param tool
*/
private void displayOptionsForTool(ITool tool) {
@@ -315,9 +316,7 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
// Make the current page visible
currentSettingsPage.setVisible(true);
- // save the last page build options.
- // If the last page is tool page then parse all the options
- // and put it in the appropriate preference store.
+ // Save the last page build options.
if (oldPage != null){
if(oldPage instanceof BuildOptionSettingsPage) {
((BuildOptionSettingsPage)oldPage).storeSettings();
@@ -327,7 +326,7 @@ public class ToolsSettingsBlock extends AbstractCOptionPage {
//((BuildToolSettingsPage)oldPage).parseAllOptions();
}
}
- //update the field editor that displays all the build options
+ // Update the field editor that displays all the build options
if(currentSettingsPage instanceof BuildToolSettingsPage)
((BuildToolSettingsPage)currentSettingsPage).updateAllOptionField();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java
index 1d52e20fd4..88e4fe068e 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ResourceBuildPropertyPage.java
@@ -15,6 +15,7 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuildOptionBlock;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderHelpContextIds;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIMessages;
@@ -23,6 +24,7 @@ import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -66,6 +68,7 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
private static final String RESOURCE_SETTINGS_LABEL = LABEL + ".ResourceSettings"; //$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 NOTMBSFILE_LABEL = LABEL + ".NotMBSFile"; //$NON-NLS-1$
private static final String EXCLUDE_CHECKBOX = LABEL + ".ExcludeCheckBox"; //$NON-NLS-1$
private static final String TIP = PREFIX + ".tip"; //$NON-NLS-1$
private static final String RESOURCE_PLAT_TIP = TIP + ".ResourcePlatform"; //$NON-NLS-1$
@@ -83,11 +86,12 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
// private Point lastShellSize;
private Button excludedCheckBox;
- private boolean isExcluded = false;
/*
* Bookeeping variables
*/
+ private boolean isExcluded = false;
+ private boolean noContentOnPage = false;
private IConfiguration[] configurations;
@@ -111,9 +115,7 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
}
protected Control createContents(Composite parent) {
- GridData gd;
-
-// Create the container we return to the property page editor
+ // Create the container we return to the property page editor
Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
GridLayout compositeLayout = new GridLayout();
@@ -121,8 +123,28 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
compositeLayout.marginHeight = 0;
compositeLayout.marginWidth = 0;
composite.setLayout( compositeLayout );
+
+ // Check to see if we are dealing with a managed build project
+ boolean openMBSProject;
+ try {
+ openMBSProject = (getProject().hasNature(ManagedCProjectNature.MNG_NATURE_ID));
+ } catch (CoreException e) {
+ openMBSProject = false;
+ }
-// Initialize the key data
+ if (openMBSProject) {
+ contentForMBSFile(composite);
+ } else {
+ noContent(composite);
+ }
+
+ return composite;
+ }
+
+ protected void contentForMBSFile(Composite composite) {
+ GridData gd;
+
+ // Initialize the key data
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
if (info.getVersion() == null) {
// Display a message page instead of the properties control
@@ -130,7 +152,6 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
invalidInfo.setFont(composite.getFont());
invalidInfo.setText(ManagedBuilderUIMessages.getResourceString("ResourceBuildPropertyPage.error.version_low")); //$NON-NLS-1$
invalidInfo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING,GridData.VERTICAL_ALIGN_CENTER, true, true));
- return composite;
}
// Add a config selection area
@@ -179,16 +200,24 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
fd.right = new FormAttachment(80, -20);
configSelector.setLayoutData(fd);
-// Create the Tools Settings, Build Settings, ... Tabbed pane
+ // Create the Tools Settings, Build Settings, ... Tabbed pane
Group tabGroup = ControlFactory.createGroup(composite, ManagedBuilderUIMessages.getResourceString(RESOURCE_SETTINGS_LABEL), 1);
gd = new GridData(GridData.FILL_BOTH);
tabGroup.setLayoutData(gd);
fOptionBlock.createContents(tabGroup, getElement());
-// Update the contents of the configuration widget
+ // Update the contents of the configuration widget
populateConfigurations();
WorkbenchHelp.setHelp(composite,ManagedBuilderHelpContextIds.MAN_PROJ_BUILD_PROP);
- return composite;
+ }
+
+ protected void noContent(Composite composite) {
+ Label label = new Label(composite, SWT.LEFT);
+ label.setText(ManagedBuilderUIMessages.getResourceString(NOTMBSFILE_LABEL));
+ label.setFont(composite.getFont());
+
+ noContentOnPage = true;
+ noDefaultAndApplyButton();
}
private void handleIsExcluded() {
@@ -310,8 +339,12 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
*/
public boolean performOk() {
+ // If there is no content on the page, then there is nothing to do
+ if (noContentOnPage) return true;
+
// If the user did not visit this page, then there is nothing to do.
if (!displayedConfig) return true;
+
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
fOptionBlock.performApply(monitor);
@@ -484,4 +517,4 @@ public class ResourceBuildPropertyPage extends PropertyPage implements
public void setExcluded(boolean isExcluded) {
this.isExcluded = isExcluded;
}
-}
+} \ No newline at end of file

Back to the top