use of org.eclipse.wst.dtd.core.internal.TopLevelNode in project webtools.sourceediting by eclipse.
the class DTDDragAndDropManager method createCommand.
public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source) {
if (target instanceof DTDNode) {
DTDNode node = (DTDNode) target;
source = mergeSource(source);
if (node instanceof TopLevelNode) {
return new DragTopLevelNodesCommand(target, location, operations, operation, source);
}
if (node instanceof Attribute) {
return new DragAttributeCommand(target, location, operations, operation, source);
}
if (node instanceof CMNode) {
return new DragContentModelCommand(target, location, operations, operation, source);
}
}
return null;
}
use of org.eclipse.wst.dtd.core.internal.TopLevelNode in project webtools.sourceediting by eclipse.
the class DragTopLevelNodesCommand method execute.
public void execute() {
DTDNode referenceNode = (DTDNode) target;
DTDFile dtdFile = referenceNode.getDTDFile();
dtdFile.getDTDModel().beginRecording(this, sources.size() > 1 ? moveNodes : moveNode);
Iterator iter = sources.iterator();
while (iter.hasNext()) {
DTDNode node = (DTDNode) iter.next();
if (node instanceof TopLevelNode) {
dtdFile.moveNode(this, referenceNode, node, isAfter());
}
}
dtdFile.getDTDModel().endRecording(this);
}
Aggregations