mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug #229771 Usability: Bad Environment preference dialog layout
This commit is contained in:
parent
28a6dc5f30
commit
6be6c455c6
2 changed files with 40 additions and 27 deletions
|
@ -103,26 +103,34 @@ public class CDTPrefUtil {
|
|||
setStr(KEY_PREFTC, b.toString().trim());
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
public static String getDMode() {
|
||||
String s = null;
|
||||
switch(CDTPrefUtil.getInt(CDTPrefUtil.KEY_DMODE)) {
|
||||
case CDTPrefUtil.DMODE_CONJUNCTION:
|
||||
switch(getInt(KEY_DMODE)) {
|
||||
default:
|
||||
setInt(KEY_DMODE, DMODE_CONJUNCTION);
|
||||
// fallthrough
|
||||
case DMODE_CONJUNCTION:
|
||||
s = UIMessages.getString("EnvironmentTab.17"); //$NON-NLS-1$
|
||||
break;
|
||||
case CDTPrefUtil.DMODE_DISJUNCTION:
|
||||
case DMODE_DISJUNCTION:
|
||||
s = UIMessages.getString("EnvironmentTab.18"); //$NON-NLS-1$
|
||||
break;
|
||||
}
|
||||
return UIMessages.getString("EnvironmentTab.19") + s; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@SuppressWarnings("fallthrough")
|
||||
public static String getWMode() {
|
||||
String s = null;
|
||||
switch(CDTPrefUtil.getInt(CDTPrefUtil.KEY_WMODE)) {
|
||||
case CDTPrefUtil.WMODE_MODIFY:
|
||||
switch(getInt(KEY_WMODE)) {
|
||||
default:
|
||||
setInt(KEY_WMODE, WMODE_MODIFY);
|
||||
// fallthrough
|
||||
case WMODE_MODIFY:
|
||||
s = UIMessages.getString("EnvironmentTab.24"); //$NON-NLS-1$
|
||||
break;
|
||||
case CDTPrefUtil.WMODE_REPLACE:
|
||||
case WMODE_REPLACE:
|
||||
s = UIMessages.getString("EnvironmentTab.21"); //$NON-NLS-1$
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
|
|||
b1.setText(UIMessages.getString("EnvironmentTab.3")); //$NON-NLS-1$
|
||||
b1.setToolTipText(UIMessages.getString("EnvironmentTab.3")); //$NON-NLS-1$
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalSpan = 2;
|
||||
gd.horizontalSpan = 3;
|
||||
b1.setLayoutData(gd);
|
||||
b1.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -219,21 +219,11 @@ public class EnvironmentTab extends AbstractCPropertyTab {
|
|||
updateData();
|
||||
}});
|
||||
|
||||
lb1 = new Label(usercomp, SWT.BORDER | SWT.CENTER);
|
||||
lb1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
lb1.setToolTipText(UIMessages.getString("EnvironmentTab.15")); //$NON-NLS-1$
|
||||
lb1.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
CDTPrefUtil.spinDMode();
|
||||
updateData();
|
||||
}});
|
||||
|
||||
b2 = new Button(usercomp, SWT.RADIO);
|
||||
b2.setText(UIMessages.getString("EnvironmentTab.4")); //$NON-NLS-1$
|
||||
b2.setToolTipText(UIMessages.getString("EnvironmentTab.4")); //$NON-NLS-1$
|
||||
gd = new GridData(GridData.FILL_HORIZONTAL);
|
||||
gd.horizontalSpan = 2;
|
||||
gd.horizontalSpan = 3;
|
||||
b2.setLayoutData(gd);
|
||||
b2.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
|
@ -245,15 +235,30 @@ public class EnvironmentTab extends AbstractCPropertyTab {
|
|||
updateData();
|
||||
}});
|
||||
|
||||
lb2 = new Label(usercomp, SWT.BORDER | SWT.CENTER);
|
||||
lb2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
lb2.setToolTipText(UIMessages.getString("EnvironmentTab.23")); //$NON-NLS-1$
|
||||
lb2.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
CDTPrefUtil.spinWMode();
|
||||
updateLbs(null, lb2);
|
||||
}});
|
||||
if (!page.isForPrefs()) {
|
||||
// dummy placeholder
|
||||
new Label(usercomp, SWT.NONE).setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
lb1 = new Label(usercomp, SWT.BORDER | SWT.CENTER);
|
||||
lb1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
lb1.setToolTipText(UIMessages.getString("EnvironmentTab.15")); //$NON-NLS-1$
|
||||
lb1.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
CDTPrefUtil.spinDMode();
|
||||
updateData();
|
||||
}});
|
||||
|
||||
lb2 = new Label(usercomp, SWT.BORDER | SWT.CENTER);
|
||||
lb2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
lb2.setToolTipText(UIMessages.getString("EnvironmentTab.23")); //$NON-NLS-1$
|
||||
lb2.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
CDTPrefUtil.spinWMode();
|
||||
updateLbs(null, lb2);
|
||||
}});
|
||||
}
|
||||
initButtons(new String[] {UIMessages.getString("EnvironmentTab.5"),UIMessages.getString("EnvironmentTab.6"),UIMessages.getString("EnvironmentTab.7"),UIMessages.getString("EnvironmentTab.8"),UIMessages.getString("EnvironmentTab.9")}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue