[jbosstools-commits] JBoss Tools SVN: r30921 - in trunk/esb/plugins/org.jboss.tools.esb.ui: META-INF and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Apr 28 13:27:06 EDT 2011


Author: scabanovich
Date: 2011-04-28 13:27:06 -0400 (Thu, 28 Apr 2011)
New Revision: 30921

Added:
   trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/ESBCompoundEditor.java
Modified:
   trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF
   trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
Log:
JBIDE-8813
https://issues.jboss.org/browse/JBIDE-8813

Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF	2011-04-28 17:20:58 UTC (rev 30920)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF	2011-04-28 17:27:06 UTC (rev 30921)
@@ -6,6 +6,7 @@
 Bundle-Activator: org.jboss.tools.esb.ui.ESBUiPlugin
 Bundle-Vendor: %providerName
 Export-Package: org.jboss.tools.esb.ui,
+ org.jboss.tools.esb.ui.editor,
  org.jboss.tools.esb.ui.editor.form,
  org.jboss.tools.esb.ui.editor.attribute,
  org.jboss.tools.esb.ui.wizard,
@@ -34,8 +35,6 @@
  org.jboss.tools.common.model,
  org.jboss.tools.common.model.ui,
  org.jboss.tools.common.text.xml,
- org.jboss.tools.jst.web,
- org.jboss.tools.jst.web.ui,
  org.jboss.tools.esb.core
 Bundle-Version: 1.3.0.qualifier
 Bundle-RequiredExecutionEnvironment: J2SE-1.5

Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml	2011-04-28 17:20:58 UTC (rev 30920)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml	2011-04-28 17:27:06 UTC (rev 30921)
@@ -36,7 +36,7 @@
 
    <extension id="e" name="XML Editors" point="org.jboss.tools.common.model.ui.xmlEditor">
       <xmlEditor 
-            class="org.jboss.tools.jst.web.ui.editors.WebCompoundEditor" 
+            class="org.jboss.tools.esb.ui.editor.ESBCompoundEditor" 
             contributorClass="org.jboss.tools.common.model.ui.texteditors.MultiPageContributor" 
             entities="FileESB101,FileESB110,FileESB120,FileESB130" 
             icon="images/xstudio/editors/esb.gif" 

Added: trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/ESBCompoundEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/ESBCompoundEditor.java	                        (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/ESBCompoundEditor.java	2011-04-28 17:27:06 UTC (rev 30921)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.esb.ui.editor;
+
+import org.jboss.tools.common.editor.TreeFormPage;
+import org.jboss.tools.common.meta.key.WizardKeys;
+import org.jboss.tools.common.model.XFilteredTreeConstraint;
+import org.jboss.tools.common.model.ui.editor.EditorDescriptor;
+import org.jboss.tools.common.model.ui.editors.multipage.DefaultMultipageEditor;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
+
+public class ESBCompoundEditor extends DefaultMultipageEditor {
+	public static String EDITOR_TREE_CONSTRAINT_ID = "editorTreeConstraint"; //$NON-NLS-1$
+			
+	protected void doCreatePages() {
+		if(isAppropriateNature()) {
+			treeFormPage = createTreeFormPage();
+			String title = "title not found"; 
+			if(object != null) {
+				String key = object.getModelEntity().getName() + ".editorTitle"; //$NON-NLS-1$
+				String s = WizardKeys.getString(key);
+				if(s != null) title = s;
+			}
+			treeFormPage.setTitle(title);
+			addTreeConstraint();
+			treeFormPage.initialize(object);
+			addFormPage(treeFormPage);
+		}
+		createTextPage();
+		initEditors();
+		if(treeFormPage != null) selectionProvider.addHost("treeEditor", treeFormPage.getSelectionProvider()); //$NON-NLS-1$
+		if(textEditor != null) selectionProvider.addHost("textEditor", getTextSelectionProvider()); //$NON-NLS-1$
+	}
+
+	protected void addTreeConstraint() {
+		XFilteredTreeConstraint constraint = null;
+		String editorTreeConstraintId = object.getModelEntity().getProperty(EDITOR_TREE_CONSTRAINT_ID);
+		if(editorTreeConstraintId != null) {
+			constraint = (XFilteredTreeConstraint)ModelFeatureFactory.getInstance().createFeatureInstance(editorTreeConstraintId);
+		}
+		if(constraint != null) {
+		((TreeFormPage)treeFormPage).addFilter(constraint);
+		}
+	}
+
+	public Object getAdapter(Class adapter) {
+		if (adapter == EditorDescriptor.class)
+			return new EditorDescriptor("web.xml"); //$NON-NLS-1$
+
+		return super.getAdapter(adapter);
+	}
+
+	protected String[] getSupportedNatures() {
+		return new String[0];
+	}
+
+}
\ No newline at end of file


Property changes on: trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/ESBCompoundEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list