|
org.netbeans.modules.xml.xam/1 1.18.0 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.modules.xml.xam.AbstractComponent<C>
public abstract class AbstractComponent<C extends Component<C>>
An abstract implementation of the Component. It implies modification capabilities.
| Constructor Summary | |
|---|---|
AbstractComponent(AbstractModel model)
|
|
| Method Summary | ||
|---|---|---|
protected void |
addAfter(String propertyName,
C component,
Collection<Class<? extends C>> typeList)
Adds a element after all other children whose types are in the typeList Collection. |
|
protected void |
addBefore(String propertyName,
C component,
Collection<Class<? extends C>> typeList)
Adds a element before all other children whose types are in the typeList Collection. |
|
void |
addPropertyChangeListener(PropertyChangeListener pcl)
|
|
protected void |
appendChild(String propertyName,
C child)
|
|
protected abstract void |
appendChildQuietly(C component,
List<C> children)
|
|
boolean |
canPaste(Component child)
Default implementation, subclass need to override if needed. |
|
void |
checkChildrenPopulated()
This method guarantee that children are populated. |
|
protected void |
checkNullOrDuplicateChild(C child)
|
|
protected void |
fireChildAdded()
|
|
protected void |
fireChildRemoved()
|
|
protected void |
firePropertyChange(String propName,
Object oldValue,
Object newValue)
|
|
protected void |
fireValueChanged()
|
|
protected
|
getChild(Class<T> type)
|
|
List<C> |
getChildren()
|
|
|
getChildren(Class<T> type)
|
|
List<C> |
getChildren(Collection<Class<? extends C>> typeList)
|
|
int |
getChildrenCount()
Sometimes it's necessary to know amount of children but the children themselves aren't necessary. |
|
AbstractModel |
getModel()
|
|
C |
getParent()
|
|
void |
insertAtIndex(String propertyName,
C component,
int index)
|
|
protected void |
insertAtIndex(String propertyName,
C component,
int index,
Class<? extends C> type)
Inserts a Component child at the specified index relative to the provided type. |
|
protected abstract void |
insertAtIndexQuietly(C newComponent,
List<C> children,
int index)
|
|
protected boolean |
isChildrenInitialized()
This method provides the ability to detect whether calling getChildren() will trigger population of children. |
|
protected abstract void |
populateChildren(List<C> children)
|
|
void |
removeChild(String propertyName,
C component)
|
|
protected abstract void |
removeChildQuietly(C component,
List<C> children)
|
|
void |
removeComponentListener(ComponentListener cl)
|
|
void |
removePropertyChangeListener(PropertyChangeListener pcl)
|
|
protected void |
setChild(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList)
When a child element is set using this method: (1) All children that are of the same or derived type as classType are removed. |
|
protected void |
setChild(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList,
boolean before)
|
|
protected void |
setChildAfter(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList)
|
|
protected void |
setChildBefore(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList)
|
|
protected void |
setModel(AbstractModel aModel)
|
|
protected void |
setParent(C component)
|
|
protected void |
verifyWrite()
This method ensures that a transaction is currently in progress and that the current thread is able to write the model. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.netbeans.modules.xml.xam.Component |
|---|
copy |
| Constructor Detail |
|---|
public AbstractComponent(AbstractModel model)
| Method Detail |
|---|
protected abstract void appendChildQuietly(C component,
List<C> children)
protected abstract void insertAtIndexQuietly(C newComponent,
List<C> children,
int index)
protected abstract void removeChildQuietly(C component,
List<C> children)
protected abstract void populateChildren(List<C> children)
public final void removePropertyChangeListener(PropertyChangeListener pcl)
public final void addPropertyChangeListener(PropertyChangeListener pcl)
public void removeComponentListener(ComponentListener cl)
public C getParent()
getParent in interface Component<C extends Component<C>>protected void setParent(C component)
protected void setModel(AbstractModel aModel)
public List<C> getChildren()
getChildren in interface Component<C extends Component<C>>public void checkChildrenPopulated()
public int getChildrenCount()
protected final boolean isChildrenInitialized()
public <T extends C> List<T> getChildren(Class<T> type)
getChildren in interface Component<C extends Component<C>>type - Interested children type to
return.
public List<C> getChildren(Collection<Class<? extends C>> typeList)
getChildren in interface Component<C extends Component<C>>typeList - Collection that accepts the interested types and filters
the return list of Children.
public AbstractModel getModel()
getModel in interface Component<C extends Component<C>>protected void verifyWrite()
protected void firePropertyChange(String propName,
Object oldValue,
Object newValue)
protected void fireValueChanged()
protected void fireChildRemoved()
protected void fireChildAdded()
protected <T extends C> T getChild(Class<T> type)
protected void addBefore(String propertyName,
C component,
Collection<Class<? extends C>> typeList)
protected void addAfter(String propertyName,
C component,
Collection<Class<? extends C>> typeList)
protected void checkNullOrDuplicateChild(C child)
protected void appendChild(String propertyName,
C child)
protected void insertAtIndex(String propertyName,
C component,
int index,
Class<? extends C> type)
propertyName - to fire event oncomponent - to insertindex - relative to first instance of type, index = firstpostype - which index should be relative to
public void insertAtIndex(String propertyName,
C component,
int index)
public void removeChild(String propertyName,
C component)
protected void setChild(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList)
classType - Class of the Component that is being added as a childpropertyName - Property name used for firing eventsnewComponent - Component that is being added as a childtypeList - Collection of java.lang.Class-es. newEl will be added as
a child after any children whose types belong to any listed in this. An
empty collection will append the child
protected void setChildAfter(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList)
protected void setChildBefore(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList)
protected void setChild(Class<? extends C> classType,
String propertyName,
C newComponent,
Collection<Class<? extends C>> typeList,
boolean before)
public boolean canPaste(Component child)
canPaste in interface Component<C extends Component<C>>
|
org.netbeans.modules.xml.xam/1 1.18.0 1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||