Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Suggested change to String option command generation.

Hi Sean and Chris:
 
Here is the patch for the string options window in the Build Properties dialog.  We used the latest code from the head in CVS.
 
Please let me know if you have any questions.
 
I hope it helps!
 
Mike Charls
BitMethods, Inc.
----- Original Message -----
From: Sean Evoy
Sent: Friday, March 05, 2004 12:27 PM
Subject: Re: [cdt-dev] Suggested change to String option command generation.


Mike,
Just a heads-up; I used the tool item in the tree view for setting the command in this release, so I would make sure that your patch is based on the latest stuff out of the head. We can always figure out how to make the two uses co-exist, of course.

Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada



"Mike Charls" <mcharls@xxxxxxxxxxxxxx>
Sent by: cdt-dev-admin@xxxxxxxxxxx

03/04/2004 01:11 PM

Please respond to
cdt-dev

To
<cdt-dev@xxxxxxxxxxx>
cc
Subject
Re: [cdt-dev] Suggested change to String option command generation.





Hi Chis:
 
I do not have a patch right now since we have other changes from CDT.  
 
However, we can make a patch and send it in a day or two.
 
Mike Charls
BitMethods
----- Original Message -----
From: Recoskie, Chris
To: cdt-dev@xxxxxxxxxxx
Sent: Thursday, March 04, 2004 11:03 AM
Subject: RE: [cdt-dev] Suggested change to String option command generation.

The split approach per tool makes sense.  I might not have expressed it but this was what I had already been thinking.
 
I am interested to take a look and I’m sure Sean would be too.  Do you have a patch file you could send?
 
___________________________________________
 
Chris Recoskie
Software Designer
IDE Frameworks Group
Texas Instruments, Toronto
 
 
-----Original Message-----
From:
cdt-dev-admin@xxxxxxxxxxx [mailto:cdt-dev-admin@xxxxxxxxxxx] On Behalf Of Mike Charls
Sent:
Thursday, March 04, 2004 12:50 PM
To:
cdt-dev@xxxxxxxxxxx
Subject:
Re: [cdt-dev] Suggested change to String option command generation.

 
Hi Sean and Chris:
 
We have been using the ManagedBuilder for our application and we thought a "Command Summary" would be a good feature too, so we went ahead and implemented it.
 
Instead of creating one Summary page for all commands, we spilt the summary based on the Compiler options and the Linker options.  When the user clicks on the top-level Compiler item or the Linker item, we show the Summary page.   I attached a screen snapshot to show you what I mean.  We felt that dividing it by Compiler and Linker is more logical since this is the way you see the commands in the makefile.  
 
Our Summary pages provide round-trip editing.  The only problem occurs when an Additional Option (i.e., and option that is not in the predefined option list) is entered in the Command Summary.  The software does not know which category to place the option in.  To resolve this, we placed any undefined options in the Miscellaneous page.
 
Eclipse/CDT is great for our application, so we are happy to contribute back.  We can send you the code for this if you like.
 
We have also implemented code to compile a single file (as opposed to always doing a complete build) if anyone is interested in that.
 
 
Regards,
 
Mike Charls
BitMethods
----- Original Message -----
From: Sean Evoy
To: cdt-dev@xxxxxxxxxxx
Sent: Thursday, March 04, 2004 6:34 AM
Subject: RE: [cdt-dev] Suggested change to String option command generation.
 

That sounds good. I will get back to you after I fuel up on some coffee with some pointers on where to start.


Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada


"Recoskie, Chris" <crecoskie@xxxxxx>
Sent by:
cdt-dev-admin@xxxxxxxxxxx

03/03/2004 04:44 PM


Please respond to
cdt-dev


To
<cdt-dev@xxxxxxxxxxx>
cc
 
Subject
RE: [cdt-dev] Suggested change to String option command generation.

 


   





I agree with respect to the round-tripping.  It would be nice, but isn’t what I would call essential.  Certainly not the kind of thing we should be focusing on right now when there are so many more important things to do.

 
I could start taking a look at the summary page stuff part time if you want to get me started.  It would be nice to start getting TI involved in contributing more actively.

 
___________________________________________

 
Chris Recoskie

Software Designer

IDE Frameworks Group

Texas Instruments, Toronto

 
 
-----Original Message-----
From:
cdt-dev-admin@xxxxxxxxxxx [mailto:cdt-dev-admin@xxxxxxxxxxx] On Behalf Of Sean Evoy
Sent:
Wednesday, March 03, 2004 4:24 PM
To:
cdt-dev@xxxxxxxxxxx
Subject:
RE: [cdt-dev] Suggested change to String option command generation.

 


Minus the round-trip part, I wanted to provide a summary page that would aggregate all the option settings together and display it to the user back in 1.2. There is even a skeletal "summary" option page ready to go. The problem of updating the summary page in response to UI events was a bit more complex than I had time to deal with back then. The complexity is still there, but I haven't thought about it in a while and it might not be all that bad with enough time to do the job right. If you guys at TI are interested in doing this, let me know and maybe I can point you in the right direction.


I can state with certainty that round-tripping is going to be virtually impossible given the current architecture.


Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada

"Treggiari, Leo" <leo.treggiari@xxxxxxxxx>
Sent by: cdt-dev-admin@xxxxxxxxxxx

03/03/2004 02:35 PM


Please respond to
cdt-dev

 


To
<cdt-dev@xxxxxxxxxxx>
cc
 
Subject
RE: [cdt-dev] Suggested change to String option command generation.


 


   





Regarding round-trip editing and Visual Studio.  Visual C++ used to support that, but hasn't since Visual Studio .NET.  I don't know if they gave it up because they didn't think it was used by many people, or because it was "too hard".  Visual C++ still does display the entire command line and has an edit box for "Additional Options".

Regards,
Leo

-----Original Message-----
From: cdt-dev-admin@xxxxxxxxxxx [mailto:cdt-dev-admin@xxxxxxxxxxx]On
Behalf Of Chris Wiebe
Sent: Wednesday, March 03, 2004 2:27 PM
To: cdt-dev@xxxxxxxxxxx
Subject: Re: [cdt-dev] Suggested change to String option command
generation.


