JBoss Tools SVN: r28764 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/utils and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-31 09:27:12 -0500 (Mon, 31 Jan 2011)
New Revision: 28764
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PreferencesContentProposalProvider.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
[JBIDE-8259] added content proposals for cloud name, cloud url, username
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-31 14:26:32 UTC (rev 28763)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-31 14:27:12 UTC (rev 28764)
@@ -1,3 +1,8 @@
+2011-01-31 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java (createControl):
+ [JBIDE-8259] added content proposals for cloud name, cloud url, username
+
2011-01-27 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/SshPrivateKeysPreferences.java
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java 2011-01-31 14:27:12 UTC (rev 28764)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.internal.deltacloud.ui.utils;
+
+import org.eclipse.jface.fieldassist.ContentProposalAdapter;
+import org.eclipse.jface.fieldassist.TextContentAdapter;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.internal.deltacloud.ui.wizards.PreferencesContentProposalProvider;
+
+/**
+ * @author André Dietisheim
+ */
+public class DeltaCloudUIUtils {
+
+ private static char[] ACTIVATION_CHARS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:.,-".toCharArray();
+
+ public static ContentProposalAdapter createPreferencesProposalAdapter(final Text text, String preferencesKey) {
+ final PreferencesContentProposalProvider proposalProvider = new PreferencesContentProposalProvider(preferencesKey, Activator.PLUGIN_ID);
+ proposalProvider.setFiltering(true);
+ text.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ String currentValue = text.getText();
+ proposalProvider.add(currentValue);
+ proposalProvider.save();
+ }
+ });
+ ContentProposalAdapter proposalAdapter = new ContentProposalAdapter(text, new TextContentAdapter(), proposalProvider, null, ACTIVATION_CHARS);
+ proposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
+ return proposalAdapter;
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudUIUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-01-31 14:26:32 UTC (rev 28763)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-01-31 14:27:12 UTC (rev 28764)
@@ -66,6 +66,7 @@
import org.jboss.tools.internal.deltacloud.ui.common.swt.JFaceUtils;
import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
+import org.jboss.tools.internal.deltacloud.ui.utils.DeltaCloudUIUtils;
/**
* @author Jeff Jonhston
@@ -73,6 +74,10 @@
*/
public class CloudConnectionPage extends WizardPage {
+ private static final String USERNAME_PROPOSAL_KEY = "cloud/username";
+
+ private static final String URL_PROPOSAL_KEY = "cloud/url";
+
private static final int CLOUDTYPE_CHECK_DELAY = 1000;
private static final String DESCRIPTION = "CloudConnection.desc"; //$NON-NLS-1$
@@ -329,6 +334,7 @@
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ DeltaCloudUIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY());
bindName(dbc, nameText);
// url
@@ -336,7 +342,7 @@
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
-
+ DeltaCloudUIUtils.createPreferencesProposalAdapter(nameText, URL_PROPOSAL_KEY);
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(urlText),
BeanProperties.value(
@@ -361,6 +367,7 @@
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ DeltaCloudUIUtils.createPreferencesProposalAdapter(nameText, USERNAME_PROPOSAL_KEY);
IObservableValue usernameObservable = WidgetProperties.text(SWT.Modify).observe(usernameText);
dbc.bindValue(
usernameObservable,
@@ -480,6 +487,10 @@
setControl(container);
}
+ private String NAME_PROPOSAL_KEY() {
+ return "cloud/name";
+ }
+
/**
* Enables/Disables (credentials) test button on url validity changes.
*
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PreferencesContentProposalProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PreferencesContentProposalProvider.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PreferencesContentProposalProvider.java 2011-01-31 14:27:12 UTC (rev 28764)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.internal.deltacloud.ui.wizards;
+
+import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
+import org.jboss.tools.internal.deltacloud.ui.preferences.StringEntriesPreferenceValue;
+
+/**
+ * @author André Dietisheim
+ */
+public class PreferencesContentProposalProvider extends SimpleContentProposalProvider {
+
+ private StringEntriesPreferenceValue preferencesValues;
+
+ public PreferencesContentProposalProvider(String preferencesKey, String pluginId) {
+ super(new String[] {});
+ this.preferencesValues = new StringEntriesPreferenceValue(",", preferencesKey, pluginId);
+ setProposals(preferencesValues.get());
+ }
+
+ public void add(String newEntry) {
+ preferencesValues.add(newEntry);
+ }
+
+ public void save() {
+ preferencesValues.store();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/PreferencesContentProposalProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 11 months
JBoss Tools SVN: r28763 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-01-31 09:26:32 -0500 (Mon, 31 Jan 2011)
New Revision: 28763
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
Log:
https://issues.jboss.org/browse/JBIDE-8230
Non convention package name was shown as error
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2011-01-31 14:26:24 UTC (rev 28762)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2011-01-31 14:26:32 UTC (rev 28763)
@@ -309,11 +309,14 @@
return;
}
+ String warning = null;
if(packageName.isEnabled() && getOutputPackage().length()>0) {
IStatus val= JavaConventions.validatePackageName(getOutputPackage() );
- if (val.getSeverity() == IStatus.ERROR || val.getSeverity() == IStatus.WARNING) {
+ if (val.getSeverity() == IStatus.ERROR ) {
updateStatus(val.getMessage() );
return;
+ } else if (val.getSeverity() == IStatus.WARNING){
+ warning = val.getMessage();
}
}
@@ -356,6 +359,10 @@
setMessage(null);
}*/
}
+ }
+
+ if (warning != null){
+ setMessage(warning);
} else {
setMessage(null);
}
13 years, 11 months
JBoss Tools SVN: r28762 - branches/jbosstools-3.2.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-01-31 09:26:24 -0500 (Mon, 31 Jan 2011)
New Revision: 28762
Modified:
branches/jbosstools-3.2.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
Log:
https://issues.jboss.org/browse/JBIDE-8152 , fixed in branch.
Modified: branches/jbosstools-3.2.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
===================================================================
--- branches/jbosstools-3.2.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2011-01-31 14:26:07 UTC (rev 28761)
+++ branches/jbosstools-3.2.x/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2011-01-31 14:26:24 UTC (rev 28762)
@@ -19,12 +19,16 @@
import java.util.ResourceBundle;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jsf.vpe.jsf.template.util.ComponentUtil;
import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.base.test.TestUtil;
import org.jboss.tools.vpe.base.test.VpeTest;
@@ -260,12 +264,24 @@
* Change the locale
*/
Element fViewElement = controller.getSourceBuilder().getSourceDocument().getElementById(FVIEW_ID);
+ int offset = controller.getSourceBuilder().getPosition(fViewElement,0,false);
assertTrue("Previous locale should be 'de'", "de".equalsIgnoreCase(fViewElement.getAttribute("locale"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- fViewElement.setAttribute("locale", "en_GB"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ IRegion reg = new FindReplaceDocumentAdapter(
+ controller.getSourceBuilder().getStructuredTextViewer().getDocument())
+ .find(offset, "de", true, true, false, false);
+ controller.getSourceBuilder().getStructuredTextViewer().getDocument().replace(reg.getOffset(), reg.getLength(), "en_GB");
/*
* Wait until new value is applied and children are refreshed.
+ * Wait while all deferred events are processed
*/
+ while(Display.getCurrent().readAndDispatch());
+ /*
+ * Wait while all jobs including started through deferred events are ended
+ */
+ JobUtils.delay(VpeController.DEFAULT_UPDATE_DELAY_TIME*4);
TestUtil.waitForIdle();
+ fViewElement = controller.getSourceBuilder().getSourceDocument().getElementById(FVIEW_ID);
assertTrue("Current locale should be 'en_GB'", "en_GB".equalsIgnoreCase(fViewElement.getAttribute("locale"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
doc = controller.getXulRunnerEditor().getDOMDocument();
localeText = doc.getElementById(LOCALE_TEXT_ID);
13 years, 11 months
JBoss Tools SVN: r28761 - branches/jbosstools-3.2.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-01-31 09:26:07 -0500 (Mon, 31 Jan 2011)
New Revision: 28761
Modified:
branches/jbosstools-3.2.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
Log:
https://issues.jboss.org/browse/JBIDE-8230
Non convention package name was shown as error
Modified: branches/jbosstools-3.2.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- branches/jbosstools-3.2.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2011-01-31 14:16:59 UTC (rev 28760)
+++ branches/jbosstools-3.2.x/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2011-01-31 14:26:07 UTC (rev 28761)
@@ -309,11 +309,14 @@
return;
}
+ String warning = null;
if(packageName.isEnabled() && getOutputPackage().length()>0) {
IStatus val= JavaConventions.validatePackageName(getOutputPackage() );
- if (val.getSeverity() == IStatus.ERROR || val.getSeverity() == IStatus.WARNING) {
+ if (val.getSeverity() == IStatus.ERROR ) {
updateStatus(val.getMessage() );
return;
+ } else if (val.getSeverity() == IStatus.WARNING){
+ warning = val.getMessage();
}
}
@@ -356,6 +359,10 @@
setMessage(null);
}*/
}
+ }
+
+ if (warning != null){
+ setMessage(warning);
} else {
setMessage(null);
}
13 years, 11 months
JBoss Tools SVN: r28760 - trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-01-31 09:16:59 -0500 (Mon, 31 Jan 2011)
New Revision: 28760
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-beans.meta
Log:
JBIDE-8255
https://issues.jboss.org/browse/JBIDE-8255
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-beans.meta
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-beans.meta 2011-01-31 14:15:39 UTC (rev 28759)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-beans.meta 2011-01-31 14:16:59 UTC (rev 28760)
@@ -104,7 +104,7 @@
<XModelAttribute default="class" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="id=true;save=always;category=general"
+ <XModelAttribute PROPERTIES="id=true;save=always;category=general;newWizardClassFactory=org.jboss.tools.cdi.xml.ui.editor.form.CDINewClassWizardFactory"
name="class" xmlname="#text">
<Editor name="AccessibleJava"/>
</XModelAttribute>
@@ -223,7 +223,7 @@
<XModelAttribute default="stereotype" loader="ElementType" name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="id=true;save=always;category=general"
+ <XModelAttribute PROPERTIES="id=true;save=always;category=general;newWizardClassFactory=org.jboss.tools.cdi.xml.ui.editor.form.CDINewClassWizardFactory"
name="stereotype" xmlname="#text">
<Editor name="AccessibleJava"/>
</XModelAttribute>
13 years, 11 months
JBoss Tools SVN: r28759 - in trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-01-31 09:15:39 -0500 (Mon, 31 Jan 2011)
New Revision: 28759
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/src/org/jboss/tools/cdi/xml/ui/editor/form/CDINewClassWizardFactory.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/plugin.xml
Log:
JBIDE-8255
https://issues.jboss.org/browse/JBIDE-8255
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/META-INF/MANIFEST.MF 2011-01-31 14:14:07 UTC (rev 28758)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/META-INF/MANIFEST.MF 2011-01-31 14:15:39 UTC (rev 28759)
@@ -30,6 +30,7 @@
org.jboss.tools.common.text.xml,
org.jboss.tools.jst.web,
org.jboss.tools.jst.web.ui,
- org.jboss.tools.cdi.xml
+ org.jboss.tools.cdi.xml,
+ org.jboss.tools.cdi.ui
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/plugin.xml 2011-01-31 14:14:07 UTC (rev 28758)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/plugin.xml 2011-01-31 14:15:39 UTC (rev 28759)
@@ -15,6 +15,8 @@
<extension point="org.jboss.tools.common.model.classes">
<xclass id="org.jboss.tools.cdi.xml.ui.editor.form.CDIXMLFormLayoutData"
class="org.jboss.tools.cdi.xml.ui.editor.form.CDIXMLFormLayoutData"/>
+ <xclass id="org.jboss.tools.cdi.xml.ui.editor.form.CDINewClassWizardFactory"
+ class="org.jboss.tools.cdi.xml.ui.editor.form.CDINewClassWizardFactory"/>
</extension>
Added: trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/src/org/jboss/tools/cdi/xml/ui/editor/form/CDINewClassWizardFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/src/org/jboss/tools/cdi/xml/ui/editor/form/CDINewClassWizardFactory.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/src/org/jboss/tools/cdi/xml/ui/editor/form/CDINewClassWizardFactory.java 2011-01-31 14:15:39 UTC (rev 28759)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.cdi.xml.ui.editor.form;
+
+import org.jboss.tools.cdi.ui.wizard.NewBeanCreationWizard;
+import org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard;
+import org.jboss.tools.cdi.ui.wizard.NewInterceptorCreationWizard;
+import org.jboss.tools.cdi.ui.wizard.NewStereotypeCreationWizard;
+import org.jboss.tools.cdi.xml.beans.model.CDIBeansConstants;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.model.XModelConstants;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.wizards.INewClassWizard;
+import org.jboss.tools.common.model.ui.wizards.INewClassWizardFactory;
+
+public class CDINewClassWizardFactory implements INewClassWizardFactory {
+
+ public INewClassWizard createWizard(XModelObject context,
+ XAttribute attribute) {
+ if(context != null) {
+ XModelObject folder = context;
+ String entity = context.getModelEntity().getName();
+ if(entity.equals(CDIBeansConstants.ENT_CDI_CLASS) || entity.equals(CDIBeansConstants.ENT_CDI_STEREOTYPE)) {
+ folder = context.getParent();
+ }
+ String folderName = folder.getAttributeValue(CDIBeansConstants.ATTR_NAME);
+ if("Interceptors".equals(folderName)) {
+ return new NewInterceptorCreationWizard();
+ } else if("Decorators".equals(folderName)) {
+ return new NewDecoratorCreationWizard();
+ } else if("Alternatives".equals(folderName)) {
+ if("stereotype".equals(attribute.getName())) {
+ return new NewStereotypeCreationWizard();
+ } else if("class".equals(attribute.getName())) {
+ return new NewBeanCreationWizard();
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/src/org/jboss/tools/cdi/xml/ui/editor/form/CDINewClassWizardFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 11 months
JBoss Tools SVN: r28758 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-01-31 09:14:07 -0500 (Mon, 31 Jan 2011)
New Revision: 28758
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIElementWizard.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorWizardPage.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java
Log:
JBIDE-8255
https://issues.jboss.org/browse/JBIDE-8255
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanCreationWizard.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanCreationWizard.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -11,12 +11,6 @@
package org.jboss.tools.cdi.ui.wizard;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
import org.jboss.tools.cdi.ui.CDIUIMessages;
@@ -25,23 +19,27 @@
* @author Viacheslav Kabanovich
*
*/
-public class NewBeanCreationWizard extends NewElementWizard {
- private NewClassWizardPage fPage;
- private boolean fOpenEditorOnFinish = true;
+public class NewBeanCreationWizard extends NewCDIElementWizard {
-
public NewBeanCreationWizard() {
setWindowTitle(CDIUIMessages.NEW_BEAN_WIZARD_TITLE);
}
+ protected void initPageFromAdapter() {
+ super.initPageFromAdapter();
+ if(adapter != null) {
+ ((NewBeanWizardPage)fPage).setAlternative(true);
+ }
+ }
/*
* @see Wizard#createPages
*/
public void addPages() {
super.addPages();
if (fPage == null) {
- fPage = new NewBeanWizardPage();
- fPage.init(getSelection());
+ fPage = new NewBeanWizardPage();
+ ((NewClassWizardPage)fPage).init(getSelection());
+ initPageFromAdapter();
}
addPage(fPage);
}
@@ -53,37 +51,4 @@
return !fPage.isEnclosingTypeSelected();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
- fPage.createType(monitor); // use the full progress monitor
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- warnAboutTypeCommentDeprecation();
- boolean res= super.performFinish();
- if (res) {
- IResource resource= fPage.getModifiedResource();
- if (resource != null) {
- selectAndReveal(resource);
- if (fOpenEditorOnFinish) {
- openResource((IFile) resource);
- }
- }
- }
- return res;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#getCreatedElement()
- */
- public IJavaElement getCreatedElement() {
- return fPage.getCreatedType();
- }
-
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewBeanWizardPage.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -88,6 +88,8 @@
protected StatusInfo fieldNameStatus = new StatusInfo();
+ boolean isAlternativeInitialValue = false;
+
public NewBeanWizardPage() {
setTitle(CDIUIMessages.NEW_BEAN_WIZARD_PAGE_NAME);
setDescription(CDIUIMessages.NEW_BEAN_WIZARD_DESCRIPTION);
@@ -96,7 +98,7 @@
public void init(IStructuredSelection selection) {
super.init(selection);
- if (!selection.isEmpty()) {
+ if (selection != null && !selection.isEmpty()) {
Object o = selection.iterator().next();
IType type = null;
if (o instanceof IType) {
@@ -379,7 +381,7 @@
protected void createAlternativeField(Composite composite) {
String label = "Add @Alternative";
- alternative = createCheckBoxField(composite, "isAlternative", label, false);
+ alternative = createCheckBoxField(composite, "isAlternative", label, isAlternativeInitialValue);
}
protected CheckBoxEditorWrapper createCheckBoxField(Composite composite, String name, String label, boolean defaultValue) {
@@ -423,5 +425,12 @@
return result;
}
+ public void setAlternative(boolean value) {
+ if(alternative != null) {
+ alternative.composite.setValue(Boolean.valueOf(value));
+ } else {
+ isAlternativeInitialValue = value;
+ }
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationCreationWizard.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIAnnotationCreationWizard.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -10,22 +10,15 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.wizard;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
import org.eclipse.jdt.ui.wizards.NewAnnotationWizardPage;
+import org.jboss.tools.common.model.ui.wizards.INewClassWizard;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public abstract class NewCDIAnnotationCreationWizard extends NewElementWizard {
- protected NewAnnotationWizardPage fPage;
- protected boolean fOpenEditorOnFinish = true;
+public abstract class NewCDIAnnotationCreationWizard extends NewCDIElementWizard implements INewClassWizard {
public NewCDIAnnotationCreationWizard() {}
@@ -33,7 +26,8 @@
super.addPages();
if (fPage == null) {
fPage = createAnnotationWizardPage();
- fPage.init(getSelection());
+ ((NewAnnotationWizardPage)fPage).init(getSelection());
+ initPageFromAdapter();
}
addPage(fPage);
@@ -41,30 +35,4 @@
protected abstract NewAnnotationWizardPage createAnnotationWizardPage();
- protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
- fPage.createType(monitor); // use the full progress monitor
- }
-
- public IJavaElement getCreatedElement() {
- return fPage.getCreatedType();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- warnAboutTypeCommentDeprecation();
- boolean res= super.performFinish();
- if (res) {
- IResource resource= fPage.getModifiedResource();
- if (resource != null) {
- selectAndReveal(resource);
- if (fOpenEditorOnFinish) {
- openResource((IFile) resource);
- }
- }
- }
- return res;
- }
-
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIElementWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIElementWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIElementWizard.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -0,0 +1,71 @@
+package org.jboss.tools.cdi.ui.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
+import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
+import org.jboss.tools.common.model.ui.wizards.INewClassWizard;
+import org.jboss.tools.common.model.ui.wizards.NewTypeWizardAdapter;
+
+public class NewCDIElementWizard extends NewElementWizard implements INewClassWizard {
+ protected boolean fOpenEditorOnFinish = true;
+
+ protected NewTypeWizardPage fPage;
+ protected NewTypeWizardAdapter adapter;
+
+ public NewCDIElementWizard() {}
+
+ public void setAdapter(NewTypeWizardAdapter adapter) {
+ this.adapter = adapter;
+ }
+
+ public String getQualifiedClassName() {
+ IType type = fPage.getCreatedType();
+ return type == null ? "" : type.getFullyQualifiedName();
+ }
+
+ protected void initPageFromAdapter() {
+ if(adapter != null) {
+ fPage.setPackageFragmentRoot(adapter.getPackageFragmentRoot(), true);
+ fPage.setPackageFragment(adapter.getPackageFragment(), true);
+ fPage.setTypeName(adapter.getTypeName(), true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
+ fPage.createType(monitor); // use the full progress monitor
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#getCreatedElement()
+ */
+ public IJavaElement getCreatedElement() {
+ return fPage.getCreatedType();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ warnAboutTypeCommentDeprecation();
+ boolean res= super.performFinish();
+ if (res) {
+ IResource resource= fPage.getModifiedResource();
+ if (resource != null) {
+ selectAndReveal(resource);
+ if (fOpenEditorOnFinish) {
+ openResource((IFile) resource);
+ }
+ }
+ }
+ return res;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewCDIElementWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorCreationWizard.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorCreationWizard.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -11,12 +11,6 @@
package org.jboss.tools.cdi.ui.wizard;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
import org.jboss.tools.cdi.ui.CDIUIMessages;
@@ -25,11 +19,8 @@
* @author Viacheslav Kabanovich
*
*/
-public class NewDecoratorCreationWizard extends NewElementWizard {
- private NewClassWizardPage fPage;
- private boolean fOpenEditorOnFinish = true;
+public class NewDecoratorCreationWizard extends NewCDIElementWizard {
-
public NewDecoratorCreationWizard() {
setWindowTitle(CDIUIMessages.NEW_DECORATOR_WIZARD_TITLE);
}
@@ -41,7 +32,8 @@
super.addPages();
if (fPage == null) {
fPage = new NewDecoratorWizardPage();
- fPage.init(getSelection());
+ ((NewClassWizardPage)fPage).init(getSelection());
+ initPageFromAdapter();
}
addPage(fPage);
}
@@ -53,37 +45,4 @@
return !fPage.isEnclosingTypeSelected();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
- fPage.createType(monitor); // use the full progress monitor
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- warnAboutTypeCommentDeprecation();
- boolean res= super.performFinish();
- if (res) {
- IResource resource= fPage.getModifiedResource();
- if (resource != null) {
- selectAndReveal(resource);
- if (fOpenEditorOnFinish) {
- openResource((IFile) resource);
- }
- }
- }
- return res;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#getCreatedElement()
- */
- public IJavaElement getCreatedElement() {
- return fPage.getCreatedType();
- }
-
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorWizardPage.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewDecoratorWizardPage.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -80,7 +80,7 @@
super.init(selection);
defaultTypeName = null;
defaultFieldName = null;
- if (!selection.isEmpty()) {
+ if (selection != null && !selection.isEmpty()) {
Object o = selection.iterator().next();
IType type = null;
if (o instanceof IType) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewInterceptorCreationWizard.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -11,13 +11,6 @@
package org.jboss.tools.cdi.ui.wizard;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
-import org.eclipse.jdt.ui.wizards.NewClassWizardPage;
import org.jboss.tools.cdi.ui.CDIUIMessages;
/**
@@ -25,11 +18,8 @@
* @author Viacheslav Kabanovich
*
*/
-public class NewInterceptorCreationWizard extends NewElementWizard {
- private NewClassWizardPage fPage;
- private boolean fOpenEditorOnFinish = true;
-
-
+public class NewInterceptorCreationWizard extends NewCDIElementWizard {
+
public NewInterceptorCreationWizard() {
setWindowTitle(CDIUIMessages.NEW_INTERCEPTOR_WIZARD_TITLE);
}
@@ -41,7 +31,8 @@
super.addPages();
if (fPage == null) {
fPage = new NewInterceptorWizardPage();
- fPage.init(getSelection());
+ ((NewInterceptorWizardPage)fPage).init(getSelection());
+ initPageFromAdapter();
}
addPage(fPage);
}
@@ -53,37 +44,4 @@
return !fPage.isEnclosingTypeSelected();
}
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
- fPage.createType(monitor); // use the full progress monitor
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- warnAboutTypeCommentDeprecation();
- boolean res= super.performFinish();
- if (res) {
- IResource resource= fPage.getModifiedResource();
- if (resource != null) {
- selectAndReveal(resource);
- if (fOpenEditorOnFinish) {
- openResource((IFile) resource);
- }
- }
- }
- return res;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#getCreatedElement()
- */
- public IJavaElement getCreatedElement() {
- return fPage.getCreatedType();
- }
-
-
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeCreationWizard.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeCreationWizard.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -28,4 +28,11 @@
return new NewStereotypeWizardPage();
}
+ protected void initPageFromAdapter() {
+ super.initPageFromAdapter();
+ if(adapter != null) {
+ ((NewStereotypeWizardPage)fPage).setAlternative(true);
+ }
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java 2011-01-31 14:12:36 UTC (rev 28757)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewStereotypeWizardPage.java 2011-01-31 14:14:07 UTC (rev 28758)
@@ -54,6 +54,8 @@
protected ListFieldEditor stereotypes = null;
protected ListFieldEditor interceptorBindings = null;
+ boolean isAlternativeInitialValue = false;
+
protected StatusInfo targetStatus = new StatusInfo();
public NewStereotypeWizardPage() {
@@ -138,7 +140,7 @@
protected void createAlternativeField(Composite composite) {
String label = "Add @Alternative";
- alternative = createCheckBoxField(composite, "isAlternative", label, false);
+ alternative = createCheckBoxField(composite, "isAlternative", label, isAlternativeInitialValue);
}
protected void createNamedField(Composite composite) {
@@ -325,4 +327,12 @@
stereotypes.setValue(nvs);
}
+ public void setAlternative(boolean value) {
+ if(alternative != null) {
+ alternative.composite.setValue(Boolean.valueOf(value));
+ } else {
+ isAlternativeInitialValue = value;
+ }
+ }
+
}
13 years, 11 months
JBoss Tools SVN: r28757 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
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;
13 years, 11 months
JBoss Tools SVN: r28756 - trunk/drools/docs/guvnor_ref/en-US.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-01-31 08:53:58 -0500 (Mon, 31 Jan 2011)
New Revision: 28756
Modified:
trunk/drools/docs/guvnor_ref/en-US/introduction.xml
Log:
Remove Eclipse version from Requirements section
Modified: trunk/drools/docs/guvnor_ref/en-US/introduction.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en-US/introduction.xml 2011-01-31 13:48:46 UTC (rev 28755)
+++ trunk/drools/docs/guvnor_ref/en-US/introduction.xml 2011-01-31 13:53:58 UTC (rev 28756)
@@ -115,7 +115,7 @@
<itemizedlist>
<listitem>
<para>
- Eclipse 3.4.x with Jboss Tools bundle of Eclipse plugins installed. How to install JBoss Tools onto Eclipse you can find in the JBoss Tools Installation section.
+ Eclipse IDE with installed JBoss Tools plugins. How to install JBoss Tools onto Eclipse you can find in the JBoss Tools Installation section.
</para>
</listitem>
13 years, 11 months
JBoss Tools SVN: r28755 - trunk/drools/docs/guvnor_ref/en-US.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-01-31 08:48:46 -0500 (Mon, 31 Jan 2011)
New Revision: 28755
Modified:
trunk/drools/docs/guvnor_ref/en-US/conclusion.xml
Log:
Fix typo Jboss -> JBoss
Modified: trunk/drools/docs/guvnor_ref/en-US/conclusion.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en-US/conclusion.xml 2011-01-31 13:48:02 UTC (rev 28754)
+++ trunk/drools/docs/guvnor_ref/en-US/conclusion.xml 2011-01-31 13:48:46 UTC (rev 28755)
@@ -47,7 +47,7 @@
</listitem>
</itemizedlist>
<para>
- If you have some questions, comments or suggestions on the topic, please feel free to ask in the <ulink url="http://www.jboss.org/index.html?module=bb&op=viewforum&f=201">Jboss Tools Forum</ulink>.
+ If you have some questions, comments or suggestions on the topic, please feel free to ask in the <ulink url="http://www.jboss.org/index.html?module=bb&op=viewforum&f=201">JBoss Tools Forum</ulink>.
</para>
</section>
</chapter>
13 years, 11 months