Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog5
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java3
-rw-r--r--core/org.eclipse.cdt.ui/ChangeLog44
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java19
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionListFieldEditor.java385
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java17
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java8
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java62
-rw-r--r--core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java21
-rw-r--r--core/org.eclipse.cdt.ui/icons/full/build16/config-category.gifbin0 -> 893 bytes
-rw-r--r--core/org.eclipse.cdt.ui/plugin.xml65
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java2
12 files changed, 556 insertions, 75 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 4d1c76eda5..1413d58c18 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-10 Sean Evoy
+ Fix for Bug 41274. Was not saving the library option properly because the value type
+ of the option was not recognized.
+ * build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+
2003-07-30 Hoda Amer
The C Model recognizes pointers to functions.
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
index 94b2b27acf..7ce09b7912 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Configuration.java
@@ -283,6 +283,9 @@ public class Configuration extends BuildObject implements IConfiguration {
case IOption.PREPROCESSOR_SYMBOLS :
oldValue = option.getDefinedSymbols();
break;
+ case IOption.LIBRARIES :
+ oldValue = option.getLibraries();
+ break;
default :
oldValue = new String[0];
break;
diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog
index cafd225072..f589337f01 100644
--- a/core/org.eclipse.cdt.ui/ChangeLog
+++ b/core/org.eclipse.cdt.ui/ChangeLog
@@ -1,3 +1,47 @@
+2003-08-10 Sean Evoy
+ Added a new target for building DLLs on Cygwin.
+ * plugin.xml
+
+ Added a new icon for configurations in the tree view of the build
+ property page for managed builds.
+ * icons/full/build16/config-category.gif
+ * src/org/eclipse/cdt/internal/ui/CPluginImages.java
+
+ Changed the icons used to display tools and categories in the tree view
+ of the managed build property page. Now the tool uses the tool icon and
+ the category uses the new category icon.
+ * build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java
+
+ Changed the list field editor so that it will better fit a page with
+ space-grabbing widgets in different columns. For example, the default list
+ field editor puts the list in the left column and allows it to garab all
+ excess space. Entry fields put the label in the left and the space-grabbing
+ entry field/combo box in the right. The layout manager then gives both left
+ and right columns equal space. By wrapping the list field editor in a group
+ control that spans both columns, the layout manager allocates enough space for
+ controls in the right-hand column. It also lays out the contents of the list
+ field editor inside the group control independently of the outer container, so
+ it looks right too. Also added a double-click event handler so users can edit
+ list elements. Mondo happy with this!
+ * build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java
+
+ Re-activated the summary field editor class. It still does not behave quite right,
+ but it is there.
+ * build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java
+ * build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
+
+ Changed the combo-box field editor to lay itself out in the grid more like the other
+ field editors. This has not made the widget behave differently in any way, but should
+ insure that it lay itself out correctly on any page with any combination of
+ field editors.
+ * build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java
+
+ Fixed the resize behaviour of the build property page; at least in terms of resizing up
+ to its constrained size. There is the issue of size-creep (each time you reselect the
+ category, the property page control resizes up a bit until it hits some limit). But,
+ this is a better situation than what was there before.
+ * build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java
+
2003-08-08 Bogdan Gheorghe
- Filled out CSearchScopeFactory to translate working sets
into CElements
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java
index 08b2ade702..8e470efdb5 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionComboFieldEditor.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
public class BuildOptionComboFieldEditor extends FieldEditor {
@@ -23,7 +24,7 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
private Combo optionSelector;
private String [] options = new String[0];
private String selected;
-
+
/**
* @param name
* @param label
@@ -52,13 +53,23 @@ public class BuildOptionComboFieldEditor extends FieldEditor {
* @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
*/
protected void doFillIntoGrid(Composite parent, int numColumns) {
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = numColumns;
+ parent.setLayoutData(gd);
+
// Add the label
- getLabelControl(parent);
+ Label label = getLabelControl(parent);
+ GridData labelData = new GridData();
+ labelData.horizontalSpan = 1;
+ labelData.grabExcessHorizontalSpace = false;
+ label.setLayoutData(labelData);
// Now add the combo selector
optionSelector = ControlFactory.createSelectCombo(parent, options, selected);
- GridData gd = (GridData) optionSelector.getLayoutData();
- gd.horizontalSpan = numColumns - 1;
+ GridData selectorData = (GridData) optionSelector.getLayoutData();
+ selectorData.horizontalSpan = numColumns - 1;
+ selectorData.grabExcessHorizontalSpace = true;
+ optionSelector.setLayoutData(selectorData);
}
/* (non-Javadoc)
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionListFieldEditor.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionListFieldEditor.java
index 52b3f5807c..ef2e289a1c 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionListFieldEditor.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildOptionListFieldEditor.java
@@ -12,37 +12,304 @@ package org.eclipse.cdt.ui.build.properties;
* **********************************************************************/
import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.utils.ui.controls.ControlFactory;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.preference.ListEditor;
+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.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
-public class BuildOptionListFieldEditor extends ListEditor {
+public class BuildOptionListFieldEditor extends FieldEditor {
+ // Label constants
private static final String TITLE = "BuildPropertyCommon.label.title"; //$NON-NLS-1$
+ private static final String NEW = "BuildPropertyCommon.label.new"; //$NON-NLS-1$
+ private static final String REMOVE = "BuildPropertyCommon.label.remove"; //$NON-NLS-1$
+ private static final String UP = "BuildPropertyCommon.label.up"; //$NON-NLS-1$
+ private static final String DOWN = "BuildPropertyCommon.label.down"; //$NON-NLS-1$
- private boolean browse;
+ // UI constants
+ private static final int VERTICAL_DIALOG_UNITS_PER_CHAR = 8;
+ private static final int HORIZONTAL_DIALOG_UNITS_PER_CHAR = 4;
+ private static final int LIST_HEIGHT_IN_CHARS = 10;
+ private static final int LIST_HEIGHT_IN_DLUS =
+ LIST_HEIGHT_IN_CHARS * VERTICAL_DIALOG_UNITS_PER_CHAR;
+
+ // The top-level control for the field editor.
+ private Composite top;
+ // The list of tags.
+ private List list;
+
+ // The group control for the list and button composite
+ private Group controlGroup;
+
private String fieldName;
-
+ private SelectionListener selectionListener;
+
+ // The button for adding the contents of the text field to the list
+ private Button addButton;
+ // The button for removing the currently-selected list item.
+ private Button removeButton;
+ // The button for swapping the currently selected item up
+ private Button upButton;
+ // The button for swapping the currently-selected list item down
+ private Button downButton;
+
/**
- * @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
- */
+ * @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 BuildOptionListFieldEditor (String name, String labelText, Composite parent) {
super(name, labelText, parent);
this.fieldName = labelText;
- createControl(parent);
}
-
+
/* (non-Javadoc)
- * @see org.eclipse.jface.preference.ListEditor#createList(java.lang.String[])
+ * Event handler for the addButton widget
+ */
+ protected void addPressed() {
+ setPresentsDefaultValue(false);
+ // Prompt user for a new item
+ String input = getNewInputObject();
+
+ // Add it to the list
+ if (input != null) {
+ int index = list.getSelectionIndex();
+ if (index >= 0)
+ list.add(input, index + 1);
+ else
+ list.add(input, 0);
+ selectionChanged();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
+ */
+ protected void adjustForNumColumns(int numColumns) {
+ ((GridData)top.getLayoutData()).horizontalSpan = numColumns;
+ }
+
+ /* (non-Javadoc)
+ * Creates the Add, Remove, Up, and Down button in the button composite.
+ *
+ * @param container the box for the buttons
+ */
+ private void createButtons(Composite container) {
+ addButton = createPushButton(container, CUIPlugin.getResourceString(NEW));
+ removeButton = createPushButton(container, CUIPlugin.getResourceString(REMOVE));
+ upButton = createPushButton(container, CUIPlugin.getResourceString(UP));
+ downButton = createPushButton(container, CUIPlugin.getResourceString(DOWN));
+ }
+
+ /**
+ * @param items
+ * @return
*/
protected String createList(String[] items) {
return BuildToolsSettingsStore.createList(items);
}
/* (non-Javadoc)
- * @see org.eclipse.jface.preference.ListEditor#getNewInputObject()
+ * Rather than using the ControlFactory helper methods, this field
+ * editor is using this helper method. Other field editors use a similar
+ * set of method calls, so this seems like the safest approach
+ *
+ * @param parent the button composite
+ * @param label the label to place in the button
+ * @return
+ */
+ private Button createPushButton(Composite parent, String label) {
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(label);
+ button.setFont(parent.getFont());
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.heightHint = convertVerticalDLUsToPixels(button, IDialogConstants.BUTTON_HEIGHT);
+ int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH);
+ data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+ button.setLayoutData(data);
+ button.addSelectionListener(getSelectionListener());
+ return button;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
+ */
+ protected void doFillIntoGrid(Composite parent, int numColumns) {
+ top = parent;
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = numColumns;
+ top.setLayoutData(gd);
+
+ controlGroup = ControlFactory.createGroup(top, getLabelText(), 2);
+ GridData groupData = new GridData(GridData.FILL_HORIZONTAL);
+ groupData.horizontalSpan = numColumns;
+ controlGroup.setLayoutData(groupData);
+
+ // Make the list
+ list = new List(controlGroup, SWT.BORDER);
+
+ // Create a grid data that takes up the extra space in the dialog and spans one column.
+ GridData listData = new GridData(GridData.FILL_HORIZONTAL);
+ listData.heightHint =
+ convertVerticalDLUsToPixels(list, LIST_HEIGHT_IN_DLUS);
+ listData.horizontalSpan = 1;
+
+ list.setLayoutData(listData);
+ list.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ selectionChanged();
+ }
+ });
+
+ list.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ list = null;
+ }
+ });
+ list.addMouseListener(new MouseAdapter() {
+ public void mouseDoubleClick(MouseEvent e) {
+ // Popup the editor on the selected item from the list
+ editSelection();
+ }
+ });
+
+ // Create a composite for the buttons
+ Composite buttonGroup = new Composite(controlGroup, SWT.NONE);
+ GridData buttonData = new GridData();
+ buttonData.horizontalSpan = 1;
+ buttonData.verticalAlignment = GridData.BEGINNING;
+ buttonGroup.setLayoutData(buttonData);
+
+ GridLayout buttonLayout = new GridLayout();
+ buttonLayout.numColumns = 1;
+ buttonLayout.marginHeight = 0;
+ buttonLayout.marginWidth = 0;
+ buttonGroup.setLayout(buttonLayout);
+
+ buttonGroup.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ addButton = null;
+ removeButton = null;
+ upButton = null;
+ downButton = null;
+ }
+ });
+
+ // Create the buttons
+ createButtons(buttonGroup);
+ }
+
+ /* (non-Javadoc)
+ * Creates a selection listener that handles the selection events
+ * for the button controls and single-click events in the list to
+ * trigger a selection change.
+ */
+ public void createSelectionListener() {
+ selectionListener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ Widget widget = event.widget;
+ if (widget == addButton) {
+ addPressed();
+ } else
+ if (widget == removeButton) {
+ removePressed();
+ } else
+ if (widget == upButton) {
+ upPressed();
+ } else
+ if (widget == downButton) {
+ downPressed();
+ } else
+ if (widget == list) {
+ selectionChanged();
+ }
+ }
+ };
+ }
+
+
+
+ /* (non-Javadoc)
+ * Event handler for the down button
+ */
+ protected void downPressed() {
+ swap(false);
+ }
+
+ /* (non-Javadoc)
+ *
*/
+ protected void editSelection() {
+ // Edit the selection index
+ int index = list.getSelectionIndex();
+ if (index != -1) {
+ String selItem = list.getItem(index);
+ if (selItem != null) {
+ InputDialog dialog = new InputDialog(getShell(), CUIPlugin.getResourceString(TITLE), fieldName, selItem, null);
+ String newItem = null;
+ if (dialog.open() == InputDialog.OK) {
+ newItem = dialog.getValue();
+ if (newItem != null && !newItem.equals(selItem)) {
+ list.setItem(index, newItem);
+ selectionChanged();
+ }
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doLoad()
+ */
+ protected void doLoad() {
+ if (list != null) {
+ String s = getPreferenceStore().getString(getPreferenceName());
+ String[] array = parseString(s);
+ for (int i = 0; i < array.length; i++){
+ list.add(array[i]);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
+ */
+ protected void doLoadDefault() {
+ if (list != null) {
+ list.removeAll();
+ String s = getPreferenceStore().getDefaultString(getPreferenceName());
+ String[] array = parseString(s);
+ for (int i = 0; i < array.length; i++){
+ list.add(array[i]);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditor#doStore()
+ */
+ protected void doStore() {
+ String s = createList(list.getItems());
+ if (s != null)
+ getPreferenceStore().setValue(getPreferenceName(), s);
+ }
+
protected String getNewInputObject() {
// Create a dialog to prompt for a new symbol or path
InputDialog dialog = new InputDialog(getShell(), CUIPlugin.getResourceString(TITLE), fieldName, new String(), null);
@@ -54,9 +321,101 @@ public class BuildOptionListFieldEditor extends ListEditor {
}
/* (non-Javadoc)
- * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String)
+ * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
+ */
+ public int getNumberOfControls() {
+ // The group control has a list and buttons so we want it to get at
+ // least 2 columns to display in.
+ return 2;
+ }
+
+ /* (non-Javadoc)
+ * Returns this field editor's selection listener.
+ * The listener is created if nessessary.
+ *
+ * @return the selection listener
+ */
+ private SelectionListener getSelectionListener() {
+ if (selectionListener == null)
+ createSelectionListener();
+ return selectionListener;
+ }
+
+ /* (non-Javadoc)
+ * Returns this field editor's shell.
+ *
+ * @return the shell
+ */
+ protected Shell getShell() {
+ if (addButton == null)
+ return null;
+ return addButton.getShell();
+ }
+
+ /* (non-Javadoc)
+ * @param stringList
+ * @return
*/
protected String[] parseString(String stringList) {
return BuildToolsSettingsStore.parseString(stringList);
}
+
+ /* (non-Javadoc)
+ * Event handler for the removeButton selected event
+ */
+ protected void removePressed() {
+ // Remove the selected item from the list
+ setPresentsDefaultValue(false);
+ int index = list.getSelectionIndex();
+ if (index >= 0) {
+ list.remove(index);
+ selectionChanged();
+ }
+ }
+
+ /* (non-Javadoc)
+ * Clean up the list and button control states after the event
+ * handlers fire.
+ */
+ protected void selectionChanged() {
+ int index = list.getSelectionIndex();
+ int size = list.getItemCount();
+
+ // Enable the remove button if there is at least one item in the list
+ removeButton.setEnabled(index >= 0);
+ // Enable the up button IFF there is more than 1 item and selection index is not first item
+ upButton.setEnabled(size > 1 && index > 0);
+ // Enable the down button IFF there is more than 1 item and selection index not last item
+ downButton.setEnabled(size > 1 && index >= 0 && index < size - 1);
+ }
+
+ /* (non-Javadoc)
+ * Swaps the location of two list elements. If the argument is <code>true</code>
+ * the list item is swapped with the item preceeding it in the list. Otherwise
+ * it is swapped with the item following it.
+ *
+ * @param moveUp
+ */
+ private void swap(boolean moveUp) {
+ setPresentsDefaultValue(false);
+ int index = list.getSelectionIndex();
+ int target = moveUp ? index - 1 : index + 1;
+
+ if (index >= 0) {
+ String[] selection = list.getSelection();
+ Assert.isTrue(selection.length == 1);
+ list.remove(index);
+ list.add(selection[0], target);
+ list.setSelection(target);
+ }
+ selectionChanged();
+ }
+
+ /* (non-Javadoc)
+ * Event handler for the up button. It simply swaps the selected
+ * item with the list item above it.
+ */
+ protected void upPressed() {
+ swap(true);
+ }
}
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java
index 7eca47b27b..18d5fdfac0 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildPropertyPage.java
@@ -340,7 +340,7 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
int vdiff = contentSize.y - containerSize.y;
if (hdiff > 0 || vdiff > 0) {
- if (shellSize.equals(lastShellSize)) {
+ if (shellSize.equals(getLastShellSize())) {
hdiff = Math.max(0, hdiff);
vdiff = Math.max(0, vdiff);
setShellSize(shellSize.x + hdiff, shellSize.y + vdiff);
@@ -377,6 +377,18 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
return names;
}
+ /**
+ * @return
+ */
+ protected Point getLastShellSize() {
+ if (lastShellSize == null) {
+ Shell shell = getShell();
+ if (shell != null)
+ lastShellSize = shell.getSize();
+ }
+ return lastShellSize;
+ }
+
private List getPagesForConfig() {
List pages = (List) configToPageListMap.get(selectedConfiguration.getId());
if (pages == null) {
@@ -550,7 +562,4 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
*/
public void updateTitle() {
}
-
-
-
} \ No newline at end of file
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
index d50114390d..4e500b1edb 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/BuildToolSettingsPage.java
@@ -84,12 +84,12 @@ public class BuildToolSettingsPage extends FieldEditorPreferencePage {
BuildOptionListFieldEditor listField = new BuildOptionListFieldEditor(opt.getId(), opt.getName(), getFieldEditorParent());
addField(listField);
break;
-// case IOption.SUMMARY :
-// SummaryFieldEditor summaryField = new SummaryFieldEditor(opt.getId(), opt.getName(), category.getTool(), getFieldEditorParent());
-// addField(summaryField);
-// break;
default :
+ SummaryFieldEditor summaryField = new SummaryFieldEditor(opt.getId(), opt.getName(), category.getTool(), getFieldEditorParent());
+ addField(summaryField);
break;
+// default :
+// break;
}
}
}
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java
index 5d0872f683..aa6e6bcded 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/SummaryFieldEditor.java
@@ -11,22 +11,24 @@ package org.eclipse.cdt.ui.build.properties;
* IBM Rational Software - Initial API and implementation
***********************************************************************/
-import org.eclipse.cdt.core.build.managed.IOption;
import org.eclipse.cdt.core.build.managed.ITool;
import org.eclipse.jface.preference.FieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class SummaryFieldEditor extends FieldEditor {
+ // Whitespace character
+ private static final String WHITESPACE = " ";
+ // The top level composite
+ protected Composite parent;
// The tool this category belongs to
- ITool tool;
+ protected ITool tool;
// The text widget to hold summary of all commands for the tool
- Text summary;
- // Whitespace character
- private static final String WHITESPACE = " ";
+ protected Text summary;
/**
* @param name
@@ -53,18 +55,22 @@ public class SummaryFieldEditor extends FieldEditor {
* @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
*/
protected void doFillIntoGrid(Composite parent, int numColumns) {
+ this.parent = parent;
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = numColumns;
+ this.parent.setLayoutData(gd);
+
// Add the label
- getLabelControl(parent);
+ Label label = getLabelControl(parent);
+ GridData labelData = new GridData();
+ labelData.horizontalSpan = numColumns;
+ label.setLayoutData(labelData);
// Create the multi-line, read-only field
summary = new Text(parent, SWT.MULTI|SWT.READ_ONLY|SWT.WRAP);
- GridData data = new GridData();
- data.horizontalSpan = numColumns - 1;
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = true;
- summary.setLayoutData(data);
+ GridData summaryData = new GridData(GridData.FILL_BOTH);
+ summaryData.horizontalSpan = numColumns;
+ summary.setLayoutData(summaryData);
}
/* (non-Javadoc)
@@ -72,21 +78,21 @@ public class SummaryFieldEditor extends FieldEditor {
*/
protected void doLoad() {
// Look at the data store for every option defined for the tool
- IOption[] options = tool.getOptions();
- for (int index = 0; index < options.length; ++index) {
- IOption option = options[index];
- String command = option.getCommand();
- if (command == null) {
- command = "";
- }
- String id = option.getId();
- String values = getPreferenceStore().getString(id);
- String[] valuesList = BuildToolsSettingsStore.parseString(values);
- for (int j = 0; j < valuesList.length; ++j) {
- String entry = valuesList[j];
- summary.append(command + entry + WHITESPACE);
- }
- }
+// IOption[] options = tool.getOptions();
+// for (int index = 0; index < options.length; ++index) {
+// IOption option = options[index];
+// String command = option.getCommand();
+// if (command == null) {
+// command = "";
+// }
+// String id = option.getId();
+// String values = getPreferenceStore().getString(id);
+// String[] valuesList = BuildToolsSettingsStore.parseString(values);
+// for (int j = 0; j < valuesList.length; ++j) {
+// String entry = valuesList[j];
+// summary.append(command + entry + WHITESPACE);
+// }
+// }
}
/* (non-Javadoc)
diff --git a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java
index b93e7dc0f0..b1d6397f0c 100644
--- a/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java
+++ b/core/org.eclipse.cdt.ui/build/org/eclipse/cdt/ui/build/properties/ToolListLabelProvider.java
@@ -11,30 +11,25 @@ package org.eclipse.cdt.ui.build.properties;
* IBM Rational Software - Initial API and implementation
* **********************************************************************/
-import org.eclipse.cdt.core.build.managed.IConfiguration;
import org.eclipse.cdt.core.build.managed.IOptionCategory;
import org.eclipse.cdt.internal.ui.CPluginImages;
-import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-
+
class ToolListLabelProvider extends LabelProvider {
- private final Image IMG_FOLDER = CUIPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
private final Image IMG_TOOL = CPluginImages.get(CPluginImages.IMG_BUILD_TOOL);
+ private final Image IMG_CAT = CPluginImages.get(CPluginImages.IMG_BUILD_CAT);
private static final String TREE_LABEL = "BuildPropertyPage.label.ToolTree"; //$NON-NLS-1$
public Image getImage(Object element) {
// If the element is a configuration, return the folder image
- if (element instanceof IConfiguration) {
- return IMG_FOLDER;
- } else if (element instanceof IOptionCategory) {
+ if (element instanceof IOptionCategory) {
IOptionCategory cat = (IOptionCategory)element;
IOptionCategory [] children = cat.getChildCategories();
if (children.length > 0){
- return IMG_FOLDER;
- } else {
return IMG_TOOL;
+ } else {
+ return IMG_CAT;
}
} else {
throw unknownElement(element);
@@ -46,11 +41,7 @@ class ToolListLabelProvider extends LabelProvider {
* @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
*/
public String getText(Object element) {
- if (element instanceof IConfiguration) {
- IConfiguration config = (IConfiguration)element;
- return CUIPlugin.getResourceString(TREE_LABEL);
- }
- else if (element instanceof IOptionCategory) {
+ if (element instanceof IOptionCategory) {
IOptionCategory cat = (IOptionCategory)element;
return cat.getName();
}
diff --git a/core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif b/core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif
new file mode 100644
index 0000000000..62090a3162
--- /dev/null
+++ b/core/org.eclipse.cdt.ui/icons/full/build16/config-category.gif
Binary files differ
diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml
index 6207ef29f8..c73f07469e 100644
--- a/core/org.eclipse.cdt.ui/plugin.xml
+++ b/core/org.eclipse.cdt.ui/plugin.xml
@@ -26,9 +26,9 @@
<extension-point id="CCompletionContributor" name="%completionContributorName"/>
<extension-point id="CElementFilters" name="%elementFiltersName"/>
<!-- =========================================================================== -->
-<!-- Extension Implementation: must implement org.eclipse.jface.text.ITextHover -->
-<!-- Purpose: Provide a perspective specific text hovering for CEditor files -->
<!-- Extension point: org.eclipse.cdt.ui.textHovers -->
+<!-- Purpose: Provide a perspective specific text hovering for CEditor files -->
+<!-- Extension Implementation: must implement org.eclipse.jface.text.ITextHover -->
<!-- =========================================================================== -->
<extension-point id="textHovers" name="%textHoversName"/>
<extension-point id="CToolTabGroup" name="C/C++ Tool Configuration Tabs" schema="schema/CToolTabGroup.exsd"/>
@@ -137,8 +137,8 @@
id="org.eclipse.cdt.ui.MakeView">
</view>
</extension>
-<!-- The wizards -->
<!-- For C Wizards -->
+<!-- The wizards -->
<extension
point="org.eclipse.ui.newWizards">
<category
@@ -808,10 +808,10 @@
</tool>
</target>
<target
- isTest="true"
+ isTest="false"
name="Cygwin Shared Library"
parent="cygwin"
- defaultExtension="dll.a"
+ defaultExtension="dll"
isAbstract="false"
id="cygwin.so">
<configuration
@@ -825,7 +825,8 @@
<tool
name="%ToolName.linker"
outputFlag="-o"
- outputs="dll.a"
+ command="g++ -shared"
+ outputs="dll"
id="org.eclipse.cdt.build.tool.cygwin.solink">
<optionCategory
owner="org.eclipse.cdt.build.tool.cygwin.solink"
@@ -833,7 +834,7 @@
id="cygwin.solink.category.general">
</optionCategory>
<option
- defaultValue="-shared"
+ defaultValue=""
name="Linker Flags"
category="cygwin.solink.category.general"
valueType="string"
@@ -856,6 +857,56 @@
</tool>
</target>
<target
+ isTest="true"
+ name="Cygwin Export Library (DLL)"
+ parent="cygwin"
+ defaultExtension="dll.a"
+ isAbstract="false"
+ id="cygwin.exp">
+ <configuration
+ name="Release"
+ id="cygwin.exp.release">
+ </configuration>
+ <configuration
+ name="Debug"
+ id="cygwin.exp.debug">
+ </configuration>
+ <tool
+ name="%ToolName.linker"
+ outputFlag="-o"
+ outputPrefix="cyg"
+ command="g++ -shared"
+ outputs="dll"
+ id="org.eclipse.cdt.build.tool.cygwin.explink">
+ <optionCategory
+ owner="org.eclipse.cdt.build.tool.cygwin.explink"
+ name="General"
+ id="cygwin.explink.category.general">
+ </optionCategory>
+ <option
+ defaultValue="-Wl,--export-all-symbols -Wl,--enable-auto-import"
+ name="Linker Flags"
+ category="cygwin.explink.category.general"
+ valueType="string"
+ id="cygwin.explink.ld.flags">
+ </option>
+ <option
+ name="Library Paths"
+ category="cygwin.explink.category.general"
+ command="-L"
+ valueType="stringList"
+ id="cygwin.explink.ld.paths">
+ </option>
+ <option
+ name="Libraries"
+ category="cygwin.explink.category.general"
+ command="-l"
+ valueType="libs"
+ id="cygwin.explink.libs">
+ </option>
+ </tool>
+ </target>
+ <target
isTest="false"
name="Cygwin Static Library"
parent="cygwin"
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
index 030317a17c..87751e72bb 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginImages.java
@@ -163,6 +163,8 @@ public class CPluginImages {
public static final ImageDescriptor DESC_BUILD_PREPROCESSOR = createManaged(T_BUILD, IMG_BUILD_PREPROCESSOR);
public static final String IMG_BUILD_TOOL = NAME_PREFIX + "config-tool.gif";
public static final ImageDescriptor DESC_BUILD_TOOL = createManaged(T_BUILD, IMG_BUILD_TOOL);
+ public static final String IMG_BUILD_CAT = NAME_PREFIX + "config-category.gif";
+ public static final ImageDescriptor DESC_BUILD_CAT = createManaged(T_BUILD, IMG_BUILD_CAT);
//for search
public static final String IMG_OBJS_SEARCH_REF = NAME_PREFIX + "search_ref_obj.gif";

Back to the top