JBoss Tools SVN: r4183 - trunk/struts/plugins/org.jboss.tools.struts.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 09:13:48 -0400 (Mon, 15 Oct 2007)
New Revision: 4183
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.properties
trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml
Log:
JBIDE-535
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.properties
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.properties 2007-10-15 13:11:33 UTC (rev 4182)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.properties 2007-10-15 13:13:48 UTC (rev 4183)
@@ -19,8 +19,6 @@
popupMenus.action.modulesConfiguration=Modules Configuration
popupMenus.action.verify=Verify
popupMenus.action.removeStrutsNature=Remove Struts Capabilities
-popupMenus.action.registerInServerXml=Register Web Context in server.xml
-popupMenus.action.unregisterFromServerXml=Unregister Web Context from server.xml
actionSets.projectActions.label=Red Hat Developer Studio Project Actions
actionSets.projectActions.description=Description For Red Hat Developer Studio Project Actions
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml 2007-10-15 13:11:33 UTC (rev 4182)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml 2007-10-15 13:13:48 UTC (rev 4183)
@@ -117,10 +117,6 @@
</action>
<action class="org.jboss.tools.struts.ui.internal.action.RemoveStrutsNatureActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RemoveStrutsNatureActionDelegate" label="%popupMenus.action.removeStrutsNature" menubarPath="RedHat4Web/d">
</action>
- <!--action class="org.jboss.tools.struts.ui.internal.action.UnregisterFromServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.UnregisterFromServerXmlActionDelegate" label="%popupMenus.action.unregisterFromServerXml" menubarPath="RedHat4Web/c">
- </action-->
- <!--action class="org.jboss.tools.struts.ui.internal.action.RegisterInServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RegisterInServerXmlActionDelegate" label="%popupMenus.action.registerInServerXml" menubarPath="RedHat4Web/c">
- </action-->
<action class="org.jboss.tools.struts.ui.internal.action.ModulesConfigurationActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.ModulesConfigurationActionDelegate" label="%popupMenus.action.modulesConfiguration" menubarPath="RedHat4Web/b">
</action>
</objectContribution>
@@ -139,10 +135,6 @@
</action>
<action class="org.jboss.tools.struts.ui.internal.action.RemoveStrutsNatureActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RemoveStrutsNatureActionDelegate" label="%popupMenus.action.removeStrutsNature" menubarPath="RedHat4Web/d">
</action>
- <!--action class="org.jboss.tools.struts.ui.internal.action.UnregisterFromServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.UnregisterFromServerXmlActionDelegate" label="%popupMenus.action.unregisterFromServerXml" menubarPath="RedHat4Web/c">
- </action-->
- <!--action class="org.jboss.tools.struts.ui.internal.action.RegisterInServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RegisterInServerXmlActionDelegate" label="%popupMenus.action.registerInServerXml" menubarPath="RedHat4Web/c">
- </action-->
<action class="org.jboss.tools.struts.ui.internal.action.ModulesConfigurationActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.ModulesConfigurationActionDelegate" label="%popupMenus.action.modulesConfiguration" menubarPath="RedHat4Web/b">
</action>
</objectContribution>
17 years, 3 months
JBoss Tools SVN: r4182 - trunk/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 09:11:33 -0400 (Mon, 15 Oct 2007)
New Revision: 4182
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
JBIDE-535
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-10-15 12:51:25 UTC (rev 4181)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-10-15 13:11:33 UTC (rev 4182)
@@ -191,10 +191,10 @@
<separator name="d">
</separator>
</menu>
- <action class="org.jboss.tools.jst.web.ui.action.UnregisterFromServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.UnregisterFromServerXmlActionDelegate" label="%popupMenus.action.unregisterFromServerXml" menubarPath="RedHat4Web/c">
- </action>
- <action class="org.jboss.tools.jst.web.ui.action.RegisterInServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RegisterInServerXmlActionDelegate" label="%popupMenus.action.registerInServerXml" menubarPath="RedHat4Web/c">
- </action>
+ <!--action class="org.jboss.tools.jst.web.ui.action.UnregisterFromServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.UnregisterFromServerXmlActionDelegate" label="%popupMenus.action.unregisterFromServerXml" menubarPath="RedHat4Web/c">
+ </action-->
+ <!--action class="org.jboss.tools.jst.web.ui.action.RegisterInServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RegisterInServerXmlActionDelegate" label="%popupMenus.action.registerInServerXml" menubarPath="RedHat4Web/c">
+ </action-->
<action class="org.jboss.tools.jst.web.ui.action.SaveProjectAsTemplateActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.SaveProjectAsTemplateActionDelegate" label="%popupMenus.action.saveAsTemplate" menubarPath="RedHat4Web/c">
</action>
</objectContribution>
@@ -209,10 +209,10 @@
<separator name="d">
</separator>
</menu>
- <action class="org.jboss.tools.jst.web.ui.action.UnregisterFromServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.UnregisterFromServerXmlActionDelegate" label="%popupMenus.action.unregisterFromServerXml" menubarPath="RedHat4Web/c">
- </action>
- <action class="org.jboss.tools.jst.web.ui.action.RegisterInServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RegisterInServerXmlActionDelegate" label="%popupMenus.action.registerInServerXml" menubarPath="RedHat4Web/c">
- </action>
+ <!--action class="org.jboss.tools.jst.web.ui.action.UnregisterFromServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.UnregisterFromServerXmlActionDelegate" label="%popupMenus.action.unregisterFromServerXml" menubarPath="RedHat4Web/c">
+ </action-->
+ <!--action class="org.jboss.tools.jst.web.ui.action.RegisterInServerXmlActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.RegisterInServerXmlActionDelegate" label="%popupMenus.action.registerInServerXml" menubarPath="RedHat4Web/c">
+ </action-->
<action class="org.jboss.tools.jst.web.ui.action.SaveProjectAsTemplateActionDelegate" enablesFor="*" id="org.jboss.tools.common.xstudio.action.SaveProjectAsTemplateActionDelegate" label="%popupMenus.action.saveAsTemplate" menubarPath="RedHat4Web/c">
</action>
</objectContribution>
@@ -505,8 +505,6 @@
class="org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData"/>
<xclass id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"
class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"/>
- <xclass id="org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard"
- class="org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard"/>
<xclass id="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"
class="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"/>
</extension>
17 years, 3 months
JBoss Tools SVN: r4181 - trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 08:51:25 -0400 (Mon, 15 Oct 2007)
New Revision: 4181
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
Log:
JBIDE-771
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2007-10-15 12:42:47 UTC (rev 4180)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/web.meta 2007-10-15 12:51:25 UTC (rev 4181)
@@ -1190,7 +1190,7 @@
</XModelAttribute>
<XModelAttribute name="application name" xmlname="NAME">
<Constraint loader="FolderName"/>
- <Editor/>
+ <Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="location" visibility="false" xmlname="LOCATION">
<Constraint loader="FileFilter">
17 years, 3 months
JBoss Tools SVN: r4180 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 08:42:47 -0400 (Mon, 15 Oct 2007)
New Revision: 4180
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java
Log:
JBIDE-1017
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java 2007-10-15 12:33:29 UTC (rev 4179)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java 2007-10-15 12:42:47 UTC (rev 4180)
@@ -105,11 +105,12 @@
String message = NLS.bind(JSFUIMessages.PROJECT_HAS_COFLICTING_LIBRARIES, conflictingFiles[0].getName() );
int q = d.showDialog(JSFUIMessages.WARNING, message, new String[]{JSFUIMessages.YES, JSFUIMessages.NO, JSFUIMessages.CANCEL}, null, ServiceDialog.WARNING);
if(q == 2) {
- context.monitor.setCanceled(true);
return false;
}
if(q == 1) {
- return false;
+ conflictingFiles = null;
+ if(jarPerformers != null) for (int i = 0; i < jarPerformers.length; i++) jarPerformers[i].setSelected(false);
+ return true;
}
}
17 years, 3 months
JBoss Tools SVN: r4179 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-10-15 08:33:29 -0400 (Mon, 15 Oct 2007)
New Revision: 4179
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-926 DataSourceXMLDeployer chooses first server that matches runtime when several may match
The server selection combo and "New..." Server dialog are added to the first wizard page
ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER (String) property now contains a name for the server selected
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-10-15 12:33:13 UTC (rev 4178)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-10-15 12:33:29 UTC (rev 4179)
@@ -48,7 +48,9 @@
org.eclipse.datatools.connectivity.db.generic.ui,
org.eclipse.datatools.connectivity.db.generic,
org.jboss.tools.common.model.ui,
- org.hibernate.eclipse
+ org.hibernate.eclipse,
+ org.eclipse.wst.server.core,
+ org.eclipse.wst.server.ui
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.actions,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-10-15 12:33:13 UTC (rev 4178)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-10-15 12:33:29 UTC (rev 4179)
@@ -343,6 +343,8 @@
public static String VALIDATOR_FACTORY_SELECTED_PROJECT;
+ public static String SEAM_TARGET_RUNTIME;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, SeamUIMessages.class);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-10-15 12:33:13 UTC (rev 4178)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-10-15 12:33:29 UTC (rev 4179)
@@ -168,3 +168,4 @@
SEAM_RUNTIME_LIST_FIELD_EDITOR_THE_SELECTED_SEAM_APPEARS_TO_BE_OF_INCOMATIBLE_VERSION=The selected seam appears to be of an incompatible version '
SEAM_GENERATE_ENTITIES_WIZARD_THIS_METHOD_IS_NOT_RELEVANT_IN_GENERATING_SEAM_ENTITIES=This method is not relevant in generating seam entities.
SEAM_FORM_WIZARD_PAGE1_JAVA_INTERFACE_SLSB_AND_KEY_SEAMEJB3_ANNOTATIONS_WILL_BE_CREATED=Java Interface, SLSB and key Seam/EJB3 annotations will be created.
+SEAM_TARGET_RUNTIME=Target Server
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-10-15 12:33:13 UTC (rev 4178)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-10-15 12:33:29 UTC (rev 4179)
@@ -10,15 +10,37 @@
******************************************************************************/
package org.jboss.tools.seam.ui.wizard;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jst.servlet.ui.project.facet.WebProjectFirstPage;
import org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.server.ui.ServerUIUtil;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage;
@@ -40,9 +62,16 @@
setWindowTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_NEW_SEAM_PROJECT);
}
+ protected IDataModel createDataModel() {
+ return DataModelFactory.createDataModel(new SeamFacetProjectCreationDataModelProvider());
+ }
+
@Override
protected IWizardPage createFirstPage() {
- IWizardPage page = super.createFirstPage();
+// IWizardPage page = super.createFirstPage();
+
+ IWizardPage page = new SeamWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
+
page.setImageDescriptor(ImageDescriptor.createFromFile(SeamFormWizard.class, "SeamWebProjectWizBan.png")); //$NON-NLS-1$
page.setTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_SEAM_WEB_PROJECT);
page.setDescription(SeamUIMessages.SEAM_PROJECT_WIZARD_CREATE_STANDALONE_SEAM_WEB_PROJECT);
@@ -53,7 +82,8 @@
public void createPageControls(Composite container) {
super.createPageControls(container);
Control control = findGroupByText(getShell(), SeamUIMessages.SEAM_PROJECT_WIZARD_EAR_MEMBERSHIP);
- control.setVisible(false);
+ if (control != null)
+ control.setVisible(false);
}
@@ -89,7 +119,6 @@
return "org.jboss.tools.seam.ui.SeamPerspective"; //$NON-NLS-1$
}
- @Override
protected IFacetedProjectTemplate getTemplate() {
return ProjectFacetsManager.getTemplate("template.jst.seam"); //$NON-NLS-1$
}
@@ -103,4 +132,136 @@
page.finishPressed();
return super.performFinish();
}
+
+ class SeamWebProjectFirstPage extends WebProjectFirstPage {
+
+ public SeamWebProjectFirstPage(IDataModel model, String pageName ) {
+ super(model, pageName);
+ }
+
+ protected Combo matchedServerTargetCombo;
+
+ protected Composite createTopLevelComposite(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(top, getInfopopID());
+ top.setLayout(new GridLayout());
+ top.setLayoutData(new GridData(GridData.FILL_BOTH));
+ createProjectGroup(top);
+ createServerTargetComposite(top);
+ createSeamServerTargetComposite(top);
+ createPresetPanel(top);
+ return top;
+ }
+
+
+ protected void createSeamServerTargetComposite(Composite parent) {
+// super.createServerTargetComposite(parent);
+ Group group = new Group(parent, SWT.NONE);
+ group.setText(SeamUIMessages.SEAM_TARGET_RUNTIME);
+ group.setLayoutData(gdhfill());
+ group.setLayout(new GridLayout(2, false));
+
+ matchedServerTargetCombo = new Combo(group, SWT.BORDER | SWT.READ_ONLY);
+ matchedServerTargetCombo.setLayoutData(gdhfill());
+ Button newMatchedServerTargetButton = new Button(group, SWT.NONE);
+ newMatchedServerTargetButton.setText(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_NEW);
+ newMatchedServerTargetButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (!SeamWebProjectFirstPage.this.internalLaunchNewServerWizard(getShell(), model)) {
+ //Bugzilla 135288
+ //setErrorMessage(ResourceHandler.InvalidServerTarget);
+ }
+ }
+ });
+ Control[] depsMatched = new Control[]{serverTargetCombo, newMatchedServerTargetButton};
+ synchHelper.synchCombo(matchedServerTargetCombo, ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, depsMatched);
+ if (matchedServerTargetCombo.getSelectionIndex() == -1 && matchedServerTargetCombo.getVisibleItemCount() != 0)
+ matchedServerTargetCombo.select(0);
+ }
+
+ protected String[] getValidationPropertyNames() {
+ String[] superProperties = super.getValidationPropertyNames();
+ List list = Arrays.asList(superProperties);
+ ArrayList arrayList = new ArrayList();
+ arrayList.addAll( list );
+ arrayList.add( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ arrayList.add( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ return (String[])arrayList.toArray( new String[0] );
+ }
+
+ public boolean launchNewServerWizard(Shell shell, IDataModel model) {
+ return launchNewServerWizard(shell, model, null);
+ }
+
+ public boolean launchNewServerWizard(Shell shell, IDataModel model, String serverTypeID) {
+ DataModelPropertyDescriptor[] preAdditionDescriptors = model.getValidPropertyDescriptors(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ IRuntime rt = (IRuntime)model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+
+ boolean isOK = ServerUIUtil.showNewServerWizard(shell, serverTypeID, null, (rt == null ? null : null));
+ if (isOK && model != null) {
+
+ DataModelPropertyDescriptor[] postAdditionDescriptors = model.getValidPropertyDescriptors(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ Object[] preAddition = new Object[preAdditionDescriptors.length];
+ for (int i = 0; i < preAddition.length; i++) {
+ preAddition[i] = preAdditionDescriptors[i].getPropertyValue();
+ }
+ Object[] postAddition = new Object[postAdditionDescriptors.length];
+ for (int i = 0; i < postAddition.length; i++) {
+ postAddition[i] = postAdditionDescriptors[i].getPropertyValue();
+ }
+ Object newAddition = null;
+
+ if (preAddition != null && postAddition != null && preAddition.length < postAddition.length) {
+ for (int i = 0; i < postAddition.length; i++) {
+ boolean found = false;
+ Object object = postAddition[i];
+ for (int j = 0; j < preAddition.length; j++) {
+ if (preAddition[j] == object) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ newAddition = object;
+ }
+ }
+ }
+ if (preAddition == null && postAddition != null && postAddition.length == 1)
+ newAddition = postAddition[0];
+
+ model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, IDataModel.VALID_VALUES_CHG);
+ if (newAddition != null)
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, newAddition);
+ else
+ return false;
+ }
+ return isOK;
+ }
+
+ public boolean internalLaunchNewServerWizard(Shell shell, IDataModel model) {
+ return launchNewServerWizard(shell, model, getModuleTypeID());
+ }
+
+ public void restoreDefaultSettings() {
+ super.restoreDefaultSettings();
+
+ String lastServerName = SeamFacetPreference
+ .getStringPreference(SeamFacetPreference.SEAM_LAST_SERVER_NAME);
+
+ if (lastServerName != null && lastServerName.length() > 0) {
+ SeamFacetProjectCreationDataModelProvider.setServerName(model,lastServerName);
+ }
+ }
+
+ public void storeDefaultSettings() {
+ super.storeDefaultSettings();
+ String serverName = SeamFacetProjectCreationDataModelProvider.getServerName(model);
+ if (serverName != null && serverName.length() > 0) {
+ SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ SeamFacetPreference.SEAM_LAST_SERVER_NAME,
+ serverName);
+ }
+ }
+
+ }
}
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r4178 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: core/project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-10-15 08:33:13 -0400 (Mon, 15 Oct 2007)
New Revision: 4178
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-926 DataSourceXMLDeployer chooses first server that matches runtime when several may match
The server selection combo and "New..." Server dialog are added to the first wizard page
ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER (String) property now contains a name for the server selected
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-10-15 12:18:52 UTC (rev 4177)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-10-15 12:33:13 UTC (rev 4178)
@@ -13,6 +13,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -122,4 +124,13 @@
IScopeContext projectScope = new ProjectScope(project);
return projectScope.getNode(PLUGIN_ID);
}
+
+ /**
+ * @param string
+ * @return
+ */
+ public static IStatus createErrorStatus(String message, Throwable exception) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, -1, message, exception);
+ }
+
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2007-10-15 12:18:52 UTC (rev 4177)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2007-10-15 12:33:13 UTC (rev 4178)
@@ -33,3 +33,9 @@
SEAM_VALIDATION_HELPER_RESOURCE_MUST_NOT_BE_NULL=Resource must not be null
SEAM_CORE_VALIDATOR_FACTORY_METHOD_MUST_HAVE_NAME=Factory method must have name:
SEAM_EL_VALIDATOR_ERROR_VALIDATING_SEAM_EL=Error validating Seam EL
+ERROR_JBOSS_AS_TARGET_SERVER_IS_EMPTY=Target Server cannot be empty
+ERROR_JBOSS_AS_TARGET_SERVER_UNKNOWN=Unknown Target Server
+ERROR_JBOSS_AS_TARGET_SERVER_NO_SERVERS_DEFINED=There are no available Target Service for selected Target Runtime
+ERROR_JBOSS_AS_TARGET_SERVER_INCOMPATIBLE=Target Server is incompatible with Target Runtime selected
+ERROR_JBOSS_AS_TARGET_RUNTIME_IS_EMPTY=Target Runtime cannot be empty", null);
+ERROR_JBOSS_AS_TARGET_RUNTIME_UNKNOWN=Unknown Target Runtime
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java 2007-10-15 12:18:52 UTC (rev 4177)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java 2007-10-15 12:33:13 UTC (rev 4178)
@@ -32,6 +32,8 @@
= SeamCorePlugin.PLUGIN_ID + ".project.default.deployment.type"; //$NON-NLS-1$
public static final String HIBERNATE_DEFAULT_DB_TYPE
= SeamCorePlugin.PLUGIN_ID + ".hibernate.default.db.type"; //$NON-NLS-1$
+ public static final String SEAM_LAST_SERVER_NAME
+ = SeamCorePlugin.PLUGIN_ID + ".project.facet.last.server.name"; //$NON-NLS-1$
public static String getStringPreference(final String name) {
return SeamCorePlugin.getDefault().getPreferenceStore().getString(name);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-10-15 12:18:52 UTC (rev 4177)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-10-15 12:33:13 UTC (rev 4178)
@@ -81,4 +81,7 @@
public static final String DEPLOY_AS_WAR = "war"; //$NON-NLS-1$
public static final String DEPLOY_AS_EAR = "ear"; //$NON-NLS-1$
+
+ public static final String JBOSS_AS_TARGET_SERVER = "seam.project.deployment.target"; //$NON-NLS-1$
+ public static final String JBOSS_AS_TARGET_RUNTIME = "seam.project.deployment.runtime"; //$NON-NLS-1$
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-10-15 12:18:52 UTC (rev 4177)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-10-15 12:33:13 UTC (rev 4178)
@@ -53,6 +53,8 @@
names.add(ISeamFacetDataModelProperties.JBOSS_AS_HOME);
names.add(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME);
names.add(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
+ names.add(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ names.add(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
// Database group
names.add(ISeamFacetDataModelProperties.DB_TYPE);
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2007-10-15 12:33:13 UTC (rev 4178)
@@ -0,0 +1,242 @@
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.j2ee.internal.web.archive.operations.WebFacetProjectCreationDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.tools.seam.core.SeamCoreMessages;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+public class SeamFacetProjectCreationDataModelProvider extends WebFacetProjectCreationDataModelProvider {
+
+ public static IStatus OK_STATUS = new Status(IStatus.OK, SeamCorePlugin.PLUGIN_ID, 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
+
+ public SeamFacetProjectCreationDataModelProvider() {
+ super();
+ }
+
+ public void init() {
+ super.init();
+ FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
+ IDataModel seamFacet = DataModelFactory.createDataModel(new SeamFacetInstallDataModelProvider());
+ map.add(seamFacet);
+
+ seamFacet.addListener(new IDataModelListener() {
+ public void propertyChanged(DataModelEvent event) {
+ if (ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME.equals(event.getPropertyName())) {
+// if (isPropertySet(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME))
+// setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, event.getProperty());
+// else
+//
+ setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, event.getProperty());
+ model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, IDataModel.DEFAULT_CHG);
+ model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, IDataModel.VALID_VALUES_CHG);
+ }
+ }
+ });
+
+/*
+ IDataModel webFacet = DataModelFactory.createDataModel(new WebFacetInstallDataModelProvider());
+ map.add(webFacet);
+
+ String webRoot = webFacet.getStringProperty(IWebFacetInstallDataModelProperties.CONFIG_FOLDER);
+ String webSrc = webFacet.getStringProperty(IWebFacetInstallDataModelProperties.SOURCE_FOLDER);
+ javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, webSrc);
+ // If using optimized single root structure, set the output folder to "<content folder>/WEB-INF/classes"
+ if (ProductManager.shouldUseSingleRootStructure())
+ javaFacet.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME, webRoot+"/"+J2EEConstants.WEB_INF_CLASSES); //$NON-NLS-1$
+ webFacet.addListener(new IDataModelListener() {
+ public void propertyChanged(DataModelEvent event) {
+ if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) {
+ if (isPropertySet(EAR_PROJECT_NAME))
+ setProperty(EAR_PROJECT_NAME, event.getProperty());
+ else
+ model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG);
+ }else if (IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR.equals(event.getPropertyName())) {
+ setProperty(ADD_TO_EAR, event.getProperty());
+ }
+ }
+ });
+*/
+ Collection requiredFacets = (Collection)getProperty(REQUIRED_FACETS_COLLECTION);
+ requiredFacets.add(ProjectFacetsManager.getProjectFacet(seamFacet.getStringProperty(IFacetDataModelProperties.FACET_ID)));
+ setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
+ }
+
+ public boolean propertySet(String propertyName, Object propertyValue) {
+ if( propertyName.equals( IFacetProjectCreationDataModelProperties.FACET_RUNTIME )){
+ FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
+ IDataModel seamFacet = map.getFacetDataModel( ISeamCoreConstants.SEAM_CORE_FACET_ID );
+ seamFacet.setProperty( ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, propertyValue );
+ }
+
+ return super.propertySet(propertyName, propertyValue);
+ }
+
+ public Set getPropertyNames() {
+ Set names = super.getPropertyNames();
+ names.add(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ names.add(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ return names;
+ }
+
+ public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
+ if (ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER.equals(propertyName)) {
+ Collection projectFacets = (Collection)getProperty(REQUIRED_FACETS_COLLECTION);
+ Object rt = getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ String primaryName = getRuntimeName(rt);
+
+ List<IServer> list = getServers(primaryName);
+
+ DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[list.size() + 1];
+
+ Iterator<IServer> iterator = list.iterator();
+ for (int i = 0; i < descriptors.length - 1; i++) {
+ IServer server = (IServer) iterator.next();
+ descriptors[i] = new DataModelPropertyDescriptor(server, server.getName());
+ }
+ descriptors[descriptors.length - 1] = new DataModelPropertyDescriptor(null, "<None>");
+
+ if(descriptors.length > 2){
+ Arrays.sort(descriptors, 0, descriptors.length - 2, new Comparator() {
+ public int compare(Object arg0, Object arg1) {
+ DataModelPropertyDescriptor d1 = (DataModelPropertyDescriptor)arg0;
+ DataModelPropertyDescriptor d2 = (DataModelPropertyDescriptor)arg1;
+ return d1.getPropertyDescription().compareTo(d2.getPropertyDescription());
+ }
+ });
+ }
+
+ return descriptors;
+ }
+ return super.getValidPropertyDescriptors(propertyName);
+ }
+
+ private List<IServer> getServers(String runtimeName) {
+ ArrayList<IServer> list = new ArrayList<IServer>();
+
+ if (runtimeName != null) {
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server : servers) {
+ IRuntime runtime = server.getRuntime();
+ if(runtime!=null) {
+ String serverRuntimeName = runtime.getName();
+ if(runtimeName.equals(serverRuntimeName)) {
+ list.add(server);
+ }
+ }
+ }
+ }
+ return list;
+ }
+ public IStatus validate(String propertyName) {
+ IStatus status = super.validate(propertyName);
+ if (status != null && !status.isOK())
+ return status;
+
+ if (ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER.equals(propertyName)) {
+ IServer server = (IServer)model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ status = validateServer(server);
+ if (!status.isOK())
+ return status;
+ }
+ if(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME.equals(propertyName)) {
+ org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime =
+ (org.eclipse.wst.common.project.facet.core.runtime.IRuntime)model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ status = validateRuntime(runtime);
+ if (!status.isOK())
+ return status;
+ }
+ return OK_STATUS;
+ }
+
+ IStatus validateServer(Object serverObject) {
+ if (serverObject == null) {
+ return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_SERVER_IS_EMPTY"), null);
+ }
+
+ IServer s = (serverObject instanceof IServer ? (IServer)serverObject : null);
+
+ if (s == null) {
+ return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_SERVER_UNKNOWN"), null);
+ }
+
+ Object rt = getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME);
+ String primaryRuntimeName = getRuntimeName(rt);
+
+ List<IServer> servers = getServers(primaryRuntimeName);
+ if (servers.isEmpty()) {
+ return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_SERVER_NO_SERVERS_DEFINED"), null);
+ }
+
+ for (IServer server : servers) {
+ if (s.equals(server)) {
+ return OK_STATUS;
+ }
+ }
+
+ return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_SERVER_INCOMPATIBLE"), null);
+ }
+
+ private String getRuntimeName(Object rt) {
+ String rtName = null;
+ if (rt instanceof org.eclipse.wst.common.project.facet.core.runtime.IRuntime) {
+ rtName = ((org.eclipse.wst.common.project.facet.core.runtime.IRuntime)rt).getName();
+ } else if (rt instanceof IRuntime) {
+ rtName = ((IRuntime)rt).getName();
+ }
+ return rtName;
+ }
+
+ IStatus validateRuntime(Object runtimeObject) {
+ if (runtimeObject == null) {
+ return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_RUNTIME_IS_EMPTY"), null);
+ }
+ if (getRuntimeName(runtimeObject) == null) {
+ return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_RUNTIME_UNKNOWN"), null);
+ }
+
+ return OK_STATUS;
+ }
+
+ public static String getServerName(IDataModel model) {
+ Object serverObject = model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
+ if (!(serverObject instanceof IServer))
+ return "";
+
+ IServer server = (IServer)serverObject;
+ return (server.getName() == null ? "" : server.getName());
+ }
+
+ public static void setServerName(IDataModel model, String serverName) {
+ if (serverName == null)
+ return;
+
+ IServer[] servers = ServerCore.getServers();
+ for (IServer server : servers) {
+ if(serverName.equals(server.getName())) {
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, server);
+ return;
+ }
+ }
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
JBoss Tools SVN: r4177 - trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 08:18:52 -0400 (Mon, 15 Oct 2007)
New Revision: 4177
Modified:
trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFCapabilities.xml
Log:
JBIDE-1017
Modified: trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFCapabilities.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFCapabilities.xml 2007-10-15 12:18:25 UTC (rev 4176)
+++ trunk/common/plugins/org.jboss.tools.common.projecttemplates/templates/JSFCapabilities.xml 2007-10-15 12:18:52 UTC (rev 4177)
@@ -63,6 +63,7 @@
</capability>
<capability name="JBoss RichFaces 3.1">
<library name="RichFaces" />
+ <conflicting-library name="a4j.jar"/>
<file-addition file-name="/WEB-INF/web.xml"
label="Skin Parameter" x-path="/web-app">
<![CDATA[<context-param>
17 years, 3 months
JBoss Tools SVN: r4176 - in trunk/jsf/plugins/org.jboss.tools.jsf: src/org/jboss/tools/jsf/messages and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 08:18:25 -0400 (Mon, 15 Oct 2007)
New Revision: 4176
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsfcapabilities.meta
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/CapabilityPerformer.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java
Log:
JBIDE-1017
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsfcapabilities.meta
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsfcapabilities.meta 2007-10-15 11:34:21 UTC (rev 4175)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/meta/jsfcapabilities.meta 2007-10-15 12:18:25 UTC (rev 4176)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN" "meta.dtd">
+<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
+ "meta.dtd">
<XModelEntityGroup>
<VERSION DEPENDS="Model:1.0" MODULE="Struts Editor" VERSION="1.0"/>
<MAPPINGS/>
@@ -19,11 +20,9 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="capabilities list" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute default="Capabilities" name="name">
- <Constraint/>
<Editor name="AccessibleJava"/>
</XModelAttribute>
</XModelAttributes>
@@ -59,6 +58,7 @@
<XModelEntity ImplementingClass="%Custom%" XMLSUBPATH="capability" name="JSFCapability">
<XChildrenEntities>
<XChildEntity name="JSFLibraryReference"/>
+ <XChildEntity name="JSFConflictingLibraryReference"/>
<XChildEntity name="JSFFileAddition"/>
</XChildrenEntities>
<XEntityRenderer>
@@ -68,12 +68,10 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="jsf capability" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true" name="name" xmlname="name">
<Constraint loader="Text"/>
- <Editor/>
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
@@ -123,6 +121,52 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ XMLSUBPATH="conflicting-library" name="JSFConflictingLibraryReference">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.jsf.application" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="library" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" name="name" xmlname="name">
+ <Constraint loader="ListString"/>
+ <Editor name="LibrarySetList"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HandlerClassName="%Edit%" ICON="action.empty"
+ PROPERTIES="validator.edit=true" WizardClassName="%Default%"
+ displayName="Edit" kind="action" name="Edit">
+ <EntityData EntityName="JSFLibraryReference">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%Custom%" XMLSUBPATH="file-addition" name="JSFFileAddition">
<XChildrenEntities/>
<XEntityRenderer>
@@ -132,27 +176,13 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="config file addition" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="id=true" name="label" xmlname="label">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="file name" xmlname="file-name">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="x-path" xmlname="x-path">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="preferred position" visibility="false" xmlname="preferred-position">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" name="label" xmlname="label"/>
+ <XModelAttribute name="file name" xmlname="file-name"/>
+ <XModelAttribute name="x-path" xmlname="x-path"/>
+ <XModelAttribute name="preferred position" visibility="false" xmlname="preferred-position"/>
<XModelAttribute PROPERTIES="greedy=always" name="text" xmlname="CDATA">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -197,7 +227,6 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="library" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true" name="name" xmlname="name">
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java 2007-10-15 11:34:21 UTC (rev 4175)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java 2007-10-15 12:18:25 UTC (rev 4176)
@@ -76,6 +76,7 @@
public static String CLOSE;
public static String PROJECT_ALREADY_HAS_SOME_OF_LIBRARIES_INCLUDED;
public static String PROJECT_ALREADY_HAS_SOME_OF_LIBRARIES_INCLUDED_2;
+ public static String PROJECT_HAS_COFLICTING_LIBRARIES;
public static String CONTINUE;
public static String OVERWRITE;
public static String CANNOT_LOAD_JSF_CAPABILITIES;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2007-10-15 11:34:21 UTC (rev 4175)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2007-10-15 12:18:25 UTC (rev 4176)
@@ -53,6 +53,7 @@
CLOSE = Close
PROJECT_ALREADY_HAS_SOME_OF_LIBRARIES_INCLUDED = The project already has some of libraries included into the capability ({0}). Existing files will be overwritten and any new files will be added.
PROJECT_ALREADY_HAS_SOME_OF_LIBRARIES_INCLUDED_2 = The project already has some of libraries included into the capability ({0} and {1} more). Existing files will be overwritten and any new files will be added.
+PROJECT_HAS_COFLICTING_LIBRARIES = The project has conflicting library {0}. Do you want to replace it with selected libraries?
CONTINUE = Continue
OVERWRITE = Overwrite
CANNOT_LOAD_JSF_CAPABILITIES = Cannot load JSF Capabilities
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/CapabilityPerformer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/CapabilityPerformer.java 2007-10-15 11:34:21 UTC (rev 4175)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/CapabilityPerformer.java 2007-10-15 12:18:25 UTC (rev 4176)
@@ -35,7 +35,7 @@
public void init(XModel model, XModelObject capability) {
this.model = model;
this.capability = capability;
- librariesPerformer.init(model, capability.getChildren("JSFLibraryReference"));
+ librariesPerformer.init(model, capability.getChildren("JSFLibraryReference"), capability.getChildren("JSFConflictingLibraryReference"));
fileAdditionsPerformer.init(model, capability);
}
@@ -43,7 +43,7 @@
if(!isSelected()) return true;
context.monitor.worked(1);
context.monitor.subTask(getDisplayName());
- if(!librariesPerformer.check()) return false;
+ if(!librariesPerformer.check(context)) return false;
if(!fileAdditionsPerformer.check()) return false;
if(!fileAdditionsPerformer.execute(context)) return true;
librariesPerformer.execute(context);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java 2007-10-15 11:34:21 UTC (rev 4175)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/capabilities/LibrariesPerformer.java 2007-10-15 12:18:25 UTC (rev 4176)
@@ -14,6 +14,8 @@
import java.util.*;
import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
@@ -22,6 +24,7 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jst.web.project.WebProject;
import org.jboss.tools.jst.web.project.helpers.*;
@@ -32,6 +35,7 @@
IContainer libResource;
JarPerformer[] jarPerformers;
+ IFile[] conflictingFiles;
public LibrariesPerformer() {}
@@ -43,7 +47,7 @@
return jarPerformers;
}
- public void init(XModel model, XModelObject[] libraryReferences) {
+ public void init(XModel model, XModelObject[] libraryReferences, XModelObject[] conflictingLibraryReferences) {
this.model = model;
lib = model.getByPath("FileSystems/lib");
if(lib == null) {
@@ -78,14 +82,39 @@
}
}
jarPerformers = l2.toArray(new JarPerformer[0]);
+
+ conflictingFiles = null;
+ IContainer r = (IContainer)lib.getAdapter(IResource.class);
+ if(conflictingLibraryReferences != null && lib != null && r != null) {
+ ArrayList<IFile> cfjs = new ArrayList<IFile>();
+ for (int i = 0; i < conflictingLibraryReferences.length; i++) {
+ String name = conflictingLibraryReferences[i].getAttributeValue("name");
+ IFile f = r.getFile(new Path(name));
+ if(f.exists()) cfjs.add(f);
+ }
+ conflictingFiles = cfjs.toArray(new IFile[0]);
+ }
}
- public boolean check() {
+ public boolean check(PerformerContext context) {
if(!isSelected()) return true;
if(libResource == null) return false;
+ ServiceDialog d = model.getService();
+
+ if(conflictingFiles != null && conflictingFiles.length > 0) {
+ String message = NLS.bind(JSFUIMessages.PROJECT_HAS_COFLICTING_LIBRARIES, conflictingFiles[0].getName() );
+ int q = d.showDialog(JSFUIMessages.WARNING, message, new String[]{JSFUIMessages.YES, JSFUIMessages.NO, JSFUIMessages.CANCEL}, null, ServiceDialog.WARNING);
+ if(q == 2) {
+ context.monitor.setCanceled(true);
+ return false;
+ }
+ if(q == 1) {
+ return false;
+ }
+ }
+
String[] existing = getExistingJars();
if(existing.length == 0) return true;
- ServiceDialog d = model.getService();
String message;
if(existing.length > 1)
message = NLS.bind(JSFUIMessages.PROJECT_ALREADY_HAS_SOME_OF_LIBRARIES_INCLUDED_2, existing[0], "" + (existing.length-1) );
@@ -177,6 +206,18 @@
//ignore
}
}
+
+ if(conflictingFiles != null) {
+ for (int i = 0; i < conflictingFiles.length; i++) {
+ try {
+ conflictingFiles[i].delete(true, context.monitor);
+ context.changeList.add(capability + ": Removed " + conflictingFiles[i].getName() + " from WEB-INF/lib");
+ } catch (CoreException ce) {
+ JSFModelPlugin.getPluginLog().logError(ce);
+ }
+ }
+ }
+
context.monitor.worked(1);
return true;
}
17 years, 3 months
JBoss Tools SVN: r4175 - branches/jbosstools_xulrunner/vpe/tests.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-10-15 07:34:21 -0400 (Mon, 15 Oct 2007)
New Revision: 4175
Added:
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.xulrunner.test/
Removed:
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/
Log:
Copied: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.xulrunner.test (from rev 4174, branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test)
17 years, 3 months
JBoss Tools SVN: r4174 - in branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test: META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-10-15 06:58:39 -0400 (Mon, 15 Oct 2007)
New Revision: 4174
Added:
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeXulRunnerAllTests.java
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/XulRunnerBrowserTest.java
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/XulRunnerView.java
Removed:
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/mozilla/
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/MozillaBrowserTest.java
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeMozillaAllTests.java
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/MozillaView.java
Modified:
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/META-INF/MANIFEST.MF
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/plugin.xml
branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/DOMCreatingTest.java
Log:
Add XulRunner JUnit test
Modified: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/META-INF/MANIFEST.MF 2007-10-15 10:49:51 UTC (rev 4173)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/META-INF/MANIFEST.MF 2007-10-15 10:58:39 UTC (rev 4174)
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Mozilla Tests Plug-in
+Bundle-Name: XulRunner Tests Plug-in
Bundle-SymbolicName: org.jboss.tools.vpe.xulrunner.test;singleton:=true
Bundle-Version: 2.0.0
Bundle-Vendor: Red Hat, Inc.
@@ -8,7 +8,8 @@
org.eclipse.core.runtime,
org.junit,
org.jboss.tools.common,
- org.jboss.tools.vpe.xulrunner
+ org.jboss.tools.vpe.xulrunner,
+ org.mozilla.xpcom
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.vpe.xulrunner.tests,
org.jboss.tools.vpe.xulrunner.view
Modified: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/plugin.xml
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/plugin.xml 2007-10-15 10:49:51 UTC (rev 4173)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/plugin.xml 2007-10-15 10:58:39 UTC (rev 4174)
@@ -4,19 +4,19 @@
<extension
point="org.eclipse.ui.views">
<category
- id="org.jboss.tools.vpe.mozilla.view"
+ id="org.jboss.tools.vpe.xulrunner.view"
name="VPE Tests"/>
<view
- category="org.jboss.tools.vpe.mozilla.view"
- class="org.jboss.tools.vpe.xulrunner.view.MozillaView"
- id="org.jboss.tools.vpe.mozilla.view.MozillaView"
- name="Mozilla View"/>
+ category="org.jboss.tools.vpe.xulrunner.view"
+ class="org.jboss.tools.vpe.xulrunner.view.XulRunnerView"
+ id="org.jboss.tools.vpe.xulrunner.view.XulRunnerView"
+ name="XulRunner View"/>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
<view
- id="org.jboss.tools.vpe.mozilla.view.MozillaView"
+ id="org.jboss.tools.vpe.xulrunner.view.XulRunnerView"
ratio="0.5"
relationship="right"
relative="org.eclipse.ui.views.TaskList" />
Modified: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/DOMCreatingTest.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/DOMCreatingTest.java 2007-10-15 10:49:51 UTC (rev 4173)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/DOMCreatingTest.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -11,14 +11,14 @@
package org.jboss.tools.vpe.xulrunner.tests;
import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.vpe.mozilla.internal.swt.xpl.nsIDOMDocument;
-import org.jboss.tools.vpe.mozilla.browser.MozillaBrowser;
-import org.jboss.tools.vpe.xulrunner.view.MozillaView;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.jboss.tools.vpe.xulrunner.view.XulRunnerView;
+import org.mozilla.interfaces.nsIDOMAttr;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMText;
/**
* This class used for testing mozilla interfaces.
@@ -31,20 +31,20 @@
/**
* Contains brouser instamce
*/
- private MozillaBrowser mozillaBrowser;
+ private XulRunnerEditor xulrunnerBrowser;
/**
* Tests possability add and remove dom elements.
*
*/
public void testAddRemovingDOMElements() {
- Element root = mozillaBrowser.getDOMDocumentElement();
- nsIDOMDocument domDocument = mozillaBrowser.getDOMDocument();
- Element child = domDocument.createElement("test-element");
+ nsIDOMDocument domDocument = xulrunnerBrowser.getDOMDocument();
+ nsIDOMElement root = domDocument.getDocumentElement();
+ nsIDOMElement child = domDocument.createElement("test-element");
root.appendChild(child);
assertTrue("We doen't have elements to remove", root.getChildNodes()
.getLength() > 0);
- for (int i = root.getChildNodes().getLength() - 1; i >= 0; i--) {
+ for (long i = root.getChildNodes().getLength() - 1; i >= 0; i--) {
root.removeChild(root.getChildNodes().item(i));
}
root.appendChild(child);
@@ -57,37 +57,37 @@
*
* @throws Exception
*/
- public void testMozillaCreatingDOM() throws Exception {
+ public void testXulRunnerCreatingDOM() throws Exception {
String chieldName = "H";
String attrName = "color";
String attrValue = "TEST_VALUE";
- assertNotNull(mozillaBrowser);
- nsIDOMDocument domDocument = mozillaBrowser.getDOMDocument();
- Element root = mozillaBrowser.getDOMDocumentElement();
+ assertNotNull(xulrunnerBrowser);
+ nsIDOMDocument domDocument = xulrunnerBrowser.getDOMDocument();
+ nsIDOMElement root = domDocument.getDocumentElement();
- for (int i = root.getChildNodes().getLength() - 1; i >= 0; i--) {
+ for (long i = root.getChildNodes().getLength() - 1; i >= 0; i--) {
root.removeChild(root.getChildNodes().item(i));
}
// checks of creating elements with attributes and chield nodes
- Element child = domDocument.createElement("test-element");
+ nsIDOMElement child = domDocument.createElement("test-element");
for (int i = 0; i < 4; i++) {
child.appendChild(domDocument.createElement(chieldName + i));
}
for (int i = 0; i < 3; i++) {
child.setAttribute(attrName + i, attrValue + i);
}
- Attr attr = domDocument.createAttribute(attrName + 3);
+ nsIDOMAttr attr = domDocument.createAttribute(attrName + 3);
attr.setValue(attrValue + 3);
child.setAttributeNode(attr);
// append child element to root element
root.appendChild(child);
- Node toCheck = root.getChildNodes().item(0);
+ nsIDOMNode toCheck = root.getChildNodes().item(0);
assertEquals("We haven't add child element", toCheck.getNodeName(),
child.getNodeName());
assertEquals("Number of child nodes do not coincide", 4,child
.getChildNodes().getLength());
- NodeList nodeList = child.getChildNodes();
+ nsIDOMNodeList nodeList = child.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
assertEquals("Child node doesn't concide", nodeList.item(i)
.getNodeName(), chieldName + i);
@@ -99,7 +99,7 @@
assertEquals("Attribute values doesn't coinside", toCheck.getAttributes()
.item(i).getNodeValue(), attrValue + i);
}
- Text text = domDocument.createTextNode("TEST");
+ nsIDOMText text = domDocument.createTextNode("TEST");
root.appendChild(text);
assertEquals("Dom element hasn't been created", "TEST", text
.getNodeValue());
@@ -109,13 +109,13 @@
protected void setUp() throws Exception {
super.setUp();
waitForJobs();
- MozillaView mozilla
- = ((MozillaView) PlatformUI.getWorkbench()
+ XulRunnerView xulrunner
+ = ((XulRunnerView) PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().showView(VIEW_ID));
waitForJobs();
delay(3000);
- mozillaBrowser = mozilla.getBrowser();
+ xulrunnerBrowser = xulrunner.getBrowser();
}
@Override
Deleted: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/MozillaBrowserTest.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/MozillaBrowserTest.java 2007-10-15 10:49:51 UTC (rev 4173)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/MozillaBrowserTest.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * 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.vpe.xulrunner.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.vpe.xulrunner.view.MozillaView;
-
-public class MozillaBrowserTest extends TestCase {
- public static final String VIEW_ID
- = "org.jboss.tools.vpe.mozilla.view.MozillaView";
- /**
- * Process UI input but do not return for the
- * specified time interval.
- *
- * @param waitTimeMillis the number of milliseconds
- */
- protected void delay(long waitTimeMillis) {
- Display display = Display.getCurrent();
-
- // If this is the UI thread,
- // then process input.
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.update();
- }
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- }
- catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
-
-
- /**
- * Wait until all background tasks are complete.
- */
- public void waitForJobs() {
- while (Job.getJobManager().currentJob() != null)
- delay(1000);
- }
-
- public void testMozillaBrowser() throws PartInitException {
- waitForJobs();
- MozillaView mozillaView =
- (MozillaView) PlatformUI
- .getWorkbench()
- .getActiveWorkbenchWindow()
- .getActivePage()
- .showView(VIEW_ID);
-
- // Delay for 3 seconds so that
- // the Favorites view can be seen.
- waitForJobs();
- delay(3000);
-
- PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow()
- .getActivePage()
- .hideView(mozillaView);
- }
-}
Deleted: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeMozillaAllTests.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeMozillaAllTests.java 2007-10-15 10:49:51 UTC (rev 4173)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeMozillaAllTests.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * 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.vpe.xulrunner.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class VpeMozillaAllTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for " + VpeMozillaAllTests.class.getName());
- //add test cases for dom elements
- suite.addTestSuite(DOMCreatingTest.class);
- return suite;
- }
-
-}
Copied: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeXulRunnerAllTests.java (from rev 4133, branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeMozillaAllTests.java)
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeXulRunnerAllTests.java (rev 0)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/VpeXulRunnerAllTests.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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.vpe.xulrunner.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class VpeXulRunnerAllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for " + VpeXulRunnerAllTests.class.getName());
+ //add test cases for dom elements
+ suite.addTestSuite(DOMCreatingTest.class);
+ return suite;
+ }
+
+}
Copied: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/XulRunnerBrowserTest.java (from rev 4133, branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/MozillaBrowserTest.java)
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/XulRunnerBrowserTest.java (rev 0)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/tests/XulRunnerBrowserTest.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.vpe.xulrunner.tests;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.vpe.xulrunner.view.XulRunnerView;
+
+public class XulRunnerBrowserTest extends TestCase {
+ public static final String VIEW_ID = "org.jboss.tools.vpe.xulrunner.view.XulRunnerView";
+
+ /**
+ * Process UI input but do not return for the specified time interval.
+ *
+ * @param waitTimeMillis
+ * the number of milliseconds
+ */
+ protected void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+
+ // If this is the UI thread,
+ // then process input.
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+
+ /**
+ * Wait until all background tasks are complete.
+ */
+ public void waitForJobs() {
+ while (Job.getJobManager().currentJob() != null)
+ delay(1000);
+ }
+
+ public void testMozillaBrowser() throws PartInitException {
+ waitForJobs();
+ XulRunnerView mozillaView = (XulRunnerView) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().showView(VIEW_ID);
+
+ // Delay for 3 seconds so that
+ // the Favorites view can be seen.
+ waitForJobs();
+ delay(3000);
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .hideView(mozillaView);
+ }
+}
Deleted: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/MozillaView.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/MozillaView.java 2007-10-15 10:49:51 UTC (rev 4173)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/MozillaView.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * 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.vpe.xulrunner.view;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.ViewPart;
-import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
-
-
-
-
-/**
- * This class wes developed for test corectly starting of Mozilla.
- * Mozilla is used as part of Visual Pade Editor.
- */
-
-public class MozillaView extends ViewPart {
- private static final String INIT_URL = "about:buildconfig";
- private XulRunnerBrowser browser;
-
- /**
- * The constructor.
- */
- public MozillaView() {
- }
-
- /**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
- */
- public void createPartControl(Composite parent) {
- browser = new MozillaBrowser(parent, SWT.NONE);
- browser.setUrl(INIT_URL);
- browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus() {
- browser.setFocus();
- }
-
- /**
- * This method is used by other test plugins for testing mozilla's functionality
- * @return MozillaBrowser
- */
- public MozillaBrowser getBrowser() {
- return browser;
- }
-}
\ No newline at end of file
Added: branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/XulRunnerView.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/XulRunnerView.java (rev 0)
+++ branches/jbosstools_xulrunner/vpe/tests/org.jboss.tools.vpe.mozilla.test/src/org/jboss/tools/vpe/xulrunner/view/XulRunnerView.java 2007-10-15 10:58:39 UTC (rev 4174)
@@ -0,0 +1,36 @@
+package org.jboss.tools.vpe.xulrunner.view;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+import org.jboss.tools.vpe.xulrunner.XulRunnerException;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+
+public class XulRunnerView extends ViewPart {
+
+ private static final String INIT_URL = "about:buildconfig";
+ private XulRunnerEditor xulrunnerEditor;
+
+ @Override
+ public void createPartControl(Composite parent) {
+ try {
+ xulrunnerEditor = new XulRunnerEditor(parent);
+ xulrunnerEditor.setURL(INIT_URL);
+ xulrunnerEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
+ true, true));
+ } catch (XulRunnerException e) {
+ // Ignore exception
+ }
+ }
+
+ @Override
+ public void setFocus() {
+ xulrunnerEditor.setFocus();
+ }
+
+ public XulRunnerEditor getBrowser() {
+ return xulrunnerEditor;
+ }
+
+}
17 years, 3 months