Oxygen XML Editor 11.2 Author API

ro.sync.contentcompletion.xml
Class CIValue

java.lang.Object
  extended by ro.sync.contentcompletion.xml.CIValue
All Implemented Interfaces:
Comparable<CIValue>

public class CIValue
extends Object
implements Comparable<CIValue>

Interface for objects holding information about element or attribute values used in the content completion process.


Field Summary
protected  int afterInsertCaretPosition
          The position in text where to place the caret position after insert value.
static int TYPE_PLAIN
          Marks that the value is a plain text value with no additional meaning.
static int TYPE_XSLT_AXIS
          Marks that the value represents an axis in XSLT.
static int TYPE_XSLT_ELEMENT
          Marks that the value represents a name of an element from the document.
static int TYPE_XSLT_FUNCTION
          Marks that the value represents an XSLT function.
 
Constructor Summary
CIValue(String value)
          Creates a CIValue.
CIValue(String value, boolean listValue)
          Creates a CIValue.
CIValue(String value, boolean listValue, String annotation)
          Creates a CIValue.
CIValue(String value, boolean listValue, String annotation, boolean defaultValue)
          Creates a CIValue.
CIValue(String value, boolean listValue, String annotation, String insertString, int type)
          Creates a CIValue.
CIValue(String value, boolean listValue, String annotation, String insertString, int type, boolean defaultValue)
          Creates a CIValue.
CIValue(String fullPrefix, CIValue ciValue)
          Create a CIValue from another one by adding a prefix to the original value.
CIValue(String value, String annotation)
          Creates a CIValue.
 
Method Summary
 int compareTo(CIValue other)
          Compares the String values.
 boolean equals(Object obj)
          Test if a CIValue is equal with this one.
 int getAfterInsertCaretPosition()
           
 String getAnnotation()
          Get the annotation associated with this value.
static CIValue[] getCIValues(Collection<String> values)
          Get an array of CIValue from a list of strings.
static List<CIValue> getCIValuesAsList(Collection<String> values)
          Get a list of CIValue from a list of strings.
 String getInsertString()
          Get the insert string.
 int getType()
          Get the type of the value.
 String getValue()
          Get the actual value.
 boolean isDefaultValue()
          Get the default value flag.
 boolean isListValue()
          Get the value of the flag indicating if the value is an entry in a list value.
 void setAnnotation(String annotation)
          Set the annotation associated with this value.
 void setDefaultValue()
          Mark the value as default value.
protected  void setInsertString(String insertString)
          Sets the insert string.
 void setListValue()
          Mark the value as belonging to a list value.
protected  void setValue(String value)
          Sets the value.
 String toString()
          Get a String representation of this CIValue.
 Object valueOf(String str)
          This is needed by a combo box editor to see if it is the same value as the old one.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

afterInsertCaretPosition

protected int afterInsertCaretPosition
The position in text where to place the caret position after insert value. If value is -1, then the caret position is not and must be computed.


TYPE_PLAIN

public static final int TYPE_PLAIN
Marks that the value is a plain text value with no additional meaning. The value is 0

See Also:
Constant Field Values

TYPE_XSLT_AXIS

public static final int TYPE_XSLT_AXIS
Marks that the value represents an axis in XSLT. The value is 1

See Also:
Constant Field Values

TYPE_XSLT_FUNCTION

public static final int TYPE_XSLT_FUNCTION
Marks that the value represents an XSLT function. The value is 2

See Also:
Constant Field Values

TYPE_XSLT_ELEMENT

public static final int TYPE_XSLT_ELEMENT
Marks that the value represents a name of an element from the document. The value is 3

See Also:
Constant Field Values
Constructor Detail

CIValue

public CIValue(String value)
Creates a CIValue.

Parameters:
value - The actual value.

CIValue

public CIValue(String value,
               boolean listValue)
Creates a CIValue.

Parameters:
value - The actual value.
listValue - Flag indicating if the value is an entry from a list value.

CIValue

public CIValue(String value,
               String annotation)
Creates a CIValue.

Parameters:
value - The actual value.
annotation - The annotation associated with this value.

CIValue

public CIValue(String value,
               boolean listValue,
               String annotation)
Creates a CIValue.

Parameters:
value - The actual value.
listValue - Flag indicating if the value is an entry from a list value.
annotation - The annotation associated with this value.

CIValue

public CIValue(String value,
               boolean listValue,
               String annotation,
               boolean defaultValue)