> As a related topic, something we at TI were thinking of doing sometime
> down the road was extending the "catch all" box so that it would show
> the full command line string that would be passed to the tool (i.e. it
> would pick up the output of all the other options based on their states)
> so that the user a) could actually see everything that would be passed
> to the tool and in what order, and b) so in theory the user could edit
> whatever they wanted in that box and theoretically have it parsed back
> and reflected in the other options in the GUI (e.g. if you turned on the
> symbolic debug checkbox, and then in the "full command to tool" box you
> removed the -g flag, then the symbolic debug checkbox would get
> unchecked).

This is a great idea, especially the round-trip editing which is very
nice to have.  I believe MS Visual Studio does this as well...

Cheers,
Chris
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/cdt-dev

Index: .project
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/.project,v
retrieving revision 1.2
diff -u -r1.2 .project
--- .project	24 Nov 2003 18:30:45 -0000	1.2
+++ .project	10 Mar 2004 19:44:04 -0000
@@ -6,6 +6,10 @@
 		<project>org.eclipse.cdt.core</project>
 		<project>org.eclipse.cdt.managedbuilder.core</project>
 		<project>org.eclipse.cdt.ui</project>
+		<project>org.eclipse.core.boot</project>
+		<project>org.eclipse.core.resources</project>
+		<project>org.eclipse.core.runtime</project>
+		<project>org.eclipse.ui</project>
 	</projects>
 	<buildSpec>
 		<buildCommand>
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java,v
retrieving revision 1.1
diff -u -r1.1 BuildOptionSettingsPage.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java	2 Mar 2004 15:27:47 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionSettingsPage.java	10 Mar 2004 19:44:04 -0000
@@ -1,4 +1,5 @@
 package org.eclipse.cdt.managedbuilder.ui.properties;
+import java.util.ArrayList;
 
 import org.eclipse.cdt.managedbuilder.core.BuildException;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -6,77 +7,92 @@
 import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
 import org.eclipse.jface.preference.StringFieldEditor;
 import org.eclipse.swt.graphics.Point;
 
 public class BuildOptionSettingsPage extends BuildSettingsPage {
-
+	private ArrayList fieldsList = new ArrayList();
 	private IOptionCategory category;
-	
-	BuildOptionSettingsPage(IConfiguration configuration, IOptionCategory category) {
+	BuildOptionSettingsPage(IConfiguration configuration,
+			IOptionCategory category) {
 		// Cache the configuration and option category this page is created for
 		super(configuration);
 		this.category = category;
 	}
-	
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.jface.preference.PreferencePage#computeSize()
 	 */
 	public Point computeSize() {
 		return super.computeSize();
 	}
-	
 	/**
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 	 */
 	protected void createFieldEditors() {
 		// Get the preference store for the build settings
 		super.createFieldEditors();
-
-		// Iterate over the options in the category and create a field editor for each
+		// Iterate over the options in the category and create a field editor
+		// for each
 		IOption[] options = category.getOptions(configuration);
 		for (int index = 0; index < options.length; ++index) {
 			// Get the option
 			IOption opt = options[index];
-			// Figure out which type the option is and add a proper field editor for it
+			// Figure out which type the option is and add a proper field
+			// editor for it
 			switch (opt.getValueType()) {
 				case IOption.STRING :
-					StringFieldEditor stringField = new StringFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
+					StringFieldEditor stringField = new StringFieldEditor(opt
+							.getId(), opt.getName(), getFieldEditorParent());
 					addField(stringField);
+					fieldsList.add(stringField);
 					break;
 				case IOption.BOOLEAN :
-					BooleanFieldEditor booleanField = new BooleanFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
+					BooleanFieldEditor booleanField = new BooleanFieldEditor(
+							opt.getId(), opt.getName(), getFieldEditorParent());
 					addField(booleanField);
+					fieldsList.add(booleanField);
 					break;
 				case IOption.ENUMERATED :
 					String sel;
 					try {
 						sel = opt.getSelectedEnum();
 					} catch (BuildException e) {
-						// If we get this exception, then the option type is wrong
+						// If we get this exception, then the option type is
+						// wrong
 						break;
 					}
-					BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(opt.getId(), opt.getName(), opt.getApplicableValues(), sel, getFieldEditorParent());
-					addField(comboField); 
+					BuildOptionComboFieldEditor comboField = new BuildOptionComboFieldEditor(
+							opt.getId(), opt.getName(), opt
+									.getApplicableValues(), sel,
+							getFieldEditorParent());
+					addField(comboField);
+					fieldsList.add(comboField);
 					break;
 				case IOption.STRING_LIST :
 				case IOption.INCLUDE_PATH :
 				case IOption.PREPROCESSOR_SYMBOLS :
 				case IOption.LIBRARIES :
-				case IOption.OBJECTS:
-					BuildOptionListFieldEditor listField = new BuildOptionListFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
-					addField(listField); 
+				case IOption.OBJECTS :
+					BuildOptionListFieldEditor listField = new BuildOptionListFieldEditor(
+							opt.getId(), opt.getName(), getFieldEditorParent());
+					addField(listField);
+					fieldsList.add(listField);
 					break;
 				default :
-					SummaryFieldEditor summaryField = new SummaryFieldEditor(opt.getId(), opt.getName(), category.getTool(), getFieldEditorParent());
+					SummaryFieldEditor summaryField = new SummaryFieldEditor(
+							opt.getId(), opt.getName(), category.getTool(),
+							getFieldEditorParent());
 					addField(summaryField);
+					fieldsList.add(summaryField);
 					break;
-//				default :
-//					break;
+			//				default :
+			//					break;
 			}
 		}
 	}
-
 	/**
 	 * @param category
 	 * @return
@@ -87,14 +103,12 @@
 		}
 		return false;
 	}
-
 	/**
 	 * @see IPreferencePage#performOk()
 	 */
 	public boolean performOk() {
 		// Write the field editor contents out to the preference store
 		boolean ok = super.performOk();
-
 		// Write the preference store values back to the build model
 		IOption[] options = category.getOptions(configuration);
 		for (int i = 0; i < options.length; i++) {
@@ -103,32 +117,55 @@
 			// Transfer value from preference store to options
 			switch (option.getValueType()) {
 				case IOption.BOOLEAN :
-					boolean boolVal = getPreferenceStore().getBoolean(option.getId());
-					ManagedBuildManager.setOption(configuration, option, boolVal);
+					boolean boolVal = getPreferenceStore().getBoolean(
+							option.getId());
+					ManagedBuildManager.setOption(configuration, option,
+							boolVal);
 					break;
 				case IOption.ENUMERATED :
-					String enumVal = getPreferenceStore().getString(option.getId());
-					ManagedBuildManager.setOption(configuration, option, enumVal);
+					String enumVal = getPreferenceStore().getString(
+							option.getId());
+					ManagedBuildManager.setOption(configuration, option,
+							enumVal);
 					break;
 				case IOption.STRING :
-					String strVal = getPreferenceStore().getString(option.getId());
-					ManagedBuildManager.setOption(configuration, option, strVal);
+					String strVal = getPreferenceStore().getString(
+							option.getId());
+					ManagedBuildManager
+							.setOption(configuration, option, strVal);
 					break;
 				case IOption.STRING_LIST :
 				case IOption.INCLUDE_PATH :
 				case IOption.PREPROCESSOR_SYMBOLS :
 				case IOption.LIBRARIES :
-				case IOption.OBJECTS:
-					String listStr = getPreferenceStore().getString(option.getId());
-					String[] listVal = BuildToolsSettingsStore.parseString(listStr);
-					ManagedBuildManager.setOption(configuration, option, listVal);
+				case IOption.OBJECTS :
+					String listStr = getPreferenceStore().getString(
+							option.getId());
+					String[] listVal = BuildToolsSettingsStore
+							.parseString(listStr);
+					ManagedBuildManager.setOption(configuration, option,
+							listVal);
 					break;
 				default :
 					break;
-			}			
+			}
 		}
-		
 		return ok;
 	}
-
+	/**
+	 * Update field editors in this page when the page is loaded.
+	 */
+	public void updateFileds() {
+		for (int i = 0; i < fieldsList.size(); i++) {
+			FieldEditor editor = (FieldEditor) fieldsList.get(i);
+			editor.loadDefault();
+			editor.load();
+		}
+	}
+	/**
+	 * saves all field editors
+	 */
+	public void storeSettings() {
+		super.performOk();
+	}
 }
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java,v
retrieving revision 1.7
diff -u -r1.7 BuildPropertyPage.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java	5 Mar 2004 15:20:44 -0000	1.7
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java	10 Mar 2004 19:44:05 -0000
@@ -25,12 +25,14 @@
 
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
-import org.eclipse.cdt.managedbuilder.core.IOption;
 import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
 import org.eclipse.cdt.managedbuilder.core.ITarget;
 import org.eclipse.cdt.managedbuilder.core.ITool;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
