Search in sources :

Example 1 with CheatSheetItemExtensionElement

use of org.eclipse.ui.internal.cheatsheets.registry.CheatSheetItemExtensionElement in project org.eclipse.rap by eclipse-rap.

the class CheatSheetParser method handleUnknownItemAttribute.

private AbstractItemExtensionElement[] handleUnknownItemAttribute(Node item, Node node) {
    ArrayList al = new ArrayList();
    if (itemExtensionContainerList == null)
        return null;
    for (int i = 0; i < itemExtensionContainerList.size(); i++) {
        CheatSheetItemExtensionElement itemExtensionElement = (CheatSheetItemExtensionElement) itemExtensionContainerList.get(i);
        if (itemExtensionElement.getItemAttribute().equals(item.getNodeName())) {
            AbstractItemExtensionElement itemElement = itemExtensionElement.createInstance();
            if (itemElement != null) {
                itemElement.handleAttribute(item.getNodeValue());
                al.add(itemElement);
            }
        }
    }
    if (al.size() == 0) {
        String message = NLS.bind(Messages.get().WARNING_PARSING_UNKNOWN_ATTRIBUTE, (new Object[] { item.getNodeName(), node.getNodeName() }));
        addStatus(IStatus.WARNING, message, null);
    }
    return (AbstractItemExtensionElement[]) al.toArray(new AbstractItemExtensionElement[al.size()]);
}
Also used : AbstractItemExtensionElement(org.eclipse.ui.cheatsheets.AbstractItemExtensionElement) CheatSheetItemExtensionElement(org.eclipse.ui.internal.cheatsheets.registry.CheatSheetItemExtensionElement) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 AbstractItemExtensionElement (org.eclipse.ui.cheatsheets.AbstractItemExtensionElement)1 CheatSheetItemExtensionElement (org.eclipse.ui.internal.cheatsheets.registry.CheatSheetItemExtensionElement)1