Search in sources :

Example 6 with AttributeList

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

the class AddAttributeAction method run.

public void run() {
    DTDNode selectedNode = getFirstNodeSelected();
    // $NON-NLS-1$
    String newName = "NewAttribute";
    if (selectedNode instanceof AttributeList) {
        ((AttributeList) selectedNode).addAttribute(newName);
    } else if (selectedNode instanceof Element) {
        ((Element) selectedNode).addAttribute(newName);
    }
}
Also used : DTDNode(org.eclipse.wst.dtd.core.internal.DTDNode) AttributeList(org.eclipse.wst.dtd.core.internal.AttributeList) Element(org.eclipse.wst.dtd.core.internal.Element)

Aggregations

AttributeList (org.eclipse.wst.dtd.core.internal.AttributeList)6 DTDNode (org.eclipse.wst.dtd.core.internal.DTDNode)6 Element (org.eclipse.wst.dtd.core.internal.Element)4 Attribute (org.eclipse.wst.dtd.core.internal.Attribute)3 DTDFile (org.eclipse.wst.dtd.core.internal.DTDFile)3 NodeList (org.eclipse.wst.dtd.core.internal.NodeList)3 ArrayList (java.util.ArrayList)2 Iterator (java.util.Iterator)2 List (java.util.List)2 CMGroupNode (org.eclipse.wst.dtd.core.internal.CMGroupNode)2 Separator (org.eclipse.jface.action.Separator)1 ITextSelection (org.eclipse.jface.text.ITextSelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 CMBasicNode (org.eclipse.wst.dtd.core.internal.CMBasicNode)1 CMNode (org.eclipse.wst.dtd.core.internal.CMNode)1 CMRepeatableNode (org.eclipse.wst.dtd.core.internal.CMRepeatableNode)1 Comment (org.eclipse.wst.dtd.core.internal.Comment)1 Entity (org.eclipse.wst.dtd.core.internal.Entity)1 Notation (org.eclipse.wst.dtd.core.internal.Notation)1 ParameterEntityReference (org.eclipse.wst.dtd.core.internal.ParameterEntityReference)1