Runtime

## org.eclipse.gmf.runtime.diagram.ui.providers.parsers
Class DescriptionParser

    java.lang.Object
      org.eclipse.gmf.runtime.diagram.ui.providers.parsers.DescriptionParser

All Implemented Interfaces:
  IParser

    public class DescriptionParser

extends java.lang.Object
implements IParser

Description parser

Since:
  1.4

Field Summary
`protected static IParser` `instance` instance of parser

Constructor Summary
`protected` `DescriptionParser()` Constructor for DescriptionParser.

Method Summary
`IContentAssistProcessor` `getCompletionProcessor(IAdaptable element)` Returns the parser's content assist processor
`java.lang.String` `getEditString(IAdaptable adapter, int flags)` Gets the string that is a subject to edit.
`static IParser` `getInstance()` Gets the instance of the parser
`ICommand` `getParseCommand(IAdaptable adapter, java.lang.String newString, int flags)` Gets the command that applies the new edit string
`java.lang.String` `getPrintString(IAdaptable adapter, 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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### instance

    protected static IParser instance

  instance of parser

Constructor Detail

### DescriptionParser

    protected DescriptionParser()

  Constructor for DescriptionParser.

Method Detail

### getInstance

    public static IParser getInstance()

  Gets the instance of the parser

  Returns:
    IParser the single instance of the parser

### getEditString

    public java.lang.String getEditString(IAdaptable adapter,
                                          int flags)

  Description copied from interface: `IParser`
  Gets the string that is a subject to edit.

  Specified by:
    `getEditString` in interface `IParser`
  Parameters:
    `adapter` - the element for which the edit string is requested
    `flags` - the bitflag of parser options
  Returns:
    String current contents of the edit string

### getParseCommand

    public ICommand getParseCommand(IAdaptable adapter,
                                    java.lang.String newString,
                                    int flags)

  Description copied from interface: `IParser`
  Gets the command that applies the new edit string

  Specified by:
    `getParseCommand` in interface `IParser`
  Parameters:
    `adapter` - 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 adapter,
                                           int flags)

  Description copied from interface: `IParser`
  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.

  Specified by:
    `getPrintString` in interface `IParser`
  Parameters:
    `adapter` - 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)

  Description copied from interface: `IParser`
  Determines if the event requires action from the parser point of view. The action usually involves some visual refreshment.

  Specified by:
    `isAffectingEvent` in interface `IParser`
  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`.
  See Also:
    `IParser.isAffectingEvent(Object, int)`

### isValidEditString

    public IParserEditStatus isValidEditString(IAdaptable element,
                                               java.lang.String editString)

  Description copied from interface: `IParser`
  Tests if the user-entered string is in a valid form that can be parsed

  Specified by:
    `isValidEditString` in interface `IParser`
  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.
  See Also:
    `IParser.isValidEditString(org.eclipse.core.runtime.IAdaptable, java.lang.String)`

### getCompletionProcessor

    public IContentAssistProcessor getCompletionProcessor(IAdaptable element)

  Description copied from interface: `IParser`
  Returns the parser's content assist processor

  Specified by:
    `getCompletionProcessor` in interface `IParser`
  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.