Author: scabanovich
Date: 2009-12-23 08:18:52 -0500 (Wed, 23 Dec 2009)
New Revision: 19547
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/WebCompoundEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5547
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/WebCompoundEditor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/WebCompoundEditor.java 2009-12-23
09:49:28 UTC (rev 19546)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/WebCompoundEditor.java 2009-12-23
13:18:52 UTC (rev 19547)
@@ -12,12 +12,15 @@
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;
import org.jboss.tools.jst.web.tld.model.EditorTreeConstraint;
import org.jboss.tools.jst.web.ui.Messages;
public class WebCompoundEditor extends DefaultMultipageEditor {
+ public static String EDITOR_TREE_CONSTRAINT_ID = "editorTreeConstraint";
//$NON-NLS-1$
protected void doCreatePages() {
if(isAppropriateNature()) {
@@ -29,7 +32,7 @@
if(s != null) title = s;
}
treeFormPage.setTitle(title);
- ((TreeFormPage)treeFormPage).addFilter(new EditorTreeConstraint());
+ addTreeConstraint();
treeFormPage.initialize(object);
addFormPage(treeFormPage);
}
@@ -39,6 +42,18 @@
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) {
+ constraint = new EditorTreeConstraint();
+ }
+ ((TreeFormPage)treeFormPage).addFilter(constraint);
+ }
+
public Object getAdapter(Class adapter) {
if (adapter == EditorDescriptor.class)
return new EditorDescriptor("web.xml"); //$NON-NLS-1$