1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 12:25:35 +02:00

Bug #206231 : The usability of the Environment variables dialogs is poor.

This commit is contained in:
Oleg Krasilnikov 2008-04-07 15:18:43 +00:00
parent e1cbe4d9da
commit 0df76bd7b0
6 changed files with 60 additions and 2 deletions

View file

@ -142,6 +142,19 @@ public class ContributedEnvironment implements IContributedEnvironment{
return false;
}
public String getOrigin(IEnvironmentVariable var) {
if(var instanceof EnvVarDescriptor) {
ICoreEnvironmentVariableSupplier sup = ((EnvVarDescriptor)var).getSupplier();
if (sup instanceof BuildSustemEnvironmentSupplier)
return Messages.getString("ContributedEnvironment.0"); //$NON-NLS-1$
if (sup instanceof EclipseEnvironmentSupplier)
return Messages.getString("ContributedEnvironment.1"); //$NON-NLS-1$
if (sup instanceof UserDefinedEnvironmentSupplier)
return Messages.getString("ContributedEnvironment.2"); //$NON-NLS-1$
}
return Messages.getString("ContributedEnvironment.3"); //$NON-NLS-1$
}
public void serialize(ICProjectDescription des){
EnvironmentVariableManager.fUserSupplier.storeProjectEnvironment(des, false);
}

View file

@ -0,0 +1,22 @@
package org.eclipse.cdt.internal.core.envvar;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.envvar.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
private Messages() {
}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}

View file

@ -0,0 +1,4 @@
ContributedEnvironment.0=BUILD SYSTEM
ContributedEnvironment.1=ECLIPSE ENV
ContributedEnvironment.2=USER
ContributedEnvironment.3=UNKNOWN

View file

@ -108,6 +108,8 @@ public class EnvironmentTab extends AbstractCPropertyTab {
if(td.var.getOperation() == IEnvironmentVariable.ENVVAR_REMOVE)
return UIMessages.getString(VALUE_UNDEF);
return td.var.getValue();
case 2:
return ce.getOrigin(td.var);
}
return EMPTY_STR;
}
@ -129,6 +131,8 @@ public class EnvironmentTab extends AbstractCPropertyTab {
if(td.var.getOperation() == IEnvironmentVariable.ENVVAR_REMOVE)
f = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT);
break;
case 2:
return null;
}
return f;
}
@ -180,10 +184,15 @@ public class EnvironmentTab extends AbstractCPropertyTab {
// add headers
TableColumn tc = new TableColumn(table, SWT.LEFT);
tc.setText(UIMessages.getString("EnvironmentTab.1")); //$NON-NLS-1$
tc.setWidth(200);
tc.setWidth(150);
tc = new TableColumn(table, SWT.LEFT);
tc.setText(UIMessages.getString("EnvironmentTab.2")); //$NON-NLS-1$
tc.setWidth(200);
tc.setWidth(150);
if (this.getResDesc() != null) {
tc = new TableColumn(table, SWT.LEFT);
tc.setText(UIMessages.getString("EnvironmentTab.16")); //$NON-NLS-1$
tc.setWidth(100);
}
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
@ -191,6 +200,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
b1 = new Button(usercomp, SWT.RADIO);
b1.setText(UIMessages.getString("EnvironmentTab.3")); //$NON-NLS-1$
b1.setToolTipText(UIMessages.getString("EnvironmentTab.3")); //$NON-NLS-1$
b1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@ -212,6 +222,7 @@ public class EnvironmentTab extends AbstractCPropertyTab {
b2 = new Button(usercomp, SWT.RADIO);
b2.setText(UIMessages.getString("EnvironmentTab.4")); //$NON-NLS-1$
b2.setToolTipText(UIMessages.getString("EnvironmentTab.4")); //$NON-NLS-1$
b2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
b2.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {

View file

@ -20,6 +20,8 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
import org.eclipse.cdt.core.settings.model.MultiItemsHolder;
import org.eclipse.cdt.internal.core.envvar.ContributedEnvironment;
/**
*
*
@ -188,4 +190,9 @@ public class MultiCfgContributedEnvironment implements IContributedEnvironment {
doReplace(des);
}
public String getOrigin(IEnvironmentVariable var) {
if (ice instanceof ContributedEnvironment)
return ((ContributedEnvironment)ice).getOrigin(var);
return AbstractPage.EMPTY_STR;
}
}

View file

@ -464,6 +464,7 @@ EnvironmentTab.12=Variables list
EnvironmentTab.13=Add to all configurations
EnvironmentTab.14=Select variables
EnvironmentTab.15=Current String List DISPLAY mode. Double-click to change
EnvironmentTab.16=Origin
EnvironmentTab.17=CONJUNCTION
EnvironmentTab.18=DISJUNCTION
EnvironmentTab.19=DISPLAY mode: