站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

Completion (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor.ext
Class Completion

java.lang.Object
  extended by org.netbeans.editor.ext.Completion
All Implemented Interfaces:
ActionListener, PropertyChangeListener, EventListener, SettingsChangeListener

public class Completion
extends Object
implements PropertyChangeListener, SettingsChangeListener, ActionListener

General Completion display formatting and services


Field Summary
protected  ExtEditorUI extEditorUI
          Editor UI supporting this completion
 boolean provokedByAutoPopup
           
 
Constructor Summary
Completion(ExtEditorUI extEditorUI)
           
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Called to do either displaying or refreshing of the view.
 void cancelRequest()
          Cancel last request for either displaying or refreshing the pane.
 void completionCancel()
           
protected  CompletionQuery createQuery()
           
protected  CompletionView createView()
           
 ExtCompletionPane getExtPane()
           
 JavaDocPane getJavaDocPane()
           
 JDCPopupPanel getJDCPopupPanel()
          Get panel holding all aids (completion and documentation panes).
 JDCPopupPanel getJDCPopupPanelIfExists()
          Get panel holding all aids (completion and documentation panes).
 CompletionQuery.Result getLastResult()
          Get the result of the last valid completion query or null if there's no valid result available.
 CompletionPane getPane()
           
 CompletionQuery getQuery()
           
 Object getSelectedValue()
           
 CompletionView getView()
           
 boolean instantSubstitution(int caretPos)
          Performs instant text substitution, provided that result contains only one item and completion has been invoked at the end of the word.
 void invalidateLastResult()
          Reset the result of the last valid completion query.
 boolean isAutoPopupEnabled()
          Return true if the completion should popup automatically
 boolean isPaneVisible()
          Return true when the pane exists and is visible.
protected  void performResults()
          Show result popup.
 void popup(boolean postRequest)
          Get the help and show it in the view.
 void propertyChange(PropertyChangeEvent evt)
           
 void refresh(boolean postRequest)
          Refresh the contents of the view if it's currently visible.
 void setPaneVisible(boolean visible)
          Set the visibility of the view.
 void settingsChange(SettingsChangeEvent evt)
           
 boolean substituteCommonText()
          Substitute the text with the longest common part of all the entries appearing in the view.
 boolean substituteSimpleText()
           
 boolean substituteText(boolean shift)
          Substitute the document's text with the text that is appopriate for the selection in the view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extEditorUI

protected ExtEditorUI extEditorUI
Editor UI supporting this completion


provokedByAutoPopup

public boolean provokedByAutoPopup
Constructor Detail

Completion

public Completion(ExtEditorUI extEditorUI)
Method Detail

settingsChange

public void settingsChange(SettingsChangeEvent evt)
Specified by:
settingsChange in interface SettingsChangeListener

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

getPane

public CompletionPane getPane()

getExtPane

public ExtCompletionPane getExtPane()

createView

protected CompletionView createView()

getView

public final CompletionView getView()

createQuery

protected CompletionQuery createQuery()

getQuery

public final CompletionQuery getQuery()

getJavaDocPane

public JavaDocPane getJavaDocPane()

getJDCPopupPanelIfExists

public final JDCPopupPanel getJDCPopupPanelIfExists()
Get panel holding all aids (completion and documentation panes).

Returns:
JDCPopupPanel or null

getJDCPopupPanel

public JDCPopupPanel getJDCPopupPanel()
Get panel holding all aids (completion and documentation panes).

Returns:
JDCPopupPanel never null

getLastResult

public final CompletionQuery.Result getLastResult()
Get the result of the last valid completion query or null if there's no valid result available.


invalidateLastResult

public final void invalidateLastResult()
Reset the result of the last valid completion query. This is done for example after the document was modified.


getSelectedValue

public Object getSelectedValue()

isAutoPopupEnabled

public boolean isAutoPopupEnabled()
Return true if the completion should popup automatically


isPaneVisible

public boolean isPaneVisible()
Return true when the pane exists and is visible. This is the preferred method of testing the visibility of the pane instead of getPane().isVisible() that forces the creation of the pane.


setPaneVisible

public void setPaneVisible(boolean visible)
Set the visibility of the view. This method should be used mainly for hiding the completion pane. If used with visible set to true it calls the popup(false).


completionCancel

public void completionCancel()

refresh

public void refresh(boolean postRequest)
Refresh the contents of the view if it's currently visible.

Parameters:
postRequest - post the request instead of refreshing the view immediately. The ExtSettingsNames.COMPLETION_REFRESH_DELAY setting stores the number of milliseconds before the view is refreshed.

popup

public void popup(boolean postRequest)
Get the help and show it in the view. If the view is already visible perform the refresh of the view.

Parameters:
postRequest - post the request instead of displaying the view immediately. The ExtSettingsNames.COMPLETION_AUTO_POPUP_DELAY setting stores the number of milliseconds before the view is displayed. If the user presses a key until the delay expires nothing is shown. This guarantees that the user which knows what to write will not be annoyed with the unnecessary help.

cancelRequest

public void cancelRequest()
Cancel last request for either displaying or refreshing the pane. It resets the internal timer.


actionPerformed

public void actionPerformed(ActionEvent evt)
Called to do either displaying or refreshing of the view. This method can be called either directly or because of the timer has fired.

Specified by:
actionPerformed in interface ActionListener
Parameters:
evt - event describing the timer firing or null if the method was called directly because of the synchronous showing/refreshing the view.

performResults

protected void performResults()
Show result popup. Always called from AWT.


instantSubstitution

public boolean instantSubstitution(int caretPos)
Performs instant text substitution, provided that result contains only one item and completion has been invoked at the end of the word.

Parameters:
caretPos - offset position of the caret

substituteText

public boolean substituteText(boolean shift)
Substitute the document's text with the text that is appopriate for the selection in the view. This function is usually triggered upon pressing the Enter key.

Returns:
true if the substitution was performed false if not.

substituteSimpleText

public boolean substituteSimpleText()

substituteCommonText

public boolean substituteCommonText()
Substitute the text with the longest common part of all the entries appearing in the view. This function is usually triggered upon pressing the Tab key.

Returns:
true if the substitution was performed false if not.

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.