[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] Fixes for bugzilla 44451 and 44841
|
The patch below has been created against the CVS head and tested on
Eclipse 3.0 on Windows and Linux. I will submit a patch against the 1.2
stream which fixes these problems shortly.
Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.217
diff -u -r1.217 ChangeLog
--- ChangeLog 11 Nov 2003 18:25:56 -0000 1.217
+++ ChangeLog 11 Nov 2003 19:34:01 -0000
@@ -1,3 +1,12 @@
+2003-11-11 Sean Evoy
+ There is a duplicate set of these string resources in the standard make
+ UI plugin, so there is little need to keep these resources in the common UI
+ plugin if the managed builder is the only one using them. Moving them also
+ reduces the dependencies between the builder UI and the core UI packages. The
+ managed builder UI is the only client of these strings, so there should be no
+ impact.
+ * src/org/eclipse/cdt/internal/ui/CPluginResources.properties
+
2003-11-10 Bogdan Gheorghe
fix bug 45688: must highlight keyword to use "Open Declarations" or "Add Include"
Index: src/org/eclipse/cdt/internal/ui/CPluginResources.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/CPluginResources.properties,v
retrieving revision 1.26
diff -u -r1.26 CPluginResources.properties
--- src/org/eclipse/cdt/internal/ui/CPluginResources.properties 1 Oct 2003 20:27:12 -0000 1.26
+++ src/org/eclipse/cdt/internal/ui/CPluginResources.properties 11 Nov 2003 19:34:07 -0000
@@ -330,15 +330,3 @@
# ------- Drag and Drop Message Text -----------
CViewDragNDrop.txt = already exists. Would you like to overwrite it?
-
-# ----------- Build Property Common -----------
-BuildPropertyCommon.label.title=Enter Value
-BuildPropertyCommon.label.new=New...
-BuildPropertyCommon.label.remove=Remove
-BuildPropertyCommon.label.up=Move Up
-BuildPropertyCommon.label.down=Move Down
-BuildPropertyCommon.label.editVar=Edit
-BuildPropertyCommon.label.addVar=Add
-BuildPropertyCommon.label.message=Value:
-BuildPropertyCommon.label.browse=Browse...
-BuildPropertyCommon.label.configs=Defined configurations:
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/ChangeLog,v
retrieving revision 1.10
diff -u -r1.10 ChangeLog
--- ChangeLog 17 Oct 2003 19:12:24 -0000 1.10
+++ ChangeLog 11 Nov 2003 19:33:37 -0000
@@ -1,3 +1,26 @@
+2003-11-11 Sean Evoy
+ Work to implement bugzilla 44841:
+ Added a scrollbar to the list control inside the custom list field editor.
+ Also added an Edit button to the field editor to make it easier for keyboard-only
+ accessibility.
+
+ Work for bugzilla 44451:
+ Changed the method that prompts user for information so that if the user cancels
+ with an empty input dialog, the method always returns an empty string. The responsibility
+ now rests with the caller to test the return value for length > 0 to decide whether or
+ not to add string to the list.
+ * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
+
+ Moved string constants from core UI plugin to build UI plugin. These values are duplicated
+ in the standadrd make UI plugin anyway, so the argument for keeping them in a common
+ plugin seems pretty weak. This removes another dependency between the builder UI and
+ common UI plugin. I did have to change the string resource lookup method in a few of
+ the UI implementation classes that use the constants.
+ * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
+ * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
+ * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
+ * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
+
2003-10-17 Tom Tromey
Changed -werror to -Werror
Index: src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties,v
retrieving revision 1.4
diff -u -r1.4 PluginResources.properties
--- src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties 26 Sep 2003 19:54:33 -0000 1.4
+++ src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties 11 Nov 2003 19:33:37 -0000
@@ -64,4 +64,16 @@
ManageConfig.label.restore=Restore
ManageConfig.label.configs.current=Current:
ManageConfig.label.configs.deleted=Deleted:
-ManageConfig.label.new.config.dialog=Create
\ No newline at end of file
+ManageConfig.label.new.config.dialog=Create
+
+# ----------- Build Property Common -----------
+BuildPropertyCommon.label.title=Enter Value
+BuildPropertyCommon.label.new=New...
+BuildPropertyCommon.label.remove=Remove
+BuildPropertyCommon.label.up=Up
+BuildPropertyCommon.label.down=Down
+BuildPropertyCommon.label.editVar=Edit...
+BuildPropertyCommon.label.addVar=Add
+BuildPropertyCommon.label.message=Value:
+BuildPropertyCommon.label.browse=Browse...
+BuildPropertyCommon.label.configs=Defined configurations:
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java,v
retrieving revision 1.1
diff -u -r1.1 BrowseEntryDialog.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java 15 Sep 2003 20:44:42 -0000 1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java 11 Nov 2003 19:33:37 -0000
@@ -11,7 +11,7 @@
* IBM Rational Software - Initial API and implementation
* **********************************************************************/
-import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -131,7 +131,7 @@
});
// Instantiate the browse button
- btnBrowse = ControlFactory.createPushButton(composite, CUIPlugin.getResourceString(BROWSE));
+ btnBrowse = ControlFactory.createPushButton(composite, ManagedBuilderUIPlugin.getResourceString(BROWSE));
setButtonLayoutData(btnBrowse);
btnBrowse.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java,v
retrieving revision 1.3
diff -u -r1.3 BuildOptionListFieldEditor.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java 22 Sep 2003 02:31:53 -0000 1.3
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java 11 Nov 2003 19:33:37 -0000
@@ -11,7 +11,7 @@
* IBM Rational Software - Initial API and implementation
* **********************************************************************/
-import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.InputDialog;
@@ -41,7 +41,8 @@
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 static final String EDIT = "BuildPropertyCommon.label.editVar"; //$NON-NLS-1$
+
// UI constants
private static final int VERTICAL_DIALOG_UNITS_PER_CHAR = 8;
private static final int HORIZONTAL_DIALOG_UNITS_PER_CHAR = 4;
@@ -62,12 +63,14 @@
// The button for adding the contents of the text field to the list
private Button addButton;
+ // The button for swapping the currently-selected list item down
+ private Button downButton;
+ // The button to start the edit process
+ private Button editButton;
// 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
@@ -88,7 +91,7 @@
String input = getNewInputObject();
// Add it to the list
- if (input != null) {
+ if (input != null && input.length() > 0) {
int index = list.getSelectionIndex();
if (index >= 0) {
list.add(input, index + 1);
@@ -115,10 +118,11 @@
* @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));
+ addButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(NEW));
+ editButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(EDIT));
+ removeButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(REMOVE));
+ upButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(UP));
+ downButton = createPushButton(container, ManagedBuilderUIPlugin.getResourceString(DOWN));
}
/**
@@ -166,7 +170,7 @@
controlGroup.setLayoutData(groupData);
// Make the list
- list = new List(controlGroup, SWT.BORDER);
+ list = new List(controlGroup, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
// Create a grid data that takes up the extra space in the dialog and spans one column.
GridData listData = new GridData(GridData.FILL_HORIZONTAL);
@@ -209,6 +213,7 @@
buttonGroup.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
addButton = null;
+ editButton = null;
removeButton = null;
upButton = null;
downButton = null;
@@ -217,7 +222,6 @@
// Create the buttons
createButtons(buttonGroup);
- selectionChanged();
}
/* (non-Javadoc)
@@ -231,20 +235,19 @@
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();
- }
+ } else if (widget == editButton) {
+ editPressed();
+ } else if (widget == removeButton) {
+ removePressed();
+ } else if (widget == upButton) {
+ upPressed();
+ } else if (widget == downButton) {
+ downPressed();
+ } else if (widget == list) {
+ selectionChanged();
+ }
}
+
};
}
@@ -257,6 +260,10 @@
swap(false);
}
+ private void editPressed() {
+ editSelection();
+ }
+
/* (non-Javadoc)
*
*/
@@ -266,7 +273,7 @@
if (index != -1) {
String selItem = list.getItem(index);
if (selItem != null) {
- InputDialog dialog = new InputDialog(getShell(), CUIPlugin.getResourceString(TITLE), fieldName, selItem, null);
+ InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, selItem, null);
String newItem = null;
if (dialog.open() == InputDialog.OK) {
newItem = dialog.getValue();
@@ -290,6 +297,7 @@
list.add(array[i]);
}
list.setSelection(0);
+ selectionChanged();
}
}
@@ -304,6 +312,8 @@
for (int i = 0; i < array.length; i++){
list.add(array[i]);
}
+ list.setSelection(0);
+ selectionChanged();
}
}
@@ -318,12 +328,12 @@
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);
- String input = null;
+ InputDialog dialog = new InputDialog(getShell(), ManagedBuilderUIPlugin.getResourceString(TITLE), fieldName, new String(), null);
+ String input = new String();
if (dialog.open() == InputDialog.OK) {
input = dialog.getValue();
}
- return input.length() == 0 ? null : input;
+ return input;
}
/* (non-Javadoc)
@@ -388,6 +398,8 @@
int index = list.getSelectionIndex();
int size = list.getItemCount();
+ // Enable the edit button if there is at least one item in the list
+ editButton.setEnabled(size > 0);
// Enable the remove button if there is at least one item in the list
removeButton.setEnabled(size > 0);
// Enable the up button IFF there is more than 1 item and selection index is not first item
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.2
diff -u -r1.2 BuildToolSettingsPage.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java 26 Sep 2003 19:54:33 -0000 1.2
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java 11 Nov 2003 19:33:37 -0000
@@ -1,5 +1,16 @@
package org.eclipse.cdt.managedbuilder.ui.properties;
+/**********************************************************************
+ * Copyright (c) 2002,2003 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
+ * **********************************************************************/
+
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IOption;
@@ -11,14 +22,6 @@
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.swt.graphics.Point;
-/**
- * @author sevoy
- *
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */
public class BuildToolSettingsPage extends FieldEditorPreferencePage {
// Variables to help map this page back to an option category and tool
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java,v
retrieving revision 1.2
diff -u -r1.2 ManageConfigDialog.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java 24 Sep 2003 14:20:49 -0000 1.2
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java 11 Nov 2003 19:33:37 -0000
@@ -19,7 +19,6 @@
import org.eclipse.cdt.managedbuilder.core.ITarget;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
-import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.dialogs.Dialog;
@@ -218,7 +217,7 @@
Composite buttonBar = ControlFactory.createComposite(configListGroup, 1);
buttonBar.setLayoutData(new GridData());
- newBtn = ControlFactory.createPushButton(buttonBar, CUIPlugin.getResourceString(NEW));
+ newBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(NEW));
setButtonLayoutData(newBtn);
newBtn.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {
@@ -230,7 +229,7 @@
newBtn = null;
}
});
- removeBtn = ControlFactory.createPushButton(buttonBar, CUIPlugin.getResourceString(REMOVE));
+ removeBtn = ControlFactory.createPushButton(buttonBar, ManagedBuilderUIPlugin.getResourceString(REMOVE));
setButtonLayoutData(removeBtn);
removeBtn.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {