Dali Provisional API
Release 3.2

org.eclipse.jpt.common.core.resource.xml
Class EBaseObjectImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by org.eclipse.jpt.common.core.resource.xml.EBaseObjectImpl
All Implemented Interfaces:
Notifier, EObject, InternalEObject, EBaseObject

public abstract class EBaseObjectImpl
extends EObjectImpl
implements EBaseObject

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is 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.

Since:
2.2

Nested Class Summary
protected static class EBaseObjectImpl.XmlEAdapterList<E extends Object & Adapter>
           
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
BasicEObjectImpl.EPropertiesHolder, BasicEObjectImpl.EPropertiesHolderBaseImpl, BasicEObjectImpl.EPropertiesHolderImpl
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
BasicNotifierImpl.EAdapterList<E extends Object & Adapter>, BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
InternalEObject.EStore
 
Field Summary
protected  IDOMNode node
           
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY
 
Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
protected EBaseObjectImpl()
           
 
Method Summary
protected  void addInsignificantXmlFeatureIdsTo(Set<Integer> insignificantXmlFeatureIds)
          Add the object's "insignificant" feature ids to the specified set.
protected  TextRange buildElementCodeAssistTextRange_(IDOMNode domNode, TextRange textRange)
          pre-condition: the specified DOM node is not null
protected  TextRange buildElementCodeAssistTextRange(IDOMNode domNode)
           
protected  TextRange buildElementCodeAssistTextRange(IDOMNode domNode, TextRange textRange)
           
protected  TextRange buildTextRange_(IDOMNode domNode, TextRange textRange)
          pre-condition: the specified DOM node is not null
protected  TextRange buildTextRange(IDOMNode domNode)
           
protected  TextRange buildTextRange(IDOMNode domNode, TextRange textRange)
           
 boolean containsOffset(int textOffset)
          Return true if this object's text representation contains the text offset
 DeleteEdit createDeleteEdit()
          Create a text DeleteEdit for deleting the entire IDOMNode and any text that precedes it.
 EList<Adapter> eAdapters()
          override to build a custom list for the adapters
 void eNotify(Notification notification)
          override to prevent notification when the object's state is unchanged
protected  void featureChanged(int featureId)
           
protected  boolean featureIsInsignificant(int featureId)
           
protected  boolean featureIsSignificant(int featureId)
           
protected  TextRange getAttributeCodeAssistTextRange(String attributeName)
          Return a text range for the specified attribute node.
protected  IDOMAttr getAttributeNode(String attributeName)
           
protected  TextRange getAttributeTextRange(String attributeName)
          Return a text range for the specified attribute node.
protected  int getDeletionOffset()
          deletion offset needs to include any text that is before the node
protected  TextRange getElementCodeAssistTextRange(String elementName)
          Return a text range for the specified element node.
protected  IDOMNode getElementNode(String elementName)
          Returns the first element node with the given name, if one exists
protected  TextRange getElementTextRange(String elementName)
          Return a text range for the specified element node.
 TextRange getFullTextRange()
          Return the text range to be used for text selection.
 int getNodeEndOffset()
           
 TextRange getSelectionTextRange()
          Return the text range to be used for selection.
protected  IDOMNode getTextNode()
           
protected  TextRange getTextTextRange()
          Return a text range for the "text" node.
 TextRange getValidationTextRange()
          Return the text range to be used for validation.
protected  JptXmlResource getXmlResource()
           
protected  Set<Integer> insignificantFeatureIds()
          Return a set of the object's "insignificant" feature ids.
 boolean isUnset()
          Return whether all the object's EMF features are "unset".
protected  IDOMNode selectTextNode(NodeList nodes)
           
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI, eStaticClass
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicInvoke, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInverseRemove, eInvocationDelegate, eInvoke, eIsSet, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStaticOperationCount, eStore, eUnset, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues, toString
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eDeliver, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

node

protected IDOMNode node
Constructor Detail

EBaseObjectImpl

protected EBaseObjectImpl()

Method Detail

isUnset

public boolean isUnset()
Description copied from interface: EBaseObject
Return whether all the object's EMF features are "unset".

Specified by:
isUnset in interface EBaseObject

eAdapters

public EList<Adapter> eAdapters()
override to build a custom list for the adapters

Specified by:
eAdapters in interface Notifier
Overrides:
eAdapters in class EObjectImpl

eNotify

public void eNotify(Notification notification)
override to prevent notification when the object's state is unchanged

Specified by:
eNotify in interface Notifier
Overrides:
eNotify in class BasicNotifierImpl

featureChanged

protected void featureChanged(int featureId)

getXmlResource

