Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.edit.cobol
Class ISeriesEditorCobolILEMarkElement

java.lang.Object
  extended by com.ibm.etools.iseries.edit.cobol.ISeriesEditorCobolILEMarkElement

public class ISeriesEditorCobolILEMarkElement
extends Object

This class represents a marked location in the COBOL file text. TIP: By implementing the IWorkbenchAdapter interface, we can easily add objects of this type to viewers and parts in the workbench. When a viewer contains IWorkbenchElements, the generic WorkbenchElementContentProvider and WorkbenchElementLabelProvider can be used to provide navigation and display for that viewer.


Field Summary
static String Copyright
           
 
Constructor Summary
ISeriesEditorCobolILEMarkElement(IAdaptable parent, String heading, int offset, int length)
          Creates a new MarkElement and stores parent element and location in the text.
 
Method Summary
 Object getAdapter(Class adapter)
          Returns an object which is an instance of the given class associated with this object.
 Object[] getChildren(Object o)
          Returns the children of this element.
 ImageDescriptor getImageDescriptor(Object object)
          Returns an image to be used for displaying an object in the desktop.
 String getLabel(Object o)
          getLabel method comment.
 int getLength()
          Returns the number of characters in this section.
 int getNumberOfLines()
          Returns the number of lines in the element.
 IAdaptable getParent()
          Returns the parent element.
 Object getParent(Object o)
          Returns the logical parent of the given object in its tree.
 int getStart()
          Returns the offset of this section in the file.
 void setNumberOfLines(int newNumberOfLines)
          Sets the number of lines in the element
 String toString()
          For debugging purposes only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

ISeriesEditorCobolILEMarkElement

public ISeriesEditorCobolILEMarkElement(IAdaptable parent,
                                        String heading,
                                        int offset,
                                        int length)
Creates a new MarkElement and stores parent element and location in the text.

Parameters:
domain - the domain notifier
parent - the parent of this element
heading - text corresponding to the heading
offset - the offset into the COBOL text
length - the length of the element
Method Detail

getAdapter

public Object getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

getChildren

public Object[] getChildren(Object o)
Returns the children of this element.


getImageDescriptor

public ImageDescriptor getImageDescriptor(Object object)
Returns an image to be used for displaying an object in the desktop.

Parameters:
object - The object to get an image for.
owner - The viewer that the image will be used in. The image will be disposed when this viewer is closed. If the owner is null, a new image is returned, and the caller is responsible for disposing it.

getLabel

public String getLabel(Object o)
getLabel method comment.


getLength

public int getLength()
Returns the number of characters in this section.


getNumberOfLines

public int getNumberOfLines()
Returns the number of lines in the element.

Returns:
the number of lines in the element

getParent

public IAdaptable getParent()
Returns the parent element.

Returns:
the parent element

getParent

public Object getParent(Object o)
Returns the logical parent of the given object in its tree. Returns null if there is no parent, or if this object doesn't belong to a tree.

Parameters:
object - The object to get the parent for.

getStart

public int getStart()
Returns the offset of this section in the file.


setNumberOfLines

public void setNumberOfLines(int newNumberOfLines)
Sets the number of lines in the element

Parameters:
newNumberOfLines - the number of lines in the element

toString

public String toString()
For debugging purposes only.

Overrides:
toString in class Object

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.