com.inline.feature
Class ResourceAdapter

java.lang.Object
  |
  +--com.inline.feature.ResourceAdapter

public class ResourceAdapter
extends java.lang.Object
implements com.inline.vide.inflect.SourceChangeListener


Constructor Summary
ResourceAdapter(com.inline.resources.ResourceRepository repository, com.inline.resources.ResourceReference reference)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void commit(int level)
          Saves the element to the underlying repository.
 boolean doesResourceExist()
          Returns true if the resource exists, in the project or outside
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
           
 java.lang.Object getResource()
           
 com.inline.resources.ResourceReference getResourceReference()
           
 long getTimestamp()
           
 void initialize(boolean override)
          Call this method if you want a completely new element to be created by the subsequent call to updateElement.
 boolean isEditable()
          Returns true if the element is editable
protected  boolean isFileNameSpecified(com.inline.resources.ResourceReference ref)
           
 boolean isManagedByProject()
           
 boolean isNew()
          Return true if the element has just been created and never been saved.
protected  boolean isResourceEditable()
           
 void postprocess()
          Invoked at the end of the Component's updateElements method to complete the element update process.
 void preprocess()
          Invoked in the beginning of the Component's updateElements method to perform necessary management of elements: creation of new ones, connection to existing ones, etc.
protected  void registerListener()
           
 void remove()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void reparse()
          Call this to refresh information about the element.
 void setEditable(boolean editable)
          Call this method to change the mutability of the element.
 void setGuarded(boolean guarded)
          Makes the element temporarily uneditable.
 void setManagedByProject(boolean flag)
           
 void setResourceReference(com.inline.resources.ResourceReference ref)
           
 void setUpdateExisting(boolean updateExisting)
          Enables updating of existing element
 void sourceChanged(com.inline.vide.inflect.SourceChangeEvent event)
          Called then a SourceChangeEvent occurs on the object being listented to.
protected  void unregisterListener()
           
protected  void updateFlags()
           
 boolean validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceAdapter

public ResourceAdapter(com.inline.resources.ResourceRepository repository,
                       com.inline.resources.ResourceReference reference)
Method Detail

setResourceReference

public void setResourceReference(com.inline.resources.ResourceReference ref)

getResourceReference

public com.inline.resources.ResourceReference getResourceReference()

getTimestamp

public long getTimestamp()

isEditable

public boolean isEditable()
Returns true if the element is editable

setEditable

public void setEditable(boolean editable)
Call this method to change the mutability of the element.

setGuarded

public void setGuarded(boolean guarded)
Makes the element temporarily uneditable. Specifically, the element will become editable again after the next time postprocess is called. Basically, it protects the element from changes for a single updateElements cycle.

setUpdateExisting

public void setUpdateExisting(boolean updateExisting)
Enables updating of existing element

isNew

public boolean isNew()
Return true if the element has just been created and never been saved. Features can safely insert themselves into this element without first parsing it. If the isNew method returns false, the feature must first check for presense of its artifacts in the element.

isResourceEditable

protected boolean isResourceEditable()

isManagedByProject

public boolean isManagedByProject()

doesResourceExist

public boolean doesResourceExist()
Returns true if the resource exists, in the project or outside

validate

public boolean validate()

setManagedByProject

public void setManagedByProject(boolean flag)

initialize

public void initialize(boolean override)
Call this method if you want a completely new element to be created by the subsequent call to updateElement. If an old version of the resource exists, it will used as is or overridden depending on the value of the override parameter.

reparse

public void reparse()
Call this to refresh information about the element.

updateFlags

protected void updateFlags()

getResource

public java.lang.Object getResource()

remove

public void remove()

commit

public void commit(int level)
Saves the element to the underlying repository.

preprocess

public void preprocess()
Invoked in the beginning of the Component's updateElements method to perform necessary management of elements: creation of new ones, connection to existing ones, etc.

isFileNameSpecified

protected boolean isFileNameSpecified(com.inline.resources.ResourceReference ref)

postprocess

public void postprocess()
Invoked at the end of the Component's updateElements method to complete the element update process.

registerListener

protected void registerListener()

unregisterListener

protected void unregisterListener()

sourceChanged

public void sourceChanged(com.inline.vide.inflect.SourceChangeEvent event)
Description copied from interface: com.inline.vide.inflect.SourceChangeListener
Called then a SourceChangeEvent occurs on the object being listented to.
Specified by:
sourceChanged in interface com.inline.vide.inflect.SourceChangeListener
Tags copied from interface: com.inline.vide.inflect.SourceChangeListener
Parameters:
event - The SourceChangeEvent.
See Also:
SourceChangeEvent

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)