Search in sources :

Example 6 with ComponentReferenceEditManager

use of org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager in project webtools.sourceediting by eclipse.

the class ElementReferenceDirectEditManager method getComponentReferenceEditManager.

protected ComponentReferenceEditManager getComponentReferenceEditManager() {
    ComponentReferenceEditManager result = null;
    IEditorPart editor = getActiveEditor();
    if (editor != null) {
        result = (ComponentReferenceEditManager) editor.getAdapter(XSDElementReferenceEditManager.class);
    }
    return result;
}
Also used : ComponentReferenceEditManager(org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager) IEditorPart(org.eclipse.ui.IEditorPart)

Example 7 with ComponentReferenceEditManager

use of org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager in project webtools.sourceediting by eclipse.

the class AttributeReferenceDirectEditManager method getComponentReferenceEditManager.

protected ComponentReferenceEditManager getComponentReferenceEditManager() {
    ComponentReferenceEditManager result = null;
    IEditorPart editor = getActiveEditor();
    if (editor != null) {
        result = (ComponentReferenceEditManager) editor.getAdapter(XSDAttributeReferenceEditManager.class);
    }
    return result;
}
Also used : ComponentReferenceEditManager(org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager) IEditorPart(org.eclipse.ui.IEditorPart)

Example 8 with ComponentReferenceEditManager

use of org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager in project webtools.sourceediting by eclipse.

the class ReferenceDirectEditManager method getComponentSpecificationForValue.

protected ComponentSpecification getComponentSpecificationForValue(String value) {
    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
    if (editManager != null) {
        ComponentSpecification[] quickPicks = editManager.getQuickPicks();
        if (quickPicks != null) {
            for (int i = 0; i < quickPicks.length; i++) {
                ComponentSpecification componentSpecification = quickPicks[i];
                if (value.equals(componentSpecification.getName())) {
                    return componentSpecification;
                }
            }
        }
        ComponentSpecification[] history = editManager.getHistory();
        if (history != null) {
            for (int i = 0; i < history.length; i++) {
                ComponentSpecification componentSpecification = history[i];
                if (value.equals(componentSpecification.getName())) {
                    return componentSpecification;
                }
            }
        }
    }
    return null;
}
Also used : ComponentSpecification(org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification) ComponentReferenceEditManager(org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager)

Example 9 with ComponentReferenceEditManager

use of org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager in project webtools.sourceediting by eclipse.

the class ReferenceDirectEditManager method computeComboContent.

protected List computeComboContent() {
    List list = new ArrayList();
    ComponentReferenceEditManager editManager = getComponentReferenceEditManager();
    if (editManager != null) {
        list.add(Messages._UI_COMBO_BROWSE);
        list.add(Messages._UI_COMBO_NEW);
        ComponentSpecification[] quickPicks = editManager.getQuickPicks();
        if (quickPicks != null) {
            for (int i = 0; i < quickPicks.length; i++) {
                ComponentSpecification componentSpecification = quickPicks[i];
                list.add(componentSpecification.getName());
            }
        }
        ComponentSpecification[] history = editManager.getHistory();
        if (history != null) {
            for (int i = 0; i < history.length; i++) {
                ComponentSpecification componentSpecification = history[i];
                list.add(componentSpecification.getName());
            }
        }
    }
    return list;
}
Also used : ComponentSpecification(org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ComponentReferenceEditManager(org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager)

Example 10 with ComponentReferenceEditManager

use of org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager in project webtools.sourceediting by eclipse.

the class TypeReferenceDirectEditManager method getComponentReferenceEditManager.

protected ComponentReferenceEditManager getComponentReferenceEditManager() {
    ComponentReferenceEditManager result = null;
    IEditorPart editor = getActiveEditor();
    if (editor != null) {
        result = (ComponentReferenceEditManager) editor.getAdapter(XSDTypeReferenceEditManager.class);
        if (result instanceof ComponentReferenceEditManager2) {
            ComponentReferenceEditManager2 manager = (ComponentReferenceEditManager2) result;
            manager.setReferencer(setObject);
        }
    }
    return result;
}
Also used : ComponentReferenceEditManager(org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager) IEditorPart(org.eclipse.ui.IEditorPart) ComponentReferenceEditManager2(org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager2)

Aggregations

ComponentReferenceEditManager (org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager)19 IEditorPart (org.eclipse.ui.IEditorPart)15 ComponentSpecification (org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification)15 IComponentDialog (org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog)6 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)6 XSDTypeReferenceEditManager (org.eclipse.wst.xsd.ui.internal.editor.XSDTypeReferenceEditManager)4 XSDSearchListDialogDelegate (org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate)4 Element (org.w3c.dom.Element)4 XSDComplexTypeBaseTypeEditManager (org.eclipse.wst.xsd.ui.internal.editor.XSDComplexTypeBaseTypeEditManager)3 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)3 XSDAttributeDeclaration (org.eclipse.xsd.XSDAttributeDeclaration)2 XSDComplexTypeDefinition (org.eclipse.xsd.XSDComplexTypeDefinition)2 XSDTypeDefinition (org.eclipse.xsd.XSDTypeDefinition)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Command (org.eclipse.gef.commands.Command)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 XSDBaseAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter)1 ComponentReferenceEditManager2 (org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager2)1 UpdateAttributeValueCommand (org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand)1