private void init() { CSH .setHelpIDString( this, "net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ApiConsumerContextualView"); }
/** * Returns the static helpID for a MenuItem. * If the component doesn't have associated help, traverse the * component's ancestors for help.<p> * * This method calls <code>CSH.getHelpIDString(comp, null)</code>. * * @see #setHelpIDString(MenuItem, String) */ public static String getHelpIDString(MenuItem comp) { return getHelpIDString(comp, null); /* String helpID = _getHelpIDString(comp); // return the helpID if it exists if (helpID != null) { return helpID; } // loop through the parents to try to find a valid helpID MenuContainer parent = comp.getParent(); if (parent instanceof MenuItem) { return getHelpIDString((MenuItem)parent); } else { return null; } */ }
/** * Returns the dynamic HelpID for a object. The method passes the arguments * into all registered CSH manageres to obtain dynamic HelpID. If no manager * provides HelpID for the object, the static HelpID is returned or traverse * to the component's ancestors for help. * @exception IllegalArgumentException comp is neither <code>Component</code> nor * <code>MenuItem</code>. * @since 2.0 */ public static String getHelpIDString(Object comp, AWTEvent evt) { if (comp == null) { return null; } String helpID = _getHelpIDString(comp, evt); if (helpID == null) { helpID = _getHelpIDString(comp); } if (helpID == null) { helpID = getHelpIDString(getParent(comp), evt); } return helpID; }
String helpID = _getHelpIDString(comp, evt); if (helpID == null) { helpID = _getHelpIDString(comp); HelpSet hs = _getHelpSet(comp, evt); if (hs == null) { hs = _getHelpSet(comp); return (getHelpSet(getParent(comp), evt));
/** * Enables help for a MenuItem. This method sets a * component's helpID and HelpSet. * * @param comp the MenuItem to set the id and hs on. * @param id the String value of an Map.ID. * @param hs the HelpSet the id is in. If hs is null the default HelpSet * will be assumed. * @see CSH.setHelpID * @see CSH.setHelpSet */ public void enableHelp(MenuItem comp, String id, HelpSet hs) { if (id == null) { throw new NullPointerException("id"); } CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs); } }
helpID = CSH.getHelpIDString(obj, event); objHS = CSH.getHelpSet(obj, event); if (objHS == null) { if (hb != null) {
/** * Enables help for a Component. This method sets a * component's helpID and HelpSet. * * @param comp the Component to set the id and hs on. * @param id the String value of an Map.ID. * @param hs the HelpSet the id is in. If hs is null the default HelpSet * will be assumed. * @see CSH.setHelpID * @see CSH.setHelpSet */ public void enableHelp(Component comp, String id, HelpSet hs) { if (id == null) { throw new NullPointerException("id"); } CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs); } }
/** * Set javax.help string to identify the component for later references to * the help document. Note that the component (ie. the * {@link AbstractMenuAction} must have an ID for an registration to take * place. * * @param component * The {@link Component} to set help string for * @param componentId * The {@link URI} to be used as identifier */ protected void setHelpStringForComponent(Component component, URI componentId) { if (componentId != null) { String helpId = componentId.toASCIIString(); CSH.setHelpIDString(component, helpId); } }
/** * Enables help for a MenuItem. This method sets a * Component's helpID and HelpSet and adds an ActionListener. * When an action is performed * it displays the Component's helpID and HelpSet in the default viewer. * * @param comp the MenuItem to set the id and hs on. If comp is null * an IllegalAgrumentException is thrown. * @param id the String value of an Map.ID. * @param hs the HelpSet the id is in. If hs is null the default HelpSet * will be assumed. * @see CSH.setHelpID * @see CSH.setHelpSet * @see java.awt.MenuItem * @throws IllegalArgumentException if comp is null. */ public void enableHelpOnButton(MenuItem comp, String id, HelpSet hs) { if (comp == null) { throw new IllegalArgumentException("Invalid Component"); } if (id == null) { throw new NullPointerException("id"); } CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs); } comp.addActionListener(getDisplayHelpFromSource()); }
return getHelpIDString(comp, null);
/** * Set javax.help string to identify the component for later references to * the help document. Note that the component (ie. the * {@link AbstractMenuAction} must have an ID for an registration to take * place. * * @param component * The {@link Component} to set help string for * @param componentId * The {@link URI} to be used as identifier */ protected void setHelpStringForComponent(Component component, URI componentId) { if (componentId != null) { String helpId = componentId.toASCIIString(); CSH.setHelpIDString(component, helpId); } }
throw new NullPointerException("id"); CSH.setHelpIDString(comp, id); if (hs != null) { CSH.setHelpSet(comp, hs);
public String findHelpId(Component comp) { String helpID = CSH.getHelpIDString(comp); if (defaultID.equals(helpID)) { String id = cache.get(comp); // on verifie qu'on est bien sur sur le bon id if (helpID.equals(id)) { // ok return helpID; } if (log.isDebugEnabled()) { log.debug("will try to find better id for comp : " + comp.getName()); } // on est pas sur le bon id // on recherche parmis les parents helpID = findExtactHelpId(comp); } if (log.isInfoEnabled()) { log.info("helpID " + helpID + " for comp " + comp.getName() + " : " + comp.getClass().getName()); } return helpID; }
public void installUI(Component comp, String helpId) { CSH.setHelpIDString(comp, helpId); if (log.isDebugEnabled()) { log.debug(helpId + " : " + comp.getName()); } cache.put(comp, helpId); }
throw new IllegalArgumentException("hs"); CSH.setHelpIDString(comp, id); if (hs !=null) { CSH.setHelpSet(comp, hs);
public String findHelpId(Component comp) { String helpID = CSH.getHelpIDString(comp); if (defaultID.equals(helpID)) { String id = cache.get(comp); // on verifie qu'on est bien sur sur le bon id if (helpID.equals(id)) { // ok return helpID; } if (log.isDebugEnabled()) { log.debug("will try to find better id for comp : " + comp.getName()); } // on est pas sur le bon id // on recherche parmis les parents helpID = findExtactHelpId(comp); } if (log.isInfoEnabled()) { log.info("helpID " + helpID + " for comp " + comp.getName() + " : " + comp.getClass().getName()); } return helpID; }
public void installUI(Component comp, String helpId) { CSH.setHelpIDString(comp, helpId); if (log.isDebugEnabled()) { log.debug(helpId + " : " + comp.getName()); } cache.put(comp, helpId); }
CSH.setHelpIDString((Component)obj, id); if (hs != null) { CSH.setHelpSet((Component)obj, hs); CSH.setHelpIDString((MenuItem)obj, id); if (hs != null) { CSH.setHelpSet((MenuItem)obj, hs);
public String findHelpId(Component comp) { String helpID = CSH.getHelpIDString(comp); if (defaultID.equals(helpID)) { String id = cache.get(comp); // on verifie qu'on est bien sur sur le bon id if (helpID.equals(id)) { // ok return helpID; } if (log.isDebugEnabled()) { log.debug("will try to find better id for comp : " + comp.getName()); } // on est pas sur le bon id // on recherche parmis les parents helpID = findExtactHelpId(comp); } if (log.isInfoEnabled()) { log.info("helpID " + helpID + " for comp " + comp.getName() + " : " + comp.getClass().getName()); } return helpID; }
public void installUI(Component comp, String helpId) { CSH.setHelpIDString(comp, helpId); if (log.isDebugEnabled()) { log.debug(helpId + " : " + comp.getName()); } cache.put(comp, helpId); }