JBoss Tools SVN: r2879 - in tags/hibernatetools-jbosstools-2.0.0.beta3: hibernatetools and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-08-03 02:09:46 -0400 (Fri, 03 Aug 2007)
New Revision: 2879
Added:
tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/
tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/features/
tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/plugins/
tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/sampleprojects/
tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/tests/
Removed:
tags/hibernatetools-jbosstools-2.0.0.beta3/features/
tags/hibernatetools-jbosstools-2.0.0.beta3/plugins/
tags/hibernatetools-jbosstools-2.0.0.beta3/sampleprojects/
tags/hibernatetools-jbosstools-2.0.0.beta3/tests/
Log:
hibernatetools tag changed to correct structure
Copied: tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/features (from rev 2877, tags/hibernatetools-jbosstools-2.0.0.beta3/features)
Copied: tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/plugins (from rev 2877, tags/hibernatetools-jbosstools-2.0.0.beta3/plugins)
Copied: tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/sampleprojects (from rev 2877, tags/hibernatetools-jbosstools-2.0.0.beta3/sampleprojects)
Copied: tags/hibernatetools-jbosstools-2.0.0.beta3/hibernatetools/tests (from rev 2877, tags/hibernatetools-jbosstools-2.0.0.beta3/tests)
18 years, 4 months
JBoss Tools SVN: r2878 - in tags/core-2.0.0.beta3: core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-08-03 02:08:03 -0400 (Fri, 03 Aug 2007)
New Revision: 2878
Added:
tags/core-2.0.0.beta3/core/
tags/core-2.0.0.beta3/core/docs/
tags/core-2.0.0.beta3/core/features/
tags/core-2.0.0.beta3/core/plugins/
tags/core-2.0.0.beta3/core/tests/
Removed:
tags/core-2.0.0.beta3/docs/
tags/core-2.0.0.beta3/features/
tags/core-2.0.0.beta3/plugins/
tags/core-2.0.0.beta3/tests/
Log:
core tag changed to correct structure
Copied: tags/core-2.0.0.beta3/core/docs (from rev 2877, tags/core-2.0.0.beta3/docs)
Copied: tags/core-2.0.0.beta3/core/features (from rev 2877, tags/core-2.0.0.beta3/features)
Copied: tags/core-2.0.0.beta3/core/plugins (from rev 2877, tags/core-2.0.0.beta3/plugins)
Copied: tags/core-2.0.0.beta3/core/tests (from rev 2877, tags/core-2.0.0.beta3/tests)
18 years, 4 months
JBoss Tools SVN: r2877 - in trunk/seam/plugins: org.jboss.tools.seam.ui and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-08-03 00:33:28 -0400 (Fri, 03 Aug 2007)
New Revision: 2877
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/images/seam16.png
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/plugin.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-643
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java 2007-08-03 04:33:28 UTC (rev 2877)
@@ -89,7 +89,8 @@
String value = template.getFilterHash().get(filter).toString();
for (Object property : values.getAllProperties()) {
if(value.contains("${"+property.toString()+"}")) {
- value = value.replace("${"+property.toString()+"}",values.getProperty(property.toString()).toString());
+ Object propertyValue = values.getProperty(property.toString());
+ value = value.replace("${"+property.toString()+"}",propertyValue==null?"":propertyValue.toString());
}
}
result.addFilter(filter.toString(), value);
@@ -103,7 +104,8 @@
String value = template.getFilterHash().get(filter).toString();
for (Object property : values.keySet()){
if(value.contains("${"+property.toString()+"}")) {
- value = value.replace("${"+property.toString()+"}",values.get(property.toString()).toString());
+ Object propertyValue = values.get(property.toString());
+ value = value.replace("${"+property.toString()+"}",propertyValue==null?"":propertyValue.toString());
}
}
result.addFilter(filter.toString(), value);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-08-03 04:33:28 UTC (rev 2877)
@@ -296,7 +296,8 @@
new FilterSetCollection(projectFilterSet), true);
// Copy JDBC driver if there is any
- AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), webLibFolder);
+ if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null)
+ AntCopyUtils.copyFiles((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH), webLibFolder);
} else {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-08-03 04:33:28 UTC (rev 2877)
@@ -28,6 +28,7 @@
public void execute(IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
IDataModel model = (IDataModel)config;
+ if(model.getProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE)==null) return;
IConnectionProfile connProfile = ProfileManager.getInstance().getProfileByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE).toString());
Properties props = connProfile.getProperties("org.eclipse.datatools.connectivity.db.generic.connectionProfile");
@@ -37,7 +38,8 @@
model.setProperty(ISeamFacetDataModelProperties.DB_USERP_PASSWORD,props.get("org.eclipse.datatools.connectivity.db.password").toString());
model.setProperty(ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,props.get("org.eclipse.datatools.connectivity.db.URL").toString());
model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,DriverManager.getInstance().getDriverInstanceByID(
- props.get("org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray());
+ props.get("org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray());
+
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-08-03 04:33:28 UTC (rev 2877)
@@ -13,10 +13,10 @@
class="org.jboss.tools.seam.ui.wizard.SeamProjectWizard"
icon="icons/view/seam_project_new.gif"
id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard"
- name="Seam Project"
+ name="Seam Web Project"
project="true">
<description>
- description body text
+ Create a Seam Web Project
</description>
<selection
class="org.eclipse.core.resources.IResource">
@@ -25,11 +25,11 @@
<wizard
category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.ui.wizard.SeamActionWizard"
- icon="icons/view/component_new.gif"
+ icon="icons/seam16.png"
id="org.jboss.tools.seam.ui.wizard.SeamActionWizard"
name="Seam Action">
<description>
- description body text
+ Create a Seam Action
</description>
<selection
class="org.eclipse.core.resources.IResource">
@@ -38,11 +38,11 @@
<wizard
category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.ui.wizard.SeamFormWizard"
- icon="icons/view/component_new.gif"
+ icon="icons/seam16.png"
id="org.jboss.tools.seam.ui.wizard2"
name="Seam Form">
<description>
- description body text
+ Create a Seam Form
</description>
<selection
class="org.eclipse.core.resources.IResource">
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-08-03 04:33:28 UTC (rev 2877)
@@ -10,21 +10,16 @@
******************************************************************************/
package org.jboss.tools.seam.ui.internal.project.facet;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IPropertySetChangeEvent;
-import org.eclipse.datatools.connectivity.IPropertySetListener;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
import org.eclipse.datatools.connectivity.db.generic.ui.NewConnectionProfileWizard;
import org.eclipse.datatools.connectivity.ui.dse.dialogs.ProfileSelectionComposite;
-import org.eclipse.jdt.internal.core.SetVariablesOperation;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
@@ -35,11 +30,13 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.internal.dialogs.PropertyDialog;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
+import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
@@ -129,7 +126,7 @@
// Code generation group
IFieldEditor sessionBeanPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
- "Session Bean Package Name:","com.mydomain.projectname.session");
+ "Session Bean Package Name:","");
IFieldEditor entityBeanPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
"Entity Bean Package Name:","com.mydomain.projectname.entity");
@@ -143,7 +140,7 @@
public SeamInstallWizardPage() {
super("Seam Facet");
setTitle("Seam Facet");
- setDescription("Seam Facest Description");
+ setDescription("Configure Seam Facest Settings");
}
/**
@@ -192,6 +189,7 @@
*/
public void createControl(Composite parent) {
initializeDialogUnits(parent);
+
Composite root = new Composite(parent, SWT.NONE);
GridData gd = new GridData();
@@ -251,6 +249,8 @@
validatorDelegate.addValidatorForProperty(jBossSeamHomeEditor.getName(), ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR);
validatorDelegate.addValidatorForProperty(pathToJdbcDriverJar.getName(), ValidatorFactory.FILESYSTEM_FILE_EXISTS_VALIDATOR);
validatorDelegate.addValidatorForProperty(connProfileSelEditor.getName(),ValidatorFactory.CONNECTION_PROFILE_IS_NOT_SELECTED);
+ setMessage(null);
+ setErrorMessage(null);
}
/**
@@ -344,5 +344,15 @@
((ITaggedFieldEditor)((CompositeEditor)connProfileSelEditor).getEditors().get(1)).setTags(getProfileNameList().toArray(new String[0]));
}
}
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ NewProjectDataModelFacetWizard wizard = (NewProjectDataModelFacetWizard)getWizard();
+ IDataModel model = wizard.getDataModel();
+ sessionBeanPkgNameditor.setValue("org.domain."+model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)+".session");
+ entityBeanPkgNameditor.setValue("org.domain."+model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)+".entity");
+ testsPkgNameditor.setValue("org.domain."+model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)+".test");
+ super.setVisible(visible);
};
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-08-03 04:33:28 UTC (rev 2877)
@@ -217,10 +217,13 @@
/**
*
*/
- public void setValue(Object newWalue) {
- fTextField.removePropertyChangeListener(this);
- fTextField.getTextControl().setText(newWalue.toString());
- fTextField.addPropertyChangeListener(this);
+ public void setValue(Object newValue) {
+ super.setValue(newValue);
+ if(fTextField!=null){
+ fTextField.removePropertyChangeListener(this);
+ fTextField.getTextControl().setText(newValue.toString());
+ fTextField.addPropertyChangeListener(this);
+ }
}
/**
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-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-08-03 04:33:28 UTC (rev 2877)
@@ -51,7 +51,7 @@
protected IWizardPage createFirstPage() {
IWizardPage page = super.createFirstPage();
page.setTitle("Seam Web Project");
- page.setDescription("TBD Description of wizard");
+ page.setDescription("Create standalone Seam Web Project");
return page;
}
Added: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/images/seam16.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/images/seam16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/plugin.xml 2007-08-03 03:13:02 UTC (rev 2876)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/plugin.xml 2007-08-03 04:33:28 UTC (rev 2877)
@@ -3,17 +3,18 @@
<plugin>
<extension point="org.eclipse.ui.newWizards">
- <category id="org.jboss.tools.seam" name="Seam" parentCategory="org.jboss.tools.jst.web">
- </category>
<wizard
- category="org.jboss.tools.jst.web/org.jboss.tools.shale"
+ category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.xml.ui.wizard.newfile.NewSeamComponentsFileWizard"
- icon="images/xstudio/wizards/seam-components.gif"
+ icon="images/seam16.png"
id="org.jboss.tools.seam.xml.ui.wizard.newfile.NewSeamComponentsFileWizard"
name="Seam Components File"
project="false">
<selection class="org.eclipse.core.resources.IResource">
</selection>
+ <description>
+ Create a Seam Components XM LFile
+ </description>
</wizard>
</extension>
@@ -34,4 +35,4 @@
class="org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"/>
</extension>
-</plugin>
\ No newline at end of file
+</plugin>
18 years, 4 months
JBoss Tools SVN: r2876 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/ide/eclipse/as/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-08-02 23:13:02 -0400 (Thu, 02 Aug 2007)
New Revision: 2876
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossServerWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss32RuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss40RuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss42RuntimeWizardFragment.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
JBIDE-655 fixed
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossRuntimeWizardFragment.java 2007-08-03 02:17:54 UTC (rev 2875)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossRuntimeWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -1,648 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.wizards;
-
-import java.io.File;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.ui.Messages;
-
-/**
- * @author Stryker
- */
-public abstract class AbstractJBossRuntimeWizardFragment extends WizardFragment {
-
- private final static int NAME_CHANGED = 1;
- private final static int HOME_CHANGED = 2;
- private final static int JRE_CHANGED = 3;
- private final static int CONFIG_CHANGED = 4;
-
- private final static int SEVERITY_ALL = 1;
- private final static int SEVERITY_MAJOR = 2;
-
- private IWizardHandle handle;
- private Label nameLabel, homeDirLabel, installedJRELabel, configLabel, explanationLabel;
- private Text nameText, homeDirText;
- private Combo jreCombo;
- private Button homeDirButton, jreButton;
- private Composite nameComposite, homeDirComposite, jreComposite, configComposite;
- private String name, homeDir, config;
-
- // jre fields
- protected ArrayList installedJREs;
- protected String[] jreNames;
- protected int defaultVMIndex;
-
- private JBossConfigurationTableViewer configurations;
-
- private IVMInstall selectedVM;
-
- private boolean pristine;
- private String originalName;
-
- public Composite createComposite(Composite parent, IWizardHandle handle)
- {
- this.handle = handle;
-
- Composite main = new Composite(parent, SWT.NONE);
- main.setLayout(new FormLayout());
-
- updateJREs();
- createExplanation(main);
- createNameComposite(main);
- createHomeComposite(main);
- createJREComposite(main);
- createConfigurationComposite(main);
-
- // If it's an already filled runtime (ie not new) fill our widgets
- pristine = isPristineRuntime();
- if( !pristine ) {
- fillWidgets();
- } else {
- setWidgetDefaults();
- }
- //initTaskModel();
-
-
- // make modifications to parent
- handle.setTitle(Messages.createRuntimeWizardTitle);
- handle.setImageDescriptor(getImageDescriptor());
- return main;
- }
-
- private void fillWidgets() {
- RuntimeWorkingCopy rwc = getRuntimeWorkingCopy();
- if( rwc != null ) {
- originalName = rwc.getName();
-
- nameText.setText(rwc.getName());
- homeDirText.setText(rwc.getLocation().toOSString());
- String configSelected = rwc.getAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, "");
- configurations.setDefaultConfiguration(configSelected);
-
- configurations.getTable().setVisible(false);
- configLabel.setText(Messages.wizardFragmentConfigLabel + ": " + configSelected);
- homeDirText.setEditable(false);
- homeDirButton.setEnabled(false);
-
- try {
- Object o = rwc.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
- if( o != null ) {
- IJBossServerRuntime jbsr = (IJBossServerRuntime)o;
- IVMInstall install = jbsr.getVM();
- String vmName = install.getName();
- String[] jres = jreCombo.getItems();
- for( int i = 0; i < jres.length; i++ ) {
- if( vmName.equals(jres[i]))
- jreCombo.select(i);
- }
- }
- } catch( Exception e ) {
-
- }
-
- }
- }
-
- private void setWidgetDefaults() {
- nameText.setText(generateNewRuntimeName());
- homeDirText.setText( Platform.getOS().equals( Platform.WS_WIN32 ) ?
- "c:/program files/jboss-" + getRuntimeVersionId() + ".x" :
- "/usr/bin/jboss-" + getRuntimeVersionId() + ".x");
- }
- private String generateNewRuntimeName() {
- String base = "JBoss-runtime";
- IRuntime rt = ServerCore.findRuntime(base);
- if( rt == null ) return base;
-
- int i = 0;
- while( rt != null ) {
- rt = ServerCore.findRuntime(base + " " + ++i);
- }
- return base + " " + i;
- }
-
- private RuntimeWorkingCopy getRuntimeWorkingCopy() {
- IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- IRuntimeWorkingCopy wc;
- if( !(r instanceof IRuntimeWorkingCopy )) {
- wc = r.createWorkingCopy();
- } else { wc = (IRuntimeWorkingCopy)r; }
-
- if( wc instanceof RuntimeWorkingCopy ) {
- RuntimeWorkingCopy rwc = (RuntimeWorkingCopy)wc;
- return rwc;
- }
- return null;
- }
-
- private String getRuntimeVersionId() {
- RuntimeWorkingCopy rwc = getRuntimeWorkingCopy();
- try {
- Object o = rwc.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
- if( o != null ) {
- IJBossServerRuntime jbsr = (IJBossServerRuntime)o;
- return jbsr.getId();
- }
- } catch( Exception e ) {
- }
- return "4.0";
- }
- private boolean isPristineRuntime() {
- RuntimeWorkingCopy rwc = getRuntimeWorkingCopy();
- if( rwc != null ) {
- if( rwc.getAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, (String)null) == null ) {
- return true;
- }
- return false;
- }
- // uncertain... its not internal... what is it? :: flails ::
- return true;
- }
-
- private void createExplanation(Composite main) {
- explanationLabel = new Label(main, SWT.WRAP);
- FormData data = new FormData();
- data.top = new FormAttachment(0,5);
- data.left = new FormAttachment(0,5);
- data.right = new FormAttachment(100,-5);
- explanationLabel.setLayoutData(data);
-
- explanationLabel.setText(Messages.runtimeWizardFragmentExplanation);
- }
-
- private void createNameComposite(Composite main) {
- // Create our name composite
- nameComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(explanationLabel, 10);
- nameComposite.setLayoutData(cData);
-
- nameComposite.setLayout(new FormLayout());
-
-
- // create internal widgets
- nameLabel = new Label(nameComposite, SWT.NONE);
- nameLabel.setText(Messages.wizardFragmentNameLabel);
-
- nameText = new Text(nameComposite, SWT.BORDER);
- nameText.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- updatePage(NAME_CHANGED);
- }
-
- });
-
- // organize widgets inside composite
- FormData nameLabelData = new FormData();
- nameLabelData.left = new FormAttachment(0,0);
- nameLabel.setLayoutData(nameLabelData);
-
- FormData nameTextData = new FormData();
- nameTextData.left = new FormAttachment(0, 5);
- nameTextData.right = new FormAttachment(100, -5);
- nameTextData.top = new FormAttachment(nameLabel, 5);
- nameText.setLayoutData(nameTextData);
- }
-
- private void createHomeComposite(Composite main) {
- // Create our composite
- homeDirComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(nameComposite, 10);
- homeDirComposite.setLayoutData(cData);
-
- homeDirComposite.setLayout(new FormLayout());
-
-
- // Create Internal Widgets
- homeDirLabel = new Label(homeDirComposite, SWT.NONE);
- homeDirLabel.setText(Messages.wizardFragmentHomeDirLabel);
-
- homeDirText = new Text(homeDirComposite, SWT.BORDER);
-
- homeDirButton = new Button(homeDirComposite, SWT.NONE);
- homeDirButton.setText(Messages.browse);
-
-
- // Add listeners
- homeDirText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updatePage(HOME_CHANGED);
- }
- });
-
- homeDirButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- browseHomeDirClicked();
- }
-
- public void widgetSelected(SelectionEvent e) {
- browseHomeDirClicked();
- }
-
- });
-
- // Set Layout Data
- FormData labelData = new FormData();
- FormData textData = new FormData();
- FormData buttonData = new FormData();
-
- labelData.left = new FormAttachment(0,0);
- homeDirLabel.setLayoutData(labelData);
-
-
- textData.left = new FormAttachment(0, 5);
- textData.right = new FormAttachment(homeDirButton, -5);
- textData.top = new FormAttachment(homeDirLabel, 5);
- homeDirText.setLayoutData(textData);
-
- buttonData.top = new FormAttachment(homeDirLabel, 5);
- buttonData.right = new FormAttachment(100, 0);
- homeDirButton.setLayoutData(buttonData);
- }
-
- private void createJREComposite(Composite main) {
- // Create our composite
- jreComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(homeDirComposite, 10);
- jreComposite.setLayoutData(cData);
-
- jreComposite.setLayout(new FormLayout());
-
-
- // Create Internal Widgets
- installedJRELabel = new Label(jreComposite, SWT.NONE);
- installedJRELabel.setText(Messages.wizardFragmentJRELabel);
-
- jreCombo = new Combo(jreComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
- jreCombo.setItems(jreNames);
- jreCombo.select(defaultVMIndex);
-
- jreButton = new Button(jreComposite, SWT.NONE);
- jreButton.setText(Messages.installedJREs);
-
- // Add action listeners
- jreButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String currentVM = jreCombo.getText();
- if (showPreferencePage()) {
- updateJREs();
- jreCombo.setItems(jreNames);
- jreCombo.setText(currentVM);
- if (jreCombo.getSelectionIndex() == -1)
- jreCombo.select(defaultVMIndex);
- }
- }
- });
-
- jreCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- updatePage(JRE_CHANGED);
- }
-
- public void widgetSelected(SelectionEvent e) {
- updatePage(JRE_CHANGED);
- }
- } );
-
- // Set Layout Data
- FormData labelData = new FormData();
- FormData comboData = new FormData();
- FormData buttonData = new FormData();
-
- labelData.left = new FormAttachment(0,0);
- installedJRELabel.setLayoutData(labelData);
-
-
- comboData.left = new FormAttachment(0, 5);
- comboData.right = new FormAttachment(jreButton, -5);
- comboData.top = new FormAttachment(installedJRELabel, 5);
- jreCombo.setLayoutData(comboData);
-
- buttonData.top = new FormAttachment(installedJRELabel, 5);
- buttonData.right = new FormAttachment(100, 0);
- jreButton.setLayoutData(buttonData);
-
- }
-
-
- private void updatePage(int changed) {
- switch( changed ) {
- case NAME_CHANGED:
- updateErrorMessage(SEVERITY_MAJOR);
- break;
- case HOME_CHANGED:
- if (! new File(homeDirText.getText()).exists()) {
- configurations.getControl().setEnabled(false);
- } else {
- // No errors, clear the message and update the available configurations
- configurations.setJBossHome(homeDirText.getText());
- configurations.setDefaultConfiguration("default");
-
- // update config variable
- int index = configurations.getTable().getSelectionIndex();
- if( index != -1 )
- config = configurations.getTable().getItem(index).getText();
- }
-
- updateErrorMessage(SEVERITY_MAJOR);
- break;
- case JRE_CHANGED:
- int sel = jreCombo.getSelectionIndex();
- if( sel != -1 )
- selectedVM = (IVMInstall) installedJREs.get(sel);
- break;
- default:
- break;
- }
- }
-
- private void updateErrorMessage(int severity) {
- String error = getErrorString(severity);
- if( error == null ) {
- handle.setMessage(null, IMessageProvider.NONE);
- return;
- }
-
- handle.setMessage(error, IMessageProvider.ERROR);
- }
-
- private String getErrorString(int severity) {
- if( getRuntime(nameText.getText()) != null ) {
- return Messages.runtimeNameInUse;
- }
-
- if ( homeDirText.getText() != "" && !new File(homeDirText.getText()).exists()) {
- return Messages.invalidDirectory;
- }
-
- if( severity == SEVERITY_MAJOR ) return null;
-
- // now give minor warnings
- if( nameText.getText().equals(""))
- return Messages.nameTextBlank;
-
- if( homeDirText.getText().equals(""))
- return Messages.homeDirBlank;
-
-
- return null;
-
- }
-
-
- private void browseHomeDirClicked() {
- File file = new File(homeDirText.getText());
- if (! file.exists()) {
- file = null;
- }
-
- File directory = getDirectory(file, homeDirComposite.getShell());
- if (directory == null) {
- return;
- }
-
- homeDirText.setText(directory.getAbsolutePath());
- }
-
- protected File getDirectory(File startingDirectory, Shell shell) {
- DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
- if (startingDirectory != null) {
- fileDialog.setFilterPath(startingDirectory.getPath());
- }
-
- String dir = fileDialog.open();
- if (dir != null) {
- dir = dir.trim();
- if (dir.length() > 0) {
- return new File(dir);
- }
- }
- return null;
- }
-
- // Other
- protected boolean showPreferencePage() {
- PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
- IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode("org.eclipse.jdt.debug.ui.preferences.VMPreferencePage");
- PreferenceManager manager2 = new PreferenceManager();
- manager2.addToRoot(node);
- final PreferenceDialog dialog = new PreferenceDialog(jreButton.getShell(), manager2);
- final boolean[] result = new boolean[] { false };
- BusyIndicator.showWhile(jreButton.getDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- if (dialog.open() == Window.OK)
- result[0] = true;
- }
- });
- return result[0];
- }
-
-
- // JRE methods
- protected void updateJREs() {
- // get all installed JVMs
- installedJREs = new ArrayList();
- IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
- int size = vmInstallTypes.length;
- for (int i = 0; i < size; i++) {
- IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
- int size2 = vmInstalls.length;
- for (int j = 0; j < size2; j++) {
- installedJREs.add(vmInstalls[j]);
- }
- }
-
- // get names
- size = installedJREs.size();
- jreNames = new String[size];
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- jreNames[i] = vmInstall.getName();
- }
-
- selectedVM = JavaRuntime.getDefaultVMInstall();
- defaultVMIndex = installedJREs.indexOf(selectedVM);
-
-
- }
-
- // WST API methods
- public void enter() {
- }
-
- public void exit() {
- name = nameText.getText();
- homeDir = homeDirText.getText();
- IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- IRuntimeWorkingCopy runtimeWC;
- if( r instanceof IRuntimeWorkingCopy ) {
- runtimeWC = (IRuntimeWorkingCopy)r;
- } else {
- runtimeWC = r.createWorkingCopy();
- }
- runtimeWC.setName(name);
- runtimeWC.setLocation(new Path(homeDir));
-
- ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_ID, selectedVM.getId());
- ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_TYPE_ID, selectedVM.getVMInstallType().getId());
- ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, configurations.getSelectedConfiguration());
-
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
- }
-
- private void createConfigurationComposite(Composite main) {
- configComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(jreComposite, 10);
- cData.bottom = new FormAttachment(100, -5);
- configComposite.setLayoutData(cData);
-
- configComposite.setLayout(new FormLayout());
-
-
- configLabel = new Label(configComposite, SWT.NONE);
- configLabel.setText(Messages.wizardFragmentConfigLabel);
-
- configurations = new JBossConfigurationTableViewer(configComposite,
- SWT.BORDER | SWT.SINGLE);
-
- FormData labelData = new FormData();
- labelData.left = new FormAttachment(0,5);
- configLabel.setLayoutData(labelData);
-
- FormData viewerData = new FormData();
- viewerData.left = new FormAttachment(0, 5);
- viewerData.right = new FormAttachment(100, -5);
- viewerData.top = new FormAttachment(configLabel, 5);
- viewerData.bottom = new FormAttachment(100, -5);
-
- configurations.getTable().setLayoutData(viewerData);
-
- configurations.getTable().addSelectionListener(new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
- updatePage(CONFIG_CHANGED);
- }
-
- public void widgetSelected(SelectionEvent e) {
- updatePage(CONFIG_CHANGED);
- }
-
- } );
-
- }
-
-
- public void performFinish(IProgressMonitor monitor) throws CoreException {
-
- IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- IRuntimeWorkingCopy runtimeWC = r.createWorkingCopy();
- runtimeWC.setName(name);
- runtimeWC.setLocation(new Path(homeDir));
- ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_ID, selectedVM.getId());
- ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_TYPE_ID, selectedVM.getVMInstallType().getId());
- ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, configurations.getSelectedConfiguration());
-
- IRuntime saved = runtimeWC.save(false, new NullProgressMonitor());
- getTaskModel().putObject(TaskModel.TASK_RUNTIME, saved);
- }
-
- public boolean isComplete() {
- String s = getErrorString(SEVERITY_ALL);
- return s == null ? true : false;
- }
-
- protected abstract ImageDescriptor getImageDescriptor();
-
- public boolean hasComposite() {
- return true;
- }
-
-
-
- private IRuntime getRuntime(String runtimeName) {
- if( runtimeName.equals(originalName)) return null; // name is same as original. No clash.
-
- IRuntime[] runtimes = ServerCore.getRuntimes();
- for( int i = 0; i < runtimes.length; i++ ) {
- if( runtimes[i].getName().equals(runtimeName)) return runtimes[i];
- }
- return null;
- }
-}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossServerWizardFragment.java 2007-08-03 02:17:54 UTC (rev 2875)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossServerWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -1,482 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.wizards;
-
-import java.io.File;
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.IVMInstallType;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.TaskModel;
-import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.internal.ServerType;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-import org.jboss.ide.eclipse.as.ui.Messages;
-
-public class AbstractJBossServerWizardFragment extends WizardFragment {
- //private final static int UNKNOWN_CHANGED = 0;
- private final static int NAME_CHANGED = 1;
- private final static int HOME_CHANGED = 2;
- private final static int JRE_CHANGED = 3;
- private final static int CONFIG_CHANGED = 4;
-
- private final static int SEVERITY_ALL = 1;
- private final static int SEVERITY_MAJOR = 2;
-
- private IWizardHandle handle;
- private Label nameLabel, homeDirLabel, installedJRELabel, configLabel, explanationLabel;
- private Text nameText, homeDirText, configText;
- private Combo jreCombo;
- private Composite nameComposite, homeDirComposite, jreComposite, configComposite;
- private Group g;
- private String name, config;
-
- // jre fields
- protected ArrayList installedJREs;
- protected String[] jreNames;
- protected int defaultVMIndex;
-
-
- private IVMInstall selectedVM;
- private JBossServer server;
- private IJBossServerRuntime runtime;
-
-
-
- protected void debug (String message)
- {
- System.out.println("[jboss-wizard-fragment] " + message);
- }
-
- public Composite createComposite(Composite parent, IWizardHandle handle)
- {
- this.handle = handle;
-
- Composite main = new Composite(parent, SWT.NONE);
- main.setLayout(new FormLayout());
-
-
- updateJREs();
- createExplanationLabel(main);
- createNameComposite(main);
-
- g = new Group(main, SWT.NONE);
- g.setText(Messages.runtimeInformation);
- g.setLayout(new FormLayout());
- FormData groupData = new FormData();
- groupData.left = new FormAttachment(0,5);
- groupData.right = new FormAttachment(100, -5);
- groupData.top = new FormAttachment(nameComposite, 5);
- g.setLayoutData(groupData);
-
- createHomeComposite(g);
- createJREComposite(g);
- createConfigurationComposite(g);
-
-
-
- // make modifications to parent
- handle.setTitle(Messages.createWizardTitle);
- handle.setDescription(Messages.createWizardDescription);
- //handle.setImageDescriptor (getImageDescriptor());
- return main;
- }
-
- private void createExplanationLabel(Composite main) {
- explanationLabel = new Label(main, SWT.NONE);
- FormData data = new FormData();
- data.top = new FormAttachment(0,5);
- data.left = new FormAttachment(0,5);
- data.right = new FormAttachment(100,-5);
- explanationLabel.setLayoutData(data);
-
- explanationLabel.setText(Messages.serverWizardFragmentExplanation);
- }
-
- private void createNameComposite(Composite main) {
- // Create our name composite
- nameComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(explanationLabel, 10);
- nameComposite.setLayoutData(cData);
-
- nameComposite.setLayout(new FormLayout());
-
-
- // create internal widgets
- nameLabel = new Label(nameComposite, SWT.None);
- nameLabel.setText(Messages.wizardFragmentNameLabel);
-
- nameText = new Text(nameComposite, SWT.BORDER);
- nameText.setText(getDefaultNameText());
- nameText.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- updatePage(NAME_CHANGED);
- }
-
- });
-
- // organize widgets inside composite
- FormData nameLabelData = new FormData();
- nameLabelData.left = new FormAttachment(0,0);
- nameLabel.setLayoutData(nameLabelData);
-
- FormData nameTextData = new FormData();
- nameTextData.left = new FormAttachment(0, 5);
- nameTextData.right = new FormAttachment(100, -5);
- nameTextData.top = new FormAttachment(nameLabel, 5);
- nameText.setLayoutData(nameTextData);
- }
-
- private String getDefaultNameText() {
- String base = "JBoss-server";
- if( findServer(base) == null ) return base;
- int i = 1;
- while( ServerCore.findServer(base + " " + i) != null )
- i++;
- return base + " " + i;
- }
- private IServer findServer(String name) {
- IServer[] servers = ServerCore.getServers();
- for( int i = 0; i < servers.length; i++ ) {
- Server server = (Server) servers[i];
- if (name.equals(server.getName()))
- return server;
- }
- return null;
- }
- private void createHomeComposite(Composite main) {
- // Create our composite
- homeDirComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(0, 5);
- homeDirComposite.setLayoutData(cData);
-
- homeDirComposite.setLayout(new FormLayout());
-
-
- // Create Internal Widgets
- homeDirLabel = new Label(homeDirComposite, SWT.NONE);
- homeDirLabel.setText(Messages.wizardFragmentHomeDirLabel);
-
- homeDirText = new Text(homeDirComposite, SWT.BORDER);
- homeDirText.setEditable(false);
-
- // Set Layout Data
- FormData labelData = new FormData();
- FormData textData = new FormData();
- //FormData buttonData = new FormData();
-
- labelData.left = new FormAttachment(0,0);
- homeDirLabel.setLayoutData(labelData);
-
-
- textData.left = new FormAttachment(0, 5);
- textData.right = new FormAttachment(100, -5);
- textData.top = new FormAttachment(homeDirLabel, 5);
- homeDirText.setLayoutData(textData);
- }
-
- private void createJREComposite(Composite main) {
- // Create our composite
- jreComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(homeDirComposite, 10);
- jreComposite.setLayoutData(cData);
-
- jreComposite.setLayout(new FormLayout());
-
-
- // Create Internal Widgets
- installedJRELabel = new Label(jreComposite, SWT.NONE);
- installedJRELabel.setText(Messages.wizardFragmentJRELabel);
-
- jreCombo = new Combo(jreComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
- jreCombo.setItems(jreNames);
- jreCombo.select(defaultVMIndex);
- jreCombo.setEnabled(false);
-
-
- // Set Layout Data
- FormData labelData = new FormData();
- FormData comboData = new FormData();
-
- labelData.left = new FormAttachment(0,5);
- labelData.top = new FormAttachment(0, 7);
- installedJRELabel.setLayoutData(labelData);
-
-
- comboData.left = new FormAttachment(installedJRELabel, 5);
- comboData.right = new FormAttachment(60, -5);
- comboData.top = new FormAttachment(homeDirComposite, 5);
- jreCombo.setLayoutData(comboData);
- }
-
- private void createConfigurationComposite(Composite main) {
- configComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0,5);
- cData.right = new FormAttachment(100,-5);
- cData.top = new FormAttachment(jreComposite, 5);
- configComposite.setLayoutData(cData);
-
- configComposite.setLayout(new FormLayout());
-
-
- // Create Internal Widgets
- configLabel = new Label(configComposite, SWT.NONE);
- configLabel.setText("Configuration");
-
- configText = new Text(configComposite, SWT.BORDER);
- configText.setEditable(false);
-
- // Set Layout Data
- FormData labelData = new FormData();
- FormData textData = new FormData();
- //FormData buttonData = new FormData();
-
- labelData.left = new FormAttachment(0,0);
- configLabel.setLayoutData(labelData);
-
-
- textData.left = new FormAttachment(0, 5);
- textData.right = new FormAttachment(100, -5);
- textData.top = new FormAttachment(configLabel, 5);
- configText.setLayoutData(textData);
- }
-
- private void updatePage(int changed) {
- switch( changed ) {
- case NAME_CHANGED:
- updateErrorMessage(SEVERITY_MAJOR);
- break;
- case HOME_CHANGED:
- updateErrorMessage(SEVERITY_MAJOR);
-
- break;
- case JRE_CHANGED:
- int sel = jreCombo.getSelectionIndex();
- if( sel != -1 )
- selectedVM = (IVMInstall) installedJREs.get(sel);
- break;
- case CONFIG_CHANGED:
- break;
- default:
- break;
- }
- }
-
- private void updateErrorMessage(int severity) {
- String error = getErrorString(severity);
- if( error == null ) {
- handle.setMessage(null, IMessageProvider.NONE);
- return;
- }
-
- handle.setMessage(error, IMessageProvider.ERROR);
-
- }
-
- private String getErrorString(int severity) {
- if( getJbossServerFolder(nameText.getText()) != null && getJbossServerFolder(nameText.getText()).exists() ) {
- return Messages.serverNameInUse;
- }
-
- if ( !new File(homeDirText.getText()).exists()) {
- return Messages.invalidDirectory;
- }
-
- if( severity == SEVERITY_MAJOR ) return null;
-
- // now give minor warnings
- if( nameText.getText().trim().equals(""))
- return Messages.nameTextBlank;
-
- if( homeDirText.getText().trim().equals(""))
- return Messages.homeDirBlank;
-
-
- return null;
-
- }
-
- protected File getDirectory(File startingDirectory, Shell shell) {
- DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
- if (startingDirectory != null) {
- fileDialog.setFilterPath(startingDirectory.getPath());
- }
-
- String dir = fileDialog.open();
- if (dir != null) {
- dir = dir.trim();
- if (dir.length() > 0) {
- return new File(dir);
- }
- }
- return null;
- }
-
- // JRE methods
- protected void updateJREs() {
- // get all installed JVMs
- installedJREs = new ArrayList();
- IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
- int size = vmInstallTypes.length;
- for (int i = 0; i < size; i++) {
- IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
- int size2 = vmInstalls.length;
- for (int j = 0; j < size2; j++) {
- installedJREs.add(vmInstalls[j]);
- }
- }
-
- // get names
- size = installedJREs.size();
- jreNames = new String[size];
- for (int i = 0; i < size; i++) {
- IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
- jreNames[i] = vmInstall.getName();
- }
-
- selectedVM = JavaRuntime.getDefaultVMInstall();
- defaultVMIndex = installedJREs.indexOf(selectedVM);
- }
-
- // WST API methods
- public void enter() {
- IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- IRuntimeWorkingCopy wc;
- if( r instanceof IRuntimeWorkingCopy )
- wc = (IRuntimeWorkingCopy)r;
- else
- wc = r.createWorkingCopy();
-
- if( wc instanceof RuntimeWorkingCopy ) {
- RuntimeWorkingCopy rwc = (RuntimeWorkingCopy)wc;
- homeDirText.setText(rwc.getLocation().toOSString());
- configText.setText(rwc.getAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, ""));
-
-
- String[] vmNames = jreCombo.getItems();
- IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(rwc.getAttribute(IJBossServerRuntime.PROPERTY_VM_TYPE_ID, ""));
- String vmId = rwc.getAttribute(IJBossServerRuntime.PROPERTY_VM_ID, "");
-
- IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
-
- int comboIndex = -1;
- for (int i = 0; i < vmNames.length && comboIndex == -1; i++) {
- for( int j = 0; j < vmInstalls.length && comboIndex == -1; j++ ) {
-// ASDebug.p("comparing " + vmNames[i] + " with " + vmInstalls[j].getName(), this);
- if (vmNames[i].equals(vmInstalls[j].getName()) && vmInstalls[j].getId().equals(vmId))
- comboIndex = i;
- }
- }
-
- jreCombo.select(comboIndex);
-
- }
- }
-
- public void exit() {
- name = nameText.getText();
- }
-
- public void performFinish(IProgressMonitor monitor) throws CoreException {
- IServerWorkingCopy serverWC = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
- IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
- runtime = (IJBossServerRuntime) r.loadAdapter(IJBossServerRuntime.class, null);
-
-
-
- IFolder folder = getJbossServerFolder(name);
- if( !folder.exists()) {
- folder.create(true,true, new NullProgressMonitor());
- }
- serverWC.setServerConfiguration(folder);
- serverWC.setName(name);
-
-
- server = (JBossServer) serverWC.getAdapter(JBossServer.class);
- if( server == null ) {
- server = (JBossServer) serverWC.loadAdapter(JBossServer.class, new NullProgressMonitor());
- }
- }
-
- public boolean isComplete() {
- String s = getErrorString(SEVERITY_ALL);
- return s == null ? true : false;
- }
-
- public boolean hasComposite() {
- return true;
- }
-
-
-
- private IFolder getJbossServerFolder(String serverName) {
- try {
- return ServerType.getServerProject().getFolder(serverName);
- } catch( Exception e) {
- return null;
- }
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss32RuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss32RuntimeWizardFragment.java 2007-08-03 02:17:54 UTC (rev 2875)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss32RuntimeWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-
-/**
- * @author Marshall
- */
-public class JBoss32RuntimeWizardFragment extends AbstractJBossRuntimeWizardFragment
-{
-
- protected ImageDescriptor getImageDescriptor()
- {
- return JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.WIZBAN_JBOSS32_LOGO);
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss40RuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss40RuntimeWizardFragment.java 2007-08-03 02:17:54 UTC (rev 2875)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss40RuntimeWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-
-/**
- * @author Marshall
- */
-public class JBoss40RuntimeWizardFragment extends AbstractJBossRuntimeWizardFragment
-{
-
- protected ImageDescriptor getImageDescriptor()
- {
- return JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.WIZBAN_JBOSS40_LOGO);
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss42RuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss42RuntimeWizardFragment.java 2007-08-03 02:17:54 UTC (rev 2875)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss42RuntimeWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -1,13 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.wizards;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-
-public class JBoss42RuntimeWizardFragment extends
- AbstractJBossRuntimeWizardFragment {
-
- protected ImageDescriptor getImageDescriptor() {
- return JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.WIZBAN_JBOSS42_LOGO);
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java (from rev 2790, trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossRuntimeWizardFragment.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -0,0 +1,655 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.ui.wizards;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMInstallType;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.preference.IPreferenceNode;
+import org.eclipse.jface.preference.PreferenceDialog;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.ui.wizard.WizardFragment;
+import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
+import org.jboss.ide.eclipse.as.ui.Messages;
+
+/**
+ * @author Stryker
+ */
+public class JBossRuntimeWizardFragment extends WizardFragment {
+
+ private final static int NAME_CHANGED = 1;
+ private final static int HOME_CHANGED = 2;
+ private final static int JRE_CHANGED = 3;
+ private final static int CONFIG_CHANGED = 4;
+
+ private final static int SEVERITY_ALL = 1;
+ private final static int SEVERITY_MAJOR = 2;
+
+ private IWizardHandle handle;
+ private Label nameLabel, homeDirLabel, installedJRELabel, configLabel, explanationLabel;
+ private Text nameText, homeDirText;
+ private Combo jreCombo;
+ private Button homeDirButton, jreButton;
+ private Composite nameComposite, homeDirComposite, jreComposite, configComposite;
+ private String name, homeDir, config;
+
+ // jre fields
+ protected ArrayList installedJREs;
+ protected String[] jreNames;
+ protected int defaultVMIndex;
+
+ private JBossConfigurationTableViewer configurations;
+
+ private IVMInstall selectedVM;
+
+ private boolean pristine;
+ private String originalName;
+
+ public Composite createComposite(Composite parent, IWizardHandle handle)
+ {
+ this.handle = handle;
+
+ Composite main = new Composite(parent, SWT.NONE);
+ main.setLayout(new FormLayout());
+
+ updateJREs();
+ createExplanation(main);
+ createNameComposite(main);
+ createHomeComposite(main);
+ createJREComposite(main);
+ createConfigurationComposite(main);
+
+ // If it's an already filled runtime (ie not new) fill our widgets
+ pristine = isPristineRuntime();
+ if( !pristine ) {
+ fillWidgets();
+ } else {
+ setWidgetDefaults();
+ }
+ //initTaskModel();
+
+
+ // make modifications to parent
+ handle.setTitle(Messages.createRuntimeWizardTitle);
+ handle.setImageDescriptor(getImageDescriptor());
+ return main;
+ }
+
+ protected ImageDescriptor getImageDescriptor() {
+ IRuntime rt = (IRuntime)getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ String id = rt.getRuntimeType().getId();
+ String imageKey = "";
+ if( id.equals("org.jboss.ide.eclipse.as.runtime.32")) imageKey = JBossServerUISharedImages.WIZBAN_JBOSS32_LOGO;
+ else if( id.equals("org.jboss.ide.eclipse.as.runtime.40")) imageKey = JBossServerUISharedImages.WIZBAN_JBOSS40_LOGO;
+ else if( id.equals("org.jboss.ide.eclipse.as.runtime.42")) imageKey = JBossServerUISharedImages.WIZBAN_JBOSS42_LOGO;
+ return JBossServerUISharedImages.getImageDescriptor(imageKey);
+ }
+
+ private void fillWidgets() {
+ RuntimeWorkingCopy rwc = getRuntimeWorkingCopy();
+ if( rwc != null ) {
+ originalName = rwc.getName();
+
+ nameText.setText(rwc.getName());
+ homeDirText.setText(rwc.getLocation().toOSString());
+ String configSelected = rwc.getAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, "");
+ configurations.setDefaultConfiguration(configSelected);
+
+ configurations.getTable().setVisible(false);
+ configLabel.setText(Messages.wizardFragmentConfigLabel + ": " + configSelected);
+ homeDirText.setEditable(false);
+ homeDirButton.setEnabled(false);
+
+ try {
+ Object o = rwc.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ if( o != null ) {
+ IJBossServerRuntime jbsr = (IJBossServerRuntime)o;
+ IVMInstall install = jbsr.getVM();
+ String vmName = install.getName();
+ String[] jres = jreCombo.getItems();
+ for( int i = 0; i < jres.length; i++ ) {
+ if( vmName.equals(jres[i]))
+ jreCombo.select(i);
+ }
+ }
+ } catch( Exception e ) {
+
+ }
+
+ }
+ }
+
+ private void setWidgetDefaults() {
+ nameText.setText(generateNewRuntimeName());
+ homeDirText.setText( Platform.getOS().equals( Platform.WS_WIN32 ) ?
+ "c:/program files/jboss-" + getRuntimeVersionId() + ".x" :
+ "/usr/bin/jboss-" + getRuntimeVersionId() + ".x");
+ }
+ private String generateNewRuntimeName() {
+ String base = "JBoss-runtime";
+ IRuntime rt = ServerCore.findRuntime(base);
+ if( rt == null ) return base;
+
+ int i = 0;
+ while( rt != null ) {
+ rt = ServerCore.findRuntime(base + " " + ++i);
+ }
+ return base + " " + i;
+ }
+
+ private RuntimeWorkingCopy getRuntimeWorkingCopy() {
+ IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ IRuntimeWorkingCopy wc;
+ if( !(r instanceof IRuntimeWorkingCopy )) {
+ wc = r.createWorkingCopy();
+ } else { wc = (IRuntimeWorkingCopy)r; }
+
+ if( wc instanceof RuntimeWorkingCopy ) {
+ RuntimeWorkingCopy rwc = (RuntimeWorkingCopy)wc;
+ return rwc;
+ }
+ return null;
+ }
+
+ private String getRuntimeVersionId() {
+ RuntimeWorkingCopy rwc = getRuntimeWorkingCopy();
+ try {
+ Object o = rwc.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ if( o != null ) {
+ IJBossServerRuntime jbsr = (IJBossServerRuntime)o;
+ return jbsr.getId();
+ }
+ } catch( Exception e ) {
+ }
+ return "4.0";
+ }
+ private boolean isPristineRuntime() {
+ RuntimeWorkingCopy rwc = getRuntimeWorkingCopy();
+ if( rwc != null ) {
+ if( rwc.getAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, (String)null) == null ) {
+ return true;
+ }
+ return false;
+ }
+ // uncertain... its not internal... what is it? :: flails ::
+ return true;
+ }
+
+ private void createExplanation(Composite main) {
+ explanationLabel = new Label(main, SWT.WRAP);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0,5);
+ data.left = new FormAttachment(0,5);
+ data.right = new FormAttachment(100,-5);
+ explanationLabel.setLayoutData(data);
+
+ explanationLabel.setText(Messages.runtimeWizardFragmentExplanation);
+ }
+
+ private void createNameComposite(Composite main) {
+ // Create our name composite
+ nameComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(explanationLabel, 10);
+ nameComposite.setLayoutData(cData);
+
+ nameComposite.setLayout(new FormLayout());
+
+
+ // create internal widgets
+ nameLabel = new Label(nameComposite, SWT.NONE);
+ nameLabel.setText(Messages.wizardFragmentNameLabel);
+
+ nameText = new Text(nameComposite, SWT.BORDER);
+ nameText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ updatePage(NAME_CHANGED);
+ }
+
+ });
+
+ // organize widgets inside composite
+ FormData nameLabelData = new FormData();
+ nameLabelData.left = new FormAttachment(0,0);
+ nameLabel.setLayoutData(nameLabelData);
+
+ FormData nameTextData = new FormData();
+ nameTextData.left = new FormAttachment(0, 5);
+ nameTextData.right = new FormAttachment(100, -5);
+ nameTextData.top = new FormAttachment(nameLabel, 5);
+ nameText.setLayoutData(nameTextData);
+ }
+
+ private void createHomeComposite(Composite main) {
+ // Create our composite
+ homeDirComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(nameComposite, 10);
+ homeDirComposite.setLayoutData(cData);
+
+ homeDirComposite.setLayout(new FormLayout());
+
+
+ // Create Internal Widgets
+ homeDirLabel = new Label(homeDirComposite, SWT.NONE);
+ homeDirLabel.setText(Messages.wizardFragmentHomeDirLabel);
+
+ homeDirText = new Text(homeDirComposite, SWT.BORDER);
+
+ homeDirButton = new Button(homeDirComposite, SWT.NONE);
+ homeDirButton.setText(Messages.browse);
+
+
+ // Add listeners
+ homeDirText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updatePage(HOME_CHANGED);
+ }
+ });
+
+ homeDirButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ browseHomeDirClicked();
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ browseHomeDirClicked();
+ }
+
+ });
+
+ // Set Layout Data
+ FormData labelData = new FormData();
+ FormData textData = new FormData();
+ FormData buttonData = new FormData();
+
+ labelData.left = new FormAttachment(0,0);
+ homeDirLabel.setLayoutData(labelData);
+
+
+ textData.left = new FormAttachment(0, 5);
+ textData.right = new FormAttachment(homeDirButton, -5);
+ textData.top = new FormAttachment(homeDirLabel, 5);
+ homeDirText.setLayoutData(textData);
+
+ buttonData.top = new FormAttachment(homeDirLabel, 5);
+ buttonData.right = new FormAttachment(100, 0);
+ homeDirButton.setLayoutData(buttonData);
+ }
+
+ private void createJREComposite(Composite main) {
+ // Create our composite
+ jreComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(homeDirComposite, 10);
+ jreComposite.setLayoutData(cData);
+
+ jreComposite.setLayout(new FormLayout());
+
+
+ // Create Internal Widgets
+ installedJRELabel = new Label(jreComposite, SWT.NONE);
+ installedJRELabel.setText(Messages.wizardFragmentJRELabel);
+
+ jreCombo = new Combo(jreComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ jreCombo.setItems(jreNames);
+ jreCombo.select(defaultVMIndex);
+
+ jreButton = new Button(jreComposite, SWT.NONE);
+ jreButton.setText(Messages.installedJREs);
+
+ // Add action listeners
+ jreButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String currentVM = jreCombo.getText();
+ if (showPreferencePage()) {
+ updateJREs();
+ jreCombo.setItems(jreNames);
+ jreCombo.setText(currentVM);
+ if (jreCombo.getSelectionIndex() == -1)
+ jreCombo.select(defaultVMIndex);
+ }
+ }
+ });
+
+ jreCombo.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ updatePage(JRE_CHANGED);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ updatePage(JRE_CHANGED);
+ }
+ } );
+
+ // Set Layout Data
+ FormData labelData = new FormData();
+ FormData comboData = new FormData();
+ FormData buttonData = new FormData();
+
+ labelData.left = new FormAttachment(0,0);
+ installedJRELabel.setLayoutData(labelData);
+
+
+ comboData.left = new FormAttachment(0, 5);
+ comboData.right = new FormAttachment(jreButton, -5);
+ comboData.top = new FormAttachment(installedJRELabel, 5);
+ jreCombo.setLayoutData(comboData);
+
+ buttonData.top = new FormAttachment(installedJRELabel, 5);
+ buttonData.right = new FormAttachment(100, 0);
+ jreButton.setLayoutData(buttonData);
+
+ }
+
+
+ private void updatePage(int changed) {
+ switch( changed ) {
+ case NAME_CHANGED:
+ updateErrorMessage(SEVERITY_MAJOR);
+ break;
+ case HOME_CHANGED:
+ if (! new File(homeDirText.getText()).exists()) {
+ configurations.getControl().setEnabled(false);
+ } else {
+ // No errors, clear the message and update the available configurations
+ configurations.setJBossHome(homeDirText.getText());
+ configurations.setDefaultConfiguration("default");
+
+ // update config variable
+ int index = configurations.getTable().getSelectionIndex();
+ if( index != -1 )
+ config = configurations.getTable().getItem(index).getText();
+ }
+
+ updateErrorMessage(SEVERITY_MAJOR);
+ break;
+ case JRE_CHANGED:
+ int sel = jreCombo.getSelectionIndex();
+ if( sel != -1 )
+ selectedVM = (IVMInstall) installedJREs.get(sel);
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void updateErrorMessage(int severity) {
+ String error = getErrorString(severity);
+ if( error == null ) {
+ handle.setMessage(null, IMessageProvider.NONE);
+ return;
+ }
+
+ handle.setMessage(error, IMessageProvider.ERROR);
+ }
+
+ private String getErrorString(int severity) {
+ if( getRuntime(nameText.getText()) != null ) {
+ return Messages.runtimeNameInUse;
+ }
+
+ if ( homeDirText.getText() != "" && !new File(homeDirText.getText()).exists()) {
+ return Messages.invalidDirectory;
+ }
+
+ if( severity == SEVERITY_MAJOR ) return null;
+
+ // now give minor warnings
+ if( nameText.getText().equals(""))
+ return Messages.nameTextBlank;
+
+ if( homeDirText.getText().equals(""))
+ return Messages.homeDirBlank;
+
+
+ return null;
+
+ }
+
+
+ private void browseHomeDirClicked() {
+ File file = new File(homeDirText.getText());
+ if (! file.exists()) {
+ file = null;
+ }
+
+ File directory = getDirectory(file, homeDirComposite.getShell());
+ if (directory == null) {
+ return;
+ }
+
+ homeDirText.setText(directory.getAbsolutePath());
+ }
+
+ protected File getDirectory(File startingDirectory, Shell shell) {
+ DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
+ if (startingDirectory != null) {
+ fileDialog.setFilterPath(startingDirectory.getPath());
+ }
+
+ String dir = fileDialog.open();
+ if (dir != null) {
+ dir = dir.trim();
+ if (dir.length() > 0) {
+ return new File(dir);
+ }
+ }
+ return null;
+ }
+
+ // Other
+ protected boolean showPreferencePage() {
+ PreferenceManager manager = PlatformUI.getWorkbench().getPreferenceManager();
+ IPreferenceNode node = manager.find("org.eclipse.jdt.ui.preferences.JavaBasePreferencePage").findSubNode("org.eclipse.jdt.debug.ui.preferences.VMPreferencePage");
+ PreferenceManager manager2 = new PreferenceManager();
+ manager2.addToRoot(node);
+ final PreferenceDialog dialog = new PreferenceDialog(jreButton.getShell(), manager2);
+ final boolean[] result = new boolean[] { false };
+ BusyIndicator.showWhile(jreButton.getDisplay(), new Runnable() {
+ public void run() {
+ dialog.create();
+ if (dialog.open() == Window.OK)
+ result[0] = true;
+ }
+ });
+ return result[0];
+ }
+
+
+ // JRE methods
+ protected void updateJREs() {
+ // get all installed JVMs
+ installedJREs = new ArrayList();
+ IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
+ int size = vmInstallTypes.length;
+ for (int i = 0; i < size; i++) {
+ IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
+ int size2 = vmInstalls.length;
+ for (int j = 0; j < size2; j++) {
+ installedJREs.add(vmInstalls[j]);
+ }
+ }
+
+ // get names
+ size = installedJREs.size();
+ jreNames = new String[size];
+ for (int i = 0; i < size; i++) {
+ IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
+ jreNames[i] = vmInstall.getName();
+ }
+
+ selectedVM = JavaRuntime.getDefaultVMInstall();
+ defaultVMIndex = installedJREs.indexOf(selectedVM);
+
+
+ }
+
+ // WST API methods
+ public void enter() {
+ }
+
+ public void exit() {
+ name = nameText.getText();
+ homeDir = homeDirText.getText();
+ IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ IRuntimeWorkingCopy runtimeWC;
+ if( r instanceof IRuntimeWorkingCopy ) {
+ runtimeWC = (IRuntimeWorkingCopy)r;
+ } else {
+ runtimeWC = r.createWorkingCopy();
+ }
+ runtimeWC.setName(name);
+ runtimeWC.setLocation(new Path(homeDir));
+
+ ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_ID, selectedVM.getId());
+ ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_TYPE_ID, selectedVM.getVMInstallType().getId());
+ ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, configurations.getSelectedConfiguration());
+
+ getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
+ }
+
+ private void createConfigurationComposite(Composite main) {
+ configComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(jreComposite, 10);
+ cData.bottom = new FormAttachment(100, -5);
+ configComposite.setLayoutData(cData);
+
+ configComposite.setLayout(new FormLayout());
+
+
+ configLabel = new Label(configComposite, SWT.NONE);
+ configLabel.setText(Messages.wizardFragmentConfigLabel);
+
+ configurations = new JBossConfigurationTableViewer(configComposite,
+ SWT.BORDER | SWT.SINGLE);
+
+ FormData labelData = new FormData();
+ labelData.left = new FormAttachment(0,5);
+ configLabel.setLayoutData(labelData);
+
+ FormData viewerData = new FormData();
+ viewerData.left = new FormAttachment(0, 5);
+ viewerData.right = new FormAttachment(100, -5);
+ viewerData.top = new FormAttachment(configLabel, 5);
+ viewerData.bottom = new FormAttachment(100, -5);
+
+ configurations.getTable().setLayoutData(viewerData);
+
+ configurations.getTable().addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ updatePage(CONFIG_CHANGED);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ updatePage(CONFIG_CHANGED);
+ }
+
+ } );
+
+ }
+
+
+ public void performFinish(IProgressMonitor monitor) throws CoreException {
+
+ IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ IRuntimeWorkingCopy runtimeWC = r.createWorkingCopy();
+ runtimeWC.setName(name);
+ runtimeWC.setLocation(new Path(homeDir));
+ ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_ID, selectedVM.getId());
+ ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_VM_TYPE_ID, selectedVM.getVMInstallType().getId());
+ ((RuntimeWorkingCopy)runtimeWC).setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, configurations.getSelectedConfiguration());
+
+ IRuntime saved = runtimeWC.save(false, new NullProgressMonitor());
+ getTaskModel().putObject(TaskModel.TASK_RUNTIME, saved);
+ }
+
+ public boolean isComplete() {
+ String s = getErrorString(SEVERITY_ALL);
+ return s == null ? true : false;
+ }
+
+ public boolean hasComposite() {
+ return true;
+ }
+
+ private IRuntime getRuntime(String runtimeName) {
+ if( runtimeName.equals(originalName)) return null; // name is same as original. No clash.
+
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ for( int i = 0; i < runtimes.length; i++ ) {
+ if( runtimes[i].getName().equals(runtimeName)) return runtimes[i];
+ }
+ return null;
+ }
+}
\ No newline at end of file
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java (from rev 2790, trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/AbstractJBossServerWizardFragment.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2007-08-03 03:13:02 UTC (rev 2876)
@@ -0,0 +1,495 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.ui.wizards;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.IVMInstallType;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.ServerType;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.ui.wizard.WizardFragment;
+import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.JBossServer;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
+import org.jboss.ide.eclipse.as.ui.Messages;
+
+public class JBossServerWizardFragment extends WizardFragment {
+ //private final static int UNKNOWN_CHANGED = 0;
+ private final static int NAME_CHANGED = 1;
+ private final static int HOME_CHANGED = 2;
+ private final static int JRE_CHANGED = 3;
+ private final static int CONFIG_CHANGED = 4;
+
+ private final static int SEVERITY_ALL = 1;
+ private final static int SEVERITY_MAJOR = 2;
+
+ private IWizardHandle handle;
+ private Label nameLabel, homeDirLabel, installedJRELabel, configLabel, explanationLabel;
+ private Text nameText, homeDirText, configText;
+ private Combo jreCombo;
+ private Composite nameComposite, homeDirComposite, jreComposite, configComposite;
+ private Group g;
+ private String name, config;
+
+ // jre fields
+ protected ArrayList installedJREs;
+ protected String[] jreNames;
+ protected int defaultVMIndex;
+
+
+ private IVMInstall selectedVM;
+ private JBossServer server;
+ private IJBossServerRuntime runtime;
+
+
+
+ protected void debug (String message)
+ {
+ System.out.println("[jboss-wizard-fragment] " + message);
+ }
+
+ public Composite createComposite(Composite parent, IWizardHandle handle)
+ {
+ this.handle = handle;
+
+ Composite main = new Composite(parent, SWT.NONE);
+ main.setLayout(new FormLayout());
+
+
+ updateJREs();
+ createExplanationLabel(main);
+ createNameComposite(main);
+
+ g = new Group(main, SWT.NONE);
+ g.setText(Messages.runtimeInformation);
+ g.setLayout(new FormLayout());
+ FormData groupData = new FormData();
+ groupData.left = new FormAttachment(0,5);
+ groupData.right = new FormAttachment(100, -5);
+ groupData.top = new FormAttachment(nameComposite, 5);
+ g.setLayoutData(groupData);
+
+ createHomeComposite(g);
+ createJREComposite(g);
+ createConfigurationComposite(g);
+
+ // make modifications to parent
+ handle.setTitle(Messages.createWizardTitle);
+ handle.setDescription(Messages.createWizardDescription);
+ handle.setImageDescriptor (getImageDescriptor());
+
+ return main;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ IRuntime rt = (IRuntime)getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ String id = rt.getRuntimeType().getId();
+ String imageKey = "";
+ if( id.equals("org.jboss.ide.eclipse.as.runtime.32")) imageKey = JBossServerUISharedImages.WIZBAN_JBOSS32_LOGO;
+ else if( id.equals("org.jboss.ide.eclipse.as.runtime.40")) imageKey = JBossServerUISharedImages.WIZBAN_JBOSS40_LOGO;
+ else if( id.equals("org.jboss.ide.eclipse.as.runtime.42")) imageKey = JBossServerUISharedImages.WIZBAN_JBOSS42_LOGO;
+ return JBossServerUISharedImages.getImageDescriptor(imageKey);
+ }
+
+ private void createExplanationLabel(Composite main) {
+ explanationLabel = new Label(main, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0,5);
+ data.left = new FormAttachment(0,5);
+ data.right = new FormAttachment(100,-5);
+ explanationLabel.setLayoutData(data);
+
+ explanationLabel.setText(Messages.serverWizardFragmentExplanation);
+ }
+
+ private void createNameComposite(Composite main) {
+ // Create our name composite
+ nameComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(explanationLabel, 10);
+ nameComposite.setLayoutData(cData);
+
+ nameComposite.setLayout(new FormLayout());
+
+
+ // create internal widgets
+ nameLabel = new Label(nameComposite, SWT.None);
+ nameLabel.setText(Messages.wizardFragmentNameLabel);
+
+ nameText = new Text(nameComposite, SWT.BORDER);
+ nameText.setText(getDefaultNameText());
+ nameText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ updatePage(NAME_CHANGED);
+ }
+
+ });
+
+ // organize widgets inside composite
+ FormData nameLabelData = new FormData();
+ nameLabelData.left = new FormAttachment(0,0);
+ nameLabel.setLayoutData(nameLabelData);
+
+ FormData nameTextData = new FormData();
+ nameTextData.left = new FormAttachment(0, 5);
+ nameTextData.right = new FormAttachment(100, -5);
+ nameTextData.top = new FormAttachment(nameLabel, 5);
+ nameText.setLayoutData(nameTextData);
+ }
+
+ private String getDefaultNameText() {
+ String base = "JBoss-server";
+ if( findServer(base) == null ) return base;
+ int i = 1;
+ while( ServerCore.findServer(base + " " + i) != null )
+ i++;
+ return base + " " + i;
+ }
+ private IServer findServer(String name) {
+ IServer[] servers = ServerCore.getServers();
+ for( int i = 0; i < servers.length; i++ ) {
+ Server server = (Server) servers[i];
+ if (name.equals(server.getName()))
+ return server;
+ }
+ return null;
+ }
+ private void createHomeComposite(Composite main) {
+ // Create our composite
+ homeDirComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(0, 5);
+ homeDirComposite.setLayoutData(cData);
+
+ homeDirComposite.setLayout(new FormLayout());
+
+
+ // Create Internal Widgets
+ homeDirLabel = new Label(homeDirComposite, SWT.NONE);
+ homeDirLabel.setText(Messages.wizardFragmentHomeDirLabel);
+
+ homeDirText = new Text(homeDirComposite, SWT.BORDER);
+ homeDirText.setEditable(false);
+
+ // Set Layout Data
+ FormData labelData = new FormData();
+ FormData textData = new FormData();
+ //FormData buttonData = new FormData();
+
+ labelData.left = new FormAttachment(0,0);
+ homeDirLabel.setLayoutData(labelData);
+
+
+ textData.left = new FormAttachment(0, 5);
+ textData.right = new FormAttachment(100, -5);
+ textData.top = new FormAttachment(homeDirLabel, 5);
+ homeDirText.setLayoutData(textData);
+ }
+
+ private void createJREComposite(Composite main) {
+ // Create our composite
+ jreComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(homeDirComposite, 10);
+ jreComposite.setLayoutData(cData);
+
+ jreComposite.setLayout(new FormLayout());
+
+
+ // Create Internal Widgets
+ installedJRELabel = new Label(jreComposite, SWT.NONE);
+ installedJRELabel.setText(Messages.wizardFragmentJRELabel);
+
+ jreCombo = new Combo(jreComposite, SWT.DROP_DOWN | SWT.READ_ONLY);
+ jreCombo.setItems(jreNames);
+ jreCombo.select(defaultVMIndex);
+ jreCombo.setEnabled(false);
+
+
+ // Set Layout Data
+ FormData labelData = new FormData();
+ FormData comboData = new FormData();
+
+ labelData.left = new FormAttachment(0,5);
+ labelData.top = new FormAttachment(0, 7);
+ installedJRELabel.setLayoutData(labelData);
+
+
+ comboData.left = new FormAttachment(installedJRELabel, 5);
+ comboData.right = new FormAttachment(60, -5);
+ comboData.top = new FormAttachment(homeDirComposite, 5);
+ jreCombo.setLayoutData(comboData);
+ }
+
+ private void createConfigurationComposite(Composite main) {
+ configComposite = new Composite(main, SWT.NONE);
+
+ FormData cData = new FormData();
+ cData.left = new FormAttachment(0,5);
+ cData.right = new FormAttachment(100,-5);
+ cData.top = new FormAttachment(jreComposite, 5);
+ configComposite.setLayoutData(cData);
+
+ configComposite.setLayout(new FormLayout());
+
+
+ // Create Internal Widgets
+ configLabel = new Label(configComposite, SWT.NONE);
+ configLabel.setText("Configuration");
+
+ configText = new Text(configComposite, SWT.BORDER);
+ configText.setEditable(false);
+
+ // Set Layout Data
+ FormData labelData = new FormData();
+ FormData textData = new FormData();
+ //FormData buttonData = new FormData();
+
+ labelData.left = new FormAttachment(0,0);
+ configLabel.setLayoutData(labelData);
+
+
+ textData.left = new FormAttachment(0, 5);
+ textData.right = new FormAttachment(100, -5);
+ textData.top = new FormAttachment(configLabel, 5);
+ configText.setLayoutData(textData);
+ }
+
+ private void updatePage(int changed) {
+ switch( changed ) {
+ case NAME_CHANGED:
+ updateErrorMessage(SEVERITY_MAJOR);
+ break;
+ case HOME_CHANGED:
+ updateErrorMessage(SEVERITY_MAJOR);
+
+ break;
+ case JRE_CHANGED:
+ int sel = jreCombo.getSelectionIndex();
+ if( sel != -1 )
+ selectedVM = (IVMInstall) installedJREs.get(sel);
+ break;
+ case CONFIG_CHANGED:
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void updateErrorMessage(int severity) {
+ String error = getErrorString(severity);
+ if( error == null ) {
+ handle.setMessage(null, IMessageProvider.NONE);
+ return;
+ }
+
+ handle.setMessage(error, IMessageProvider.ERROR);
+
+ }
+
+ private String getErrorString(int severity) {
+ if( getJbossServerFolder(nameText.getText()) != null && getJbossServerFolder(nameText.getText()).exists() ) {
+ return Messages.serverNameInUse;
+ }
+
+ if ( !new File(homeDirText.getText()).exists()) {
+ return Messages.invalidDirectory;
+ }
+
+ if( severity == SEVERITY_MAJOR ) return null;
+
+ // now give minor warnings
+ if( nameText.getText().trim().equals(""))
+ return Messages.nameTextBlank;
+
+ if( homeDirText.getText().trim().equals(""))
+ return Messages.homeDirBlank;
+
+
+ return null;
+
+ }
+
+ protected File getDirectory(File startingDirectory, Shell shell) {
+ DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
+ if (startingDirectory != null) {
+ fileDialog.setFilterPath(startingDirectory.getPath());
+ }
+
+ String dir = fileDialog.open();
+ if (dir != null) {
+ dir = dir.trim();
+ if (dir.length() > 0) {
+ return new File(dir);
+ }
+ }
+ return null;
+ }
+
+ // JRE methods
+ protected void updateJREs() {
+ // get all installed JVMs
+ installedJREs = new ArrayList();
+ IVMInstallType[] vmInstallTypes = JavaRuntime.getVMInstallTypes();
+ int size = vmInstallTypes.length;
+ for (int i = 0; i < size; i++) {
+ IVMInstall[] vmInstalls = vmInstallTypes[i].getVMInstalls();
+ int size2 = vmInstalls.length;
+ for (int j = 0; j < size2; j++) {
+ installedJREs.add(vmInstalls[j]);
+ }
+ }
+
+ // get names
+ size = installedJREs.size();
+ jreNames = new String[size];
+ for (int i = 0; i < size; i++) {
+ IVMInstall vmInstall = (IVMInstall) installedJREs.get(i);
+ jreNames[i] = vmInstall.getName();
+ }
+
+ selectedVM = JavaRuntime.getDefaultVMInstall();
+ defaultVMIndex = installedJREs.indexOf(selectedVM);
+ }
+
+ // WST API methods
+ public void enter() {
+ IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ IRuntimeWorkingCopy wc;
+ if( r instanceof IRuntimeWorkingCopy )
+ wc = (IRuntimeWorkingCopy)r;
+ else
+ wc = r.createWorkingCopy();
+
+ if( wc instanceof RuntimeWorkingCopy ) {
+ RuntimeWorkingCopy rwc = (RuntimeWorkingCopy)wc;
+ homeDirText.setText(rwc.getLocation().toOSString());
+ configText.setText(rwc.getAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, ""));
+
+
+ String[] vmNames = jreCombo.getItems();
+ IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(rwc.getAttribute(IJBossServerRuntime.PROPERTY_VM_TYPE_ID, ""));
+ String vmId = rwc.getAttribute(IJBossServerRuntime.PROPERTY_VM_ID, "");
+
+ IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
+
+ int comboIndex = -1;
+ for (int i = 0; i < vmNames.length && comboIndex == -1; i++) {
+ for( int j = 0; j < vmInstalls.length && comboIndex == -1; j++ ) {
+// ASDebug.p("comparing " + vmNames[i] + " with " + vmInstalls[j].getName(), this);
+ if (vmNames[i].equals(vmInstalls[j].getName()) && vmInstalls[j].getId().equals(vmId))
+ comboIndex = i;
+ }
+ }
+
+ jreCombo.select(comboIndex);
+
+ }
+ }
+
+ public void exit() {
+ name = nameText.getText();
+ }
+
+ public void performFinish(IProgressMonitor monitor) throws CoreException {
+ IServerWorkingCopy serverWC = (IServerWorkingCopy) getTaskModel().getObject(TaskModel.TASK_SERVER);
+ IRuntime r = (IRuntime) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+ runtime = (IJBossServerRuntime) r.loadAdapter(IJBossServerRuntime.class, null);
+
+
+
+ IFolder folder = getJbossServerFolder(name);
+ if( !folder.exists()) {
+ folder.create(true,true, new NullProgressMonitor());
+ }
+ serverWC.setServerConfiguration(folder);
+ serverWC.setName(name);
+
+
+ server = (JBossServer) serverWC.getAdapter(JBossServer.class);
+ if( server == null ) {
+ server = (JBossServer) serverWC.loadAdapter(JBossServer.class, new NullProgressMonitor());
+ }
+ }
+
+ public boolean isComplete() {
+ String s = getErrorString(SEVERITY_ALL);
+ return s == null ? true : false;
+ }
+
+ public boolean hasComposite() {
+ return true;
+ }
+
+
+
+ private IFolder getJbossServerFolder(String serverName) {
+ try {
+ return ServerType.getServerProject().getFolder(serverName);
+ } catch( Exception e) {
+ return null;
+ }
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2007-08-03 02:17:54 UTC (rev 2875)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2007-08-03 03:13:02 UTC (rev 2876)
@@ -44,30 +44,15 @@
<extension
point="org.eclipse.wst.server.ui.wizardFragments">
<fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.JBoss32RuntimeWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.runtime.32"
+ class="org.jboss.ide.eclipse.as.ui.wizards.JBossRuntimeWizardFragment"
+ typeIds="org.jboss.ide.eclipse.as.runtime.32,org.jboss.ide.eclipse.as.runtime.40,org.jboss.ide.eclipse.as.runtime.42"
id="org.jboss.ide.eclipse.as.ui.jboss32RuntimeWizardFragmentragment"/>
+
<fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.JBoss40RuntimeWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.runtime.40"
- id="org.jboss.ide.eclipse.as.ui.jboss40RuntimeWizardFragmentWizardFragment"/>
- <fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.JBoss42RuntimeWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.runtime.42"
- id="org.jboss.ide.eclipse.as.ui.jboss42RuntimeWizardFragmentWizardFragment"/>
- <fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.AbstractJBossServerWizardFragment"
- id="org.jboss.ide.eclipse.as.ui.jboss32ServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.32"/>
+ class="org.jboss.ide.eclipse.as.ui.wizards.JBossServerWizardFragment"
+ id="org.jboss.ide.eclipse.as.ui.jbossServerWizardFragment"
+ typeIds="org.jboss.ide.eclipse.as.32,org.jboss.ide.eclipse.as.40,org.jboss.ide.eclipse.as.42"/>
<fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.AbstractJBossServerWizardFragment"
- id="org.jboss.ide.eclipse.as.ui.jboss40ServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.40"/>
- <fragment
- class="org.jboss.ide.eclipse.as.ui.wizards.AbstractJBossServerWizardFragment"
- id="org.jboss.ide.eclipse.as.ui.jboss42ServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.42"/>
- <fragment
class="org.jboss.ide.eclipse.as.ui.wizards.StrippedServerWizardFragment"
id="org.jboss.ide.eclipse.as.ui.strippedServerWizardFragment"
typeIds="org.jboss.ide.eclipse.as.systemCopyServer"/>
18 years, 4 months
JBoss Tools SVN: r2875 - trunk/seam/features/org.jboss.tools.seam.feature.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-08-02 22:17:54 -0400 (Thu, 02 Aug 2007)
New Revision: 2875
Modified:
trunk/seam/features/org.jboss.tools.seam.feature/feature.xml
Log:
updated with copyright/license etc
Modified: trunk/seam/features/org.jboss.tools.seam.feature/feature.xml
===================================================================
--- trunk/seam/features/org.jboss.tools.seam.feature/feature.xml 2007-08-03 02:12:39 UTC (rev 2874)
+++ trunk/seam/features/org.jboss.tools.seam.feature/feature.xml 2007-08-03 02:17:54 UTC (rev 2875)
@@ -9,7 +9,7 @@
JBossTools Seam Feature
</description>
- <copyright url="http://www.example.com/copyright">
+ <copyright>
Copyright (c) 2007 Red Hat, Inc.
Distributed under license by Red Hat, Inc. All rights reserved.
This program is made available under the terms of the
18 years, 4 months
JBoss Tools SVN: r2874 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-08-02 22:12:39 -0400 (Thu, 02 Aug 2007)
New Revision: 2874
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java
Log:
JBIDE-648 fixed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java 2007-08-03 02:11:48 UTC (rev 2873)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/WarArchiveType.java 2007-08-03 02:12:39 UTC (rev 2874)
@@ -69,8 +69,6 @@
}
public IArchive fillDefaultConfiguration(IProject project, IArchive topLevel, IProgressMonitor monitor) {
IModule mod = getModule(project.getName());
-// topLevel.setDestinationPath(new Path(project.getName()));
-// topLevel.setInWorkspace(true);
IArchiveFolder webinf = addFolder(project, topLevel, WEBINF);
IArchiveFolder lib = addFolder(project, webinf, LIB);
IArchiveFolder classes = addFolder(project, webinf, CLASSES);
@@ -169,7 +167,8 @@
IArchiveFolder lib = addFolder(project, webinf, LIB);
IArchiveFolder classes = addFolder(project, webinf, CLASSES);
- addFileset(project, topLevel, new Path(project.getName()).append(WEBCONTENT).toOSString(), null);
+// addFileset(project, topLevel, new Path(project.getName()).append(WEBCONTENT).toOSString(), null);
+ addWebContentFileset(project, topLevel);
addClassesFileset(project, classes);
// package each child and add to lib folder
18 years, 4 months
JBoss Tools SVN: r2873 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-08-02 22:11:48 -0400 (Thu, 02 Aug 2007)
New Revision: 2873
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
Log:
default should be exploded for easier incremental update
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-08-03 02:11:09 UTC (rev 2872)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-08-03 02:11:48 UTC (rev 2873)
@@ -160,6 +160,7 @@
IArchive topLevel = type.createDefaultConfiguration(module.getProject().getName(), monitor);
topLevel.setDestinationPath(new Path(deployDir));
topLevel.setInWorkspace(false);
+ topLevel.setExploded(true);
return topLevel;
}
return null;
18 years, 4 months
JBoss Tools SVN: r2872 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-08-02 22:11:09 -0400 (Thu, 02 Aug 2007)
New Revision: 2872
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/JBossLaunchAdapter.java
Log:
Servlet was wrong.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/JBossLaunchAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/JBossLaunchAdapter.java 2007-08-03 02:08:06 UTC (rev 2871)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/client/JBossLaunchAdapter.java 2007-08-03 02:11:09 UTC (rev 2872)
@@ -83,7 +83,7 @@
path = path.substring(1);
url = new URL(url, path);
} else
- url = new URL(url, "servlet/" + servlet.getServletClassName()); //$NON-NLS-1$
+ url = new URL(url, servlet.getName()); //$NON-NLS-1$
} else if (moduleObject instanceof WebResource) {
WebResource resource = (WebResource) moduleObject;
String path = resource.getPath().toString();
18 years, 4 months
JBoss Tools SVN: r2871 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-08-02 22:08:06 -0400 (Thu, 02 Aug 2007)
New Revision: 2871
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java
Log:
some internal dirs were not being created. rawblematic
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2007-08-02 21:50:41 UTC (rev 2870)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2007-08-03 02:08:06 UTC (rev 2871)
@@ -67,6 +67,7 @@
}
public static void copyFile(String source, de.schlichtherle.io.File file) {
+ file.getParentFile().mkdirs();
new de.schlichtherle.io.File(source).copyAllTo(file);
updateParentTimestamps(file);
}
18 years, 4 months
JBoss Tools SVN: r2870 - tags/richfaces-2.0.0.beta3.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-08-02 17:50:41 -0400 (Thu, 02 Aug 2007)
New Revision: 2870
Added:
tags/richfaces-2.0.0.beta3/vpe/
Log:
2.0.0.beta3 tag for
common
jsf
jst
vpe
Copied: tags/richfaces-2.0.0.beta3/vpe (from rev 2869, trunk/vpe)
18 years, 4 months