+import org.eclipse.cdt.managedbuilder.ui.properties.BuildSettingsPage;
+import org.eclipse.cdt.managedbuilder.ui.properties.BuildToolsSettingsStore;
+import org.eclipse.cdt.managedbuilder.ui.properties.ToolListContentProvider;
 import org.eclipse.cdt.utils.ui.controls.ControlFactory;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.jface.preference.IPreferencePageContainer;
@@ -324,6 +326,23 @@
 				children[i].setVisible(false);
 		}
 		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.
+		if (oldPage != null){
+			if(oldPage instanceof BuildOptionSettingsPage) {
+				((BuildOptionSettingsPage)oldPage).storeSettings();
+			}
+			else if(oldPage instanceof BuildToolSettingsPage) {
+				((BuildToolSettingsPage)oldPage).storeSettings();
+				((BuildToolSettingsPage)oldPage).parseAllOptions();
+			}
+		}
+		//update the field editors in the current page
+		if(currentSettingsPage instanceof BuildOptionSettingsPage)
+			((BuildOptionSettingsPage)currentSettingsPage).updateFileds();
+		
 		if (oldPage != null)
 			oldPage.setVisible(false);
 
@@ -375,6 +394,23 @@
 				children[i].setVisible(false);
 		}
 		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.
+		if (oldPage != null){
+			if(oldPage instanceof BuildOptionSettingsPage) {
+				((BuildOptionSettingsPage)oldPage).storeSettings();
+			}
+			else if(oldPage instanceof BuildToolSettingsPage) {
+				((BuildToolSettingsPage)oldPage).storeSettings();
+				((BuildToolSettingsPage)oldPage).parseAllOptions();
+			}
+		}
+		//update the field editor that displays all the build options
+		if(currentSettingsPage instanceof BuildToolSettingsPage)
+			((BuildToolSettingsPage)currentSettingsPage).updateAllOptionField();
+
 		if (oldPage != null)
 			oldPage.setVisible(false);
 
