Author: dennyxu
Date: 2008-10-15 06:25:57 -0400 (Wed, 15 Oct 2008)
New Revision: 10848
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.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/module/JBossESBModuleDelegate.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-2889: fix the bad refresh issue
JBIDE-2902: could not publish esb project
JBIDE-2888: set server supplied esb runtime as default
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-15 09:04:53 UTC
(rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-15 10:25:57 UTC
(rev 10848)
@@ -50,7 +50,7 @@
<supported>
<facet
id="jst.jboss.esb"
- version="4.2,4.3">
+ version="4.2,4.3,4.4">
</facet>
<runtime-component
id="org.jboss.ide.eclipse.as.runtime.component"
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-15
09:04:53 UTC (rev 10847)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-15
10:25:57 UTC (rev 10848)
@@ -12,5 +12,8 @@
public final static String ESB_CONFIG_QUEUE_SERVICE_JBM =
"jbm-queue-service.xml";
public final static String ESB_CONFIG_QUEUE_SERVICE_JBMQ =
"jbmq-queue-service.xml";
+ public final static String DEFAULT_ESB_CONFIG_RESOURCE_FOLDER = "resources";
+ public final static String DEFAULT_ESB_SOURCE_FOLDER = "src";
+
public final static String ESB_PROJECT_NATURE =
"org.jboss.tools.esb.project.ESBNature";
}
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 2008-10-15
09:04:53 UTC (rev 10847)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2008-10-15
10:25:57 UTC (rev 10848)
@@ -6,6 +6,7 @@
import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
import org.eclipse.jst.j2ee.project.facet.J2EEModuleFacetInstallDataModelProvider;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.esb.core.ESBProjectConstant;
public class JBossESBFacetDataModelProvider extends
J2EEModuleFacetInstallDataModelProvider implements IJBossESBFacetDataModelProperties{
@@ -28,15 +29,17 @@
return JBOSSESB_PROJECT_FACET;
}
else if(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER.equals(propertyName)){
- return "esbcontent";
+ return
"esbcontent";//ESBProjectConstant.DEFAULT_ESB_CONFIG_RESOURCE_FOLDER;
}
else if(IJBossESBFacetDataModelProperties.ESB_SOURCE_FOLDER.equals(propertyName)){
- return "src";
+ return ESBProjectConstant.DEFAULT_ESB_SOURCE_FOLDER;
}
else if(propertyName.equals(RUNTIME_ID)){
return "";
}else if(propertyName.equals(FACET_ID)){
return IJBossESBFacetDataModelProperties.JBOSS_ESB_FACET_ID;
+ } else if( propertyName.equals(RUNTIME_IS_SERVER_SUPPLIED)){
+ return true;
}
return super.getDefaultProperty(propertyName);
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-15
09:04:53 UTC (rev 10847)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-15
10:25:57 UTC (rev 10848)
@@ -40,40 +40,60 @@
IJavaProject javaPrj = JavaCore.create(project);
IPath output = javaPrj.getOutputLocation();
// if the jboss-esb.xml file is not in META-INF folder, try to get it from other folder
of the project
+ List<IModuleResource> mrs = getConfigModuleFile(project, configFolder);
+
+ IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
+ IModuleResource[] classes = getModuleResources(Path.EMPTY,
project.getWorkspace().getRoot().getFolder(output));
+ IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length
+ mrs.size()];
+ System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
+ System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
+ if(mrs.size() > 0){
+ IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
+ System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
+ }
+ return allResource;
+ }
+
+ private List<IModuleResource> getConfigModuleFile(IProject project, IFolder
configFolder) throws CoreException {
List<IModuleResource> mrs = new ArrayList<IModuleResource>();
IFolder metainf = configFolder.getFolder(ESBProjectConstant.META_INF);
IResource res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ IModuleFile tmpmf;
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF),
project, ESBProjectConstant.ESB_CONFIG_JBOSSESB));
+ tmpmf = getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF),
project, ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ if( tmpmf != null){
+ mrs.add(tmpmf);
+ }
}
//check the deployment.xml just like jboss-esb.xml
res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_DEPLOYMENT);
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF),
project, ESBProjectConstant.ESB_CONFIG_DEPLOYMENT));
+ tmpmf = getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF),
project, ESBProjectConstant.ESB_CONFIG_DEPLOYMENT);
+ if(tmpmf != null){
+ mrs.add(tmpmf);
+ }
}
res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM);
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project,
ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM));
+ tmpmf = getModuleResourcesOutofESBContent(Path.EMPTY, project,
ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM);
+ if(tmpmf != null){
+ mrs.add(tmpmf);
+ }
}
res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ);
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project,
ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ));
+ tmpmf = getModuleResourcesOutofESBContent(Path.EMPTY, project,
ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ);
+ if( tmpmf != null ){
+ mrs.add(tmpmf);
+ }
}
- IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
- IModuleResource[] classes = getModuleResources(Path.EMPTY,
project.getWorkspace().getRoot().getFolder(output));
- IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length
+ mrs.size()];
- System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
- System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
- if(mrs.size() > 0){
- IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
- System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
- }
- return allResource;
+ return mrs;
}
+
@Override
public IStatus validate() {
return null;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml 2008-10-15 09:04:53 UTC
(rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml 2008-10-15 10:25:57 UTC
(rev 10848)
@@ -31,5 +31,12 @@
name="JBoss ESB Runtimes">
</page>
</extension>
-
+ <extension
+ point="org.eclipse.wst.server.ui.serverImages">
+ <image
+ icon="icons/wizards/esb.gif"
+ id="org.jboss.tools.esb.project.ui.image"
+ typeIds="jst.jboss.esb">
+ </image>
+ </extension>
</plugin>
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-10-15
09:04:53 UTC (rev 10847)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-10-15
10:25:57 UTC (rev 10848)
@@ -35,7 +35,7 @@
ESBFacetInstallationPage_Button_Text_New=New
ESBFacetInstallationPage_Default_SRC_Folder=src
ESBFacetInstallationPage_Description=Configure project structure and classpath
-ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=Please specify Target
Runtime at the first wizard page.
+ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=Please specify the
project primary target runtime
ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime=The specified target runtime
does not contain a valid ESB runtime.
ESBFacetInstallationPage_Error_Message_No_Target_Runtime=No target runtime was
specified.
ESBFacetInstallationPage_Error_Message_Specify_Content_Folder=Please specify a valid
content folder.
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 2008-10-15
09:04:53 UTC (rev 10847)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-15
10:25:57 UTC (rev 10848)
@@ -66,6 +66,9 @@
private Button btnServerSupplied;
private Button btnNew;
+ private IFacetedProjectListener fpListerner;
+ private IFacetedProjectWorkingCopy fpwc;
+
public ESBFacetInstallationPage() {
super( "esb.facet.install.page"); //$NON-NLS-1$
setTitle(JBossESBUIMessages.ESBFacetInstallationPage_Title);
@@ -94,33 +97,44 @@
Dialog.applyDialogFont(parent);
// add listener to listen the changes on the project facet
- final IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
- fpwc.addListener(new IFacetedProjectListener(){
+ fpwc = getFacetedProjectWorkingCopy();
+ if(fpListerner == null){
+ fpListerner = new IFacetedProjectListener(){
- public void handleEvent(IFacetedProjectEvent event) {
- IProjectFacet facet =
ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
- final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
- Display.getDefault().syncExec(new Runnable() {
+ public void handleEvent(IFacetedProjectEvent event) {
+ IProjectFacet facet =
ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
+ final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
+ Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if(version != null){
- initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
- }else{
- initializeRuntimesCombo(cmbRuntimes, null);
+ public void run() {
+ if(version != null){
+ initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+
+ }else{
+ initializeRuntimesCombo(cmbRuntimes, null);
+ }
+ changePageStatus();
}
- }
+
+ });
- });
-
- }
- }, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
+ }
+ };
+ }
+ if(fpwc != null){
+ fpwc.addListener(fpListerner, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED,
+ IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
+ }
+ //set page status
+ changePageStatus();
+
return composite;
}
private void createProjectGroup(Composite parent){
- Group prjGroup = new Group(parent, SWT.BORDER);
+ Group prjGroup = new Group(parent, SWT.NONE);
prjGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Text_Folder);
prjGroup.setLayout(new GridLayout(1, false));
prjGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -208,7 +222,7 @@
private void createRuntimeGroup(Composite parent){
- Group runtimeGroup = new Group(parent, SWT.BORDER);
+ Group runtimeGroup = new Group(parent, SWT.NONE);
runtimeGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Runtime_Text);
runtimeGroup.setLayout(new GridLayout(3, false));
runtimeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -270,6 +284,9 @@
hasRuntime = false;
}
+ //set default ESB runtime option
+ btnServerSupplied.setSelection(true);
+ enableUserSupplied(false);
}
@@ -314,31 +331,11 @@
}
private void checkServerSuppliedESBRuntime() {
- String prjname = model.getStringProperty(FACET_PROJECT_NAME);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- prjname);
try {
- IFacetedProject fp = ProjectFacetsManager.create(project);
- if (fp != null) {
- IRuntime runtime = fp.getPrimaryRuntime();
- if (runtime == null) {
- setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_No_Target_Runtime);
- hasRuntime = false;
- setPageComplete(isPageComplete());
- return;
- }
- org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
- .findRuntime(runtime.getProperty("id"));
- if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString())) {
- setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
- hasRuntime = false;
- setPageComplete(isPageComplete());
- return;
- }
- } else {
- IFacetedProjectWorkingCopy ifpwc = getFacetedProjectWorkingCopy();
+ IFacetedProjectWorkingCopy ifpwc = getFacetedProjectWorkingCopy();
+ //when the UI is loaded from esb project creation wizard
+ if (ifpwc != null) {
IRuntime runtime = ifpwc.getPrimaryRuntime();
if (runtime == null) {
setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime);
@@ -356,8 +353,33 @@
setPageComplete(isPageComplete());
return;
}
+ }
+ // when the UI loaded from project facet properties page
+ else {
+ String prjname = model.getStringProperty(FACET_PROJECT_NAME);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjname);
+ IFacetedProject fp = ProjectFacetsManager.create(project);
+ // if fp != null , the UI will be loaded for an exist project
+ if (fp != null) {
+ IRuntime runtime = fp.getPrimaryRuntime();
+ if (runtime == null) {
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_No_Target_Runtime);
+ hasRuntime = false;
+ setPageComplete(isPageComplete());
+ return;
+ }
+ org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
+ .findRuntime(runtime.getProperty("id"));
+ if (!JBossRuntimeManager.isValidESBServer(serverRuntime
+ .getLocation().toOSString())) {
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
+ hasRuntime = false;
+ setPageComplete(isPageComplete());
+ return;
+ }
+ }
}
-
+
} catch (CoreException e) {
ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
}
@@ -419,7 +441,7 @@
selectedJbRuntime = jr;
selectIndex = i;
}
- // get default jbossws runtime
+ // get default jbossws runtime from esb runtime preference
if (jr.isDefault()) {
defaultJbws = jr;
defaultIndex = i;
@@ -428,10 +450,14 @@
if(selectedJbRuntime != null){
cmRuntime.select(selectIndex);
- saveJBossESBRuntimeToModel(selectedJbRuntime);
+ if(btnUserSupplied.getSelection()){
+ saveJBossESBRuntimeToModel(selectedJbRuntime);
+ }
}else if(defaultJbws != null){
cmRuntime.select(defaultIndex);
- saveJBossESBRuntimeToModel(defaultJbws);
+ if(btnUserSupplied.getSelection()){
+ saveJBossESBRuntimeToModel(defaultJbws);
+ }
}
}
@@ -523,7 +549,7 @@
/* private void fillMessageGroup(Composite parent){
- Group messageGroup = new Group(parent, SWT.BORDER);
+ Group messageGroup = new Group(parent, SWT.);
messageGroup.setText("Target Message Product");
messageGroup.setLayout(new GridLayout(1, false));
messageGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -547,5 +573,15 @@
return null;
}
+ @Override
+ public void dispose() {
+ if(fpwc != null){
+ fpwc.removeListener(fpListerner);
+ }
+ super.dispose();
+ }
+
+
+
}
\ No newline at end of file