Author: dennyxu
Date: 2009-04-09 05:05:36 -0400 (Thu, 09 Apr 2009)
New Revision: 14624
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/IJBossESBFacetDataModelProperties.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-3847: JBoss Tools should provide features for full 4.5 ESB to support different
jboss-esb.xsd version(Apply Viacheslav's patch)
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/IJBossESBFacetDataModelProperties.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/IJBossESBFacetDataModelProperties.java 2009-04-09
08:44:06 UTC (rev 14623)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/IJBossESBFacetDataModelProperties.java 2009-04-09
09:05:36 UTC (rev 14624)
@@ -23,6 +23,8 @@
public static final String ESB_CONTENT_FOLDER =
"JBoss.Project.Content_Folder";
public static final String ESB_SOURCE_FOLDER = "JBoss.Project.Src_Folder";
+ public static final String ESB_CONFIG_VERSION =
"JBoss.Project.Config_Version";
+
public static final QualifiedName QNAME_ESB_CONTENT_FOLDER = new
QualifiedName("jboss", ESB_CONTENT_FOLDER);
public static final QualifiedName QNAME_ESB_SRC_FOLDER = new
QualifiedName("jboss", ESB_SOURCE_FOLDER);
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2009-04-09
08:44:06 UTC (rev 14623)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2009-04-09
09:05:36 UTC (rev 14624)
@@ -31,6 +31,7 @@
names.add(RUNTIME_ID);
names.add(RUNTIME_HOME);
names.add(RUNTIME_IS_SERVER_SUPPLIED);
+ names.add(IJBossESBFacetDataModelProperties.ESB_CONFIG_VERSION);
return names;
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2009-04-09
08:44:06 UTC (rev 14623)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2009-04-09
09:05:36 UTC (rev 14624)
@@ -111,20 +111,18 @@
private IFile createJBossESBXML(IFolder folder) throws CoreException{
StringBuffer emptyESB = new StringBuffer();
+ String configVersion =
model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONFIG_VERSION);
emptyESB.append("<?xml version = \"1.0\" encoding =
\"UTF-8\"?>");
emptyESB.append("\n");
- emptyESB.append("<jbossesb
xmlns=\"http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/et...
parameterReloadSecs=\"5\">");
+ emptyESB.append("<jbossesb
xmlns=\"http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/et...
+ configVersion + ".xsd\" parameterReloadSecs=\"5\">");
emptyESB.append("\n");
emptyESB.append("</jbossesb>");
IFile esbfile = folder.getFile("jboss-esb.xml");
esbfile.create(new ByteArrayInputStream(emptyESB.toString().getBytes()), true, null);
return esbfile;
- }
-
+ }
-
-
private void createProjectStructure(IProject project) throws CoreException{
String strContentFolder =
model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER,
strContentFolder);
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-04-09
08:44:06 UTC (rev 14623)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-04-09
09:05:36 UTC (rev 14624)
@@ -78,7 +78,9 @@
private Button btnUserSupplied;
private Button btnServerSupplied;
private Button btnNew;
-
+
+ private Combo cmbConfigVersions;
+
private IFacetedProjectListener fpListerner;
private IFacetedProjectWorkingCopy fpwc;
@@ -103,6 +105,7 @@
createProjectGroup(composite);
createRuntimeGroup(composite);
+ createConfigVersionGroup(composite);
setPageComplete(false);
setDefaultOutputFolder();
@@ -122,9 +125,11 @@
public void run() {
if(version != null){
initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+ initializeConfigVersionCombo(cmbConfigVersions, null,
version.getVersionString());
}else{
initializeRuntimesCombo(cmbRuntimes, null);
+ initializeConfigVersionCombo(cmbConfigVersions, null);
}
changePageStatus();
}
@@ -600,8 +605,52 @@
}
super.dispose();
}
-
-
+ private void createConfigVersionGroup(Composite parent) {
+ Group configGroup = new Group(parent, SWT.NONE);
+ configGroup.setText("ESB Config Version"); //TODO move to messages
+ configGroup.setLayout(new GridLayout(3, false));
+ configGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ GridData gd = new GridData();
+
+ cmbConfigVersions = new Combo(configGroup, SWT.READ_ONLY);
+ cmbConfigVersions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ cmbConfigVersions.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ String convigVersionName = cmbConfigVersions.getText();
+ saveESBConfigVersionToModel(convigVersionName);
+ changePageStatus();
+ }
+ });
+ initializeConfigVersionCombo(cmbConfigVersions, null);
+ }
+
+ protected void saveESBConfigVersionToModel(String convigVersionName) {
+ model.setStringProperty(
+ IJBossESBFacetDataModelProperties.ESB_CONFIG_VERSION, convigVersionName);
+ }
+
+ protected void initializeConfigVersionCombo(Combo cmVersions, String runtimeName) {
+ IProjectFacetVersion version = getSelectedESBVersion();
+ if(version != null) {
+ initializeConfigVersionCombo(cmbConfigVersions, null, version.getVersionString());
+
+ } else {
+ initializeConfigVersionCombo(cmbConfigVersions, null, ""); //$NON-NLS-1$
+ }
+ }
+
+ protected void initializeConfigVersionCombo(Combo cmVersions, String currentName, String
version) {
+ cmVersions.removeAll();
+ cmVersions.add("1.0.1"); //$NON-NLS-1$
+ if(version != null && version.equals("4.5")) { //$NON-NLS-1$
+ cmVersions.add("1.1.0"); //$NON-NLS-1$
+ }
+ int index = cmVersions.getItemCount() - 1;
+ String convigVersionName = cmVersions.getItem(index);
+ cmVersions.select(index);
+ saveESBConfigVersionToModel(convigVersionName);
+ }
}
\ No newline at end of file