@@ -470,9 +506,9 @@
 		Object primary = elements.length > 0 ? elements[0] : null;
 		
 		if (primary != null && primary instanceof ITool) {
-			// Check to see if there are any options.
+			// set the tool as primary selection in the tree hence it displays all the build options.
 			ITool tool = (ITool)primary;
-			IOptionCategory top = tool.getTopOptionCategory();
+		/*	IOptionCategory top = tool.getTopOptionCategory();
 			IOption[] topOpts = top.getOptions(selectedConfiguration);
 			if (topOpts != null && topOpts.length == 0) {
 				// Get the children categories and start looking
@@ -485,7 +521,7 @@
 						break;
 					}
 				}
-			}
+			}*/
 		}
 		
 		if (primary != null) {
@@ -760,6 +796,11 @@
 		while (iter.hasNext()) {
 			BuildSettingsPage page = (BuildSettingsPage) iter.next();
 			if (page instanceof BuildToolSettingsPage) {
+				// if the currentsettings page is not the tool settings page
+				// then update the all build options field editor based on the 
+				// build options in other options settings page.
+				if (!(currentSettingsPage instanceof BuildToolSettingsPage))
+					((BuildToolSettingsPage)page).updateAllOptionField();
 				((BuildToolSettingsPage)page).performOk();
 			} else if (page instanceof BuildOptionSettingsPage) {
 				((BuildOptionSettingsPage)page).performOk();				
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java,v
retrieving revision 1.4
diff -u -r1.4 BuildToolSettingsPage.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java	2 Mar 2004 15:27:47 -0000	1.4
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java	10 Mar 2004 19:44:06 -0000
@@ -1,18 +1,20 @@
 package org.eclipse.cdt.managedbuilder.ui.properties;
-
-/**********************************************************************
- * Copyright (c) 2004 IBM Rational Software Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
+/*******************************************************************************
+ * Copyright (c) 2004 IBM Rational Software Corporation and others. All rights
+ * reserved. This program and the accompanying materials are made available
+ * under the terms of the Common Public License v0.5 which accompanies this
+ * distribution, and is available at http://www.eclipse.org/legal/cpl-v05.html
  * 
- * Contributors: 
- * IBM Rational Software - Initial API and implementation
- * **********************************************************************/
-
+ * Contributors: IBM Rational Software - Initial API and implementation
+ ******************************************************************************/
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.eclipse.cdt.managedbuilder.core.BuildException;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IOption;
 import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.cdt.managedbuilder.internal.core.ToolReference;
 import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
 import org.eclipse.jface.preference.StringFieldEditor;
@@ -20,39 +22,278 @@
 
 public class BuildToolSettingsPage extends BuildSettingsPage {
 	// Field editor label
-	private static final String COMMAND = "FieldEditors.tool.command";	//$NON-NLS-1$
-
+	private static final String COMMAND = "FieldEditors.tool.command"; //$NON-NLS-1$
+	// option names that stores additional options
+	private static final String COMPILER_FLAGS = "Other flags";
+	private static final String LINKER_FLAGS = "Linker flags";
+	// field editor that displays all the build options for a particular tool
+	private MultiLineTextFieldEditor allOptionFieldEditor;
+	private static final String DEFAULT_SEPERATOR = ";";
 	// Tool the settings belong to
 	private ITool tool;
-	
+	// all build options preference store id
+	private String allOptionsId = "";
 	BuildToolSettingsPage(IConfiguration configuration, ITool tool) {
 		// Cache the configuration and tool this page is for
 		super(configuration);
 		this.tool = tool;
+		allOptionsId = tool.getId() + ".allOptions";
 	}
-
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.jface.preference.PreferencePage#computeSize()
 	 */
 	public Point computeSize() {
 		return super.computeSize();
 	}
-	
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 	 */
 	protected void createFieldEditors() {
 		// Load up the preference store
 		super.createFieldEditors();
-		
 		// Add a string editor to edit the tool command
-		StringFieldEditor stringField = new StringFieldEditor(tool.getId(), ManagedBuilderUIPlugin.getResourceString(COMMAND), getFieldEditorParent());
+		StringFieldEditor stringField = new StringFieldEditor(tool.getId(),
+				ManagedBuilderUIPlugin.getResourceString(COMMAND),
+				getFieldEditorParent());
 		stringField.setEmptyStringAllowed(false);
-		addField(stringField);		
+		addField(stringField);
+		// Add a field editor that displays over all build options
+		allOptionFieldEditor = new MultiLineTextFieldEditor(allOptionsId,
+				"All options", getFieldEditorParent());
+		getPreferenceStore().setValue(allOptionsId, "");
+		addField(allOptionFieldEditor);
 	}
-
 	/**
-	 * Answers <code>true</code> if the receiver manages settings for the argument
+	 * Update the field editor that displays all the build options
+	 */
+	public void updateAllOptionField() {
+		try {
+			if (getToolFlags() != null) {
+				getPreferenceStore().setValue(allOptionsId, getToolFlags());
+				allOptionFieldEditor.load();
+			}
+		} catch (BuildException e) {
+		}
+	}
+	/**
+	 * Returns all the build options string
+	 * 
+	 * @return @throws
+	 *         BuildException
+	 */
+	private String getToolFlags() throws BuildException {
+		StringBuffer buf = new StringBuffer();
+		// get the options for this tool
+		IOption[] options = tool.getOptions();
+		String listStr = "";
+		String[] listVal = null;
+		for (int k = 0; k < options.length; k++) {
+			IOption option = options[k];
+			switch (option.getValueType()) {
+				case IOption.BOOLEAN :
+					if (getPreferenceStore().getBoolean(option.getId())) {
+						buf.append(option.getCommand() + ITool.WHITE_SPACE);
+					}
+					break;
+				case IOption.ENUMERATED :
+					String enumCommand = getPreferenceStore().getString(
+							option.getId());
+					if (enumCommand.indexOf(DEFAULT_SEPERATOR) != -1)
+						enumCommand = option.getSelectedEnum();
+					String enum = option.getEnumCommand(enumCommand);
+					if (enum.length() > 0) {
+						buf.append(enum + ITool.WHITE_SPACE);
+					}
+					break;
+				case IOption.STRING :
+					String val = getPreferenceStore().getString(option.getId());
+					if (val.length() > 0) {
+						buf.append(val + ITool.WHITE_SPACE);
+					}
+					break;
+				case IOption.STRING_LIST :
+				case IOption.INCLUDE_PATH :
+				case IOption.PREPROCESSOR_SYMBOLS :
+				case IOption.LIBRARIES :
+				case IOption.OBJECTS :
+					String cmd = option.getCommand();
+					listStr = getPreferenceStore().getString(option.getId());
+					listVal = BuildToolsSettingsStore.parseString(listStr);
+					for (int j = 0; j < listVal.length; j++) {
+						String temp = listVal[j];
+						if (cmd != null)
+							buf.append(cmd + temp + ITool.WHITE_SPACE);
+						else
+							buf.append(temp + ITool.WHITE_SPACE);
+					}
+					break;
+				default :
+					break;
+			}
+		}
+		return buf.toString().trim();
+	}
+	/**
+	 * Creates single string from the string array with a separator
+	 * 
+	 * @param items
+	 * @return
+	 */
+	private String createList(String[] items) {
+		StringBuffer path = new StringBuffer(""); //$NON-NLS-1$
+		for (int i = 0; i < items.length; i++) {
+			path.append(items[i]);
+			if (i < (items.length - 1)) {
+				path.append(DEFAULT_SEPERATOR);
+			}
+		}
+		return path.toString();
+	}
+	/**
+	 * This method parses the string that is entered in the all build option
+	 * field editor and stores the options to the corresponding option fields.
+	 */
+	public void parseAllOptions() {
+		// Get the all build options string from all options field
+		String alloptions = getPreferenceStore().getString(allOptionsId);
+		// list that holds the options for the option type other than
+		// boolean,string and enumerated
+		List optionsList = new ArrayList();
+		// additional options buffer
+		StringBuffer addnOptions = new StringBuffer();
+		// split all build options string
+		String[] optionsArr = alloptions.split(" ");
+		for (int j = 0; j < optionsArr.length; j++) {
+			boolean optionValueExist = false;
+			// get the options for this tool
+			IOption[] options = tool.getOptions();
+			for (int k = 0; k < options.length; ++k) {
+				IOption opt = options[k];
+				String name = opt.getId();
+				// check whether the option value is already exist
+				// and also change the preference store based on
+				// the option value
+				switch (opt.getValueType()) {
+					case IOption.BOOLEAN :
+						if (opt.getCommand().equals(optionsArr[j])) {
+							getPreferenceStore().setValue(opt.getId(), true);
+							optionValueExist = true;
+						}
+						break;
+					case IOption.ENUMERATED :
+						String enum = "";
+						String[] enumValues = opt.getApplicableValues();
+						for (int i = 0; i < enumValues.length; i++) {
+							if (opt.getEnumCommand(enumValues[i]).equals(
+									optionsArr[j])) {
+								enum = enumValues[i];
+								optionValueExist = true;
+							}
+						}
+						if (!enum.equals(""))
+							getPreferenceStore().setValue(opt.getId(), enum);
+						break;
+					case IOption.STRING :
+						String str = getPreferenceStore()
+								.getString(opt.getId());
+						if (alloptions.indexOf(str) == -1) {
+							getPreferenceStore().setValue(opt.getId(), "");
+						}
+						if (str.indexOf(optionsArr[j]) != -1) {
+							optionValueExist = true;
+						}
+						break;
+					case IOption.STRING_LIST :
+					case IOption.INCLUDE_PATH :
+					case IOption.PREPROCESSOR_SYMBOLS :
+					case IOption.LIBRARIES :
+						if (opt.getCommand() != null
+								&& optionsArr[j].startsWith(opt.getCommand())) {
+							optionsList.add(optionsArr[j]);
+							optionValueExist = true;
+						}
+						break;
+					case IOption.OBJECTS :
+						String userObjStr = getPreferenceStore().getString(
+								opt.getId());
+						String[] userObjs = BuildToolsSettingsStore
+								.parseString(userObjStr);
+						for (int m = 0; m < userObjs.length; m++) {
+							if (userObjs[m].equalsIgnoreCase(optionsArr[j]))
+								optionValueExist = true;
+						}
+						break;
+					default :
+						break;
+				}
+			}
+			// If the parsed string does not match with any previous option
+			// values then consider this option as a additional build option
+			if (!optionValueExist) {
+				addnOptions.append(optionsArr[j] + ITool.WHITE_SPACE);
+			}
+		}
+		// Now update the preference store with parsed options
+		// Get the options for this tool
+		IOption[] options = tool.getOptions();
+		for (int k = 0; k < options.length; ++k) {
+			IOption opt = options[k];
+			String name = opt.getId();
+			String listStr = "";
+			String[] listVal = null;
+			switch (opt.getValueType()) {
+				case IOption.BOOLEAN :
+					ArrayList optsList = new ArrayList(Arrays
+							.asList(optionsArr));
+					if (opt.getCommand() != null
+							&& !optsList.contains(opt.getCommand()))
+						getPreferenceStore().setValue(opt.getId(), false);
+					break;
+				case IOption.STRING :
+					// put the additional options in the compiler flag or
+					// linker flag field
+					if (opt.getName().equals(COMPILER_FLAGS)
+							|| opt.getName().equals(LINKER_FLAGS)) {
+						String newOptions = getPreferenceStore().getString(
+								opt.getId());
+						if (addnOptions.length() > 0) {
+							newOptions = newOptions + ITool.WHITE_SPACE
+									+ addnOptions.toString().trim();
+						}
+						getPreferenceStore().setValue(opt.getId(), newOptions);
+					}
+					break;
+				case IOption.STRING_LIST :
+				case IOption.INCLUDE_PATH :
+				case IOption.PREPROCESSOR_SYMBOLS :
+				case IOption.LIBRARIES :
+					ArrayList newList = new ArrayList();
+					for (int i = 0; i < optionsList.size(); i++) {
+						if (opt.getCommand() != null
+								&& ((String) optionsList.get(i)).startsWith(opt
+										.getCommand())) {
+							newList.add(((String) optionsList.get(i))
+									.substring(opt.getCommand().length()));
+						}
+					}
+					String[] strlist = new String[newList.size()];
+					newList.toArray(strlist);
+					newList.clear();
+					getPreferenceStore().setValue(opt.getId(),
+							BuildToolsSettingsStore.createList(strlist));
+					break;
+				default :
+					break;
+			}
+		}
+	}
+	/**
+	 * Answers <code>true</code> if the receiver manages settings for the
+	 * argument
 	 * 
 	 * @param tool
 	 * @return
@@ -63,24 +304,81 @@
 		}
 		return false;
 	}
-	
-	/* (non-Javadoc)
+	/**
+	 * saves all field editors
+	 */
+	public void storeSettings() {
+		super.performOk();
+	}
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
 	 */
 	public boolean performOk() {
 		// Do the super-class thang
-		boolean result =  super.performOk();
-		
+		boolean result = super.performOk();
+		//parse and store all build options in the corresponding preference store
+		parseAllOptions();
+		// Write the preference store values back to the build model
+		ITool[] tools = configuration.getTools();
+		for (int i = 0; i < tools.length; ++i) {
+			if (tools[i] instanceof ToolReference) {
+				if (((ToolReference) tools[i]).references(tool)) {
+					tool = tools[i];
+					break;
+				}
+			} else if (tools[i].equals(tool))
+				break;
+		}
+		IOption[] options = tool.getOptions();
+		for (int i = 0; i < options.length; i++) {
+			IOption option = options[i];
+			// Transfer value from preference store to options
+			switch (option.getValueType()) {
+				case IOption.BOOLEAN :
+					boolean boolVal = getPreferenceStore().getBoolean(
+							option.getId());
+					ManagedBuildManager.setOption(configuration, option,
+							boolVal);
+					break;
+				case IOption.ENUMERATED :
+					String enumVal = getPreferenceStore().getString(
+							option.getId());
+					ManagedBuildManager.setOption(configuration, option,
+							enumVal);
+					break;
+				case IOption.STRING :
+					String strVal = getPreferenceStore().getString(
+							option.getId());
+					ManagedBuildManager
+							.setOption(configuration, option, strVal);
+					break;
+				case IOption.STRING_LIST :
+				case IOption.INCLUDE_PATH :
+				case IOption.PREPROCESSOR_SYMBOLS :
+				case IOption.LIBRARIES :
+				case IOption.OBJECTS :
+					String listStr = getPreferenceStore().getString(
+							option.getId());
+					String[] listVal = BuildToolsSettingsStore
+							.parseString(listStr);
+					ManagedBuildManager.setOption(configuration, option,
+							listVal);
+					break;
+				default :
+					break;
+			}
+		}
 		// Get the actual value out of the field editor
 		String command = getPreferenceStore().getString(tool.getId());
 		if (command.length() == 0) {
 			return result;
 		}
-		
 		// The tool may be a reference.
 		if (tool instanceof ToolReference) {
 			// If so, just set the command in the reference
-			((ToolReference)tool).setToolCommand(command);
+			((ToolReference) tool).setToolCommand(command);
 		} else {
 			configuration.setToolCommand(tool, command);
 		}
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/MultiLineTextFieldEditor.java
===================================================================
RCS file: src/org/eclipse/cdt/managedbuilder/ui/properties/MultiLineTextFieldEditor.java
diff -N src/org/eclipse/cdt/managedbuilder/ui/properties/MultiLineTextFieldEditor.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/MultiLineTextFieldEditor.java	10 Mar 2004 19:44:06 -0000
@@ -0,0 +1,535 @@
+package org.eclipse.cdt.managedbuilder.ui.properties;
+
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Kudbudeen, BitMethods Inc
+ *	MultiLineTextFieldEditor.
+ *	Field editor that is same as string field editor but 
+ *	will have the multi line text field for user input.
+ */
+public class MultiLineTextFieldEditor extends FieldEditor {
+
+	/**
+	 * Validation strategy constant (value <code>0</code>) indicating that
+	 * the editor should perform validation after every key stroke.
+	 *
+	 * @see #setValidateStrategy
+	 */
+	public static final int VALIDATE_ON_KEY_STROKE = 0;
+
+	/**
+	 * Validation strategy constant (value <code>1</code>) indicating that
+	 * the editor should perform validation only when the text widget 
+	 * loses focus.
+	 *
+	 * @see #setValidateStrategy
+	 */
+	public static final int VALIDATE_ON_FOCUS_LOST = 1;
+
+	/**
+	 * Text limit constant (value <code>-1</code>) indicating unlimited
+	 * text limit and width.
+	 */
+	public static int UNLIMITED = -1;
+
+	/**
+	 * Cached valid state.
+	 */
+	private boolean isValid;
+
+	/**
+	 * Old text value.
+	 */
+	private String oldValue;
+	private String compTitle;
+	private Label title;
+
+	/**
+	 * The text field, or <code>null</code> if none.
+	 */
+	private Text textField;
+
+	/**
+	 * Width of text field in characters; initially unlimited.
+	 */
+	private int widthInChars = UNLIMITED;
+
+	/**
+	 * Text limit of text field in characters; initially unlimited.
+	 */
+	private int textLimit = UNLIMITED;
+
+	/**
+	 * The error message, or <code>null</code> if none.
+	 */
+	private String errorMessage;
+
+	/**
+	 * Indicates whether the empty string is legal;
+	 * <code>true</code> by default.
+	 */
+	private boolean emptyStringAllowed = true;
+
+	/**
+	 * The validation strategy; 
+	 * <code>VALIDATE_ON_KEY_STROKE</code> by default.
+	 */
+	private int validateStrategy = VALIDATE_ON_KEY_STROKE;
+	/**
+	 * Creates a new string field editor 
+	 */
+	protected MultiLineTextFieldEditor() {
+	}
+	/**
+	 * Creates a string field editor.
+	 * Use the method <code>setTextLimit</code> to limit the text.
+	 * 
+	 * @param name the name of the preference this field editor works on
+	 * @param labelText the label text of the field editor
+	 * @param width the width of the text input field in characters,
+	 *  or <code>UNLIMITED</code> for no limit
+	 * @param strategy either <code>VALIDATE_ON_KEY_STROKE</code> to perform
+	 *  on the fly checking (the default), or <code>VALIDATE_ON_FOCUS_LOST</code> to
+	 *  perform validation only after the text has been typed in
+	 * @param parent the parent of the field editor's control
+	 * @since 2.0
+	 */
+	public MultiLineTextFieldEditor(
+		String name,
+		String labelText,
+		int width,
+		int strategy,
+		Composite parent) {
+		init(name, labelText);
+		widthInChars = width;
+		setValidateStrategy(strategy);
+		isValid = false;
+		errorMessage = "Please give correct input"; //$NON-NLS-1$
+		createControl(parent);
+	}
+	/**
+	 * Creates a string field editor.
+	 * Use the method <code>setTextLimit</code> to limit the text.
+	 * 
+	 * @param name the name of the preference this field editor works on
+	 * @param labelText the label text of the field editor
+	 * @param width the width of the text input field in characters,
+	 *  or <code>UNLIMITED</code> for no limit
+	 * @param parent the parent of the field editor's control
+	 */
+	public MultiLineTextFieldEditor(
+		String name,
+		String labelText,
+		int width,
+		Composite parent) {
+		this(name, labelText, width, VALIDATE_ON_KEY_STROKE, parent);
+		this.compTitle = labelText;
+	}
+	/**
+	 * Creates a string field editor of unlimited width.
+	 * Use the method <code>setTextLimit</code> to limit the text.
+	 * 
+	 * @param name the name of the preference this field editor works on
+	 * @param labelText the label text of the field editor
+	 * @param parent the parent of the field editor's control
+	 */
+	public MultiLineTextFieldEditor(
+		String name,
+		String labelText,
+		Composite parent) {
+		this(name, labelText, UNLIMITED, parent);
+	}
+	/**
+		* Adjusts the horizontal span of this field editor's basic controls 
+		* <p>
+		* Subclasses must implement this method to adjust the horizontal span 
+		* of controls so they appear correct in the given number of columns.
+		* </p>
+		* <p>
+		* The number of columns will always be equal to or greater than the 
+		* value returned by this editor's <code>getNumberOfControls</code> method.
+		*
+		* @param numColumns the number of columns
+		*/
+	protected void adjustForNumColumns(int numColumns) {
+		GridData gd = (GridData) textField.getLayoutData();
+		gd.horizontalSpan = numColumns - 1;
+		// We only grab excess space if we have to
+		// If another field editor has more columns then
+		// we assume it is setting the width.
+		gd.grabExcessHorizontalSpace = gd.horizontalSpan == 1;
+	}
+	/**
+	 * Checks whether the text input field contains a valid value or not.
+	 *
+	 * @return <code>true</code> if the field value is valid,
+	 *   and <code>false</code> if invalid
+	 */
+	protected boolean checkState() {
+		boolean result = false;
+		if (emptyStringAllowed)
+			result = true;
+
+		if (textField == null)
+			result = false;
+
+		String txt = textField.getText();
+
+		if (txt == null)
+			result = false;
+
+		result = (txt.trim().length() > 0) || emptyStringAllowed;
+
+		// call hook for subclasses
+		result = result && doCheckState();
+
+		if (result)
+			clearErrorMessage();
+		else
+			showErrorMessage(errorMessage);
+
+		return result;
+	}
+	/**
+	 * Hook for subclasses to do specific state checks.
+	 * <p>
+	 * The default implementation of this framework method does
+	 * nothing and returns <code>true</code>.  Subclasses should 
+	 * override this method to specific state checks.
+	 * </p>
+	 *
+	 * @return <code>true</code> if the field value is valid,
+	 *   and <code>false</code> if invalid
+	 */
+	protected boolean doCheckState() {
+		return true;
+	}
+	/**
+	 * Fills this field editor's basic controls into the given parent.
+	 * <p>
+	 * The string field implementation of this <code>FieldEditor</code>
+	 * framework method contributes the text field. Subclasses may override
+	 * but must call <code>super.doFillIntoGrid</code>.
+	 * </p>
+	 */
+	protected void doFillIntoGrid(Composite parent, int numColumns) {
+
+		title = new Label(parent, SWT.UP);
+		this.compTitle = getLabelText();
+		title.setText(this.compTitle);
+		GridData gd1 = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+		gd1.widthHint = 80;
+		title.setLayoutData(gd1);
+
+		textField = getTextControl(parent);
+		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.widthHint = 100;
+		gd.heightHint = 70;
+		textField.setLayoutData(gd);
+
+	}
+	/**
+		* Initializes this field editor with the preference value from
+		* the preference store.
+		* <p>
+		* Subclasses must implement this method to properly initialize 
+		* the field editor.
+		* </p>
+		*/
+	protected void doLoad() {
+		if (textField != null) {
+			String value = getPreferenceStore().getString(getPreferenceName());
+			textField.setText(value);
+			oldValue = value;
+		}
+	}
+	/**
+		* Initializes this field editor with the default preference value from
+		* the preference store.
+		* <p>
+		* Subclasses must implement this method to properly initialize 
+		* the field editor.
+		* </p>
+		*/
+	protected void doLoadDefault() {
+		if (textField != null) {
+			String value =
+				getPreferenceStore().getDefaultString(getPreferenceName());
+			textField.setText(value);
+		}
+		valueChanged();
+	}
+	/**
+		* Stores the preference value from this field editor into
+		* the preference store.
+		* <p>
+		* Subclasses must implement this method to save the entered value
+	 * into the preference store.
+		* </p>
+		*/
+	protected void doStore() {
+		getPreferenceStore().setValue(getPreferenceName(), textField.getText());
+	}
+	/**
+	 * Returns the error message that will be displayed when and if 
+	 * an error occurs.
+	 *
+	 * @return the error message, or <code>null</code> if none
+	 */
+	public String getErrorMessage() {
+		return errorMessage;
+	}
+	/**
+		* Returns the number of basic controls this field editor consists of.
+		*
+		* @return the number of controls
+		*/
+	public int getNumberOfControls() {
+		return 2;
+	}
+	/**
+	 * Returns the field editor's value.
+	 *
+	 * @return the current value
+	 */
+	public String getStringValue() {
+		if (textField != null)
+			return textField.getText();
+		else
+			return getPreferenceStore().getString(getPreferenceName());
+	}
+	/**
+	 * Returns this field editor's text control.
+	 *
+	 * @param parent the parent
+	 * @return the text control, or <code>null</code> if no
+	 * text field is created yet
+	 */
+	protected Text getTextControl() {
+		return textField;
+	}
+	/**
+	 * Returns this field editor's text control.
+	 * <p>
+	 * The control is created if it does not yet exist
+	 * </p>
+	 *
+	 * @param parent the parent
+	 * @return the text control
+	 */
+	public Text getTextControl(Composite parent) {
+		if (textField == null) {
+			textField =
+				new Text(
+					parent,
+					SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.WRAP);
+			textField.setFont(parent.getFont());
+			switch (validateStrategy) {
+				case VALIDATE_ON_KEY_STROKE :
+					textField.addKeyListener(new KeyAdapter() {
+						public void keyPressed(KeyEvent e) {
+							valueChanged();
+						}
+					});
+
+					textField.addFocusListener(new FocusAdapter() {
+						public void focusGained(FocusEvent e) {
+							refreshValidState();
+						}
+						public void focusLost(FocusEvent e) {
+							clearErrorMessage();
+						}
+					});
+					break;
+				case VALIDATE_ON_FOCUS_LOST :
+					textField.addKeyListener(new KeyAdapter() {
+						public void keyPressed(KeyEvent e) {
+							clearErrorMessage();
+						}
+					});
+					textField.addFocusListener(new FocusAdapter() {
+						public void focusGained(FocusEvent e) {
+							refreshValidState();
+						}
+						public void focusLost(FocusEvent e) {
+							valueChanged();
+							clearErrorMessage();
+						}
+					});
+					break;
+				default :
+					Assert.isTrue(false, "Unknown validate strategy"); //$NON-NLS-1$
+			}
+			textField.addDisposeListener(new DisposeListener() {
+				public void widgetDisposed(DisposeEvent event) {
+					textField = null;
+				}
+			});
+			if (textLimit > 0) { //Only set limits above 0 - see SWT spec
+				textField.setTextLimit(textLimit);
+			}
+		} else {
+			checkParent(textField, parent);
+		}
+		return textField;
+	}
+	/**
+	 * Returns whether an empty string is a valid value.
+	 *
+	 * @return <code>true</code> if an empty string is a valid value, and
+	 *  <code>false</code> if an empty string is invalid
+	 * @see #setEmptyStringAllowed
+	 */
+	public boolean isEmptyStringAllowed() {
+		return emptyStringAllowed;
+	}
+	/**
+		* Returns whether this field editor contains a valid value.
+		* <p>
+		* The default implementation of this framework method
+		* returns <code>true</code>. Subclasses wishing to perform
+		* validation should override both this method and
+		* <code>refreshValidState</code>.
+		* </p>
+		* 
+		* @return <code>true</code> if the field value is valid,
+		*   and <code>false</code> if invalid
+		* @see #refreshValidState
+		*/
+	public boolean isValid() {
+		return isValid;
+	}
+	/**
+		* Refreshes this field editor's valid state after a value change
+		* and fires an <code>IS_VALID</code> property change event if
+		* warranted.
+		* <p>
+		* The default implementation of this framework method does
+		* nothing. Subclasses wishing to perform validation should override
+		* both this method and <code>isValid</code>.
+		* </p>
+		*
+		* @see #isValid
+		*/
+	protected void refreshValidState() {
+		isValid = checkState();
+	}
+	/**
+	 * Sets whether the empty string is a valid value or not.
+	 *
+	 * @param b <code>true</code> if the empty string is allowed,
+	 *  and <code>false</code> if it is considered invalid
+	 */
+	public void setEmptyStringAllowed(boolean b) {
+		emptyStringAllowed = b;
+	}
+	/**
+	 * Sets the error message that will be displayed when and if 
+	 * an error occurs.
+	 *
+	 * @param message the error message
+	 */
+	public void setErrorMessage(String message) {
+		errorMessage = message;
+	}
+	/**
+	 * Sets the focus to this field editor.
+		* <p>
+		* The default implementation of this framework method
+		* does nothing. Subclasses may reimplement.
+		* </p>
+		*/
+	public void setFocus() {
+		if (textField != null) {
+			textField.setFocus();
+		}
+	}
+	/**
+	 * Sets this field editor's value.
+	 *
+	 * @param value the new value, or <code>null</code> meaning the empty string
+	 */
+	public void setStringValue(String value) {
+		if (textField != null) {
+			if (value == null)
+				value = ""; //$NON-NLS-1$
+			oldValue = textField.getText();
+			if (!oldValue.equals(value)) {
+				textField.setText(value);
+				valueChanged();
+			}
+		}
+	}
+	/**
+	 * Sets this text field's text limit.
+	 *
+	 * @param limit the limit on the number of character in the text
+	 *  input field, or <code>UNLIMITED</code> for no limit
+	
+	 */
+	public void setTextLimit(int limit) {
+		textLimit = limit;
+		if (textField != null)
+			textField.setTextLimit(limit);
+	}
+	/**
+	 * Sets the strategy for validating the text.
+	 * <p>
+	 * Calling this method has no effect after <code>createPartControl</code>
+	 * is called. Thus this method is really only useful for subclasses to call
+	 * in their constructor. However, it has public visibility for backward 
+	 * compatibility.
+	 * </p>
+	 *
+	 * @param value either <code>VALIDATE_ON_KEY_STROKE</code> to perform
+	 *  on the fly checking (the default), or <code>VALIDATE_ON_FOCUS_LOST</code> to
+	 *  perform validation only after the text has been typed in
+	 */
+	public void setValidateStrategy(int value) {
+		Assert.isTrue(
+			value == VALIDATE_ON_FOCUS_LOST || value == VALIDATE_ON_KEY_STROKE);
+		validateStrategy = value;
+	}
+	/**
+	 * Shows the error message set via <code>setErrorMessage</code>.
+	 */
+	public void showErrorMessage() {
+		showErrorMessage(errorMessage);
+	}
+	/**
+	 * Informs this field editor's listener, if it has one, about a change
+	 * to the value (<code>VALUE</code> property) provided that the old and
+	 * new values are different.
+	 * <p>
+	 * This hook is <em>not</em> called when the text is initialized 
+	 * (or reset to the default value) from the preference store.
+	 * </p>
+	 */
+	protected void valueChanged() {
+		setPresentsDefaultValue(false);
+		boolean oldState = isValid;
+		refreshValidState();
+
+		if (isValid != oldState)
+			fireStateChanged(IS_VALID, oldState, isValid);
+
+		String newValue = textField.getText();
+		if (!newValue.equals(oldValue)) {
+			fireValueChanged(VALUE, oldValue, newValue);
+			oldValue = newValue;
+		}
+	}
+}

Attachment: org.eclipse.cdt.managedbuilder.ui.zip
Description: Zip compressed data


Back to the top