protected JptXmlResource getXmlResource()

featureIsSignificant

protected boolean featureIsSignificant(int featureId)

featureIsInsignificant

protected boolean featureIsInsignificant(int featureId)

insignificantFeatureIds

protected Set<Integer> insignificantFeatureIds()
Return a set of the object's "insignificant" feature ids. These are the EMF features that will not be used to determine if all the features are unset. We use this to determine when to remove an element from the xml. If you need instance-based calculation of your xml "insignificant" aspects, override this method. If class-based calculation is sufficient, override #addInsignificantXmlFeatureIdsTo(Set).

See Also:
isUnset()

addInsignificantXmlFeatureIdsTo

protected void addInsignificantXmlFeatureIdsTo(Set<Integer> insignificantXmlFeatureIds)
Add the object's "insignificant" feature ids to the specified set. These are the EMF features that, when they change, will NOT cause the object (or its containing tree) to be updated, i.e. defaults calculated. If class-based calculation of your "insignificant" features is sufficient, override this method. If you need instance-based calculation, override #insignificantXmlFeatureIds().


getTextTextRange

protected TextRange getTextTextRange()
Return a text range for the "text" node. If the text node does not exist, return a text range for this object's node


getTextNode

protected IDOMNode getTextNode()

selectTextNode

protected IDOMNode selectTextNode(NodeList nodes)

getAttributeTextRange

protected TextRange getAttributeTextRange(String attributeName)
Return a text range for the specified attribute node. If the attribute node does not exist, return a text range for this object's node


getAttributeNode

protected IDOMAttr getAttributeNode(String attributeName)

getElementTextRange

protected TextRange getElementTextRange(String elementName)
Return a text range for the specified element node. If the element node does not exist, return a text range for this object's node


getElementNode

protected IDOMNode getElementNode(String elementName)
Returns the first element node with the given name, if one exists


getValidationTextRange

public TextRange getValidationTextRange()
Description copied from interface: EBaseObject
Return the text range to be used for validation. This is the source range that will be marked for a validation error.

Specified by:
getValidationTextRange in interface EBaseObject

getSelectionTextRange

public TextRange getSelectionTextRange()
Description copied from interface: EBaseObject
Return the text range to be used for selection. This is the source range that will be highlighted when the node is selected by clicking in the structure view.

Specified by:
getSelectionTextRange in interface EBaseObject

getFullTextRange

public TextRange getFullTextRange()
Description copied from interface: EBaseObject
Return the text range to be used for text selection. When the cursor is moved to within this source range in the text editor, the node will be selected in the structure view.

Specified by:
getFullTextRange in interface EBaseObject

buildTextRange

protected TextRange buildTextRange(IDOMNode domNode)

buildTextRange

protected TextRange buildTextRange(IDOMNode domNode,
                                   TextRange textRange)

buildTextRange_

protected TextRange buildTextRange_(IDOMNode domNode,
                                    TextRange textRange)
pre-condition: the specified DOM node is not null


containsOffset

public boolean containsOffset(int textOffset)
Description copied from interface: EBaseObject
Return true if this object's text representation contains the text offset

Specified by:
containsOffset in interface EBaseObject

getAttributeCodeAssistTextRange

protected TextRange getAttributeCodeAssistTextRange(String attributeName)
Return a text range for the specified attribute node. If the attribute node does not exist, return null This is used for content assist to return the exact text range of an attribute. It is different from the text range used by validation which returns the parent's text range if the specified attribute node does not exist


getElementCodeAssistTextRange

protected TextRange getElementCodeAssistTextRange(String elementName)
Return a text range for the specified element node. If the element node does not exist, return null This is used for content assist to return the exact text range of an element. It is different from the text range used by validation which returns the parent's text range if the specified element node does not exist


buildElementCodeAssistTextRange

protected TextRange buildElementCodeAssistTextRange(IDOMNode domNode)

buildElementCodeAssistTextRange

protected TextRange buildElementCodeAssistTextRange(IDOMNode domNode,
                                                    TextRange textRange)

buildElementCodeAssistTextRange_

protected TextRange buildElementCodeAssistTextRange_(IDOMNode domNode,
                                                     TextRange textRange)
pre-condition: the specified DOM node is not null


createDeleteEdit

public DeleteEdit createDeleteEdit()
Description copied from interface: EBaseObject
Create a text DeleteEdit for deleting the entire IDOMNode and any text that precedes it.

Specified by:
createDeleteEdit in interface EBaseObject

getNodeEndOffset

public int getNodeEndOffset()

getDeletionOffset

protected int getDeletionOffset()
deletion offset needs to include any text that is before the node


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.