|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.lpex.alef.contentassist.ContentAssistant
public class ContentAssistant
An LPEX-based implementation of the IContentAssistant
interface.
Usually, clients instantiate this class and configure it before using it.
Field Summary | |
---|---|
static int |
LAYOUT_CONTEXT_INFO_POPUP
The presentation type for the context information hover . |
static int |
LAYOUT_CONTEXT_SELECTOR
The presentation type for the context selection popup. |
static int |
LAYOUT_PROPOSAL_SELECTOR
The presentation type for the proposal selection popup. |
static String |
STORE_SIZE_X
Dialog store constants. |
static String |
STORE_SIZE_Y
|
static int |
WIDGET_PRIORITY
The popup priority: > linked position proposals and hover popups. |
Fields inherited from interface com.ibm.lpex.alef.contentassist.IContentAssistant |
---|
CONTEXT_INFO_ABOVE, CONTEXT_INFO_BELOW, PROPOSAL_OVERLAY, PROPOSAL_REMOVE, PROPOSAL_STACKED |
Constructor Summary | |
---|---|
ContentAssistant()
Create a new content assistant. |
Method Summary | |
---|---|
protected void |
contextInformationClosed()
Callback to signal this content assistant that the presentation of the context information has been stopped. |
void |
disposeLpexView(LpexView lpexView)
Called when a view on the document of our viewer is being disposed. |
void |
enableAutoActivation(boolean enabled)
Enable the content assistant's auto activation mode. |
void |
enableAutoInsert(boolean enabled)
Enable the content assistant's auto insertion mode. |
IContentAssistProcessor |
getContentAssistProcessor(String contentType)
Return the content assist processor which was registered to be used for the given content type. |
String |
getDocumentPartitioning()
Returns the document partitioning this content assistant is using. |
boolean |
hasProposalPopupFocus()
Returns whether the content assistant proposal popup has the focus. |
protected void |
hide()
Hides any open popups. |
void |
install(ITextViewer textViewer)
Install content-assist support on the given LpexTextViewer. |
void |
newLpexView(LpexView lpexView)
Called when a new view was opened on the document of our viewer. |
boolean |
requestWidgetToken(IWidgetTokenOwner owner)
The given widget token owner requests the widget token from this token keeper. |
boolean |
requestWidgetToken(IWidgetTokenOwner owner,
int priority)
The given widget token owner requests the widget token from this token keeper. |
void |
setAutoActivationDelay(int delay)
Sets the delay after which the content assistant is automatically invoked if the cursor is behind an auto activation character. |
void |
setContentAssistProcessor(IContentAssistProcessor processor,
String contentType)
Register a given content assist processor for a particular content type. |
void |
setContextInformationPopupBackground(Color background)
Set the context information popup's background color. |
void |
setContextInformationPopupForeground(Color foreground)
Set the context information popup's foreground color. |
void |
setContextInformationPopupOrientation(int orientation)
Set the context information popup's orientation. |
void |
setContextSelectorBackground(Color background)
Set the context selector's background color. |
void |
setContextSelectorForeground(Color foreground)
Set the context selector's foreground color. |
void |
setDocumentPartitioning(String partitioning)
Sets the document partitioning this content assistant is using. |
void |
setInformationControlCreator(IInformationControlCreator creator)
Set the information control creator for the additional information control. |
void |
setProposalPopupOrientation(int orientation)
Set the proposal popups' orientation. |
void |
setProposalSelectorBackground(Color background)
Set the proposal selector's background color. |
void |
setProposalSelectorForeground(Color foreground)
Set the proposal's foreground color. |
String |
showContextInformation()
Show context information for the content at the viewer's cursor position. |
String |
showPossibleCompletions()
Show all possible completions of the content at the viewer's cursor position. |
String |
showProposals(boolean autoActivated)
Bring up the proposals window. |
void |
uninstall()
Uninstall content-assist support from the text viewer it was previously installed on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String STORE_SIZE_X
public static final String STORE_SIZE_Y
public static final int LAYOUT_PROPOSAL_SELECTOR
public static final int LAYOUT_CONTEXT_SELECTOR
public static final int LAYOUT_CONTEXT_INFO_POPUP
public static final int WIDGET_PRIORITY
20
.
Constructor Detail |
---|
public ContentAssistant()
Method Detail |
---|
public void setDocumentPartitioning(String partitioning)
partitioning
- the document partitioning for this content assistantpublic String getDocumentPartitioning()
IContentAssistantExtension
public void setContentAssistProcessor(IContentAssistProcessor processor, String contentType)
LpexCommonParser.getLanguage(LpexDocumentLocation)
,
as content type.
processor
- the content assist processor to register, or
null
to remove an existing onecontentType
- the document content type under which to registerpublic IContentAssistProcessor getContentAssistProcessor(String contentType)
getContentAssistProcessor
in interface IContentAssistant
contentType
- the type of the content for which this
content assistant is to be requested
null
if none exists for the specified content typesetContentAssistProcessor(com.ibm.lpex.alef.contentassist.IContentAssistProcessor, java.lang.String)
public void enableAutoActivation(boolean enabled)
enabled
- indicates whether auto activation should be enabled or notpublic void enableAutoInsert(boolean enabled)
enabled
- indicates whether auto insertion should be enabled or notpublic void newLpexView(LpexView lpexView)
public void disposeLpexView(LpexView lpexView)
public void setAutoActivationDelay(int delay)
delay
- the auto activation delay (as of 3.6 a negative argument will be set to 0)public void setProposalPopupOrientation(int orientation)
orientation
- the popup's orientationpublic void setContextInformationPopupOrientation(int orientation)
orientation
- the popup's orientationpublic void setContextInformationPopupBackground(Color background)
public void setContextInformationPopupForeground(Color foreground)
public void setProposalSelectorBackground(Color background)
public void setProposalSelectorForeground(Color foreground)
public void setContextSelectorBackground(Color background)
public void setContextSelectorForeground(Color foreground)
public void setInformationControlCreator(IInformationControlCreator creator)
public void install(ITextViewer textViewer)
IContentAssistant
install
in interface IContentAssistant
textViewer
- the LpexTextViewer on which content assist will workpublic void uninstall()
IContentAssistant
uninstall
in interface IContentAssistant
public String showPossibleCompletions()
The implementation of this method calls showProposals(false)
.
showPossibleCompletions
in interface IContentAssistant
IContentAssistant.showPossibleCompletions()
public String showProposals(boolean autoActivated)
Called:
showPossibleCompletions()
on explicit content-assist
invocation by the user (autoActivated = false).
protected void contextInformationClosed()
public String showContextInformation()
showContextInformation
in interface IContentAssistant
IContentAssistant.showContextInformation()
public boolean requestWidgetToken(IWidgetTokenOwner owner)
IWidgetTokenKeeper
public boolean requestWidgetToken(IWidgetTokenOwner owner, int priority)
The general contract is that the receiver should release the token if priority exceeds the receiver's priority.
IWidgetTokenKeeperExtension
protected void hide()
public boolean hasProposalPopupFocus()
true
if the proposal popup has the focus
|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |