Search in sources :

Example 31 with DTDNode

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

the class AddCommentAction method run.

public void run() {
    DTDNode selectedNode = getFirstNodeSelected();
    // $NON-NLS-1$
    getModel().getDTDFile().createComment(selectedNode, "NewComment", true);
}
Also used : DTDNode(org.eclipse.wst.dtd.core.internal.DTDNode)

Example 32 with DTDNode

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

the class AddParameterEntityReferenceAction method run.

public void run() {
    DTDFile dtdFile = getModel().getDTDFile();
    String extEntity = getFirstExternalParameterEntity(dtdFile);
    DTDNode selectedNode = getFirstNodeSelected();
    if (extEntity != null) {
        dtdFile.createParameterEntityReference(selectedNode, extEntity, true);
    } else {
        // $NON-NLS-1$
        dtdFile.createParameterEntityReference(selectedNode, "%NewEntityReference;", true);
    }
}
Also used : DTDNode(org.eclipse.wst.dtd.core.internal.DTDNode) DTDFile(org.eclipse.wst.dtd.core.internal.DTDFile)

Aggregations

DTDNode (org.eclipse.wst.dtd.core.internal.DTDNode)32 DTDFile (org.eclipse.wst.dtd.core.internal.DTDFile)13 Element (org.eclipse.wst.dtd.core.internal.Element)13 Iterator (java.util.Iterator)9 AttributeList (org.eclipse.wst.dtd.core.internal.AttributeList)8 NodeList (org.eclipse.wst.dtd.core.internal.NodeList)6 CMGroupNode (org.eclipse.wst.dtd.core.internal.CMGroupNode)5 CMNode (org.eclipse.wst.dtd.core.internal.CMNode)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 Attribute (org.eclipse.wst.dtd.core.internal.Attribute)4 CMBasicNode (org.eclipse.wst.dtd.core.internal.CMBasicNode)3 Comment (org.eclipse.wst.dtd.core.internal.Comment)3 Entity (org.eclipse.wst.dtd.core.internal.Entity)3 Image (org.eclipse.swt.graphics.Image)2 ParameterEntityReference (org.eclipse.wst.dtd.core.internal.ParameterEntityReference)2 TopLevelNode (org.eclipse.wst.dtd.core.internal.TopLevelNode)2 DTDModelImpl (org.eclipse.wst.dtd.core.internal.document.DTDModelImpl)2 Separator (org.eclipse.jface.action.Separator)1