Search in sources :

Example 1 with TypeVizEditorMode

use of org.eclipse.wst.xsd.ui.internal.adt.typeviz.TypeVizEditorMode in project webtools.sourceediting by eclipse.

the class InternalXSDMultiPageEditor method createEditorModeManager.

// private boolean isInitializing = false;
protected EditorModeManager createEditorModeManager() {
    final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider) getAdapter(ProductCustomizationProvider.class);
    EditorModeManager manager = new EditorModeManager(XSD_EDITOR_MODE_EXTENSION_ID) {

        public void init() {
            if (productCustomizationProvider == null || productCustomizationProvider.isEditorModeApplicable(TypeVizEditorMode.ID)) {
                addMode(new TypeVizEditorMode());
            }
            super.init();
        }

        protected EditorMode getDefaultMode() {
            String defaultModeId = XSDEditorPlugin.getPlugin().getPreferenceStore().getString(DEFAULT_EDITOR_MODE_ID);
            if (defaultModeId != null) {
                EditorMode editorMode = getEditorMode(defaultModeId);
                if (editorMode != null) {
                    return editorMode;
                }
            }
            return super.getDefaultMode();
        }
    };
    manager.setProductCustomizationProvider(productCustomizationProvider);
    return manager;
}
Also used : EditorMode(org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode) TypeVizEditorMode(org.eclipse.wst.xsd.ui.internal.adt.typeviz.TypeVizEditorMode) TypeVizEditorMode(org.eclipse.wst.xsd.ui.internal.adt.typeviz.TypeVizEditorMode) ProductCustomizationProvider(org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider) EditorModeManager(org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager)

Aggregations

EditorMode (org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode)1 EditorModeManager (org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager)1 ProductCustomizationProvider (org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider)1 TypeVizEditorMode (org.eclipse.wst.xsd.ui.internal.adt.typeviz.TypeVizEditorMode)1