Extension SDK 10.1.2

oracle.javatools.editor.insight
Interface InsightView

All Known Implementing Classes:
ListInsightView, TooltipInsightView

public interface InsightView

The InsightView interface acts as the view and controller for the Insight. Information that is retrieved from the InsightProvider is passed on to the InsightView which is responsible for constructing a Swing UI component to represent the data. Additionally, Insight commands (navigation, completion acceptance) are passed on to the InsightView to delegate as appropriate.

Note that all of the commands defined by this interface return a boolean value. This is because certain commands only make sense with certain Insight features. For example, if a given Insight implementation only provides tooltip assistance, then accept() and partial() should return false since completion assistance is not applicable.

See Also:
Insight, InsightProvider, InsightData

Method Summary
 boolean begin()
          Command to move the selection of the view to the top of the data set.
 boolean complete(Insight insight)
          Command to accept (complete) the current insight selection into the document.
 boolean down()
          Command to move the selection of the view to the next item (down) in the data set.
 boolean end()
          Command to move the selection of the view to the bottom of the data set.
 javax.swing.JComponent getComponent()
          Fetches the Swing UI component for displaying this view.
 InsightData getData()
          Fetches the InsightData that is the data model associated with this particular view.
 boolean left()
          Command to move the selection of the view to the left item in the data set.
 boolean pageDown()
          Command to move the selection of the view down by one page in the data set.
 boolean pageUp()
          Command to move the selection of the view up by one page in the data set.
 boolean partialComplete()
          Command to request partial completion using the current insight information based on the current document contents.
 boolean right()
          Command to move the selection of the view to the right item in the data set.
 void selectDefault()
          Instructs the InsightView to select the default insight data item, and to make sure that it is visible.
 void setData(InsightData insightData)
          Sets the InsightData data model which should be displayed by this view.
 void setPopupWindow(oracle.javatools.editor.popup.PopupWindow popupWindow)
          Sets the PopupWindow which will contain the InsightView This is necessary so the InsightView can set the accessible name on the window so it will be read.
 boolean up()
          Command to move the selection of the view to the previous item (up) in the data set.
 

Method Detail

setData

public void setData(InsightData insightData)
Sets the InsightData data model which should be displayed by this view.

Parameters:
insightData - the data model to use

getData

public InsightData getData()
Fetches the InsightData that is the data model associated with this particular view.

Returns:
the InsightData that is displayed by this view

selectDefault

public void selectDefault()
Instructs the InsightView to select the default insight data item, and to make sure that it is visible. This may be necessary as the InsightData instance may be set into the view using setData() before the actual view is even visible.


getComponent

public javax.swing.JComponent getComponent()
Fetches the Swing UI component for displaying this view. This is a JComponent so that the AbstractInsight implementation can take care of mapping some basic keys for completion and cancelling when the component has focus.

Returns:
the Swing UI component for displaying this view.

up

public boolean up()
Command to move the selection of the view to the previous item (up) in the data set. If the underlying view does not support the given navigation (i.e., it is a tooltip view and provides read-only information), nothing will happen. The view should return true if the view supports the up navigation, even if no action is taken. This is so that the up action can be consumed by the Insight framework instead of being passed on through the editor hierarchy.

For example, suppose the underlying Insight implements completion insight, and the view is a List. The view should return true here even if the selection is at the top of the list since the view supports navigation upwards and downwards.

Returns:
true if the underlying InsightView supports the concept of navigating up in the visible data

down

public boolean down()
Command to move the selection of the view to the next item (down) in the data set.

Returns:
true if the underlying InsightView supports the concept of navigating down in the visible data

right

public boolean right()
Command to move the selection of the view to the right item in the data set. The right() and left() actions are here to support views where the concept of right and left makes sense, such as a tree view.

Returns:
true if the underlying InsightView supports the concept of navigating right in the visible data

left

public boolean left()
Command to move the selection of the view to the left item in the data set. The right() and left() actions are here to support views where the concept of right and left makes sense, such as a tree view.

Returns:
true if the underlying InsightView supports the concept of navigating left in the visible data

pageUp

public boolean pageUp()
Command to move the selection of the view up by one page in the data set.

Returns:
true if the underlying InsightView supports the concept of navigating one page up

pageDown

public boolean pageDown()
Command to move the selection of the view down by one page in the data set.

Returns:
true if the underlying InsightView supports the concept of navigating one page down

begin

public boolean begin()
Command to move the selection of the view to the top of the data set.

Returns:
true if the underlying InsightView supports the concept of navigating to the top of the data set

end

public boolean end()
Command to move the selection of the view to the bottom of the data set.

Returns:
true if the underlying InsightView supports the concept of navigating to the bottom of the data set

complete

public boolean complete(Insight insight)
Command to accept (complete) the current insight selection into the document. This occurs when the user hits the "Enter" key while Insight information is visible. This method is responding for hiding the Insight window and retriggering the Insight auto-popup if necessary.

Parameters:
insight - the main Insight engine for the purpose of hiding or re-triggering Insight
Returns:
true if this Insight supports completion assistance

partialComplete

public boolean partialComplete()
Command to request partial completion using the current insight information based on the current document contents. This occurs when the user hits the "Tab" key while insight information is available. For example, suppose the user has typed "s.eq" in the document, and Insight information is currently displaying:

Hitting "Tab" will enter "ual" into the document so that the user's document now reads "s.equal". The Insight information should also be updated to reflect the new document contents.

Even if there is only one selection applicable to the partial match, this will not perform an "accept". It is up to the user to hit "Enter" to accept the single selection applicable.

Returns:
true if this Insight supports partial completion assitance

setPopupWindow

public void setPopupWindow(oracle.javatools.editor.popup.PopupWindow popupWindow)
Sets the PopupWindow which will contain the InsightView This is necessary so the InsightView can set the accessible name on the window so it will be read.


Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.