use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class ADTContentOutlineProvider method dispose.
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
Object input = viewer.getInput();
if (input instanceof IADTObject) {
removeListener((IADTObject) input);
}
if (refreshJob != null) {
refreshJob.cancel();
refreshJob = null;
}
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class XSDBaseAdapter method getGlobalXSDContainer.
protected IADTObject getGlobalXSDContainer(XSDConcreteComponent component) {
XSDConcreteComponent c = component.getContainer();
// We want the top most structural component
while (c != null && !(c.getContainer() instanceof XSDSchema) && !(c instanceof XSDComplexTypeDefinition) && !(c instanceof XSDSimpleTypeDefinition) && !(c instanceof XSDModelGroupDefinition) && !(c instanceof XSDAttributeGroupDefinition)) {
c = c.getContainer();
}
Adapter adapter = XSDAdapterFactory.getInstance().adapt(c);
if (adapter instanceof IADTObject)
return (IADTObject) adapter;
return null;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class XSDModelGroupDefinitionAdapter method getFields.
public List getFields() {
List fields = new ArrayList();
otherThingsToListenTo = new ArrayList();
XSDVisitorForFields visitor = new XSDVisitorForGroupFieldsWithSpaceFillers();
visitor.visitModelGroupDefinition(getXSDModelGroupDefinition());
populateAdapterList(visitor.concreteComponentList, fields);
// TODO (cs) common a base class for a structure thingee
//
populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext(); ) {
Adapter adapter = (Adapter) i.next();
if (adapter instanceof IADTObject) {
IADTObject adtObject = (IADTObject) adapter;
adtObject.registerListener(this);
}
}
return fields;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class XSDModelGroupDefinitionAdapter method clearFields.
// TODO Common this up with XSDComplexType's. See also getFields
protected void clearFields() {
if (otherThingsToListenTo != null) {
for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext(); ) {
Adapter adapter = (Adapter) i.next();
if (adapter instanceof IADTObject) {
IADTObject adtObject = (IADTObject) adapter;
adtObject.unregisterListener(this);
}
}
}
fields = null;
otherThingsToListenTo = null;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class XSDAttributeGroupDefinitionAdapter method getFields.
public List getFields() {
if (fields == null) {
fields = new ArrayList();
otherThingsToListenTo = new ArrayList();
XSDVisitorForFields visitor = new XSDVisitorForFields();
visitor.visitAttributeGroupDefinition(getXSDAttributeGroupDefinition());
populateAdapterList(visitor.concreteComponentList, fields);
populateAdapterList(visitor.thingsWeNeedToListenTo, otherThingsToListenTo);
for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext(); ) {
Adapter adapter = (Adapter) i.next();
if (adapter instanceof IADTObject) {
IADTObject adtObject = (IADTObject) adapter;
adtObject.registerListener(this);
}
}
}
return fields;
}
Aggregations