Author: scabanovich
Date: 2011-01-31 09:12:36 -0500 (Mon, 31 Jan 2011)
New Revision: 28757
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizardFactory.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java
Log:
JBIDE-8255
https://issues.jboss.org/browse/JBIDE-8255
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2011-01-31
13:53:58 UTC (rev 28756)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2011-01-31
14:12:36 UTC (rev 28757)
@@ -54,6 +54,8 @@
import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
import org.jboss.tools.common.model.ui.templates.ControlContentAssistHelper;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
+import org.jboss.tools.common.model.ui.wizards.INewClassWizard;
+import org.jboss.tools.common.model.ui.wizards.INewClassWizardFactory;
import org.jboss.tools.common.model.ui.wizards.NewClassWizard;
import org.jboss.tools.common.model.ui.wizards.NewTypeWizardAdapter;
import org.jboss.tools.common.model.util.AccessibleJava;
@@ -159,13 +161,19 @@
}
}
- NewClassWizard wizard = null;
+ INewClassWizard wizard = null;
XAttribute a = ((DefaultValueAdapter)getPropertyEditor().getInput()).getAttribute();
if(a != null) {
String cls = a.getProperty("newWizardClass");
if(cls != null && cls.length() > 0) {
- wizard =
(NewClassWizard)ModelFeatureFactory.getInstance().createFeatureInstance(cls);
+ wizard =
(INewClassWizard)ModelFeatureFactory.getInstance().createFeatureInstance(cls);
+ } else {
+ cls = a.getProperty("newWizardClassFactory");
+ if(cls != null && cls.length() > 0) {
+ INewClassWizardFactory factory =
(INewClassWizardFactory)ModelFeatureFactory.getInstance().createFeatureInstance(cls);
+ wizard =
factory.createWizard(((DefaultValueAdapter)getPropertyEditor().getInput()).getModelObject(),
a);
+ }
}
}
if(wizard == null) {
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizard.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizard.java 2011-01-31
14:12:36 UTC (rev 28757)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.model.ui.wizards;
+
+import org.eclipse.jface.wizard.IWizard;
+
+/**
+ * Wizard run by JavaHyperlinkLineFieldEditor as new Java type wizard.
+ *
+ * @author Viachesld.av Kabanovich
+ *
+ */
+public interface INewClassWizard extends IWizard {
+
+ public void setAdapter(NewTypeWizardAdapter adapter);
+
+ public String getQualifiedClassName();
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizardFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizardFactory.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizardFactory.java 2011-01-31
14:12:36 UTC (rev 28757)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.model.ui.wizards;
+
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * Factory to create instance of INewClassWizard for JavaHyperlinkLineFieldEditor.
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface INewClassWizardFactory {
+
+ public INewClassWizard createWizard(XModelObject context, XAttribute attribute);
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/INewClassWizardFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java 2011-01-31
13:53:58 UTC (rev 28756)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java 2011-01-31
14:12:36 UTC (rev 28757)
@@ -29,7 +29,7 @@
* @author au
*/
-public class NewClassWizard extends Wizard {
+public class NewClassWizard extends Wizard implements INewClassWizard {
protected NewTypeWizardAdapter adapter = null;
protected NewClassWizardPageEx mainPage;