Creates a CIValue.

Parameters:
value - The actual value.
listValue - Flag indicating if the value is an entry from a list value.
annotation - The annotation associated with this value.
defaultValue - true if it is the default value.

CIValue

public CIValue(String value,
               boolean listValue,
               String annotation,
               String insertString,
               int type)
Creates a CIValue.

Parameters:
value - The actual value.
listValue - Flag indicating if the value is an entry from a list value.
annotation - The annotation associated with this value.
insertString - The string to be inserted in the document when the CIValue is chosen from the content completion list of proposals. If null, the value will be used.
type - The type of the value. Use by the renderer.
Can be one of the constants: TYPE_PLAIN, TYPE_XSLT_AXIS, TYPE_XSLT_FUNCTION, TYPE_XSLT_ELEMENT

CIValue

public CIValue(String value,
               boolean listValue,
               String annotation,
               String insertString,
               int type,
               boolean defaultValue)
Creates a CIValue.

Parameters:
value - The actual value.
listValue - Flag indicating if the value is an entry from a list value.
annotation - The annotation associated with this value.
insertString - The string to be inserted in the document when the CIValue is chosen from the content completion list of proposals. If null, the value will be used.
type - The type of the value. Use by the renderer.
Can be one of the constants: TYPE_PLAIN, TYPE_XSLT_AXIS, TYPE_XSLT_FUNCTION, TYPE_XSLT_ELEMENT
defaultValue - true if it is the default value.

CIValue

public CIValue(String fullPrefix,
               CIValue ciValue)
Create a CIValue from another one by adding a prefix to the original value.

Parameters:
fullPrefix - The full prefix of the value field.
ciValue - The CIValue to use when creating a new one.
Method Detail

getValue

public String getValue()
Get the actual value.

Returns:
The value of the CIValue.

isListValue

public boolean isListValue()
Get the value of the flag indicating if the value is an entry in a list value.

Returns:
true if the value is part of a list.

setListValue

public void setListValue()
Mark the value as belonging to a list value.


getAnnotation

public String getAnnotation()
Get the annotation associated with this value.

Returns:
The value annotation.

setAnnotation

public void setAnnotation(String annotation)
Set the annotation associated with this value.

Parameters:
annotation - The value annotation.

getCIValues

public static CIValue[] getCIValues(Collection<String> values)
Get an array of CIValue from a list of strings. Assumes no annotations and no list types are present.

Parameters:
values - A collection of String values.
Returns:
An array of CIValues.

getCIValuesAsList

public static List<CIValue> getCIValuesAsList(Collection<String> values)
Get a list of CIValue from a list of strings. Assumes no annotation and no list types are present.

Parameters:
values - A collection of String values.
Returns:
An new list of CIValues.

equals

public boolean equals(Object obj)
Test if a CIValue is equal with this one.

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

isDefaultValue

public boolean isDefaultValue()
Get the default value flag.

Returns:
True if the value is marked as default.

setDefaultValue

public void setDefaultValue()
Mark the value as default value.


toString

public String toString()
Get a String representation of this CIValue.

Overrides:
toString in class Object
See Also:
Object.toString()

compareTo

public int compareTo(CIValue other)
Compares the String values.

Specified by:
compareTo in interface Comparable<CIValue>
See Also:
Comparable.compareTo(java.lang.Object)

getInsertString

public String getInsertString()
Get the insert string. It represents the value to be inserted in the document. If it was not specified before, this method returns the value field.

Returns:
The String to be inserted in the document.

setInsertString

protected void setInsertString(String insertString)
Sets the insert string.

Parameters:
insertString - The value to be inserted in the document.

getType

public int getType()
Get the type of the value. It may be plain text value, an axe or a function in xslt or an element from the input document involved in an transformation scenario.

Returns:
The value type. Can be one of: TYPE_PLAIN, TYPE_XSLT_AXIS, TYPE_XSLT_FUNCTION or TYPE_XSLT_ELEMENT.

valueOf

public Object valueOf(String str)
This is needed by a combo box editor to see if it is the same value as the old one. RADU CORAVU: IMPORTANT DO NOT DELETE!

Parameters:
str - The str.
Returns:
The same object.

getAfterInsertCaretPosition

public int getAfterInsertCaretPosition()
Returns:
The position to place the caret after inserting the string. If -1 the caret position was not computed.

setValue

protected void setValue(String value)
Sets the value.

Parameters:
value - The new value.

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.