Class InformationPresenter

    • Field Detail

      • WIDGET_PRIORITY

        public static final int WIDGET_PRIORITY
        Priority of the info controls managed by this information presenter. Default value: 5.
        Since:
        3.0
        See Also:
        Constant Field Values
    • Constructor Detail

      • InformationPresenter

        public InformationPresenter​(IInformationControlCreator creator)
        Creates a new information presenter that uses the given information control creator. The presenter is not installed on any text viewer yet. By default, an information control closer is set that closes the information control in the event of key strokes, resizing, moves, focus changes, mouse clicks, and disposal - all of those applied to the information control's parent control. Also, the setup ensures that the information control when made visible will request the focus. By default, the default document partitioning IDocumentExtension3.DEFAULT_PARTITIONING is used.
        Parameters:
        creator - the information control creator to be used
    • Method Detail

      • setDocumentPartitioning

        public void setDocumentPartitioning​(String partitioning)
        Sets the document partitioning to be used by this information presenter.
        Parameters:
        partitioning - the document partitioning to be used by this information presenter
        Since:
        3.0
      • setInformationProvider

        public void setInformationProvider​(IInformationProvider provider,
                                           String contentType)
        Registers a given information provider for a particular content type. If there is already a provider registered for this type, the new provider is registered instead of the old one.
        Parameters:
        provider - the information provider to register, or null to remove an existing one
        contentType - the content type under which to register
      • getInformationProvider

        public IInformationProvider getInformationProvider​(String contentType)
        Description copied from interface: IInformationPresenter
        Returns the information provider to be used for the given content type.
        Specified by:
        getInformationProvider in interface IInformationPresenter
        Parameters:
        contentType - the type of the content for which information will be requested
        Returns:
        an information provider or null if none exists for the specified content type
      • setOffset

        public void setOffset​(int offset)
        Sets a offset to override the selection. Setting the value to -1 will disable overriding.
        Parameters:
        offset - the offset to override selection or -1
      • requestWidgetToken

        public boolean requestWidgetToken​(IWidgetTokenOwner owner,
                                          int priority)
        Description copied from interface: IWidgetTokenKeeperExtension
        The given widget token owner requests the widget token from this token keeper. Returns true if the token is released by this token keeper. Note, the keeper must not call releaseWidgetToken(IWidgetTokenKeeper) explicitly.

        The general contract is that the receiver should release the token if priority exceeds the receiver's priority.

        Specified by:
        requestWidgetToken in interface IWidgetTokenKeeperExtension
        Parameters:
        owner - the token owner
        priority - the priority of the request
        Returns:
        true if token has been released false otherwise
      • setFocus

        public boolean setFocus​(IWidgetTokenOwner owner)
        Description copied from interface: IWidgetTokenKeeperExtension
        Requests the receiver to give focus to its popup shell, hover, or similar. There is no assumption made whether the receiver actually succeeded in taking the focus. The return value gives a hint whether the receiver tried to take focus.
        Specified by:
        setFocus in interface IWidgetTokenKeeperExtension
        Parameters:
        owner - the token owner
        Returns:
        true if the receiver tried to take focus, false if it did not.