/** * Gets the resource string for the given command command-ID and command property name. */ protected String getResourceString(ResourceBundle resourceBundle, String commandPropertyName) { String key = createResourceKey(commandPropertyName); try { return resourceBundle.getString(key); } catch (MissingResourceException e) { //Debug.trace("missing value for resource key '" + key + "'"); return null; } }
/** * Gets the resource strings for the given command command-ID and command property name. */ protected String[] getResourceStringArray(ResourceBundle resourceBundle, String commandPropertyName) { String key = createResourceKey(commandPropertyName); try { return resourceBundle.getStringArray(key); } catch (MissingResourceException e) { //Debug.trace("missing value for resource key '" + key + "'"); return null; } }
protected Icon getResourceIcon(ResourceBundle resourceBundle, String commandPropertyName) { String value = getResourceString(resourceBundle, commandPropertyName); if (value != null) { try { return UIUtils.loadImageIcon(value); } catch (RuntimeException e) { String message = String.format("failed to load icon for resource entry '%s=%s'", createResourceKey(commandPropertyName), value); Debug.trace(message); } } return null; }