org.eclipse.cdt.internal.ui.text.contentassist
Class CompletionProposalCategory

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalCategory

public final class CompletionProposalCategory
extends java.lang.Object

Describes a category extension to the "completionProposalComputer" extension point.

Since:
4.0

Method Summary
 java.util.List computeCompletionProposals(ContentAssistInvocationContext context, java.lang.String partition, org.eclipse.core.runtime.SubProgressMonitor monitor)
          Safely computes completion proposals of all computers of this category through their extension.
 java.util.List computeContextInformation(ContentAssistInvocationContext context, java.lang.String partition, org.eclipse.core.runtime.SubProgressMonitor monitor)
          Safely computes context information objects of all computers of this category through their extension.
 java.lang.String getDisplayName()
          Returns the name of the described extension without mnemonic hint in order to be displayed in a message.
 java.lang.String getErrorMessage()
          Returns the error message from the computers in this category.
 java.lang.String getId()
          Returns the identifier of the described extension.
 org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
          Returns the image descriptor of the described category.
 java.lang.String getName()
          Returns the name of the described extension.
 int getSortOrder()
           
 boolean hasComputers()
          Returns true if the category contains any computers, false otherwise.
 boolean hasComputers(java.lang.String partition)
          Returns true if the category contains any computers in the given partition, false otherwise.
 boolean isEnabled()
           
 boolean isIncluded()
           
 boolean isSeparateCommand()
          Returns the enablement state of the category.
 void sessionEnded()
          Notifies the computers in this category of a proposal computation session end.
 void sessionStarted()
          Notifies the computers in this category of a proposal computation session start.
 void setEnabled(boolean isEnabled)
           
 void setIncluded(boolean included)
           
 void setSeparateCommand(boolean enabled)
          Sets the separate command state of the category.
 void setSortOrder(int sortOrder)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getId

public java.lang.String getId()
Returns the identifier of the described extension.

Returns:
Returns the id

getName

public java.lang.String getName()
Returns the name of the described extension.

Returns:
Returns the name

getDisplayName

public java.lang.String getDisplayName()
Returns the name of the described extension without mnemonic hint in order to be displayed in a message.

Returns:
Returns the name

getImageDescriptor

public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor()
Returns the image descriptor of the described category.

Returns:
the image descriptor of the described category

setSeparateCommand

public void setSeparateCommand(boolean enabled)
Sets the separate command state of the category.

Parameters:
enabled - the new enabled state.

isSeparateCommand

public boolean isSeparateCommand()
Returns the enablement state of the category.

Returns:
the enablement state of the category

setIncluded

public void setIncluded(boolean included)
Parameters:
included - the included

isIncluded

public boolean isIncluded()
Returns:
included

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean isEnabled)

hasComputers

public boolean hasComputers()
Returns true if the category contains any computers, false otherwise.

Returns:
true if the category contains any computers, false otherwise

hasComputers

public boolean hasComputers(java.lang.String partition)
Returns true if the category contains any computers in the given partition, false otherwise.

Parameters:
partition - the partition
Returns:
true if the category contains any computers, false otherwise

getSortOrder

public int getSortOrder()
Returns:
sortOrder

setSortOrder

public void setSortOrder(int sortOrder)
Parameters:
sortOrder - the sortOrder

computeCompletionProposals

public java.util.List computeCompletionProposals(ContentAssistInvocationContext context,
                                                 java.lang.String partition,
                                                 org.eclipse.core.runtime.SubProgressMonitor monitor)
Safely computes completion proposals of all computers of this category through their extension. If an extension is disabled, throws an exception or otherwise does not adhere to the contract described in ICompletionProposalComputer, it is disabled.

Parameters:
context - the invocation context passed on to the extension
partition - the partition type where to invocation occurred
monitor - the progress monitor passed on to the extension
Returns:
the list of computed completion proposals (element type: ICompletionProposal)

computeContextInformation

public java.util.List computeContextInformation(ContentAssistInvocationContext context,
                                                java.lang.String partition,
                                                org.eclipse.core.runtime.SubProgressMonitor monitor)
Safely computes context information objects of all computers of this category through their extension. If an extension is disabled, throws an exception or otherwise does not adhere to the contract described in ICompletionProposalComputer, it is disabled.

Parameters:
context - the invocation context passed on to the extension
partition - the partition type where to invocation occurred
monitor - the progress monitor passed on to the extension
Returns:
the list of computed context information objects (element type: IContextInformation)

getErrorMessage

public java.lang.String getErrorMessage()
Returns the error message from the computers in this category.

Returns:
the error message from the computers in this category

sessionStarted

public void sessionStarted()
Notifies the computers in this category of a proposal computation session start.


sessionEnded

public void sessionEnded()
Notifies the computers in this category of a proposal computation session end.