Author: scabanovich
Date: 2011-02-16 05:32:08 -0500 (Wed, 16 Feb 2011)
New Revision: 29171
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java
Log:
JBIDE-8424
https://issues.jboss.org/browse/JBIDE-8424
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java 2011-02-16
10:15:43 UTC (rev 29170)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java 2011-02-16
10:32:08 UTC (rev 29171)
@@ -38,10 +38,14 @@
import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
import org.jboss.tools.common.meta.action.SpecialWizard;
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
import org.jboss.tools.common.meta.action.impl.handlers.HUtil;
+import org.jboss.tools.common.meta.constraint.XAttributeEditor;
+import org.jboss.tools.common.meta.constraint.impl.XAttributeEditorImpl;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.XModelObjectUtil;
@@ -68,9 +72,15 @@
Composite supportControl;
AddServer addServer = new AddServer();
AddRuntime addRuntime = new AddRuntime();
+
+ boolean disableContextRoot = false;
public void setLight(boolean b) {
}
+
+ public void setDisableContextRoot(boolean disableContextRoot) {
+ this.disableContextRoot = disableContextRoot;
+ }
public void setLayoutForSupport(Layout layout) {
supportLayout = layout;
@@ -100,6 +110,9 @@
attInfo = new String[][] {
{ENTITY, ""}, {ATTR_APP_NAME, "yes"}, {ATTR_RUNTIME,
"yes"}, {ATTR_SEPARATOR, "no"}, {ATTR_TARGET_SERVER, "no"}
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
};
+
+ initDisablingContextRoot();
+
XEntityData entityData = XEntityDataImpl.create(attInfo);
support = new XAttributeSupport() {
protected boolean keepGreedy(String name, int index, int greedyCount) {
@@ -120,6 +133,17 @@
a = support.getPropertyEditorAdapterByName(ATTR_RUNTIME);
a.addValueChangeListener(new RuntimeInputChangeListener());
}
+
+ void initDisablingContextRoot() {
+ XModelEntity entity =
PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(ENTITY);
+ XAttribute attr = entity.getAttribute(ATTR_APP_NAME);
+ XAttributeEditorImpl ed = (XAttributeEditorImpl)attr.getEditor();
+ if(disableContextRoot) {
+ ed.setName("Uneditable"); //$NON-NLS-1$
+ } else {
+ ed.setName("Text"); //$NON-NLS-1$
+ }
+ }
public boolean isEnabling() {
return isEnabling;