Package org.eclipse.help

Examples of org.eclipse.help.IContext


    action.setHelpListener(new HelpListener() {
      public void helpRequested(HelpEvent event) {
        if (contexts != null && contexts.length > 0
            && getHelpUI() != null) {
          // determine the context
          IContext context = null;
          if (contexts[0] instanceof String) {
            context = HelpSystem.getContext((String) contexts[0]);
          } else if (contexts[0] instanceof IContext) {
            context = (IContext) contexts[0];
          }
View Full Code Here


      public void helpRequested(HelpEvent event) {
        Object[] helpContexts = computer.computeContexts(event);
        if (helpContexts != null && helpContexts.length > 0
            && getHelpUI() != null) {
          // determine the context
          IContext context = null;
          if (helpContexts[0] instanceof String) {
            context = HelpSystem
                .getContext((String) helpContexts[0]);
          } else if (helpContexts[0] instanceof IContext) {
            context = (IContext) helpContexts[0];
View Full Code Here

    // final String contextId = command.getHelpId();
    final String contextId = ""; //$NON-NLS-1$
    return new HelpListener() {
      public void helpRequested(HelpEvent event) {
        if (getHelpUI() != null) {
          IContext context = HelpSystem.getContext(contextId);
          if (context != null) {
            Point point = computePopUpLocation(event.widget
                .getDisplay());
            displayContext(context, point.x, point.y);
          }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.ui.help.IWorkbenchHelpSystem#displayHelp(java.lang.String)
   */
  public void displayHelp(String contextId) {
    IContext context = HelpSystem.getContext(contextId);
    if (context != null) {
      Point point = computePopUpLocation(Display.getCurrent());
      displayContext(context, point.x, point.y);
    }
  }
View Full Code Here

   */
  public void setHelp(final IAction action, final String contextId) {
    action.setHelpListener(new HelpListener() {
      public void helpRequested(HelpEvent event) {
        if (getHelpUI() != null) {
          IContext context = HelpSystem.getContext(contextId);
          if (context != null) {
            Point point = computePopUpLocation(event.widget
                .getDisplay());
            displayContext(new ContextWithTitle(context, action.getText()), point.x, point.y);
          }
View Full Code Here

      Object object = event.widget.getData(HELP_KEY);

      // Since 2.0 we can expect that object is a String, however
      // for backward compatability we handle context computers and
      // arrays.
      IContext context = null;
      if (object instanceof String) {
        // context id - this is the norm
        context = HelpSystem.getContext((String) object);
      } else if (object instanceof IContext) {
        // already resolved context (pre 2.0)
View Full Code Here

    }

    /** @deprecated */
    public void displayContext(String contextId, int x, int y) {
      // convenience method - funnel through the real method
      IContext context = HelpSystem.getContext(contextId);
      if (context != null) {
        displayContext(context, x, y);
      }
    }
View Full Code Here

    }
   
    @Override
    protected Object run( final Presentation context )
    {
        final IContext documentationContext = getPart().getDocumentationContext();
       
        if ( documentationContext != null )
        {
            PlatformUI.getWorkbench().getHelpSystem().displayHelp( documentationContext );
        }
View Full Code Here

     */
  }

  protected boolean resolvePage(String contextId, boolean endpoint) {
    String contextName = contextId;
    IContext context = HelpSystem.getContext(contextName);
    if (context == null) {
      if (endpoint) {
        contextName = "org.fusesource.ide.camel.editor.endpoint";
      } else {
        contextName = "org.fusesource.ide.camel.editor.allEIPs";
        context = HelpSystem.getContext("");
      }
      context = HelpSystem.getContext(contextName);

      // Activator.getLogger().debug("Context ID " + contextId +
      // " is bad using default.");
    }
    if (context == null) {
      Activator.getLogger().warning(
          "Could not find context: " + contextName);
      return false;
    }
    IHelpResource[] relatedTopics = context.getRelatedTopics();
    if (relatedTopics != null && relatedTopics.length > 0) {
      IHelpResource resource = relatedTopics[0];
      if (resource != null) {
        String helpUrl = resource.getHref();
        IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench()
View Full Code Here

        setControl( composite );
    }
   
    public final void performHelp()
    {
        final IContext documentationContext = this.part.getDocumentationContext();
       
        if ( documentationContext != null  )
        {
            PlatformUI.getWorkbench().getHelpSystem().displayHelp( documentationContext );
        }
View Full Code Here

TOP

Related Classes of org.eclipse.help.IContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.