@Override protected MenuActionPlugin createInstance(IExtension extension) { return new MenuActionPluginJPFImpl(editorKit, extension); }
@Override public String toString() { return MoreObjects.toStringHelper("MenuActionPlugin") .add("name", getName()) .add("group", getGroup()) .add("groupIndex", getGroupIndex()) .add("accelerator", getAccelerator()) .add("parentId", getParentId()) .add("path", getPath()) .toString(); } }
public URL getURL() { String urlStr = getPluginProperty(URL_PARAM, null); if (urlStr != null){ try { return new URL(urlStr); } catch (MalformedURLException e) { Logger.getLogger(MenuActionPluginJPFImpl.class).warn("Invalid URL for action " + getId(), e); } } return null; }
@Override public String toString() { return "[Menu: " + getName() + " -- <" + getGroup() + ", " + getGroupIndex() + ">]"; } }
if (isClassSpecified()){ menuAction = super.newInstance(); URL url = getURL(); if (url != null){ menuAction = new OpenURLMenuAction(url); menuAction.putValue(AbstractAction.NAME, getName()); String toolTip = getToolTipText(); if (toolTip != null) { toolTip = toolTip.replace("\n", ""); menuAction.putValue(AbstractAction.SHORT_DESCRIPTION, toolTip); menuAction.putValue(AbstractAction.ACCELERATOR_KEY, getAccelerator()); menuAction.setEditorKit(getEditorKit()); try { menuAction.initialise();
private String getPath() { // The path corresponds to the path parameter value. return getPluginProperty(PATH_PARAM, SEPARATOR); }
/** * Parses the path to extract the parent id, the * group and the group index. If the group and group * index aren't specified then these default to the * empty string. */ private void parse() { group = ""; groupIndex = ""; String path = getPath(); int separatorIndex = path.indexOf(SEPARATOR); if (separatorIndex > -1) { parentId = path.substring(0, separatorIndex).trim(); String groupPart = path.substring(separatorIndex + 1, path.length()).trim(); int groupPartIndex = groupPart.indexOf("-"); if (groupPartIndex > -1) { group = groupPart.substring(0, groupPartIndex).trim(); groupIndex = groupPart.substring(groupPartIndex + 1, groupPart.length()); } else { group = groupPart; } } }
if (isClassSpecified()){ menuAction = super.newInstance(); URL url = getURL(); if (url != null){ menuAction = new OpenURLMenuAction(url); menuAction.putValue(AbstractAction.NAME, getName()); String toolTip = getToolTipText(); if (toolTip != null) { toolTip = toolTip.replace("\n", ""); menuAction.putValue(AbstractAction.SHORT_DESCRIPTION, toolTip); menuAction.putValue(AbstractAction.ACCELERATOR_KEY, getAccelerator()); menuAction.setEditorKit(getEditorKit()); try { menuAction.initialise();
private String getPath() { // The path corresponds to the path parameter value. return getPluginProperty(PATH_PARAM, SEPARATOR); }
@Override public String toString() { return "[Menu: " + getName() + " -- <" + getGroup() + ", " + getGroupIndex() + ">]"; } }
/** * Parses the path to extract the parent id, the * group and the group index. If the group and group * index aren't specified then these default to the * empty string. */ private void parse() { group = ""; groupIndex = ""; String path = getPath(); int separatorIndex = path.indexOf(SEPARATOR); if (separatorIndex > -1) { parentId = path.substring(0, separatorIndex).trim(); String groupPart = path.substring(separatorIndex + 1, path.length()).trim(); int groupPartIndex = groupPart.indexOf("-"); if (groupPartIndex > -1) { group = groupPart.substring(0, groupPartIndex).trim(); groupIndex = groupPart.substring(groupPartIndex + 1, groupPart.length()); } else { group = groupPart; } } if (logger.isDebugEnabled()) { logger.debug("Parsed: " + this + " parentId = " + parentId); } }
if (isClassSpecified()){ menuAction = super.newInstance(); URL url = getURL(); if (url != null){ menuAction = new OpenURLMenuAction(url); menuAction.putValue(AbstractAction.NAME, getName()); String toolTip = getToolTipText(); if (toolTip != null) { toolTip = toolTip.replace("\n", ""); menuAction.putValue(AbstractAction.SHORT_DESCRIPTION, toolTip); menuAction.putValue(AbstractAction.ACCELERATOR_KEY, getAccelerator()); menuAction.setEditorKit(getEditorKit()); try { menuAction.initialise();
private boolean isClassSpecified(){ return getPluginProperty(PluginProperties.CLASS_PARAM_NAME) != null; }
public URL getURL() { String urlStr = getPluginProperty(URL_PARAM, null); if (urlStr != null){ try { return new URL(urlStr); } catch (MalformedURLException e) { LoggerFactory.getLogger(MenuActionPluginJPFImpl.class).warn("Invalid URL for action " + getId(), e); } } return null; }
@Override protected MenuActionPlugin createInstance(IExtension extension) { return new MenuActionPluginJPFImpl(editorKit, extension); }
/** * Parses the path to extract the parent id, the * group and the group index. If the group and group * index aren't specified then these default to the * empty string. */ private void parse() { group = ""; groupIndex = ""; String path = getPath(); int separatorIndex = path.indexOf(SEPARATOR); if (separatorIndex > -1) { parentId = path.substring(0, separatorIndex).trim(); String groupPart = path.substring(separatorIndex + 1, path.length()).trim(); int groupPartIndex = groupPart.indexOf("-"); if (groupPartIndex > -1) { group = groupPart.substring(0, groupPartIndex).trim(); groupIndex = groupPart.substring(groupPartIndex + 1, groupPart.length()); } else { group = groupPart; } } if (logger.isDebugEnabled()) { logger.debug("Parsed: " + this + " parentId = " + parentId); } }
private String getPath() { // The path corresponds to the path parameter value. return getPluginProperty(PATH_PARAM, SEPARATOR); }
public URL getURL() { String urlStr = getPluginProperty(URL_PARAM, null); if (urlStr != null){ try { return new URL(urlStr); } catch (MalformedURLException e) { Logger.getLogger(MenuActionPluginJPFImpl.class).warn("Invalid URL for action " + getId(), e); } } return null; }
@Override protected MenuActionPlugin createInstance(IExtension extension) { return new MenuActionPluginJPFImpl(editorKit, extension); }
private boolean isClassSpecified(){ return getPluginProperty(PluginProperties.CLASS_PARAM_NAME) != null; }