Runtime

org.eclipse.gmf.runtime.common.ui.services.parser
Interface IParser

All Known Subinterfaces:
ISemanticParser

public interface IParser

The interface for all parsers


Method Summary
 IContentAssistProcessor getCompletionProcessor(IAdaptable element)
          Returns the parser's content assist processor
 java.lang.String getEditString(IAdaptable element, int flags)
          Gets the string that is a subject to edit.
 ICommand getParseCommand(IAdaptable element, java.lang.String newString, int flags)
          Gets the command that applies the new edit string
 java.lang.String getPrintString(IAdaptable element, int flags)
          Returns a string intended for display.
 boolean isAffectingEvent(java.lang.Object event, int flags)
          Determines if the event requires action from the parser point of view.
 IParserEditStatus isValidEditString(IAdaptable element, java.lang.String editString)
          Tests if the user-entered string is in a valid form that can be parsed
 

Method Detail

getEditString

public java.lang.String getEditString(IAdaptable element,
                                      int flags)
Gets the string that is a subject to edit.

Parameters:
element - the element for which the edit string is requested
flags - the bitflag of parser options
Returns:
String current contents of the edit string

isValidEditString

public IParserEditStatus isValidEditString(IAdaptable element,
                                           java.lang.String editString)
Tests if the user-entered string is in a valid form that can be parsed

Parameters:
element - the element for which the edit string is applied to
editString - the user-entered string
Returns:
IParserEditStatus EDITABLE_STATUS if the edit string is valid, otherwise a status that includes information describing why it is an invalid edit string.

getParseCommand

public ICommand getParseCommand(IAdaptable element,
                                java.lang.String newString,
                                int flags)
Gets the command that applies the new edit string

Parameters:
element - the element for which the parse command is requested
newString - to be set by the command
flags - the bitflag of parser options
Returns:
ICommand command that when executed will result in setting the newString

getPrintString

public java.lang.String getPrintString(IAdaptable element,
                                       int flags)
Returns a string intended for display. That might be a different string that the one returned by getEditString. E.g., for stereotypes, the print string will be adorned with <<>> brackets while edit string will not be adorned.

Parameters:
element - the element for which the print string is requested
flags - the bitflag of parser options
Returns:
String the print string

isAffectingEvent

public boolean isAffectingEvent(java.lang.Object event,
                                int flags)
Determines if the event requires action from the parser point of view. The action usually involves some visual refreshment.

Parameters:
event - the event, an instance of IElementEvent
flags - the bitflag of parser options
Returns:
boolean true if the event affects the parser, otherwise false.

getCompletionProcessor

public IContentAssistProcessor getCompletionProcessor(IAdaptable element)
Returns the parser's content assist processor

Parameters:
element - the element
Returns:
the content assist processor

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.