@Override public void configure(ConfigurationElement config) throws CoreException { super.configure(config); Boolean resBoolean = getConfigBoolean(config, "selected"); if (resBoolean != null) { setSelected(resBoolean); } }
/** * Configures this command with the properties (if any) found in the given resource bundle. Overrides the base class * implementation in order to configure the following extra properties:<p> <ld> * <li><code>command.</code><i>command-ID</i><code>.selected = true</code> or <code>false</code></li> </ld> * * @param resourceBundle the resource bundle from which the properties are received * * @throws IllegalArgumentException if the resource bundle is null */ @Override public void configure(ResourceBundle resourceBundle) { super.configure(resourceBundle); Boolean resBoolean; resBoolean = getResourceBoolean(resourceBundle, "selected"); if (resBoolean != null) { setSelected(resBoolean); } }
protected final void configureCommandsByResourceBundle() { ResourceBundle resourceBundle = getResourceBundle(); if (resourceBundle == null) { return; } for (int i = 0; i < commandManager.getNumCommands(); i++) { commandManager.getCommandAt(i).configure(resourceBundle); } }
@Override public void configure(ConfigurationElement config) throws CoreException { super.configure(config); ConfigurationElement itemsElement = config.getChild(ELEMENT_NAME_ITEMS); if (itemsElement == null) { return; } ConfigurationElement[] children = itemsElement.getChildren(); String[] groupItems = new String[children.length]; for (int i = 0; i < children.length; i++) { ConfigurationElement child = children[i]; String childName = child.getName(); switch (childName) { case ELEMENT_NAME_ACTION_ID: case ELEMENT_NAME_ACTION_GROUP_ID: groupItems[i] = child.getValue().trim(); break; case ELEMENT_NAME_SEPARATOR: groupItems[i] = null; break; default: Module declaringModule = config.getDeclaringExtension().getDeclaringModule(); throw new CoreException(String.format("Module [%s]: '%s' is an unknown 'groupItems' element", declaringModule.getName(), childName)); } } setProperty(ACTION_KEY_GROUP_ITEMS, groupItems); }