1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug #175494 [New Project Model] Definition requeres value - fix

This commit is contained in:
Oleg Krasilnikov 2007-02-26 10:59:15 +00:00
parent 25d77f4ed2
commit 349a765023
2 changed files with 16 additions and 15 deletions

View file

@ -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

View file

@ -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;
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);
if (!newAction) {
b_add2all.setVisible(false);
txt1.setEnabled(false); // don't change name
}
// 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)) {