JBoss Tools SVN: r10703 - in trunk/esb/plugins: org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-07 04:46:38 -0400 (Tue, 07 Oct 2008)
New Revision: 10703
Added:
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.ui/src/org/jboss/tools/esb/project/ui/messages/
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/JBossESBUIMessages.java
Removed:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectUtilities.java
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/JBossESBUIMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/
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/JBossClassPathCommand.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.core/src/org/jboss/tools/esb/core/messages/JBossFacetCore.properties
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCoreMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.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.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.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/preference/controls/BaseFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ButtonFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/CompositeEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/TextFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
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/ESBProjectFirstPage.java
Log:
JBIDE-2864: Add the support of getting ESB runtime from the project target runtime
Copied: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java (from rev 10017, trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectUtilities.java)
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -0,0 +1,13 @@
+package org.jboss.tools.esb.core;
+
+public class ESBProjectConstant {
+
+ public final static String ESB_PROJECT_FACET = "jst.jboss.esb";
+ public final static String ESB_PROJECT_FACET_TEMPLATE = "template.jst.jboss.esb";
+ public final static String BUILD_CLASSES = "build/classes";
+ public final static String META_INF = "META-INF";
+
+ public final static String ESB_DEPLOYMENT_FILE_NAME = "META-INF/deployment.xml";
+
+ public final static String ESB_PROJECT_NATURE = "org.jboss.tools.esb.project.ESBNature";
+}
Deleted: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectUtilities.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectUtilities.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectUtilities.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -1,10 +0,0 @@
-package org.jboss.tools.esb.core;
-
-public class ESBProjectUtilities {
-
- public final static String ESB_PROJECT_FACET = "jst.jboss.esb";
- public final static String ESB_PROJECT_FACET_TEMPLATE = "template.jst.jboss.esb";
- public final static String BUILD_CLASSES = "build/classes";
-
- 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/IJBossESBFacetDataModelProperties.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/IJBossESBFacetDataModelProperties.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/IJBossESBFacetDataModelProperties.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -1,9 +1,9 @@
package org.jboss.tools.esb.core.facet;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-public interface IJBossESBFacetDataModelProperties extends IFacetProjectCreationDataModelProperties {
+public interface IJBossESBFacetDataModelProperties extends IFacetDataModelProperties {
public static final String USER_DEFINED_LOCATION = "IProjectCreationPropertiesNew.USER_DEFINED_LOCATION"; //$NON-NLS-1$
public static final String DEFAULT_LOCATION = "IProjectCreationPropertiesNew.DEFAULT_LOCATION"; //$NON-NLS-1$
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -27,17 +28,21 @@
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.jboss.tools.esb.core.StatusUtils;
import org.jboss.tools.esb.core.messages.JBossFacetCoreMessages;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
/**
- * @author Grid Qian
+ * @author Denny Xu
*/
public class JBossClassPathCommand extends AbstractDataModelOperation {
IProject project;
private IDataModel model;
+ private String serverRuntimeId;
public JBossClassPathCommand(IProject project, IDataModel model) {
this.project = project;
@@ -54,43 +59,58 @@
try {
// store runtime name and runtime location to the project
-
- String runtimeName = model
- .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
- String runtimeLocation = model
- .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_HOME);
- String esbcontentFolder = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
- project
- .setPersistentProperty(
- IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME,
- runtimeName);
- project
- .setPersistentProperty(
- IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
- runtimeLocation);
- project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER, esbcontentFolder);
- status = addClassPath(project, runtimeName);
+ boolean isServerSupplied = model.getBooleanProperty(IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED);
+ if(isServerSupplied){
+ serverRuntimeId = getProjectTargetRuntimeID(project);
+ String[] segments = new String[]{JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED,
+ serverRuntimeId};
+ status = addClassPath(project, segments);
+ }else{
+ String runtimeName = model
+ .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
+ String runtimeLocation = model
+ .getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_HOME);
+ String esbcontentFolder = model.getStringProperty(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER);
+ project
+ .setPersistentProperty(
+ IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME,
+ runtimeName);
+ project
+ .setPersistentProperty(
+ IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
+ runtimeLocation);
+ project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER, esbcontentFolder);
+ status = addClassPath(project, new String[]{runtimeName});
+ }
+
} catch (CoreException e) {
status = StatusUtils.errorStatus(
- JBossFacetCoreMessages.Error_Add_Facet_JBossWS, e);
+ JBossFacetCoreMessages.Error_Add_Facet_JBossESB, e);
}
return status;
}
- public IStatus addClassPath(IProject project, String segment) {
+ private String getProjectTargetRuntimeID(IProject project) throws CoreException{
+ IFacetedProject fp = ProjectFacetsManager.create(project);
+ IRuntime runtime = fp.getPrimaryRuntime();
+ return runtime.getProperty("id");
+
+ }
+
+ public IStatus addClassPath(IProject project, String[] segments) {
IStatus status = Status.OK_STATUS;
try {
IClasspathEntry newClasspath;
IJavaProject javaProject = JavaCore.create(project);
+ IPath path = new Path(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID);
+ for(String segment: segments ){
+ path = path.append(segment);
+ }
+ newClasspath = JavaCore.newContainerEntry(path);
- newClasspath = JavaCore
- .newContainerEntry(new Path(
- JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID)
- .append(segment));
-
IClasspathEntry[] oldClasspathEntries = javaProject
.readRawClasspath();
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-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -19,6 +19,7 @@
names.add(IJBossESBFacetDataModelProperties.ESB_SOURCE_FOLDER);
names.add(RUNTIME_ID);
names.add(RUNTIME_HOME);
+ names.add(RUNTIME_IS_SERVER_SUPPLIED);
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 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -63,13 +63,11 @@
String runtimeId = model
.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
- if (runtimeId != null && !runtimeId.equals("")) {
- JBossClassPathCommand command = new JBossClassPathCommand(project,
+ JBossClassPathCommand command = new JBossClassPathCommand(project,
model);
- IStatus status = command.executeOverride(monitor);
- if (!status.equals(Status.OK_STATUS)) {
- throw new CoreException(status);
- }
+ IStatus status = command.executeOverride(monitor);
+ if (!status.equals(Status.OK_STATUS)) {
+ throw new CoreException(status);
}
ClasspathHelper.removeClasspathEntries(project, fv);
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCore.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCore.properties 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCore.properties 2008-10-07 08:46:38 UTC (rev 10703)
@@ -6,9 +6,9 @@
Dir_Web_Content=WebContent
Error_Copy=Exception while copy runtime jars
ESB_Location=jbossesbruntimelocation
-JBossWS_Runtime=JBoss ESB Runtime
+JBoss_Runtime=JBoss ESB Runtime
JBossAS=JBOSS
Error_WS_Location=The JBoss ESB Runtime Location is NULL
Error_WS_Classpath=A error comes up when create JBoss ESB runtime Classpath
-Error_Add_Facet_JBossWS=Exception while install JBoss ESB facet
+Error_Add_Facet_JBossESB=Exception while install JBoss ESB facet
Error_Remove_Facet_JBossWS=Exception while uninstall JBoss ESB facet
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCoreMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCoreMessages.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/messages/JBossFacetCoreMessages.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -32,11 +32,11 @@
public static String Dir_Web_Content;
public static String Error_Copy;
public static String ESB_Location;
- public static String JBossWS_Runtime;
+ public static String JBoss_Runtime;
public static String JBossAS;
public static String Error_WS_Location;
public static String Error_WS_Classpath;
- public static String Error_Add_Facet_JBossWS;
+ public static String Error_Add_Facet_JBossESB;
public static String Error_Remove_Facet_JBossWS;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -9,13 +9,11 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.ModuleFactory;
import org.eclipse.wst.server.core.internal.ModuleType;
import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-import org.jboss.tools.esb.core.ESBProjectUtilities;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.core.ESBProjectCorePlugin;
public class JBossESBModule implements IModule{
@@ -29,7 +27,6 @@
}
public Object getAdapter(Class adapter) {
- // TODO Auto-generated method stub
return null;
}
@@ -44,11 +41,11 @@
if (facetPrj == null) {
return null;
}
- final IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ final IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
final IProjectFacetVersion fv = facetPrj.getInstalledVersion(esbfacet);
return ModuleType.getModuleType(esbfacet.getId(), fv.getVersionString());
} catch (CoreException e) {
- e.printStackTrace();
+ ESBProjectCorePlugin.getDefault().getLog().log(e.getStatus());
}
return null;
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-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -14,11 +14,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.internal.ModuleResourceDelta;
import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
import org.eclipse.wst.server.core.util.ModuleFile;
import org.eclipse.wst.server.core.util.ModuleFolder;
import org.eclipse.wst.server.core.util.ProjectModule;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -7,9 +7,9 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.util.ProjectModule;
import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
-import org.jboss.tools.esb.core.ESBProjectUtilities;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.core.ESBProjectCorePlugin;
public class JBossESBModuleFactory extends ProjectModuleFactoryDelegate {
@@ -32,13 +32,14 @@
if (facetProject == null) {
return null;
}
- IProjectFacet esbFacet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ IProjectFacet esbFacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
+
if(facetProject.hasProjectFacet(esbFacet)){
JBossESBModule module = new JBossESBModule(project, this, this.getId());
return new IModule[]{ module };
}
} catch (CoreException e) {
- e.printStackTrace();
+ ESBProjectCorePlugin.getDefault().getLog().log(e.getStatus());
}
return null;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -15,7 +15,7 @@
import java.util.List;
/**
- * @author Grid Qian
+ * @author Denny Xu
*/
public class JBossRuntime {
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ClasspathContainerInitializer;
import org.eclipse.jdt.core.IClasspathContainer;
@@ -23,50 +24,70 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.tools.esb.core.ESBProjectCorePlugin;
+import org.jboss.tools.esb.core.StatusUtils;
import org.jboss.tools.esb.core.messages.JBossFacetCoreMessages;
/**
- * @author Grid Qian
+ * @author Denny Xu
*/
public class JBossRuntimeClassPathInitializer extends
ClasspathContainerInitializer {
public final static String JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID = "org.jboss.esb.runtime.classpath";
+ public final static String JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED = "server.supplied";
public JBossRuntimeClassPathInitializer() {
}
private String segment;
+ private boolean isServerSupplied = false;
+ private IJavaProject javaProject;
@Override
public void initialize(IPath containerPath, IJavaProject project)
throws CoreException {
-
+ this.javaProject = project;
if (containerPath.segment(0).equals(
JBOSS_ESB_RUNTIME_CLASSPATH_CONTAINER_ID)) {
+ if(containerPath.segmentCount() == 3
+ && containerPath.segment(1).equals(JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED)){
+ segment = containerPath.segment(2);
+ isServerSupplied = true;
+ }else{
+ segment = containerPath.segment(1);
+ isServerSupplied = false;
+ }
+
JBossRuntimeClasspathContainer container = new JBossRuntimeClasspathContainer(
- containerPath);
- segment = containerPath.segment(1);
+ containerPath, project, isServerSupplied);
JavaCore.setClasspathContainer(containerPath,
new IJavaProject[] { project },
- new IClasspathContainer[] { container }, null);
+ new IClasspathContainer[] { container }, null);
}
}
public IClasspathEntry[] getEntries(IPath path) {
- return new JBossRuntimeClasspathContainer(path).getClasspathEntries();
+ return new JBossRuntimeClasspathContainer(path, javaProject, isServerSupplied).getClasspathEntries();
}
public class JBossRuntimeClasspathContainer implements
IClasspathContainer {
private IPath path;
+ private boolean isFromServer = false;
private IClasspathEntry[] entries = null;
+ private IJavaProject jproject;
+ private List<String> jars;
- public JBossRuntimeClasspathContainer(IPath path) {
+ public JBossRuntimeClasspathContainer(IPath path, IJavaProject project, boolean isFromServer) {
this.path = path;
+ this.isFromServer = isFromServer;
+ this.jproject = project;
}
public String getDescription() {
- return JBossFacetCoreMessages.JBossWS_Runtime;
+ return JBossFacetCoreMessages.JBoss_Runtime;
}
public int getKind() {
@@ -80,18 +101,35 @@
public IClasspathEntry[] getClasspathEntries() {
if (entries == null) {
ArrayList<IClasspathEntry> entryList = new ArrayList<IClasspathEntry>();
- JBossRuntime jbws = JBossRuntimeManager.getInstance()
- .findRuntimeByName(segment);
- if (jbws != null) {
-
- List<String> jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(jbws);
- for (String jar : jars) {
- entryList.add(getEntry(new Path(jar)));
+ if (isFromServer) {
+ IRuntime serverRuntime = ServerCore.findRuntime(segment);
+
+ if(serverRuntime == null){
+ IStatus status = StatusUtils.errorStatus("Can not find the runtime: "+ segment);
+ ESBProjectCorePlugin.getDefault().getLog().log(status);
+ }
+ String runtimeLocation = serverRuntime.getLocation().toOSString();
+ jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(runtimeLocation);
+
+ } else {
+
+ JBossRuntime jbws = JBossRuntimeManager.getInstance()
+ .findRuntimeByName(segment);
+ if (jbws != null) {
+ jars = JBossRuntimeManager.getInstance()
+ .getAllRuntimeJars(jbws);
}
- entries = entryList.toArray(new IClasspathEntry[entryList.size()]);
- if (entries == null)
- return new IClasspathEntry[0];
}
+
+ if(jars == null) return new IClasspathEntry[0];
+
+ for (String jar : jars) {
+ entryList.add(getEntry(new Path(jar)));
+ }
+ entries = entryList.toArray(new IClasspathEntry[entryList
+ .size()]);
+ if (entries == null)
+ return new IClasspathEntry[0];
}
return entries;
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -10,7 +10,7 @@
/**
*
- * @author Grid Qian
+ * @author Denny Xu
*
*/
public class JBossRuntimeListConverter {
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -34,7 +34,7 @@
import org.jboss.tools.esb.core.messages.JBossFacetCoreMessages;
/**
- * @author Grid Qian
+ * @author Denny Xu
*/
public class JBossRuntimeManager {
@@ -158,36 +158,42 @@
} else {
- IPath rtHome = new Path(rt.getHomeDir());
- IPath deployPath = rtHome.append("server").append("default").append("deploy");
-
- IPath esbPath = deployPath.append(JBOSSESB_ESB);
- IPath sarPath = deployPath.append(JBOSSESB_SAR);
-
- IPath libPath = rtHome.append("lib");
-
- if (!esbPath.toFile().exists() || !sarPath.toFile().exists()) {
- esbPath = libPath.append(JBOSSESB_ESB);
- sarPath = libPath.append(JBOSSESB_SAR);
-
- }
-
- List<File> esblibs = getJarsOfFolder(esbPath.toFile());
- IPath sarLibPath = sarPath.append("lib");
- List<File> sarJars = getJarsOfFolder(sarLibPath.toFile());
- ///List<File> commonLibs = getJarsOfFolder(libPath.toFile());
- //List<File> tmpLibs = mergeTwoFileList(esblibs, sarJars);
- //libs.addAll(commonLibs);
-
- jarList = mergeTwoList(esblibs, sarJars);
-
+ jarList = getAllRuntimeJars(rt.getHomeDir());
}
}
return jarList;
}
+ public List<String> getAllRuntimeJars(String runtimeLocation) {
+ List<String> jarList = new ArrayList<String>();
+ IPath rtHome = new Path(runtimeLocation);
+ IPath deployPath = rtHome.append("server").append("default").append(
+ "deploy");
+
+ IPath esbPath = deployPath.append(JBOSSESB_ESB);
+ IPath sarPath = deployPath.append(JBOSSESB_SAR);
+
+ IPath libPath = rtHome.append("lib");
+
+ if (!esbPath.toFile().exists() || !sarPath.toFile().exists()) {
+ esbPath = libPath.append(JBOSSESB_ESB);
+ sarPath = libPath.append(JBOSSESB_SAR);
+
+ }
+
+ List<File> esblibs = getJarsOfFolder(esbPath.toFile());
+ IPath sarLibPath = sarPath.append("lib");
+ List<File> sarJars = getJarsOfFolder(sarLibPath.toFile());
+ // /List<File> commonLibs = getJarsOfFolder(libPath.toFile());
+ // List<File> tmpLibs = mergeTwoFileList(esblibs, sarJars);
+ // libs.addAll(commonLibs);
+
+ jarList = mergeTwoList(esblibs, sarJars);
+
+ return jarList;
+ }
private List<File> getJarsOfFolder(File folder){
List<File> jars = new ArrayList<File>();
@@ -376,8 +382,7 @@
try {
facetedProjects = ProjectFacetsManager.getFacetedProjects(facet);
} catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ return false;
}
for (IFacetedProject facetedProject : facetedProjects) {
QualifiedName qRuntimeName = IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME;
@@ -402,5 +407,42 @@
runtimes = converter.getMap(runtimeListString);
}
+
+ public static boolean isValidESBServer(String path){
+ IPath serverLocation = new Path(path);
+
+ String esbLcoationSeg = "server" + File.separator + "default"
+ + File.separator + "deploy" + File.separator
+ + "jbossesb.esb";
+ String sarLocationSeg = "server" + File.separator + "default"
+ + File.separator + "deploy" + File.separator
+ + "jbossesb.sar";
+ IPath esbLocation = serverLocation.append(esbLcoationSeg);
+ IPath sarLocation = serverLocation.append(sarLocationSeg);
+
+ if(!esbLocation.toFile().isDirectory()){
+ return false;
+ }
+ if(!sarLocation.toFile().isDirectory()){
+ return false;
+ }
+
+
+ return true;
+ }
+
+ public static boolean isValidESBStandaloneRuntimeDir(String path) {
+ IPath location = new Path(path);
+ IPath esblocation = location.append("lib").append("jbossesb.esb");
+ IPath sarLocation = location.append("lib").append("jbossesb.sar");
+ if (!esblocation.toFile().isDirectory()) {
+ return false;
+ }
+ if (!sarLocation.toFile().isDirectory()) {
+ return false;
+ }
+ return true;
+ }
+
}
\ No newline at end of file
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-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml 2008-10-07 08:46:38 UTC (rev 10703)
@@ -1,21 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
- <extension-point id="org.jboss.tools.esb.project.ui.template" name="ESB Template" schema="schema/org.jboss.tools.esb.project.ui.template.exsd"/>
<extension
point="org.eclipse.ui.newWizards">
<wizard
- category="org.jboss.tools.esb.category1"
+ category="org.jboss.tools.esb.ui"
class="org.jboss.tools.esb.project.ui.wizards.ESBProjectWizard"
icon="$nl$/icons/wizards/esb.gif"
id="JBoss.ESB.Project.Wizard"
- name="ESB Project Wizard"
+ name="ESB Project"
project="true">
</wizard>
- <category
- id="org.jboss.tools.esb.category1"
- name="ESB Wizard">
- </category>
</extension>
<extension
Copied: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages (from rev 10374, trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages)
Deleted: 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/preference/messages/JBossESBUI.properties 2008-09-19 05:42:06 UTC (rev 10374)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-10-07 08:46:38 UTC (rev 10703)
@@ -1,32 +0,0 @@
-Label_JBoss_Runtime_Load_Error=Error occurred while loading JBoss ESB runtime. Please select a correct JBoss ESB runtime or JBoss ESB server location
-
-Error_JBoss_Basic_Editor_Composite=Parent control should be Composite
-Error_JBoss_Basic_Editor_Support=Editor supports only grid layout
-Error_JBoss_Basic_Editor_Different=Parent for label is different
-JBoss_Runtime_List_Field_Editor_Name=Name
-JBoss_Runtime_List_Field_Editor_Version=Version
-JBoss_Runtime_List_Field_Editor_Path=Path
-JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be=inputElement must be
-JBoss_Runtime_List_Field_Editor_An_Instance_Of_List=an instance of List<JBossRuntime>.
-JBoss_Runtime_Delete_Confirm_Title=Confirm Runtime Delete
-JBoss_Runtime_Delete_Used_Confirm=Runtime ''{0}'' is used by JBoss ESB projects. Are you sure you want to delete it?
-JBoss_Runtime_Delete_Not_Used_Confirm=Are you sure you want to delete runtime ''{0}''?
-JBoss_Runtime_List_Field_Editor_Edit_Runtime=Edit JBoss ESB Runtime
-JBoss_Runtime_List_Field_Editor_Modify_Runtime=Input new values
-JBoss_Runtime_List_Field_Editor_New_Runtime=New JBoss ESB Runtime
-Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty=Path to JBoss ESB runtime home directory cannot be empty
-JBoss_Runtime_List_Field_Editor_Already_Exists=' already exists
-JBoss_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
-Error_JBoss_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct=Runtime name is not correct
-Error_JBoss_Runtime_List_Field_Editor_Name_Cannot_Be_Empty=Name cannot be empty
-Error_JBoss_Runtime_List_Field_Editor_Version_Cannot_Be_Empty=Version cannot be empty
-JBoss_Runtime_List_Field_Editor_Create_A_Runtime=Create a JBoss ESB Runtime
-JBoss_Runtime_List_Field_Editor_Home_Folder=Home Folder:
-JBoss_Composite_Editor_This_Method_Can_Be_Invoked=This metod can be invoked after getEditorControls(parent) only
-JBoss_Button_Field_Editor_Browse=Browse...
-Error_JBoss_Button_Field_Editor_Not_Implemented_Yet=Not implemented yet. Please setup real acion for editor.
-JBoss_SWT_Field_Editor_Factory_Browse=Browse...
-JBoss_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBoss ESB runtime Home Folder
-JBoss_Runtime_List_Field_Editor_Name2=Name:
-JBoss_Runtime_Check_Field_Default_Classpath=Customize JBoss ESB runtime jars
-JBoss_Preference_Page_Runtimes=JBoss ESB Runtimes
\ No newline at end of file
Copied: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties (from rev 10702, trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUI.properties)
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-10-07 08:46:38 UTC (rev 10703)
@@ -0,0 +1,56 @@
+Label_JBoss_Runtime_Load_Error=Error occurred while loading JBoss ESB runtime. Please select a correct JBoss ESB runtime or JBoss ESB server location
+
+Error_JBoss_Basic_Editor_Composite=Parent control should be Composite
+Error_JBoss_Basic_Editor_Support=Editor supports only grid layout
+Error_JBoss_Basic_Editor_Different=Parent for label is different
+JBoss_Runtime_List_Field_Editor_Name=Name
+JBoss_Runtime_List_Field_Editor_Version=Version
+JBoss_Runtime_List_Field_Editor_Path=Path
+JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be=inputElement must be
+JBoss_Runtime_List_Field_Editor_An_Instance_Of_List=an instance of List<JBossRuntime>.
+JBoss_Runtime_Delete_Confirm_Title=Confirm Runtime Delete
+JBoss_Runtime_Delete_Used_Confirm=Runtime ''{0}'' is used by JBoss ESB projects. Are you sure you want to delete it?
+JBoss_Runtime_Delete_Not_Used_Confirm=Are you sure you want to delete runtime ''{0}''?
+JBoss_Runtime_List_Field_Editor_Edit_Runtime=Edit JBoss ESB Runtime
+JBoss_Runtime_List_Field_Editor_Modify_Runtime=Input new values
+JBoss_Runtime_List_Field_Editor_New_Runtime=New JBoss ESB Runtime
+Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty=Path to JBoss ESB runtime home directory cannot be empty
+JBoss_Runtime_List_Field_Editor_Already_Exists=' already exists
+JBoss_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
+Error_JBoss_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct=Runtime name is not correct
+Error_JBoss_Runtime_List_Field_Editor_Name_Cannot_Be_Empty=Name cannot be empty
+Error_JBoss_Runtime_List_Field_Editor_Version_Cannot_Be_Empty=Version cannot be empty
+JBoss_Runtime_List_Field_Editor_Create_A_Runtime=Create a JBoss ESB Runtime
+JBoss_Runtime_List_Field_Editor_Home_Folder=Home Folder:
+JBoss_Composite_Editor_This_Method_Can_Be_Invoked=This method can be invoked after getEditorControls(parent) only
+JBoss_Button_Field_Editor_Browse=Browse...
+Error_JBoss_Button_Field_Editor_Not_Implemented_Yet=Not implemented yet. Please setup real acion for editor.
+JBoss_SWT_Field_Editor_Factory_Browse=Browse...
+JBoss_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBoss ESB runtime Home Folder
+JBoss_Runtime_List_Field_Editor_Name2=Name:
+JBoss_Runtime_Check_Field_Default_Classpath=Customize JBoss ESB runtime jars
+JBoss_Preference_Page_Runtimes=JBoss ESB Runtimes
+
+
+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_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.
+ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime=Please specify a ESB runtime
+ESBFacetInstallationPage_Error_Message_Specify_Source_Folder=Please specify a valid source folder.
+ESBFacetInstallationPage_Group_Runtime_Text=JBoss ESB Runtime
+ESBFacetInstallationPage_Group_Text_Folder=Project Folders
+ESBFacetInstallationPage_Label_Content_Directory=Content Directory
+ESBFacetInstallationPage_Label_Server_Supplied_Runtime=Server supplied ESB Runtime
+ESBFacetInstallationPage_Label_Source_Directory=Java Source Directory
+ESBFacetInstallationPage_Title=Install ESB Facet
+
+
+ESBProjectFirstPage_Description=Create a new JBoss ESB project.
+ESBProjectFirstPage_Title=JBoss ESB Project
+
+
+ESBProjectWizard_Title=New ESB Project Wizard
Deleted: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUIMessages.java 2008-09-19 05:42:06 UTC (rev 10374)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.esb.project.ui.preference.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @author Grid Qian
- */
-public final class JBossESBUIMessages extends NLS {
-
- private static final String BUNDLE_NAME =
- "org.jboss.tools.esb.project.ui.preference.messages.JBossESBUI"; //$NON-NLS-1$
-
- private JBossESBUIMessages() {
- // Do not instantiate
- }
-
- public static String Label_JBoss_Runtime_Load_Error;
-
- public static String Error_JBoss_Basic_Editor_Composite;
- public static String Error_JBoss_Basic_Editor_Support;
- public static String Error_JBoss_Basic_Editor_Different;
- public static String JBoss_Runtime_List_Field_Editor_Name;
- public static String JBoss_Runtime_List_Field_Editor_Version;
- public static String JBoss_Runtime_List_Field_Editor_Path;
- public static String JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be;
- public static String JBoss_Runtime_List_Field_Editor_An_Instance_Of_List;
- public static String JBoss_Runtime_Delete_Confirm_Title;
- public static String JBoss_Runtime_Delete_Used_Confirm;
- public static String JBoss_Runtime_Delete_Not_Used_Confirm;
- public static String JBoss_Runtime_List_Field_Editor_Edit_Runtime;
- public static String JBoss_Runtime_List_Field_Editor_Modify_Runtime;
- public static String JBoss_Runtime_List_Field_Editor_New_Runtime;
- public static String Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty;
- public static String JBoss_Runtime_List_Field_Editor_Already_Exists;
- public static String JBoss_Runtime_List_Field_Editor_Runtime;
- public static String Error_JBoss_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct;
- public static String Error_JBoss_Runtime_List_Field_Editor_Name_Cannot_Be_Empty;
- public static String Error_JBoss_Runtime_List_Field_Editor_Version_Cannot_Be_Empty;
- public static String JBoss_Runtime_List_Field_Editor_Create_A_Runtime;
- public static String JBoss_Runtime_List_Field_Editor_Home_Folder;
- public static String JBoss_Composite_Editor_This_Method_Can_Be_Invoked;
- public static String JBoss_Button_Field_Editor_Browse;
- public static String Error_JBoss_Button_Field_Editor_Not_Implemented_Yet;
- public static String JBoss_SWT_Field_Editor_Factory_Browse;
- public static String JBoss_SWT_Field_Editor_Factory_Select_Home_Folder;
- public static String JBoss_Runtime_List_Field_Editor_Name2;
- public static String JBoss_Runtime_Check_Field_Default_Classpath;
- public static String JBoss_Preference_Page_Runtimes;
-
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, JBossESBUIMessages.class);
- }
-}
Copied: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java (from rev 10702, trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/messages/JBossESBUIMessages.java)
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.project.ui.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Grid Qian
+ */
+public final class JBossESBUIMessages extends NLS {
+
+ private static final String BUNDLE_NAME =
+ "org.jboss.tools.esb.project.ui.messages.JBossESBUI"; //$NON-NLS-1$
+
+ private JBossESBUIMessages() {
+ // Do not instantiate
+ }
+
+ public static String Label_JBoss_Runtime_Load_Error;
+
+ public static String Error_JBoss_Basic_Editor_Composite;
+ public static String Error_JBoss_Basic_Editor_Support;
+ public static String Error_JBoss_Basic_Editor_Different;
+ public static String JBoss_Runtime_List_Field_Editor_Name;
+ public static String JBoss_Runtime_List_Field_Editor_Version;
+ public static String JBoss_Runtime_List_Field_Editor_Path;
+ public static String JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be;
+ public static String JBoss_Runtime_List_Field_Editor_An_Instance_Of_List;
+ public static String JBoss_Runtime_Delete_Confirm_Title;
+ public static String JBoss_Runtime_Delete_Used_Confirm;
+ public static String JBoss_Runtime_Delete_Not_Used_Confirm;
+ public static String JBoss_Runtime_List_Field_Editor_Edit_Runtime;
+ public static String JBoss_Runtime_List_Field_Editor_Modify_Runtime;
+ public static String JBoss_Runtime_List_Field_Editor_New_Runtime;
+ public static String Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty;
+ public static String JBoss_Runtime_List_Field_Editor_Already_Exists;
+ public static String JBoss_Runtime_List_Field_Editor_Runtime;
+ public static String Error_JBoss_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct;
+ public static String Error_JBoss_Runtime_List_Field_Editor_Name_Cannot_Be_Empty;
+ public static String Error_JBoss_Runtime_List_Field_Editor_Version_Cannot_Be_Empty;
+ public static String JBoss_Runtime_List_Field_Editor_Create_A_Runtime;
+ public static String JBoss_Runtime_List_Field_Editor_Home_Folder;
+ public static String JBoss_Composite_Editor_This_Method_Can_Be_Invoked;
+ public static String JBoss_Button_Field_Editor_Browse;
+ public static String Error_JBoss_Button_Field_Editor_Not_Implemented_Yet;
+ public static String JBoss_SWT_Field_Editor_Factory_Browse;
+ public static String JBoss_SWT_Field_Editor_Factory_Select_Home_Folder;
+ public static String JBoss_Runtime_List_Field_Editor_Name2;
+ public static String JBoss_Runtime_Check_Field_Default_Classpath;
+ public static String JBoss_Preference_Page_Runtimes;
+
+
+ //esb facet messages
+ public static String ESBFacetInstallationPage_Button_Text_New;
+
+ public static String ESBFacetInstallationPage_Default_SRC_Folder;
+
+ public static String ESBFacetInstallationPage_Description;
+
+ public static String ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime;
+
+ public static String ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime;
+
+ public static String ESBFacetInstallationPage_Error_Message_No_Target_Runtime;
+
+ public static String ESBFacetInstallationPage_Error_Message_Specify_Content_Folder;
+
+ public static String ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime;
+
+ public static String ESBFacetInstallationPage_Error_Message_Specify_Source_Folder;
+
+ public static String ESBFacetInstallationPage_Group_Runtime_Text;
+
+ public static String ESBFacetInstallationPage_Group_Text_Folder;
+
+ public static String ESBFacetInstallationPage_Label_Content_Directory;
+
+ public static String ESBFacetInstallationPage_Label_Server_Supplied_Runtime;
+
+ public static String ESBFacetInstallationPage_Label_Source_Directory;
+
+ public static String ESBFacetInstallationPage_Title;
+
+
+
+
+ public static String ESBProjectFirstPage_Description;
+
+ public static String ESBProjectFirstPage_Title;
+
+ public static String ESBProjectWizard_Title;
+
+
+
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, JBossESBUIMessages.class);
+ }
+}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/BaseFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/BaseFieldEditor.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/BaseFieldEditor.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -26,7 +26,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
/**
* @author Grid Qian
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ButtonFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ButtonFieldEditor.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/ButtonFieldEditor.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -16,7 +16,7 @@
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
/**
* @author Grid Qian
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/CompositeEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/CompositeEditor.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/CompositeEditor.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -27,7 +27,7 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
/**
* @author Grid Qian
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -24,7 +24,7 @@
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
/**
* @author Grid Qian
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -49,8 +49,8 @@
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.preference.JBossESBUIPlugin;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
/**
* @author Grid Qian
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -60,10 +60,10 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.jboss.tools.esb.core.ESBProjectUtilities;
+import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
/**
* @author Grid Qian
@@ -578,7 +578,7 @@
private List<String> getESBFacetVersions(){
List<String> versions = new ArrayList<String>();
- IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
for(IProjectFacetVersion version: esbfacet.getVersions()){
versions.add(version.getVersionString());
}
@@ -661,8 +661,8 @@
if (!jbosswsHomeDir.isDirectory())
return false;
- if(!isValidESBStandaloneRuntimeDir(path)
- && !isValidESBServer(path)){
+ if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path)
+ && !JBossRuntimeManager.isValidESBServer(path)){
return false;
}
@@ -670,42 +670,7 @@
return true;
}
- private boolean isValidESBStandaloneRuntimeDir(String path) {
- IPath location = new Path(path);
- IPath esblocation = location.append("lib").append("jbossesb.esb");
- IPath sarLocation = location.append("lib").append("jbossesb.sar");
- if (!esblocation.toFile().isDirectory()) {
- return false;
- }
- if (!sarLocation.toFile().isDirectory()) {
- return false;
- }
-
- return true;
- }
- private boolean isValidESBServer(String path){
- IPath serverLocation = new Path(path);
-
- String esbLcoationSeg = "server" + File.separator + "default"
- + File.separator + "deploy" + File.separator
- + "jbossesb.esb";
- String sarLocationSeg = "server" + File.separator + "default"
- + File.separator + "deploy" + File.separator
- + "jbossesb.sar";
- IPath esbLocation = serverLocation.append(esbLcoationSeg);
- IPath sarLocation = serverLocation.append(sarLocationSeg);
-
- if(!esbLocation.toFile().isDirectory()){
- return false;
- }
- if(!sarLocation.toFile().isDirectory()){
- return false;
- }
-
-
- return true;
- }
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/TextFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/TextFieldEditor.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/TextFieldEditor.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -22,7 +22,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.esb.project.ui.preference.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
/**
*
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -9,20 +9,21 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.jboss.tools.common.model.ui.ModelUIImages;
-import org.jboss.tools.esb.core.ESBProjectUtilities;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.wizards.pages.ESBProjectFirstPage;
public class ESBProjectWizard extends NewProjectDataModelFacetWizard implements
INewWizard {
public ESBProjectWizard() {
- setWindowTitle("New ESB Project Wizard");
+ setWindowTitle(JBossESBUIMessages.ESBProjectWizard_Title);
setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_NEW_PROJECT));
}
public ESBProjectWizard(IDataModel model) {
super(model);
- setWindowTitle("New ESB Project Wizard");
+ setWindowTitle(JBossESBUIMessages.ESBProjectWizard_Title);
setDefaultPageImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_NEW_PROJECT));
}
@@ -34,7 +35,7 @@
@Override
protected IWizardPage createFirstPage() {
- return new ESBProjectFirstPage(model, "first.page");
+ return new ESBProjectFirstPage(model, "first.page"); //$NON-NLS-1$
}
@Override
@@ -44,7 +45,7 @@
@Override
protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate(ESBProjectUtilities.ESB_PROJECT_FACET_TEMPLATE);
+ return ProjectFacetsManager.getTemplate(ESBProjectConstant.ESB_PROJECT_FACET_TEMPLATE);
}
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-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -2,8 +2,11 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.EventObject;
import java.util.List;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
@@ -14,6 +17,8 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
@@ -34,12 +39,16 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
-import org.jboss.tools.esb.core.ESBProjectUtilities;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
+import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.preference.controls.JBossRuntimeListFieldEditor;
public class ESBFacetInstallationPage extends AbstractFacetWizardPage implements IFacetWizardPage, IJBossESBFacetDataModelProperties {
@@ -51,20 +60,23 @@
private IDataModel model;
private boolean hasValidContentFolder = true;
private boolean hasValidSrc = true;
- private boolean hasRuntime = true;
+ private boolean hasRuntime = false;
private Combo cmbRuntimes;
+ private Button btnUserSupplied;
+ private Button btnServerSupplied;
+ private Button btnNew;
public ESBFacetInstallationPage() {
super( "esb.facet.install.page"); //$NON-NLS-1$
- setTitle("Install ESB Facet");
- setDescription("Configure project structure and classpath");
+ setTitle(JBossESBUIMessages.ESBFacetInstallationPage_Title);
+ setDescription(JBossESBUIMessages.ESBFacetInstallationPage_Description);
}
private void setDefaultOutputFolder(){
JavaFacetInstallConfig cfg = findJavaFacetInstallConfig();
if(cfg != null){
- cfg.setDefaultOutputFolder(new Path(ESBProjectUtilities.BUILD_CLASSES));
+ cfg.setDefaultOutputFolder(new Path(ESBProjectConstant.BUILD_CLASSES));
}
}
@@ -75,7 +87,7 @@
createProjectGroup(composite);
createRuntimeGroup(composite);
-
+ setPageComplete(false);
setDefaultOutputFolder();
//synchHelper.synchText(configFolder, CONTENT_DIR, null);
@@ -86,7 +98,7 @@
fpwc.addListener(new IFacetedProjectListener(){
public void handleEvent(IFacetedProjectEvent event) {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
Display.getDefault().syncExec(new Runnable() {
@@ -109,13 +121,13 @@
private void createProjectGroup(Composite parent){
Group prjGroup = new Group(parent, SWT.BORDER);
- prjGroup.setText("Project Folders");
+ prjGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Text_Folder);
prjGroup.setLayout(new GridLayout(1, false));
prjGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.contextRootLabel = new Label(prjGroup, SWT.NONE);
- this.contextRootLabel.setText("Content Directory");
+ this.contextRootLabel.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Content_Directory);
this.contextRootLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
this.contentFolder = new Text(prjGroup, SWT.BORDER);
@@ -125,7 +137,7 @@
contentFolder.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e){
String content = contentFolder.getText();
- if(content != null && !content.equals("")){
+ if(content != null && !content.equals("")){ //$NON-NLS-1$
model.setProperty(ESB_CONTENT_FOLDER, content);
}
changePageStatus();
@@ -133,17 +145,17 @@
});
configFolderLabel = new Label(prjGroup, SWT.NONE);
- configFolderLabel.setText("Java Source Directory");
+ configFolderLabel.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Source_Directory);
configFolderLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
configFolder = new Text(prjGroup, SWT.BORDER);
configFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
configFolder.setData("label", configFolderLabel); //$NON-NLS-1$
- configFolder.setText("src");
+ configFolder.setText(JBossESBUIMessages.ESBFacetInstallationPage_Default_SRC_Folder);
configFolder.addModifyListener(new ModifyListener(){
public void modifyText(ModifyEvent e){
String srcFolder = configFolder.getText();
- if(srcFolder != null && !srcFolder.equals("")){
+ if(srcFolder != null && !srcFolder.equals("")){ //$NON-NLS-1$
model.setProperty(ESB_SOURCE_FOLDER, srcFolder);
setConfigFolder(srcFolder);
}
@@ -197,26 +209,40 @@
private void createRuntimeGroup(Composite parent){
Group runtimeGroup = new Group(parent, SWT.BORDER);
- runtimeGroup.setText("JBoss ESB Runtime");
- runtimeGroup.setLayout(new GridLayout(2, false));
+ runtimeGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Runtime_Text);
+ runtimeGroup.setLayout(new GridLayout(3, false));
runtimeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- /* Button btnServerSupplied = new Button(runtimeGroup, SWT.RADIO);
-
+ btnServerSupplied = new Button(runtimeGroup, SWT.RADIO);
+ btnServerSupplied.addMouseListener(new MouseAdapter(){
+ public void mouseDown(MouseEvent e) {
+ setServerSuppliedSelection(e);
+ }
+ });
GridData gd = new GridData();
gd.horizontalSpan = 1;
- btnServerSupplied.setLayoutData(gd);*/
+ btnServerSupplied.setLayoutData(gd);
- /*Label lblServerSupplied = new Label(runtimeGroup, SWT.NONE);
+ Label lblServerSupplied = new Label(runtimeGroup, SWT.NONE);
+ lblServerSupplied.addMouseListener(new MouseAdapter(){
+ public void mouseDown(MouseEvent e) {
+ btnServerSupplied.setSelection(true);
+ setServerSuppliedSelection(e);
+ }
+ });
- lblServerSupplied.setText("Server supplied ESB Runtime");
+ lblServerSupplied.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Server_Supplied_Runtime);
gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 3;
+ gd.horizontalSpan = 2;
lblServerSupplied.setLayoutData(gd);
- Button btnUserSupplied = new Button(runtimeGroup, SWT.RADIO);*/
-
+ btnUserSupplied = new Button(runtimeGroup, SWT.RADIO);
+ btnUserSupplied.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ setUserSuppliedSelection(e);
+ }
+ });
cmbRuntimes = new Combo(runtimeGroup, SWT.READ_ONLY);
cmbRuntimes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -225,50 +251,129 @@
String runtimeName = cmbRuntimes.getText();
JBossRuntime jr = (JBossRuntime) cmbRuntimes
.getData(runtimeName);
- saveJBosswsRuntimeToModel(jr);
+ saveJBossESBRuntimeToModel(jr);
+ changePageStatus();
}
});
initializeRuntimesCombo(cmbRuntimes, null);
- Button btnNew = new Button(runtimeGroup, SWT.NONE);
- btnNew.setText("New");
+ btnNew = new Button(runtimeGroup, SWT.NONE);
+ btnNew.setText(JBossESBUIMessages.ESBFacetInstallationPage_Button_Text_New);
btnNew.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- newJBossWSRuntime();
+ newJBossRuntime();
changePageStatus();
}
});
- if("".equals(cmbRuntimes.getText())){
+ if("".equals(cmbRuntimes.getText())){ //$NON-NLS-1$
hasRuntime = false;
}
- /*Composite chkcom = new Composite(runtimeGroup, SWT.NONE);
- chkcom.setLayout(new GridLayout(3, true));
- chkcom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Button jbpm = new Button(chkcom, SWT.CHECK);
- jbpm.setText("Depends on jbpm.esb");
- Button smooks = new Button(chkcom, SWT.CHECK);
- smooks.setText("Depends on Smooks.esb");
-
- Button jbrules = new Button(chkcom, SWT.CHECK);
- jbrules.setText("Depends on jrules.esb");
+ }
+
+ protected void setServerSuppliedSelection(EventObject e) {
+ btnServerSupplied.setSelection(true);
+ btnUserSupplied.setSelection(false);
+ model
+ .setBooleanProperty(
+ IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED,
+ true);
+ //remove user supplied properties
+ model.setStringProperty(
+ IJBossESBFacetDataModelProperties.RUNTIME_ID, null);
+ model.setStringProperty(
+ IJBossESBFacetDataModelProperties.RUNTIME_HOME, null);
+ enableUserSupplied(false);
+ //checkServerSuppliedESBRuntime();
+ changePageStatus();
- Button spring = new Button(chkcom, SWT.CHECK);
- spring.setText("Depends on spring.esb");
+ }
+
+ protected void setUserSuppliedSelection(EventObject e) {
+ btnServerSupplied.setSelection(false);
+ btnUserSupplied.setSelection(true);
+ model
+ .setBooleanProperty(
+ IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED,
+ false);
+ String runtimename = cmbRuntimes.getText();
+ if(runtimename == null || runtimename.equals("")){ //$NON-NLS-1$
+ hasRuntime = false;
+ }
+ JBossRuntime jbRuntime = JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
- Button soap = new Button(chkcom, SWT.CHECK);
- soap.setText("Depends on soap.esb");*/
+ if (jbRuntime != null) {
+ saveJBossESBRuntimeToModel(jbRuntime);
+ }
+ enableUserSupplied(true);
+ changePageStatus();
+
}
-
+
+ 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();
+ IRuntime runtime = ifpwc.getPrimaryRuntime();
+ if (runtime == null) {
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime);
+ hasRuntime = false;
+ setPageComplete(isPageComplete());
+ return;
+ }
+
+ org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
+ .findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
+ if (!JBossRuntimeManager.isValidESBServer(serverRuntime
+ .getLocation().toOSString())) {
+ hasRuntime = false;
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
+ setPageComplete(isPageComplete());
+ return;
+ }
+ }
+
+ } catch (CoreException e) {
+ ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
+ }
+
+ }
+
+
+ private void enableUserSupplied(boolean enabled){
+ cmbRuntimes.setEnabled(enabled);
+ btnNew.setEnabled(enabled);
+ }
/*
- * create a new jbossws runtime and set user supplied runtime to the new one
+ * create a new jboss ESB runtime and set user supplied runtime to the new one
*/
- protected void newJBossWSRuntime() {
+ protected void newJBossRuntime() {
List<JBossRuntime> exists = new ArrayList<JBossRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
List<JBossRuntime> added = new ArrayList<JBossRuntime>();
@@ -291,13 +396,13 @@
}
protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName, String version) {
- JBossRuntime selectedJbws = null;
+ JBossRuntime selectedJbRuntime = null;
JBossRuntime defaultJbws = null;
int selectIndex = 0;
int defaultIndex = 0;
cmRuntime.removeAll();
- if(runtimeName == null || "".equals(runtimeName)){
+ if(runtimeName == null || "".equals(runtimeName)){ //$NON-NLS-1$
runtimeName = model.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
}
JBossRuntime[] runtimes = JBossRuntimeManager.getInstance()
@@ -308,7 +413,7 @@
cmRuntime.setData(jr.getName(), jr);
if(jr.getName().equals(runtimeName)){
- selectedJbws = jr;
+ selectedJbRuntime = jr;
selectIndex = i;
}
// get default jbossws runtime
@@ -318,12 +423,12 @@
}
}
- if(selectedJbws != null){
+ if(selectedJbRuntime != null){
cmRuntime.select(selectIndex);
- saveJBosswsRuntimeToModel(selectedJbws);
+ saveJBossESBRuntimeToModel(selectedJbRuntime);
}else if(defaultJbws != null){
cmRuntime.select(defaultIndex);
- saveJBosswsRuntimeToModel(defaultJbws);
+ saveJBossESBRuntimeToModel(defaultJbws);
}
}
@@ -334,13 +439,13 @@
initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
}else{
- initializeRuntimesCombo(cmbRuntimes, null, "");
+ initializeRuntimesCombo(cmbRuntimes, null, ""); //$NON-NLS-1$
}
}
private IProjectFacetVersion getSelectedESBVersion(){
IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
if(fpwc != null){
return fpwc.getProjectFacetVersion(facet);
}else{
@@ -349,14 +454,8 @@
}
- protected void saveJBosswsRuntimeToModel(JBossRuntime jbws) {
- /* String duplicateMsg = "";
- try {
- duplicateMsg = ESBProjectUtil.getDuplicateJars(model, jbws.getName());
- } catch (JavaModelException e1) {
- JBossESBPlugin.getDefault().getLog().log(
- StatusUtils.errorStatus(e1));
- }*/
+ protected void saveJBossESBRuntimeToModel(JBossRuntime jbws) {
+
if (jbws != null) {
model.setStringProperty(
IJBossESBFacetDataModelProperties.RUNTIME_HOME,
@@ -385,18 +484,20 @@
StatusUtils.errorStatus(e1));
}*/
- if(contentFolder.getText().trim().equals("")){
- setErrorMessage("Please specify a valid content folder.");
+ if(contentFolder.getText().trim().equals("")){ //$NON-NLS-1$
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_Content_Folder);
hasValidContentFolder = false;
setPageComplete(isPageComplete());
}
- else if(configFolder.getText().trim().equals("")){
- setErrorMessage("Please specify a valid source folder.");
+ else if(configFolder.getText().trim().equals("")){ //$NON-NLS-1$
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_Source_Folder);
hasValidSrc = false;
setPageComplete(isPageComplete());
- }else if(!hasRuntime){
- setErrorMessage("Please specify a ESB runtime");
+ }else if(btnUserSupplied.getSelection() && !hasRuntime){
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime);
setPageComplete(isPageComplete());
+ }else if(btnServerSupplied.getSelection()){
+ checkServerSuppliedESBRuntime();
}
/* else if (!duplicateMsg.equals("")) {
setErrorMessage("Duplicated jar on classpath:" + duplicateMsg);
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBProjectFirstPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBProjectFirstPage.java 2008-10-07 07:18:37 UTC (rev 10702)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBProjectFirstPage.java 2008-10-07 08:46:38 UTC (rev 10703)
@@ -6,18 +6,19 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
-import org.jboss.tools.esb.core.ESBProjectUtilities;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
public class ESBProjectFirstPage extends DataModelFacetCreationWizardPage {
public ESBProjectFirstPage(IDataModel dataModel, String pageName) {
super(dataModel, pageName);
- setTitle("JBoss ESB Project");
- setDescription("Create a new JBoss ESB project.");
+ setTitle(JBossESBUIMessages.ESBProjectFirstPage_Title);
+ setDescription(JBossESBUIMessages.ESBProjectFirstPage_Description);
}
protected String getModuleTypeID() {
- return ESBProjectUtilities.ESB_PROJECT_FACET;
+ return ESBProjectConstant.ESB_PROJECT_FACET;
}
protected void createPresetPanel(Composite top) {
16 years, 3 months
JBoss Tools SVN: r10702 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-07 03:18:37 -0400 (Tue, 07 Oct 2008)
New Revision: 10702
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateConnectionCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/DeleteConnectionCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataConnectionModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/IConnectableModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/RootModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataContentModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/LeftSourceAnchor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
Log:
JBIDE-2833
If the root nodes don't connect , when user want to save the file , there will open a question dialog to ask user to connect them.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -20,19 +20,19 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.ExtendedMetaData;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.xml.type.AnyType;
-import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.analyzer.IMappingAnalyzer;
import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
import org.jboss.tools.smooks.analyzer.ITargetModelAnalyzer;
@@ -47,7 +47,6 @@
import org.jboss.tools.smooks.model.ResourceConfigType;
import org.jboss.tools.smooks.model.ResourceType;
import org.jboss.tools.smooks.model.SmooksFactory;
-import org.jboss.tools.smooks.model.SmooksPackage;
import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.model.provider.SmooksItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.util.SmooksModelUtils;
@@ -150,8 +149,7 @@
* @param parentResourceConfigType
* @param beanId
*/
- protected void analyzeStructuredDataModel(
- List resourceList,
+ protected void analyzeStructuredDataModel(List resourceList,
AbstractStructuredDataModel root,
AbstractStructuredDataModel dataModel,
ResourceConfigType parentResourceConfigType, String beanId) {
@@ -187,14 +185,14 @@
ResourceConfigType resourceConfig = SmooksFactory.eINSTANCE
.createResourceConfigType();
resourceList.add(resourceConfig);
-// Command addResourceConfigCommand = AddCommand
-// .create(
-// editingDomain,
-// resourceList,
-// SmooksPackage.eINSTANCE
-// .getSmooksResourceListType_AbstractResourceConfig(),
-// resourceConfig);
-// addResourceConfigCommand.execute();
+ // Command addResourceConfigCommand = AddCommand
+ // .create(
+ // editingDomain,
+ // resourceList,
+ // SmooksPackage.eINSTANCE
+ // .getSmooksResourceListType_AbstractResourceConfig(),
+ // resourceConfig);
+ // addResourceConfigCommand.execute();
// resouceConfig.
resourceConfig
.setSelector(getSourceBeanSelectorString((AbstractStructuredDataModel) source));
@@ -351,10 +349,91 @@
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
public void analyzeMappingGraphModel(
SmooksConfigurationFileGenerateContext context)
throws SmooksAnalyzerException {
GraphRootModel root = context.getDataMappingRootModel();
+ List sourceList = root.loadSourceModelList();
+ List targetList = root.loadTargetModelList();
+
+ JavaBeanModel rootSource = null;
+ JavaBeanModel rootTarget = null;
+
+ boolean needCheck = false;
+
+ for (Iterator iterator = sourceList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel sourcegm = (AbstractStructuredDataModel) iterator
+ .next();
+ if (sourcegm instanceof IConnectableModel) {
+ if (!((IConnectableModel) sourcegm).getModelSourceConnections()
+ .isEmpty()
+ || !((IConnectableModel) sourcegm)
+ .getModelTargetConnections().isEmpty()) {
+ needCheck = true;
+ break;
+ }
+ }
+ }
+
+ if (needCheck) {
+ for (Iterator iterator = sourceList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel sourceGraphModel = (AbstractStructuredDataModel) iterator
+ .next();
+ JavaBeanModel source = (JavaBeanModel) sourceGraphModel
+ .getReferenceEntityModel();
+ if (source.isRoot()) {
+ rootSource = source;
+ break;
+ }
+ }
+
+ for (Iterator iterator = targetList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel targetGraphModel = (AbstractStructuredDataModel) iterator
+ .next();
+ JavaBeanModel target = (JavaBeanModel) targetGraphModel
+ .getReferenceEntityModel();
+ if (target.isRoot()) {
+ rootTarget = target;
+ break;
+ }
+ }
+ if (rootSource != null && rootTarget != null) {
+ AbstractStructuredDataModel rootSourceGraphModel = UIUtils
+ .findGraphModel(root, rootSource);
+ AbstractStructuredDataModel rootTargetGraphModel = UIUtils
+ .findGraphModel(root, rootTarget);
+ if (rootSourceGraphModel instanceof IConnectableModel
+ && rootTargetGraphModel instanceof IConnectableModel) {
+ if (((IConnectableModel) rootSourceGraphModel)
+ .isSourceConnectWith((IConnectableModel) rootTargetGraphModel)) {
+ // do nothing
+ } else {
+ // ask user if they want to connect the root model
+ Shell displayParent = context.getShell();
+ boolean connectAuto = MessageDialog
+ .openQuestion(
+ displayParent,
+ "Connection Question",
+ "The root models don't be connected , maybe it will make some errors with the generation config file contents.\nDo you wan to connect them?");
+ if (connectAuto) {
+ // connect root model
+ LineConnectionModel connectionModel = new LineConnectionModel();
+ connectionModel
+ .setSource((IConnectableModel) rootSourceGraphModel);
+ connectionModel
+ .setTarget((IConnectableModel) rootTargetGraphModel);
+ connectionModel.connect();
+ }
+ }
+ }
+ }
+ }
+
SmooksResourceListType listType = context.getSmooksResourceListModel();
this.analyzeGraphicalModel(root, context.getGeneratorResourceList());
}
@@ -511,7 +590,8 @@
if (ar instanceof ResourceConfigType) {
ResourceConfigType rc = (ResourceConfigType) ar;
ResourceType resourceType = rc.getResource();
- if(resourceType == null) continue;
+ if (resourceType == null)
+ continue;
String resource = resourceType.getValue();
if (BEANPOPULATOR.equals(resource)) {
// create root beanmodel
@@ -591,7 +671,8 @@
if (ar instanceof ResourceConfigType) {
ResourceConfigType rc = (ResourceConfigType) ar;
ResourceType resourceType = rc.getResource();
- if(resourceType == null) continue;
+ if (resourceType == null)
+ continue;
String resource = resourceType.getValue();
if (BEANPOPULATOR.equals(resource)) {
// create root beanmodel
@@ -600,7 +681,8 @@
}
}
}
- if(current == null) return null;
+ if (current == null)
+ return null;
Class rootClass = null;
rootClassName = SmooksModelUtils.getParmaText("beanClass", current);
if (rootClassName != null && loader != null) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -700,6 +700,7 @@
context.setDataMappingRootModel(this.rootModel);
context.setSmooksConfigFile(((IFileEditorInput) getEditorInput())
.getFile());
+ context.setShell(getSite().getShell());
}
protected Composite createUISectionContainer(Composite parent, int columns) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -15,6 +15,7 @@
import org.jboss.tools.smooks.ui.gef.model.IGraphicalModel;
/**
+ * @deprecated
* @author Dart Peng
*
*/
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateConnectionCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateConnectionCommand.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateConnectionCommand.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -1,43 +1,29 @@
package org.jboss.tools.smooks.ui.gef.commands;
-import java.util.HashMap;
-import java.util.Map;
-
import org.eclipse.gef.commands.Command;
import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
/**
- * l�ߴ�������
- *
- * @author wangpeng created 2007-4-5 14:51:00
*
*/
public class CreateConnectionCommand extends Command {
-
- /**
- * ÿһ����϶�����Դ��ݶ���ڵ��Ŀ����ݶ���ڵ���ɵ�.
- * ��}��ڵ�����Ͷ���List��
- */
- public static Map listComponents = new HashMap();
+
+
private IConnectableModel source;
private IConnectableModel target;
/**
- * t��ģ��
*/
private LineConnectionModel connection;
/**
- * �����ж��Ƿ��ܹ�ִ��l��
*/
public boolean canExecute() {
-
if ( !validate() ) {
return false;
}
-
return true;
}
@@ -66,29 +52,18 @@
}
/**
- * ��֤l�ӵ�Դ��Ŀ���Ƿ���Խ���l��
- * <p>
- * ��֤����
- * <ul>
- * <li>1��
- * </ul>
- * </p>
- *
- * @see com.tongtech.ti.tisd.project.converter.ui.util.validity.Validator#validate()
*/
public boolean validate() {
return true;
}
/**
- * @return ���� source��
*/
public IConnectableModel getSource() {
return source;
}
/**
- * @return ���� target��
*/
public IConnectableModel getTarget() {
return target;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/DeleteConnectionCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/DeleteConnectionCommand.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/DeleteConnectionCommand.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -5,10 +5,7 @@
import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
/**
- * l��ɾ������
*
- * @author wangpeng created 2007-4-5 14:51:58
- *
*/
public class DeleteConnectionCommand extends Command {
@@ -28,15 +25,12 @@
}
/**
- * @return ���� connectionModel��
*/
public AbstractStructuredDataConnectionModel getConnectionModel() {
return connectionModel;
}
/**
- * @param connectionModel
- * Ҫ���õ� connectionModel��
*/
public void setConnectionModel(
AbstractStructuredDataConnectionModel connectionModel) {
@@ -44,30 +38,24 @@
}
/**
- * @return ���� sourceNode��
*/
public IConnectableModel getSourceNode() {
return sourceNode;
}
/**
- * @param sourceNode
- * Ҫ���õ� sourceNode��
*/
public void setSourceNode(IConnectableModel sourceNode) {
this.sourceNode = sourceNode;
}
/**
- * @return ���� targetNode��
*/
public IConnectableModel getTargetNode() {
return targetNode;
}
/**
- * @param targetNode
- * Ҫ���õ� targetNode��
*/
public void setTargetNode(IConnectableModel targetNode) {
this.targetNode = targetNode;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -40,10 +40,7 @@
import org.jboss.tools.smooks.ui.gef.util.figures.FillLayout;
/**
- * ������ṹ��EditPart
*
- * @author wangpeng 2007-3-20 15:53:37
- *
*/
public class StructuredDataEditPart extends AbstractStructuredDataEditPart
implements GraphicsConstants, IConnectableEditPart {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -65,7 +65,6 @@
}
/**
- * @param interactor Ҫ���õ� interactor��
*/
public void setInteractor(IFigure interactor) {
this.interactor = interactor;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -145,7 +145,6 @@
}
/**
- * ���ظ�Group��
* @return
*/
public String getTextName() {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataConnectionModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataConnectionModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataConnectionModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -35,7 +35,6 @@
}
/**
- * t�ӵ���ʼ����ӵ�source
*/
public void attachSource() {
if (!source.getModelSourceConnections().contains(this)) {
@@ -44,7 +43,6 @@
}
/**
- * t�ӵ�β����ӵ�target
*/
public void attachTarget() {
if (!target.getModelTargetConnections().contains(this)) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/AbstractStructuredDataModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -130,79 +130,34 @@
return typeString;
}
- /**
- * ���ýڵ��Java���͡��������Ҫ������ȫ�����ᅣ1�7code>java.lang.String</code>
- * ���������Ǹ������ͣ�������Ϊ<code>null</code>��
- *
- * @param typeString
- * �ڵ��Java����
- */
public void setTypeString(String typeString) {
this.typeString = typeString;
}
/**
- * ����Ԫ�ض����Ӵ�
*/
protected List children = new ArrayList();
private AbstractStructuredDataModel parent = null;
- /**
- * ��ģ�������ü������ģ�ͷ���ı�ʱ����������Ѹı�֪ͨEditPart��
- * EditPart��Ҫʵ��PropertyChangeListener�ӿ�
- * �����������ʱ�����PropertyChangeListener�ӿ��е�peopertyChange����4��ɴ����ᅣ1�7
- */
private PropertyChangeSupport listeners = new PropertyChangeSupport(this);
- /**
- * Ϊģ����Ӽ����ᅣ1�7
- *
- * @param listener
- * PropertyChangeSupport ������
- */
public void addPropertyChangeListener(PropertyChangeListener listener) {
listeners.addPropertyChangeListener(listener);
}
- /**
- * ɾ��ģ�͵ļ�����
- *
- * @param listener
- * PropertyChangeSupport ������
- */
public void removePropertyChangeListener(PropertyChangeListener listener) {
listeners.removePropertyChangeListener(listener);
}
- /**
- * ��ģ�ͷ���仯ʱ��Ҫ�������ᅣ1�7����������
- *
- * @param propName
- * �ı�����ᅣ1�7
- * @param oldValue
- * @param newValue
- */
public void firePropertyChange(String propName, Object oldValue,
Object newValue) {
listeners.firePropertyChange(propName, oldValue, newValue);
}
- /**
- * ���ص�ǰģ�����е���Ԫ�ء����ǰģ��û����Ԫ�ᅣ1�7
- *
- * @return ��ǰģ�����е���Ԫ��
- */
public List getChildren() {
return children;
}
-
- /**
- * �����Ԫ�أ���֪ͨģ����Ԫ�ط���ı�
- *
- * @param child
- * ��Ԫ��
- */
public void addChild(Object child) {
if (child == null)
return;
@@ -249,10 +204,6 @@
}
/**
- * ɾ����Ԫ�أ���֪ͨģ����Ԫ�ط���ıᅣ1�7
- *
- * @param child
- * ��Ԫ��
*/
public void removeChild(Object child) {
if (child == null || children == null)
@@ -271,9 +222,6 @@
* @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()
*/
public Object getEditableValue() {
-
- // ����ģ��������Ϊ�ɱ༭������ֵ
- //
return this;
}
@@ -284,8 +232,6 @@
*/
public IPropertyDescriptor[] getPropertyDescriptors() {
- // ��Ϊ�ڳ���ģ���з���null������쳣��������ﷵ��һ��0���ȵ�����
- //
return new IPropertyDescriptor[0];
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -3,87 +3,38 @@
import org.eclipse.draw2d.geometry.Rectangle;
/**
- * �����ݶ��������ģ�ͣ��������������ݶ���
* @deprecated
- * @author wangpeng 2007-3-21 13:53:30
*
*/
public class DataObjectContainerModel extends AbstractStructuredDataModel {
- /**
- * Դ��ݶ�������
- */
public static final int SOURCE_DATA_OBJECT_CONTAINER = 1;
- /**
- * Ŀ����ݶ�������
- */
public static final int TARGET_DATA_OBJECT_CIBTAUBER = 2;
- /**
- * ��ݶ�����������
- */
private String name;
- /**
- * �����ϵ�λ��
- */
private Rectangle constraint;
- /**
- * ��ݶ����������͡���}�����͵���ݶ�������
- * Դ��ݶ�������{@link DataObjectContainerModel#SOURCE_DATA_OBJECT_CONTAINER }
- * ��Ŀ����ݶ�������{@link DataObjectContainerModel#TARGET_DATA_OBJECT_CIBTAUBER }
- */
private int category = -1;
- /**
- * ������ݶ������������
- *
- * @return ��ݶ������������
- */
public int getCategory() {
return category;
}
- /**
- * ������ݶ������������
- * Դ��ݶ�������{@link DataObjectContainerModel#SOURCE_DATA_OBJECT_CONTAINER }
- * ��Ŀ����ݶ�������{@link DataObjectContainerModel#TARGET_DATA_OBJECT_CIBTAUBER }
- *
- * @param category ��ݶ�����������
- */
public void setCategory(int category) {
this.category = category;
}
- /**
- * ���������ڻ����ϵ�λ��
- *
- * @return �����ڻ����ϵ�λ��
- */
public Rectangle getConstraint() {
return constraint;
}
- /**
- * ���������ڻ����ϵ�λ��
- *
- * @param constraint �����ڻ����ϵ�λ��
- */
public void setConstraint(Rectangle constraint) {
this.constraint = constraint;
}
- /**
- * ������������
- * @return ��������
- */
public String getName() {
return name;
}
- /**
- * ������������
- * @param name ��������
- */
public void setName(String name) {
this.name = name;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/IConnectableModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/IConnectableModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/IConnectableModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -34,4 +34,8 @@
public void removeSourceConnection(Object connx);
public void removeTargetConnection(Object connx);
+
+ public boolean isSourceConnectWith(IConnectableModel target);
+
+ public boolean isTargetConnectWith(IConnectableModel source);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/RootModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/RootModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/RootModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -1,10 +1,7 @@
package org.jboss.tools.smooks.ui.gef.model;
/**
- * ͼ�ν���Ĭ�ϵĸ�����
- *
- * @author wangpeng 2007-3-20 16:35:20
- *
+ *@deprecated
*/
public class RootModel extends AbstractStructuredDataModel {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataContentModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataContentModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataContentModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -5,137 +5,54 @@
import org.eclipse.draw2d.geometry.Rectangle;
-/**
- * ��ݶ��������ڽ����е�ģ�͡�
- * <p>
- * ��ģ�Ϳ���������ݶ����еļ������ԣ���(���Ե����֡�Java���͵���Ϣ������������û��Java�
- * ��͵ġ�<br>
- * ���ң����ڼ������ͣ�ֻ֧�����顣������Ϊֻ���������ȷ�е�������Ϣ�������JDK1.4�����������
- * �List�ȼ������ͣ�<br>
- * ��Ϊû��ȷ�е����ͣ����Բ���֧�֡�<br>
- * </p>
- *
- * @author wangpeng 2007-3-21 15:09:11
- */
public class StructuredDataContentModel extends AbstractStructuredDataModel
implements IConnectableModel {
public static final int DATA_OBJECT_NODE_CATEGORY_SOURCE = 1;
public static final int DATA_OBJECT_NODE_CATEGORY_TARGET = 2;
- /**
- * �ڵ��� - ������ݶ������Ե�����
- */
private String name;
- /**
- * �ڵ����� - ���Ǹ����Ե�Java���͡��������Ҫ������ȫ������
- * <code>java.lang.String</code> ���������Ǹ������ͣ�������Ϊ<code>null</code>
- * ��
- */
private String javaType;
- /**
- * �ڵ�����������Ǽ����ͻ��Ǹ������͡�complexTypeΪ<code>true</code>
- * ����ʾ�ڵ��Ǹ������ͣ� complexTypeΪ<code>false</code>����ʾ�ڵ��Ǽ����͡�
- */
private boolean isComplexType;
- /**
- * ����ڵ��Ǹ�ڵ㻹����ͨ�ڵ�
- */
private boolean isRootNode;
- /**
- * ����ڵ��Ƿ�Ϊ��������
- */
private boolean isListType;
- /**
- * ����ڵ��Ƿ�Ϊ��������
- */
private boolean isObject;
- /**
- * �����ϵ�λ��
- */
private Rectangle constraint;
- /**
- * ��ݶ���ڵ�ķ��࣬Ŀǰ�ķ�����Դ��ݶ���ڵ��Ŀ����ݶ���ڵ�
- *
- * @see #DATA_OBJECT_NODE_CATEGORY_SOURCE
- * @see #DATA_OBJECT_NODE_CATEGORY_TARGET
- */
private int nodeCategory = -1;
- /**
- * Դl�Ӽ�
- */
private List sourceConnections = new ArrayList();
- /**
- * Ŀ��l�Ӽ�
- */
private List targetConnections = new ArrayList();
- /**
- * ����ģ���ڻ����ϵ�λ��
- *
- * @return ģ���ڻ����ϵ�λ��
- */
public Rectangle getConstraint() {
return constraint;
}
- /**
- * ����ģ���ڻ����ϵ�λ��
- *
- * @param constraint
- * �����ϵ�λ��
- */
public void setConstraint(Rectangle constraint) {
this.constraint = constraint;
}
- /**
- * �жϽڵ��Ǹ������ͻ��Ǽ����͡�<code>true</code>����ʾ�ڵ��Ǹ������ͣ�
- * <code>false</code>����ʾ�ڵ��Ǽ����͡�
- *
- * @return �ڵ��Ǹ������ͻ��Ǽ����͡�
- */
public boolean isComplexType() {
return isComplexType;
}
- /**
- * ���ýڵ��Ǽ����ͻ��Ǹ������͡�<code>true</code>����ʾ�ڵ��Ǹ������ͣ�
- * <code>false</code>����ʾ�ڵ��Ǽ����͡�
- *
- * @param complexType
- * �ڵ��Ǹ��ӽڵ㻹�Ǽڵ㡣
- */
public void setComplexType(boolean complexType) {
this.isComplexType = complexType;
}
- /**
- * ���ؽڵ���
- *
- * @return �ڵ���
- */
public String getName() {
return name;
}
- /**
- * ���ýڵ���
- *
- * @param name
- * �ڵ���
- */
public void setName(String name) {
this.name = name;
}
@@ -157,38 +74,30 @@
}
/**
- * @return ���� isObject��
*/
public boolean isObject() {
return isObject;
}
/**
- * @param isObject
- * Ҫ���õ� isObject��
*/
public void setObject(boolean isObject) {
this.isObject = isObject;
}
/**
- * @return ���� nodeCategory��
*/
public int getNodeCategory() {
return nodeCategory;
}
/**
- * @param nodeCategory
- * Ҫ���õ� nodeCategory��
*/
public void setNodeCategory(int nodeCategory) {
this.nodeCategory = nodeCategory;
}
/**
- * ���Դl��
- *
* @param connx
*/
public void addSourceConnection(Object connx) {
@@ -198,8 +107,6 @@
}
/**
- * ���Ŀ��l��
- *
* @param connx
*/
public void addTargetConnection(Object connx) {
@@ -208,74 +115,35 @@
firePropertyChange(P_TARGET_CONNECTION, null, connx);
}
- /**
- * ����Դl��ģ��
- *
- * @return Դl��ģ��
- */
public List getModelSourceConnections() {
return sourceConnections;
}
- /**
- * ����Ŀ��l��ģ��
- *
- * @return Ŀ��l��ģ��
- */
public List getModelTargetConnections() {
return targetConnections;
}
- /**
- * �Ƴ�Դl��
- *
- * @param connx
- */
public void removeSourceConnection(Object connx) {
sourceConnections.remove(connx);
firePropertyChange(P_SOURCE_CONNECTION, connx, null);
}
- /**
- * �Ƴ�Ŀ��l��
- *
- * @param connx
- */
public void removeTargetConnection(Object connx) {
targetConnections.remove(connx);
firePropertyChange(P_TARGET_CONNECTION, connx, null);
}
- /**
- * �Ƚ�ͬһ�����ϵ�}��ڵ��Ƿ���ͬ
- */
public boolean equals(Object node) {
return super.equals(node);
- // // ��node����DataObjectNodeModel��ʵ��ؼ�
- // //
- // if ( !(node instanceof StructuredDataContentModel) ) {
- // return false;
- // }
- //
- // StructuredDataContentModel nodeModel =
- // (StructuredDataContentModel)node;
- //
- // if ( nodeModel.getName().equals(this.getName())
- // && nodeModel.isListType() == this.isListType()
- // && nodeModel.isComplexType() == this.isComplexType()
- // && nodeModel.getNodeCategory() == this.getNodeCategory()
- // && (
- // // ��˫�����и����Ҹ�����ͬ������˫����û�и������Ϊ�棬����Ϊ��
- // //
- // (nodeModel.getParent() != null && this.getParent() != null) &&
- // nodeModel.getParent().equals(this.getParent())
- // || (nodeModel.getParent() == null && this.getParent() == null)
- // ) ) {
- // return true;
- // }
- //
- // return false;
}
+
+ public boolean isSourceConnectWith(IConnectableModel target) {
+ throw new RuntimeException("Don't support this method currently");
+ }
+
+ public boolean isTargetConnectWith(IConnectableModel source) {
+ throw new RuntimeException("Don't support this method currently");
+ }
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/StructuredDataModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -98,4 +98,12 @@
public void setModelTargetConnections(List modelTargetConnections) {
this.modelTargetConnections = modelTargetConnections;
}
+
+ public boolean isSourceConnectWith(IConnectableModel target) {
+ throw new RuntimeException("Don't support this method currently");
+ }
+
+ public boolean isTargetConnectWith(IConnectableModel source) {
+ throw new RuntimeException("Don't support this method currently");
+ }
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.ui.gef.model;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.swt.widgets.TreeItem;
@@ -19,23 +20,25 @@
* @author Dart Peng
* @Date Jul 31, 2008
*/
-public class TreeItemRelationModel extends AbstractStructuredDataModel implements IConnectableModel {
-
+public class TreeItemRelationModel extends AbstractStructuredDataModel
+ implements IConnectableModel {
+
public static final String PRO_TREE_ITEM_SELECTION_STATUS = "__pro_treeitem_selection_status";
-
+
public static final String PRO_TREE_REPAINT = "__pro_tree_repaint";
-
+
TreeItem treeItem = null;
List<Object> modelSourceConnections = new ArrayList<Object>();
List<Object> modelTargetConnections = new ArrayList<Object>();
+
public TreeItem getTreeItem() {
return treeItem;
}
-
- public boolean isCollapse(){
+
+ public boolean isCollapse() {
TreeItem item = getTreeItem();
int y = Integer.MAX_VALUE;
- if(item != null){
+ if (item != null) {
y = item.getBounds().y;
}
return (y == 0);
@@ -55,7 +58,6 @@
this.firePropertyChange(P_TARGET_CONNECTION, null, connx);
}
-
public void removeSourceConnection(Object connx) {
this.getModelSourceConnections().remove(connx);
this.firePropertyChange(P_SOURCE_CONNECTION, connx, null);
@@ -82,4 +84,28 @@
this.modelTargetConnections = modelTargetConnections;
}
+ public boolean isSourceConnectWith(IConnectableModel target) {
+ List list = this.getModelSourceConnections();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ LineConnectionModel connection = (LineConnectionModel) iterator
+ .next();
+ if (connection.getTarget() == target) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isTargetConnectWith(IConnectableModel source) {
+ List list = this.getModelTargetConnections();
+ for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+ LineConnectionModel connection = (LineConnectionModel) iterator
+ .next();
+ if (connection.getSource() == source) {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -15,6 +15,13 @@
import org.jboss.tools.smooks.ui.gef.commands.ICommandMappingFactory;
import org.jboss.tools.smooks.ui.gef.model.IGraphicalModel;
+
+
+/**
+ * @deprecated
+ * @author Dart
+ *
+ */
public class RootGraphicsXYLayoutEditPolicy extends XYLayoutEditPolicy {
private ICommandMappingFactory mappingFactory = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/LeftSourceAnchor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/LeftSourceAnchor.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/LeftSourceAnchor.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -8,7 +8,7 @@
import org.eclipse.draw2d.geometry.Point;
/**
- * @author Administrator
+ * @author Dart
*
*/
public class LeftSourceAnchor extends ChopboxAnchor {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -13,8 +13,10 @@
import org.jboss.tools.smooks.ui.gef.figures.IExpandable;
import org.jboss.tools.smooks.ui.gef.util.figures.Interactor;
-//hooks up an interactor with an edit part and the figure that needs to be expanded and collapsed
-//
+/**
+ * @deprecated
+ *
+ */
public class InteractorHelper implements MouseListener {
protected boolean needToPerformDefaultExpansion = true;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -10,7 +10,9 @@
import org.eclipse.draw2d.geometry.Rectangle;
import org.jboss.tools.smooks.ui.gef.figures.IExpandable;
import org.jboss.tools.smooks.ui.gef.figures.SpacingFigure;
-
+/**
+ * @deprecated
+ */
public class ContainerLayout extends AbstractLayout {
protected boolean isHorizontal;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -8,6 +8,11 @@
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
+/**
+ * @deprecated
+ * @author dart
+ *
+ */
public class FillLayout extends AbstractLayout {
protected boolean isHorizontal = false;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -1,7 +1,10 @@
package org.jboss.tools.smooks.ui.gef.util.figures;
import org.eclipse.draw2d.IFigure;
-
+/**
+ * @deprecated
+ *
+ */
public interface IConnectedFigure extends IFigure {
public IFigure getConnectionFigure();
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -6,7 +6,7 @@
import org.eclipse.draw2d.geometry.Rectangle;
/**
- * Interactor the +/- control commonly found in trees
+ * @deprecated
*/
public class Interactor extends RectangleFigure {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -3,6 +3,10 @@
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.geometry.Dimension;
+/**
+ * @deprecated
+ *
+ */
public class Placeholder extends RectangleFigure {
public Placeholder() {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-10-07 05:19:09 UTC (rev 10701)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-10-07 07:18:37 UTC (rev 10702)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.graphical.Param;
import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
@@ -37,6 +38,8 @@
protected IFile smooksConfigFile = null;
protected EditingDomain domain;
+ private Shell shell;
+
protected String smooksType = null;
/**
* @return the sourceDataTypeID
@@ -143,5 +146,11 @@
this.properties.put(key, properties.get(key));
}
}
+ public Shell getShell() {
+ return shell;
+ }
+ public void setShell(Shell shell) {
+ this.shell = shell;
+ }
}
16 years, 3 months
JBoss Tools SVN: r10701 - trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-07 01:19:09 -0400 (Tue, 07 Oct 2008)
New Revision: 10701
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSPropertyPage.java
Log:
JBIDE-2794: Fix the ws runtime property page and preference error
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSPropertyPage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSPropertyPage.java 2008-10-07 03:26:52 UTC (rev 10700)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSPropertyPage.java 2008-10-07 05:19:09 UTC (rev 10701)
@@ -2,6 +2,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.dialogs.PropertyPage;
@@ -26,7 +27,13 @@
@Override
protected Control createContents(Composite parent) {
- project = (IProject)this.getElement();
+ if(this.getElement() instanceof IJavaProject){
+ IJavaProject javaProject = (IJavaProject)this.getElement();
+ project = javaProject.getProject();
+ }else if(this.getElement() instanceof IProject){
+ project = (IProject)this.getElement();
+ }
+
model = (IDataModel)new JBossWSFacetInstallDataModelProvider().create();
try {
String isDeploy = project.getPersistentProperty(IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_ISDEPLOYED);
16 years, 3 months
JBoss Tools SVN: r10700 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-06 23:26:52 -0400 (Mon, 06 Oct 2008)
New Revision: 10700
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
Log:
For fixing JBIDE-2831 ( .graph file out of synch with Eclipse workspace )
make the file to refresh after saving complete
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java 2008-10-06 22:53:41 UTC (rev 10699)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/util/GraphicalInformationSaver.java 2008-10-07 03:26:52 UTC (rev 10700)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
@@ -41,6 +42,8 @@
private IEditorInput input;
protected Resource graphicalFileResource;
+
+ private IFile file = null;
/**
* Create the instance during init step
@@ -66,6 +69,7 @@
e.printStackTrace();
}
}
+ setFile(gfile);
String osString = gfile.getLocation().toOSString();
graphicalFileResource = new XMLResourceFactoryImpl()
.createResource(URI.createFileURI(osString));
@@ -89,6 +93,7 @@
e.printStackTrace();
}
}
+ setFile(gfile);
String osString = gfile.getLocation().toOSString();
graphicalFileResource = new XMLResourceFactoryImpl()
.createResource(URI.createFileURI(osString));
@@ -108,7 +113,7 @@
}
public void doSave(IProgressMonitor monitor, String sourceid,
- String targetid) throws IOException {
+ String targetid) throws IOException, CoreException {
GraphInformations graph = null;
if (graphicalFileResource != null) {
if (graphicalFileResource.getContents().isEmpty()) {
@@ -122,6 +127,7 @@
initMappingTypes(graph, sourceid, targetid);
}
graphicalFileResource.save(Collections.EMPTY_MAP);
+ if(this.file != null) file.refreshLocal(IResource.DEPTH_ONE, monitor);
}
}
@@ -146,6 +152,7 @@
initParams(params, context);
}
graphicalFileResource.save(Collections.EMPTY_MAP);
+ if(this.file != null) file.refreshLocal(IResource.DEPTH_ONE, monitor);
}
}
@@ -175,4 +182,12 @@
mapping.setTargetTypeID(targetID);
}
+ public IFile getFile() {
+ return file;
+ }
+
+ public void setFile(IFile file) {
+ this.file = file;
+ }
+
}
16 years, 3 months
JBoss Tools SVN: r10699 - trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-06 18:53:41 -0400 (Mon, 06 Oct 2008)
New Revision: 10699
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java
Log:
JBIDE-2861 - NLS error. good catch
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java 2008-10-06 20:30:06 UTC (rev 10698)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java 2008-10-06 22:53:41 UTC (rev 10699)
@@ -1,7 +1,6 @@
package org.jboss.ide.eclipse.archives.webtools;
import org.eclipse.osgi.util.NLS;
-import org.jboss.ide.eclipse.archives.core.ArchivesCoreMessages;
public class Messages extends NLS {
@@ -50,6 +49,6 @@
static {
- initializeMessages("org.jboss.ide.eclipse.archives.webtools.Messages", ArchivesCoreMessages.class); //$NON-NLS-1$
+ initializeMessages("org.jboss.ide.eclipse.archives.webtools.Messages", Messages.class); //$NON-NLS-1$
}
}
16 years, 3 months
JBoss Tools SVN: r10698 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-06 16:30:06 -0400 (Mon, 06 Oct 2008)
New Revision: 10698
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
Log:
JBIDE-2862 - weird archives UI bug
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2008-10-06 18:27:51 UTC (rev 10697)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2008-10-06 20:30:06 UTC (rev 10698)
@@ -42,7 +42,9 @@
public static final int CATEGORY = 2;
private IProject element;
private int type;
- public WrappedProject(IProject element, int type) { this.element = element; this.type = type;}
+ public WrappedProject(IProject element, int type) {
+ this.element = element; this.type = type;
+ }
public IProject getElement() { return element; }
public int getType() { return type; }
public boolean equals(Object otherObject) {
@@ -50,8 +52,9 @@
return true;
return false;
}
+ public String toString() { return element.toString() + "," + type;} //$NON-NLS-1$
public int hashCode() {
- return element.hashCode();
+ return element.hashCode() + type;
}
}
@@ -69,6 +72,9 @@
public int hashCode() {
return wProject.hashCode() + 15;
}
+ public String toString() {
+ return wProject.toString();
+ }
}
private int type;
16 years, 3 months
JBoss Tools SVN: r10697 - in trunk/archives: tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-06 14:27:51 -0400 (Mon, 06 Oct 2008)
New Revision: 10697
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelCreationTest.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java
Log:
JBIDE-2849 - since the AntArchiveAction was removed (as per max telling me months ago they were pretty much unnecessary), their tests have been commented out and the extension point removed until such time as a more likely 'action' appear necessary.
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml 2008-10-06 17:13:47 UTC (rev 10696)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/plugin.xml 2008-10-06 18:27:51 UTC (rev 10697)
@@ -45,14 +45,6 @@
</file-association>
</extension>
<extension
- point="org.jboss.ide.eclipse.archives.core.actionTypes">
- <actionType
- class="org.jboss.ide.eclipse.archives.core.model.types.AntActionType"
- id="org.jboss.ide.eclipse.archives.core.antActionType"
- label="Ant Task">
- </actionType>
- </extension>
- <extension
point="org.eclipse.core.variables.dynamicVariables">
<variable
description="The project an archives node is declared in."
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelCreationTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelCreationTest.java 2008-10-06 17:13:47 UTC (rev 10696)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelCreationTest.java 2008-10-06 18:27:51 UTC (rev 10697)
@@ -93,14 +93,14 @@
fail();
}
- public void testAddActionToModel() {
- try {
- createEmptyModelNode().addChild(createAction());;
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
+// public void testAddActionToModel() {
+// try {
+// createEmptyModelNode().addChild(createAction());;
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
public void testAddArchiveToModel() {
try {
@@ -146,16 +146,16 @@
}
}
- public void testAddActionToArchive() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveAction action = createAction();
- archive.addChild(action);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- fail();
- }
- }
+// public void testAddActionToArchive() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveAction action = createAction();
+// archive.addChild(action);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// fail();
+// }
+// }
@@ -200,22 +200,22 @@
fail();
}
}
+//
+// public void testAddActionToInnerArchive() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchive archive2 = createArchive("someName.war2", "test2");
+// IArchiveAction action = createAction();
+//
+// archive.addChild(archive2);
+// archive2.addChild(action);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
- public void testAddActionToInnerArchive() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchive archive2 = createArchive("someName.war2", "test2");
- IArchiveAction action = createAction();
-
- archive.addChild(archive2);
- archive2.addChild(action);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
-
// Add all to INNER-folder
@@ -265,79 +265,79 @@
}
- public void testAddActionToInnerFolder() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveFolder folder = createFolder("folder");
- IArchiveAction action = createAction();
-
- archive.addChild(folder);
- folder.addChild(action);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
+// public void testAddActionToInnerFolder() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveFolder folder = createFolder("folder");
+// IArchiveAction action = createAction();
+//
+// archive.addChild(folder);
+// folder.addChild(action);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
+//
+// // add all to action
+// public void testAddArchiveToAction() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveAction action = createAction();
+// IArchiveNode child = createArchive("someName2.war", "test2");
+// archive.addChild(action);
+// action.addChild(child);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
+//
+// public void testAddFolderToAction() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveAction action = createAction();
+// IArchiveNode child = createFolder("test");
+// archive.addChild(action);
+// action.addChild(child);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
+//
+// public void testAddFilesetToAction() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveAction action = createAction();
+// IArchiveNode child = createFileSet("*", "path");
+// archive.addChild(action);
+// action.addChild(child);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
+//
+//
+// public void testAddActionToAction() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveAction action = createAction();
+// IArchiveNode child = createAction();
+// archive.addChild(action);
+// action.addChild(child);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
- // add all to action
- public void testAddArchiveToAction() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveAction action = createAction();
- IArchiveNode child = createArchive("someName2.war", "test2");
- archive.addChild(action);
- action.addChild(child);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
-
- public void testAddFolderToAction() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveAction action = createAction();
- IArchiveNode child = createFolder("test");
- archive.addChild(action);
- action.addChild(child);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
-
- public void testAddFilesetToAction() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveAction action = createAction();
- IArchiveNode child = createFileSet("*", "path");
- archive.addChild(action);
- action.addChild(child);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
-
-
- public void testAddActionToAction() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveAction action = createAction();
- IArchiveNode child = createAction();
- archive.addChild(action);
- action.addChild(child);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
-
// add all to fileset
public void testAddArchiveToFileset() {
try {
@@ -381,19 +381,19 @@
fail();
}
- public void testAddActionToFileset() {
- try {
- IArchive archive = createArchive("someName.war", "test");
- IArchiveFileSet fs = createFileSet("*", "path");
- IArchiveNode child = createAction();
- archive.addChild(fs);
- fs.addChild(child);
- createEmptyModelNode().addChild(archive);
- } catch( ArchivesModelException ame ) {
- return;
- }
- fail();
- }
+// public void testAddActionToFileset() {
+// try {
+// IArchive archive = createArchive("someName.war", "test");
+// IArchiveFileSet fs = createFileSet("*", "path");
+// IArchiveNode child = createAction();
+// archive.addChild(fs);
+// fs.addChild(child);
+// createEmptyModelNode().addChild(archive);
+// } catch( ArchivesModelException ame ) {
+// return;
+// }
+// fail();
+// }
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java 2008-10-06 17:13:47 UTC (rev 10696)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java 2008-10-06 18:27:51 UTC (rev 10697)
@@ -51,12 +51,12 @@
return fs;
}
- protected IArchiveAction createAction() {
- IArchiveAction action = ArchiveNodeFactory.createAction();
- action.setTime(IArchiveAction.POST_BUILD);
- action.setType("ant");
- return action;
- }
+// protected IArchiveAction createAction() {
+// IArchiveAction action = ArchiveNodeFactory.createAction();
+// action.setTime(IArchiveAction.POST_BUILD);
+// action.setType("ant");
+// return action;
+// }
protected IArchive createArchive(String name, String dest) {
IArchive archive = ArchiveNodeFactory.createArchive();
16 years, 3 months
JBoss Tools SVN: r10696 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-06 13:13:47 -0400 (Mon, 06 Oct 2008)
New Revision: 10696
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java
Log:
JBIDE-2859 NPE when deleting an ESB project
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java 2008-10-06 15:44:23 UTC (rev 10695)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java 2008-10-06 17:13:47 UTC (rev 10696)
@@ -41,6 +41,9 @@
IFacetedProject facetPrj;
try {
facetPrj = ProjectFacetsManager.create(project);
+ if (facetPrj == null) {
+ return null;
+ }
final IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectUtilities.ESB_PROJECT_FACET);
final IProjectFacetVersion fv = facetPrj.getInstalledVersion(esbfacet);
return ModuleType.getModuleType(esbfacet.getId(), fv.getVersionString());
16 years, 3 months
JBoss Tools SVN: r10695 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: model/ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-06 11:44:23 -0400 (Mon, 06 Oct 2008)
New Revision: 10695
Removed:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/AllTypesCache.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/TypeInfoRequestor.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/IAttributeErrorProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributePropertyDescription.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultValueAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/XChildrenTableStructuredAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxCellEditorEx.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/IPropertyEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListSelectionFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListStructuredFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/MultipleChoiceFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/NoteFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditorEx.java
Log:
JBIDE-2802
Deleted: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/AllTypesCache.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/AllTypesCache.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/AllTypesCache.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.core.jdt;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.TypeNameMatch;
-
-public class AllTypesCache {
-
- private static TypeNameMatch[] cache = null;
- private static int fgSizeHint= 2000;
-
- private static int fgNumberOfCacheFlushes= 0;
-
- private static class TypeNameComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- return ((TypeNameMatch)o1).getSimpleTypeName().compareTo(((TypeNameMatch)o2).getSimpleTypeName());
- }
- }
-
- private static Comparator fgTypeNameComparator= new TypeNameComparator();
-
- /**
- * Returns all types in the given scope.
- * @param kind IJavaSearchConstants.CLASS, IJavaSearchConstants.INTERFACE
- * or IJavaSearchConstants.TYPE
- * @param typesFound The resulting <code>TypeNameMatch</code> elements are added to this collection
- */
- public static void getTypes(IJavaSearchScope scope, int kind, IProgressMonitor monitor, Collection typesFound) throws JavaModelException {
- TypeNameMatch[] ts = getAllTypes(monitor);
- for (int i = 0; i < ts.length; i++) {
- TypeNameMatch info = (TypeNameMatch) cache[i];
- checkType(info, scope, kind, monitor, typesFound);
- }
- }
- private static void checkType(TypeNameMatch info, IJavaSearchScope scope, int kind, IProgressMonitor monitor, Collection typesFound) throws JavaModelException {
- if (scope.equals(SearchEngine.createWorkspaceScope()) || scope.encloses(info.getType())) {
- if (kind == IJavaSearchConstants.TYPE || (kind == IJavaSearchConstants.INTERFACE == info.getType().isInterface())) {
- typesFound.add(info);
- }
- }
- }
-
-
- /**
- * Returns all types in the workspace. The returned array must not be
- * modified. The elements in the array are sorted by simple type name.
- */
- public static synchronized TypeNameMatch[] getAllTypes(IProgressMonitor monitor) throws JavaModelException {
- if (cache == null) {
- int r = loadCache(monitor);
- if(r < 0) return null; else monitor = null;
- }
- if (monitor != null) {
- monitor.done();
- }
- return cache;
- }
- private static int loadCache(IProgressMonitor monitor) throws JavaModelException {
- ArrayList searchResult = new ArrayList(fgSizeHint);
- doSearchTypes(SearchEngine.createWorkspaceScope(), IJavaSearchConstants.TYPE, monitor, searchResult);
- if (monitor != null && monitor.isCanceled()) {
- return -1;
- }
- cache = (TypeNameMatch[]) searchResult.toArray(new TypeNameMatch[searchResult.size()]);
- Arrays.sort(cache, getTypeNameComperator());
- fgSizeHint= cache.length;
-
- JavaCore.addElementChangedListener(new TypeCacheDeltaListener());
- return 0;
- }
-
- /**
- * Returns true if the type cache is up to date.
- */
- public static boolean isCacheUpToDate() {
- return cache != null;
- }
-
- /**
- * Returns a compartor that compares the simple type names
- */
- public static Comparator getTypeNameComperator() {
- return fgTypeNameComparator;
- }
-
- private static void doSearchTypes(IJavaSearchScope scope, int style, IProgressMonitor monitor, Collection typesFound) throws JavaModelException {
- new SearchEngine().searchAllTypeNames(
- null,
- null,
- SearchPattern.R_PATTERN_MATCH,
- style,
- scope,
- new TypeInfoRequestor(typesFound),
- IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
- monitor);
- }
-
- private static class TypeCacheDeltaListener implements IElementChangedListener {
-
- /*
- * @see IElementChangedListener#elementChanged
- */
- public void elementChanged(ElementChangedEvent event) {
- boolean needsFlushing= processDelta(event.getDelta());
- if (needsFlushing) {
- cache= null;
- fgNumberOfCacheFlushes++;
- JavaCore.removeElementChangedListener(this); // it's ok to remove listener while delta processing
- }
- }
-
- /*
- * returns true if the cache needs to be flushed
- */
- private boolean processDelta(IJavaElementDelta delta) {
- IJavaElement elem= delta.getElement();
- boolean isAddedOrRemoved= (delta.getKind() != IJavaElementDelta.CHANGED)
- || (delta.getFlags() & (IJavaElementDelta.F_ADDED_TO_CLASSPATH | IJavaElementDelta.F_REMOVED_FROM_CLASSPATH)) != 0;
-
- switch (elem.getElementType()) {
- case IJavaElement.JAVA_MODEL:
- case IJavaElement.JAVA_PROJECT:
- case IJavaElement.PACKAGE_FRAGMENT_ROOT:
- case IJavaElement.PACKAGE_FRAGMENT:
- case IJavaElement.CLASS_FILE:
- case IJavaElement.TYPE: // type children can be inner classes
- if (isAddedOrRemoved) {
- return true;
- }
- return processChildrenDelta(delta);
- case IJavaElement.COMPILATION_UNIT: // content change means refresh from local
- if (((ICompilationUnit) elem).isWorkingCopy()) {
- return false;
- }
- if (isAddedOrRemoved || isPossibleStructuralChange(delta.getFlags())) {
- return true;
- }
- return processChildrenDelta(delta);
- default:
- // fields, methods, imports ect
- return false;
- }
- }
-
- private boolean isPossibleStructuralChange(int flags) {
- return (flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_FINE_GRAINED)) == IJavaElementDelta.F_CONTENT;
- }
-
- private boolean processChildrenDelta(IJavaElementDelta delta) {
- IJavaElementDelta[] children= delta.getAffectedChildren();
- for (int i= 0; i < children.length; i++) {
- if (processDelta(children[i])) {
- return true;
- }
- }
- return false;
- }
- }
-
-
-}
Deleted: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/TypeInfoRequestor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/TypeInfoRequestor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/jdt/TypeInfoRequestor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.core.jdt;
-
-import java.util.Collection;
-
-import org.eclipse.jdt.core.search.TypeNameRequestor;
-
-
-public class TypeInfoRequestor extends TypeNameRequestor {
-
- public TypeInfoRequestor(Collection typesFound) {
- super(); // TODO-3.3: why is constructor taking typesFound as argument ? If API in 3.3 change why is the constructor here not changed ?
- }
-
- protected boolean inScope(char[] packageName, char[] typeName) {
- return true;
- }
-
-}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/IAttributeErrorProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/IAttributeErrorProvider.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/IAttributeErrorProvider.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.common.model.ui;
+import java.beans.PropertyChangeListener;
+
public interface IAttributeErrorProvider {
public boolean hasErrors();
public String getError();
+ public void addErrorStateListener(PropertyChangeListener l);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributePropertyDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributePropertyDescription.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributePropertyDescription.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.attribute;
+import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.ui.*;
import org.jboss.tools.common.model.ui.attribute.adapter.*;
import org.jboss.tools.common.model.ui.attribute.editor.*;
@@ -56,7 +57,21 @@
// CellEditor
public CellEditor createPropertyEditor(Composite parent) {
- return (!isEditable()) ? null : propertyEditor.getCellEditor(parent);
+ if(!isEditable()) {
+ return null;
+ }
+ CellEditor editor = propertyEditor.getCellEditor(parent);
+ if(editor != null) {
+ editor.setValidator(new ICellEditorValidator() {
+ public String isValid(Object value) {
+ if(modelObject == null) return null;
+ String error = ((XModelImpl)modelObject.getModel()).getError(modelObject, attribute.getName(), value == null ? "" : value.toString());
+ return error;
+ }
+
+ });
+ }
+ return (!isEditable()) ? null : editor;
}
// FieldEditor
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultValueAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultValueAdapter.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultValueAdapter.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -25,12 +25,14 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.markers.XMarkerManager;
public class DefaultValueAdapter implements IModelPropertyEditorAdapter, IAdaptable {
protected Object value = "";
protected PropertyChangeSupport pcs = new PropertyChangeSupport(this);
+ protected PropertyChangeSupport pcs2 = new PropertyChangeSupport(this);
protected XModel model;
protected XAttribute attribute;
@@ -45,6 +47,10 @@
protected boolean autoStore = true;
protected boolean storeLocked = false;
+ protected String invalidValue = null;
+ protected String lastCorrectValue = null;
+ protected String currentError = null;
+
public DefaultValueAdapter() {}
public void store() {
@@ -54,6 +60,26 @@
if(v != null && attribute.isTrimmable()) v = v.trim();
String n = attribute.getName();
if(modelObject.isActive()) {
+
+ currentError = ((XModelImpl)modelObject.getModel()).getError(modelObject, n, v);
+
+ if(currentError != null) {
+ invalidValue = getStringValue(true);
+ lastCorrectValue = modelObject.getAttributeValue(n);
+ if(pcs2 != null) {
+ pcs2.firePropertyChange(IPropertyEditor.ERROR, Boolean.FALSE, Boolean.TRUE);
+ }
+ fireValueChange(v, v);
+ return;
+ } else {
+ boolean changed = invalidValue != null;
+ invalidValue = null;
+ lastCorrectValue = null;
+ if(changed && pcs2 != null) {
+ pcs2.firePropertyChange(IPropertyEditor.ERROR, Boolean.TRUE, Boolean.FALSE);
+ }
+ }
+
try {
modelObject.getModel().editObjectAttribute(modelObject, n, v);
} catch (XModelException e) {
@@ -75,7 +101,13 @@
public void load() {
if (MODELOBJECT_TARGET == storeTarget) {
- this.setValue(modelObject.getAttributeValue(attribute.getName()));
+ String value = modelObject.getAttributeValue(attribute.getName());
+ if(currentError != null && invalidValue != null) {
+ if(value != null && value.equals(lastCorrectValue)) {
+ return;
+ }
+ }
+ this.setValue(value);
} else {
this.setValue(attributeData.getValue());
}
@@ -103,6 +135,10 @@
public void removeValueChangeListener(PropertyChangeListener l) {
if (pcs!=null) pcs.removePropertyChangeListener(l);
}
+
+ public void addErrorStateListener(PropertyChangeListener l) {
+ if (pcs2!=null) pcs2.addPropertyChangeListener(l);
+ }
// IValueChangeListener
public void valueChange(PropertyChangeEvent event) {
@@ -186,11 +222,19 @@
public boolean hasErrors() {
if(ATTRIBUTEDATA_TARGET == storeTarget) return false;
+ if(invalidValue != null && currentError != null) {
+ return true;
+ }
return attribute != null && XMarkerManager.getInstance().hasErrors(modelObject, attribute.getName());
}
public String getError() {
if(modelObject == null || attribute == null) return null;
+ if(ATTRIBUTEDATA_TARGET != storeTarget) {
+ if(invalidValue != null && currentError != null) {
+ return currentError;
+ }
+ }
return XMarkerManager.getInstance().getError(modelObject, attribute.getName());
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/XChildrenTableStructuredAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/XChildrenTableStructuredAdapter.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/XChildrenTableStructuredAdapter.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -817,4 +817,9 @@
public String getError() {
return null;
}
+
+ public void addErrorStateListener(PropertyChangeListener l) {
+ // TODO Auto-generated method stub
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxCellEditorEx.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxCellEditorEx.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxCellEditorEx.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -116,7 +116,7 @@
combo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- valueChanged(true, true);
+ check();
}
});
@@ -125,6 +125,27 @@
return combo;
}
+ protected boolean check() {
+ String value = combo.getText();
+ if (value == null) {
+ value = "";//$NON-NLS-1$
+ }
+ Object typedValue = value;
+ boolean oldValidState = isValueValid();
+ boolean newValidState = isCorrect(typedValue);
+ if (typedValue == null && newValidState) {
+ Assert.isTrue(false,
+ "Validator isn't limiting the cell editor's type range");//$NON-NLS-1$
+ }
+ if (!newValidState) {
+ // try to insert the current value into the error message.
+ setErrorMessage(MessageFormat.format(getErrorMessage(),
+ new Object[] { value }));
+ }
+ valueChanged(oldValidState, newValidState);
+ return newValidState;
+ }
+
protected Object doGetValue() {
return this.value;
}
@@ -134,8 +155,10 @@
}
public void focusLost() {
- value = combo.getText();
- valueChanged(true, true);
+ if(check()) {
+ value = combo.getText();
+ }
+// valueChanged(true, true);
this.fireApplyEditorValue();
super.focusLost();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -391,6 +391,7 @@
// PropertyChangeListener
public void propertyChange(PropertyChangeEvent evt) {
+ super.propertyChange(evt);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
Object v = evt.getNewValue();
valueProvider.removeValueChangeListener(this);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.attribute.editor;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
import org.jboss.tools.common.model.ui.IAttributeErrorProvider;
import org.jboss.tools.common.model.ui.navigator.LabelDecoratorImpl;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -206,6 +209,9 @@
public void setErrorProvider(IAttributeErrorProvider errorProvider) {
this.errorProvider = errorProvider;
+ if(this instanceof PropertyChangeListener) {
+ errorProvider.addErrorStateListener((PropertyChangeListener)this);
+ }
}
public IAttributeErrorProvider getErrorProvider() {
@@ -279,12 +285,19 @@
} else {
image = LabelDecoratorImpl.emptyImage;
}
- if(errorStateImage != image) {
+ if(errorStateImage != image ||
+ (image != null && errorSymbolLabel != null && tooltip != null && !tooltip.equals(errorSymbolLabel.getToolTipText()) )) {
errorSymbolLabel.setImage(errorStateImage = image);
errorSymbolLabel.setToolTipText(tooltip);
}
}
}
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (IPropertyEditor.ERROR.equals(evt.getPropertyName())) {
+ updateErrorState();
+ }
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/IPropertyEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/IPropertyEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/IPropertyEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -15,6 +15,7 @@
import org.eclipse.swt.widgets.Composite;
public interface IPropertyEditor extends IAdaptable {
+ public static final String ERROR = "IPropertyEditor.error";
public static final String VALUE = "IPropertyEditor.value";
public static final String LIST_CONTENT = "IPropertyEditor.listContent";
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListSelectionFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListSelectionFieldEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListSelectionFieldEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -200,6 +200,7 @@
}
public void propertyChange(java.beans.PropertyChangeEvent evt) {
+ super.propertyChange(evt);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
Object v = evt.getNewValue();
valueProvider.removeValueChangeListener(this);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListStructuredFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListStructuredFieldEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ListStructuredFieldEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -422,6 +422,7 @@
}
public void propertyChange(PropertyChangeEvent evt) {
+ super.propertyChange(evt);
valueProvider.removeValueChangeListener(this);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
elements = null;
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/MultipleChoiceFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/MultipleChoiceFieldEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/MultipleChoiceFieldEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -164,6 +164,7 @@
boolean propertyChangeEnabled = true;
public void propertyChange(PropertyChangeEvent evt) {
if(!propertyChangeEnabled) return;
+ super.propertyChange(evt);
valueProvider.removeValueChangeListener(this);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
updateChoices();
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/NoteFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/NoteFieldEditor.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/NoteFieldEditor.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -418,6 +418,7 @@
}
public void propertyChange(PropertyChangeEvent evt) {
+ super.propertyChange(evt);
valueProvider.removeValueChangeListener(this);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
setStringValue(valueProvider.getStringValue(true));
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringButtonFieldEditorEx.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -316,6 +316,7 @@
}
public void propertyChange(java.beans.PropertyChangeEvent evt) {
+ super.propertyChange(evt);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
Object v = evt.getNewValue();
valueProvider.removeValueChangeListener(this);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditorEx.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditorEx.java 2008-10-06 15:37:26 UTC (rev 10694)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditorEx.java 2008-10-06 15:44:23 UTC (rev 10695)
@@ -72,6 +72,7 @@
// PropertyChangeListener
public void propertyChange(PropertyChangeEvent evt) {
+ super.propertyChange(evt);
valueProvider.removeValueChangeListener(this);
if (IPropertyEditor.VALUE.equals(evt.getPropertyName())) {
Object v = evt.getNewValue();
16 years, 3 months
JBoss Tools SVN: r10694 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-06 11:37:26 -0400 (Mon, 06 Oct 2008)
New Revision: 10694
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
Log:
JBIDE-2802
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2008-10-06 15:17:55 UTC (rev 10693)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2008-10-06 15:37:26 UTC (rev 10694)
@@ -286,7 +286,6 @@
if(a.isTrimmable() && value != null) value = value.trim();
String ov = object.getAttributeValue(attributeName);
ov = (ov == null) ? "" : ov;
- if(!isDifferent(ov, value)) return null;
if(value.length() == 0 && "true".equals(a.getProperty("required"))) {
String mes = "Attribute " + a.getName() + " is required.";
return mes;
16 years, 3 months