Class FormContextSwitcher


  • public class FormContextSwitcher
    extends Object
    The context switcher of form editor
    • Constructor Detail

      • FormContextSwitcher

        public FormContextSwitcher​(org.eclipse.ui.IActionBars actionBars,
                                   org.eclipse.ui.contexts.IContextService contextService)
        Creates a new context switcher
        Parameters:
        actionBars - the part action bars
        contextService - the context service for switch context
    • Method Detail

      • create

        public static FormContextSwitcher create​(org.eclipse.ui.part.EditorPart part)
        Creates a FormContextSwitcher for EditorPart
        Parameters:
        part - the part for creates a context switcher
        Returns:
        a new context switcher
      • register

        public void register​(org.eclipse.swt.widgets.Control ui,
                             IGlobalActionsProvider provider)
        Add global context provider.
        Parameters:
        ui - the control at which activation(set focus) to bind context and action
        provider - the global action provider
      • dispose

        public void dispose()
        Dispose class
      • isActive

        public boolean isActive()
        Checks active context exists
        Returns:
        return true if active context exists
      • getActiveContextId

        public String getActiveContextId()
        Returns current active context id.
        Returns:
        if current context has not returns null, otherwise return context identifier.
      • unbindAll

        public void unbindAll()
        The method deactivates all contexts
      • bind

        protected void bind​(IGlobalActionsProvider provider)
        The method activate context using the provider
        Parameters:
        provider - the activation provider
      • unbind

        protected void unbind​(IGlobalActionsProvider provider)
        The method deactivate current context
        Parameters:
        provider - the deactivating provider