Search in sources :

Example 1 with DTDBatchNodeDelete

use of org.eclipse.wst.dtd.core.internal.util.DTDBatchNodeDelete in project webtools.sourceediting by eclipse.

the class DeleteAction method run.

public void run() {
    IStructuredSelection selection = getStructuredSelection();
    Iterator iter = selection.iterator();
    DTDBatchNodeDelete batchDelete = null;
    DTDFile dtdFile = null;
    while (iter.hasNext()) {
        Object element = iter.next();
        if (element instanceof DTDNode) {
            DTDNode node = (DTDNode) element;
            dtdFile = node.getDTDFile();
            if (batchDelete == null) {
                batchDelete = new DTDBatchNodeDelete(dtdFile);
            }
            batchDelete.addNode((DTDNode) element);
        }
    }
    // $NON-NLS-1$
    dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_LABEL_DTD_FILE_DELETE);
    batchDelete.deleteNodes(this);
    dtdFile.getDTDModel().endRecording(this);
}
Also used : DTDNode(org.eclipse.wst.dtd.core.internal.DTDNode) DTDBatchNodeDelete(org.eclipse.wst.dtd.core.internal.util.DTDBatchNodeDelete) Iterator(java.util.Iterator) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) DTDFile(org.eclipse.wst.dtd.core.internal.DTDFile)

Aggregations

Iterator (java.util.Iterator)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 DTDFile (org.eclipse.wst.dtd.core.internal.DTDFile)1 DTDNode (org.eclipse.wst.dtd.core.internal.DTDNode)1 DTDBatchNodeDelete (org.eclipse.wst.dtd.core.internal.util.DTDBatchNodeDelete)1