Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2007-02-26 10:59:15 +0000
committerOleg Krasilnikov2007-02-26 10:59:15 +0000
commit349a765023e622e57b28ebd585d13205a33e5201 (patch)
tree6367042e7d98d4deb9f76a411d222e32b9c9f74a
parent25d77f4ed2d89e6df1caba2331d52ef9c687cf08 (diff)
downloadorg.eclipse.cdt-349a765023e622e57b28ebd585d13205a33e5201.tar.gz
org.eclipse.cdt-349a765023e622e57b28ebd585d13205a33e5201.tar.xz
org.eclipse.cdt-349a765023e622e57b28ebd585d13205a33e5201.zip
Bug #175494 [New Project Model] Definition requeres value - fix
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties3
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/SymbolDialog.java22
2 files changed, 13 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties
index 1a8f270a229..3e7d2a12db7 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties
@@ -480,3 +480,6 @@ ExpDialog.2=Languages
ExpDialog.3=Content types
ConfigMultiSelectionDialog.0=Select configurations
ConfigMultiSelectionDialog.1=At least 2 configurations should be selected
+SymbolDialog.0=Name:
+SymbolDialog.1=Value:
+SymbolDialog.2=Add to all configurations
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/SymbolDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/SymbolDialog.java
index 281300925c0..fbf2a247384 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/SymbolDialog.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/SymbolDialog.java
@@ -55,7 +55,7 @@ public class SymbolDialog extends AbstractPropertyDialog {
GridData gd;
Label l1 = new Label(c, SWT.NONE);
- l1.setText("Name:"); //$NON-NLS-1$
+ l1.setText(NewUIMessages.getResourceString("SymbolDialog.0")); //$NON-NLS-1$
l1.setLayoutData(new GridData(GridData.BEGINNING));
txt1 = new Text(c, SWT.SINGLE | SWT.BORDER);
@@ -68,7 +68,7 @@ public class SymbolDialog extends AbstractPropertyDialog {
}});
Label l2 = new Label(c, SWT.NONE);
- l2.setText("Value:"); //$NON-NLS-1$
+ l2.setText(NewUIMessages.getResourceString("SymbolDialog.1")); //$NON-NLS-1$
l2.setLayoutData(new GridData(GridData.BEGINNING));
txt2 = new Text(c, SWT.SINGLE | SWT.BORDER);
@@ -83,40 +83,38 @@ public class SymbolDialog extends AbstractPropertyDialog {
b_vars = setupButton(c, "Variables..."); //$NON-NLS-1$
b_add2all = new Button(c, SWT.CHECK);
- b_add2all.setText("Add to all configurations"); //$NON-NLS-1$
+ b_add2all.setText(NewUIMessages.getResourceString("SymbolDialog.2")); //$NON-NLS-1$
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 4;
+ b_add2all.setLayoutData(gd);
if (!newAction) {
- gd.heightHint = 1;
b_add2all.setVisible(false);
- txt1.setText(data1);
txt1.setEnabled(false); // don't change name
- txt2.setText(data2);
}
- b_add2all.setLayoutData(gd);
// add 2 placeholders
new Label(c, 0).setLayoutData(new GridData());
new Label(c, 0).setLayoutData(new GridData());
b_ok = setupButton(c, IDialogConstants.OK_LABEL);
b_ko = setupButton(c, IDialogConstants.CANCEL_LABEL);
-
+
c.getShell().setDefaultButton(b_ok);
c.pack();
Rectangle r = shell.getBounds();
r.width = 400;
shell.setBounds(r);
+
+ // moved here to avoid accessing b_ok before it created.
+ txt1.setText(data1);
+ txt2.setText(data2);
setButtons();
return c;
}
private void setButtons() {
- b_ok.setEnabled(
- (txt1.getText().trim().length() > 0) &&
- (txt2.getText().trim().length() > 0));
+ b_ok.setEnabled(txt1.getText().trim().length() > 0);
}
-
public void buttonPressed(SelectionEvent e) {
if (e.widget.equals(b_ok)) {

Back to the top