mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-08 17:45:24 +02:00
systemTypes: return default icon if no iconLive is configured but a default icon is
This commit is contained in:
parent
36d695e826
commit
f5a69e7fa5
1 changed files with 9 additions and 3 deletions
|
@ -52,12 +52,18 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the "live" image descriptor for this system type.
|
* Returns the "live" image descriptor for this system type.
|
||||||
* Returns the default live connection image descriptor if no icon has been configured.
|
*
|
||||||
|
* If no "live" icon is found, but a non-live icon was specified,
|
||||||
|
* the non-live icon is returned instead. If a non-live icon also
|
||||||
|
* was not specified, the default live connection image descriptor
|
||||||
|
* is returned.
|
||||||
|
*
|
||||||
* @param object The object to get an image descriptor for.
|
* @param object The object to get an image descriptor for.
|
||||||
* @return ImageDescriptor
|
* @return ImageDescriptor
|
||||||
*/
|
*/
|
||||||
public ImageDescriptor getLiveImageDescriptor(Object object) {
|
public ImageDescriptor getLiveImageDescriptor(Object object) {
|
||||||
ImageDescriptor img = getImage(object, ICON_LIVE);
|
ImageDescriptor img = getImage(object, ICON_LIVE);
|
||||||
|
if (img==null) img = getImage(object, ICON);
|
||||||
if (img==null) img = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE_ID);
|
if (img==null) img = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE_ID);
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +222,7 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
|
||||||
Preferences prefs = RSECorePlugin.getDefault().getPluginPreferences();
|
Preferences prefs = RSECorePlugin.getDefault().getPluginPreferences();
|
||||||
String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_DEFAULT_USERID);
|
String key = getPreferencesKey(systemType, IRSEPreferenceNames.ST_DEFAULT_USERID);
|
||||||
if (!prefs.contains(key)) {
|
if (!prefs.contains(key)) {
|
||||||
prefs.setDefault(key, System.getProperty("user.name"));
|
prefs.setDefault(key, System.getProperty("user.name")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
result = prefs.getString(key);
|
result = prefs.getString(key);
|
||||||
}
|
}
|
||||||
|
@ -240,7 +246,7 @@ public class RSESystemTypeAdapter extends RSEAdapter implements IRSESystemTypeCo
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getPreferencesKey(IRSESystemType systemType, String preference) {
|
private String getPreferencesKey(IRSESystemType systemType, String preference) {
|
||||||
String key = systemType.getName() + "." + preference;
|
String key = systemType.getName() + "." + preference; //$NON-NLS-1$
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue