use of org.eclipse.wst.sse.core.internal.provisional.INodeAdapter in project jbosstools-hibernate by jbosstools.
the class ObserverAdapterFactory method createAdapter.
protected INodeAdapter createAdapter(INodeNotifier target) {
Node n = (Node) target;
String nodeName = n.getNodeName();
INodeAdapter result = null;
Object key = DOMAdapter.class;
if ("hibernate-reverse-engineering".equals(nodeName)) {
// $NON-NLS-1$
result = new UnknownNodeAdapter(key, revEngDefinition) {
public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
observer.hibernateMappingChanged();
}
};
} else if ("table-filter".equals(nodeName)) {
// $NON-NLS-1$
result = new TableFilterAdapter((Node) target, revEngDefinition);
} else if ("type-mapping".equals(nodeName)) {
// $NON-NLS-1$
result = new UnknownNodeAdapter(key, revEngDefinition) {
public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
observer.typeMappingChanged(notifier);
}
};
} else if ("sql-type".equals(nodeName)) {
// $NON-NLS-1$
result = new TypeMappingAdapter((Node) target, revEngDefinition);
} else if ("table".equals(nodeName)) {
// $NON-NLS-1$
result = new RevEngTableAdapter((Node) target, revEngDefinition);
} else if ("column".equals(nodeName) || "key-column".equals(nodeName)) {
// $NON-NLS-1$ //$NON-NLS-2$
result = new RevEngColumnAdapter((Node) target, revEngDefinition);
} else if ("primary-key".equals(nodeName)) {
// $NON-NLS-1$
result = new RevEngPrimaryKeyAdapter((Node) target, revEngDefinition);
} else if ("generator".equals(nodeName)) {
// $NON-NLS-1$
result = new RevEngGeneratorAdapter((Node) target, revEngDefinition);
} else if ("param".equals(nodeName)) {
// $NON-NLS-1$
result = new RevEngParamAdapter((Node) target, revEngDefinition);
} else if (// $NON-NLS-1$
"foreign-key".equals(nodeName) || // $NON-NLS-1$
"column-ref".equals(nodeName)) {
result = new UnknownNodeAdapter(key, revEngDefinition) {
public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) {
observer.tablesChanged(notifier);
}
};
}
if (result == null) {
result = new UnknownNodeAdapter(key, revEngDefinition);
}
if (result != null) {
adaptChildren((Node) target);
}
return result;
}
Aggregations