1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Env edit dialog size adjust

This commit is contained in:
Oleg Krasilnikov 2007-03-01 08:38:39 +00:00
parent 7ddd1fafe1
commit a681729447
2 changed files with 11 additions and 3 deletions

View file

@ -72,6 +72,7 @@ public class EnvDialog extends Dialog {
text1 = new Text(c, SWT.SINGLE | SWT.BORDER); text1 = new Text(c, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL); gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2; gd.horizontalSpan = 2;
gd.widthHint = 400;
text1.setLayoutData(gd); text1.setLayoutData(gd);
text1.addModifyListener(new ModifyListener () { text1.addModifyListener(new ModifyListener () {
public void modifyText(ModifyEvent e) { setButtons(); }}); public void modifyText(ModifyEvent e) { setButtons(); }});
@ -81,7 +82,9 @@ public class EnvDialog extends Dialog {
l2.setLayoutData(new GridData(GridData.BEGINNING)); l2.setLayoutData(new GridData(GridData.BEGINNING));
text2 = new Text(c, SWT.SINGLE | SWT.BORDER); text2 = new Text(c, SWT.SINGLE | SWT.BORDER);
text2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 250;
text2.setLayoutData(gd);
text2.addModifyListener(new ModifyListener () { text2.addModifyListener(new ModifyListener () {
public void modifyText(ModifyEvent e) { setButtons(); }}); public void modifyText(ModifyEvent e) { setButtons(); }});

View file

@ -27,6 +27,7 @@ import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
@ -147,9 +148,13 @@ public class EnvironmentTab extends AbstractCPropertyTab {
table = new Table(usercomp, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.FULL_SELECTION); table = new Table(usercomp, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.FULL_SELECTION);
table.setHeaderVisible(true); table.setHeaderVisible(true);
table.setLinesVisible(true); table.setLinesVisible(true);
table.addSelectionListener(new SelectionAdapter() { table.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
updateButtons(); updateButtons();
}
public void widgetDefaultSelected(SelectionEvent e) {
if (buttonIsEnabled(2) && table.getSelectionIndex() != -1)
buttonPressed(2);
}}); }});
tv = new TableViewer(table); tv = new TableViewer(table);