/** * Gets the boolean resource value for the given command command-ID and command property name. */ protected Boolean getConfigBoolean(ConfigurationElement config, String elementName) { String value = getConfigString(config, elementName); if (value != null) { return Boolean.valueOf(value); } return null; }
resString = getConfigString(config, "text"); if (resString != null && resString.length() > 0) { setText(resString); resString = getConfigString(config, "popuptext"); if (resString != null && resString.length() > 0) { setPopupText(resString); resString = getConfigString(config, "mnemonic"); if (resString != null && resString.length() > 0) { setMnemonic((int) resString.charAt(0)); resString = getConfigString(config, "accelerator"); if (resString != null && resString.length() > 0) { setAccelerator(KeyStroke.getKeyStroke(resString)); resString = getConfigString(config, "shortDescr"); if (resString != null) { setShortDescription(resString); resString = getConfigString(config, "longDescr"); if (resString != null) { setLongDescription(resString); resString = getConfigString(config, "placeBefore"); if (resString != null) { setProperty(ACTION_KEY_PLACE_BEFORE, resString); resString = getConfigString(config, "placeAfter");
/** * Gets the resource strings for the given command command-ID and command property name. */ protected String[] getConfigStrings(ConfigurationElement config, String elementName) { String value = getConfigString(config, elementName); if (value == null) { return null; } return StringUtils.split(value, new char[]{','}, true); }
protected Icon getConfigIcon(ConfigurationElement config, String elementName) { String value = getConfigString(config, elementName); if (value != null) { try { return UIUtils.loadImageIcon(value, getClass()); } catch (RuntimeException e) { // todo - handle missing icon here e.printStackTrace(); } } return null; } }