JBoss Tools SVN: r19094 - trunk/bpel/plugins.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-12-08 02:30:47 -0500 (Tue, 08 Dec 2009)
New Revision: 19094
Added:
trunk/bpel/plugins/org.eclipse.bpel.compare.ui/
Log:
JBIDE-5349: sync the bpel codes from eclipse bpel codes base
15 years, 1 month
JBoss Tools SVN: r19093 - in branches/jbosstools-3.1.0.RC1/esb/plugins: org.jboss.tools.esb.project.core/META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-12-08 01:12:57 -0500 (Tue, 08 Dec 2009)
New Revision: 19093
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
JBIDE-5108: JBossRuntimeManager has hard-coded the configuration to default
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2009-12-08 06:12:57 UTC (rev 19093)
@@ -30,7 +30,8 @@
org.eclipse.wst.common.emfworkbench.integration,
org.eclipse.emf.ecore,
org.jboss.ide.eclipse.as.classpath.core,
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.esb.core,
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-12-08 06:12:57 UTC (rev 19093)
@@ -200,7 +200,7 @@
projects="true">
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
</moduleFactory>
</extension>
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -14,13 +14,18 @@
protected final static String SOAP_AS_LOCATION = "jboss-as"; //$NON-NLS-1$
protected final static String ROSETTA_JAR = "jbossesb-rosetta.jar"; //$NON-NLS-1$
- public List<IPath> getJarDirectories(String runtimeLocation) {
+ public List<IPath> getJarDirectories(String runtimeLocation, String configuration) {
+
+ if("".equals(configuration)){
+ configuration = "default";
+ }
+
List<IPath> directories = new ArrayList<IPath>();
IPath rtHome = new Path(runtimeLocation);
IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
"deploy");
- IPath deployPath = rtHome.append("server").append("default").append(
+ IPath deployPath = rtHome.append("server").append(configuration).append(
"deploy");
IPath esbPath = deployPath.append(JBOSSESB_ESB);
@@ -39,10 +44,10 @@
return directories;
}
- public List<File> getAllRuntimeJars(String runtimeLocation) {
+ public List<File> getAllRuntimeJars(String runtimeLocation, String configuration) {
List<File> jarList = new ArrayList<File>();
- for(IPath dir : getJarDirectories(runtimeLocation)){
+ for(IPath dir : getJarDirectories(runtimeLocation, configuration)){
List<File> tmpJarList = new ArrayList<File>();
if(dir.toFile().exists()){
tmpJarList = getJarsOfFolder(dir.toFile());
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -13,10 +13,10 @@
private final static String CONFIG_MODEL_JAR = "jbossesb-config-model-1.1.0.jar";
- public boolean isValidESBRuntime(String location, String version){
+ public boolean isValidESBRuntime(String location, String version, String configuration){
List<String> jarNames = new ArrayList<String>();
- for(File file : getAllRuntimeJars(location)){
+ for(File file : getAllRuntimeJars(location, configuration)){
jarNames.add(file.getName());
}
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -14,10 +14,10 @@
private final static String CONFIG_MODEL_JAR_12 = "jbossesb-config-model-1.2.0.jar";
- public boolean isValidESBRuntime(String location, String version){
+ public boolean isValidESBRuntime(String location, String version, String configuration){
List<String> jarNames = new ArrayList<String>();
- for(File file : getAllRuntimeJars(location)){
+ for(File file : getAllRuntimeJars(location, configuration)){
jarNames.add(file.getName());
}
@@ -27,8 +27,8 @@
}
- public List<IPath> getJarDirectories(String runtimeLocation) {
- List<IPath> directories = super.getJarDirectories(runtimeLocation);
+ public List<IPath> getJarDirectories(String runtimeLocation, String configuration) {
+ List<IPath> directories = super.getJarDirectories(runtimeLocation, configuration);
IPath rtHome = new Path(runtimeLocation);
IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
"deployers").append("esb.deployer").append("lib");
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -8,9 +8,9 @@
public interface IESBRuntimeResolver {
- public boolean isValidESBRuntime(String location, String version);
+ public boolean isValidESBRuntime(String location, String version, String configuration);
- public List<IPath> getJarDirectories(String runtimeLocation);
+ public List<IPath> getJarDirectories(String runtimeLocation, String configuration);
- public List<File> getAllRuntimeJars(String runtimeLocation);
+ public List<File> getAllRuntimeJars(String runtimeLocation, String configuration);
}
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -24,6 +24,8 @@
String homeDir = null;
String version = null;
+
+ String configuration = "";
boolean defaultRt = false;
@@ -55,6 +57,16 @@
public String getHomeDir() {
return homeDir;
}
+
+
+ /**
+ * Get jboss server configuration
+ *
+ * @return JBoss configuration as string
+ */
+ public String getConfiguration(){
+ return configuration;
+ }
/**
* Set JBossWSRuntime name
@@ -75,6 +87,18 @@
public void setHomeDir(String homeDir) {
this.homeDir = homeDir;
}
+
+
+
+ /**
+ * Set JBoss server configuration, it is only for jboss AS contained ESB runtime
+ *
+ * @param configuration
+ * new JBossWSRuntime's configuration
+ */
+ public void setConfiguration(String configuration){
+ this.configuration = configuration;
+ }
/**
* Mark runtime as default
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IAccessRule;
import org.eclipse.jdt.core.IClasspathAttribute;
@@ -23,17 +24,12 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-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.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.classpath.core.jee.AbstractClasspathContainer;
import org.jboss.ide.eclipse.as.classpath.core.jee.AbstractClasspathContainerInitializer;
import org.jboss.ide.eclipse.as.classpath.core.xpl.ClasspathDecorations;
-import org.jboss.tools.esb.core.ESBProjectCorePlugin;
-import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.messages.JBossFacetCoreMessages;
/**
@@ -146,8 +142,10 @@
unbound = false;
String runtimeLocation = serverRuntime.getLocation()
.toOSString();
+ IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+
jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(
- runtimeLocation, serverRuntime.getRuntimeType().getId());
+ runtimeLocation, serverRuntime.getRuntimeType().getId(), jbossRuntime.getJBossConfiguration());
} else {
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -36,6 +36,7 @@
private static final String DEFAULT = "default";
private static final String HOME_DIR = "homeDir";
private static final String VERSION = "version";
+ private static final String CONFIGURATION = "configuration";
private static final String NAME = "name";
private static final String USER_CONFIG_CLASSPATH = "userConfig";
private static final String LIBRARY = "libraries";
@@ -71,7 +72,9 @@
rt.setHomeDir(value);
} else if (VERSION.equals(name)) {
rt.setVersion(value);
- } else if (DEFAULT.equals(name)) {
+ }else if (CONFIGURATION.equals(name)) {
+ rt.setConfiguration(value);
+ }else if (DEFAULT.equals(name)) {
rt.setDefault(Boolean.parseBoolean(value));
}else if(USER_CONFIG_CLASSPATH.equals(name)){
rt.setUserConfigClasspath(Boolean.parseBoolean(value));
@@ -134,6 +137,9 @@
buffer.append(FIELD_SEPARATOR).append(HOME_DIR).append(
FIELD_SEPARATOR);
buffer.append(runtimes[i].getHomeDir());
+ buffer.append(FIELD_SEPARATOR).append(CONFIGURATION).append(
+ FIELD_SEPARATOR);
+ buffer.append(runtimes[i].getConfiguration());
buffer.append(FIELD_SEPARATOR).append(DEFAULT).append(
FIELD_SEPARATOR);
buffer.append(runtimes[i].isDefault());
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -23,8 +23,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
@@ -169,14 +167,14 @@
} else {
- jarList = getAllRuntimeJars(rt.getHomeDir(), esbVersion);
+ jarList = getAllRuntimeJars(rt.getHomeDir(), esbVersion, rt.getConfiguration());
}
}
return jarList;
}
- public List<String> getAllRuntimeJars(String runtimeLocation, String esbVersion) {
+ public List<String> getAllRuntimeJars(String runtimeLocation, String esbVersion, String configuration) {
List<String> jarList = new ArrayList<String>();
IESBRuntimeResolver resolver = null;
if(parserMap.get(esbVersion) != null){
@@ -184,7 +182,7 @@
}
if( resolver != null){
- List<File> jars = resolver.getAllRuntimeJars(runtimeLocation);
+ List<File> jars = resolver.getAllRuntimeJars(runtimeLocation, configuration);
for(File file : jars){
jarList.add(file.getAbsolutePath());
}
@@ -357,9 +355,9 @@
runtimes = converter.getMap(runtimeListString);
}
- public static boolean isValidESBServer(String path, String version){
+ public static boolean isValidESBServer(String path, String version, String configuration){
- return isValidESBStandaloneRuntimeDir(path, version);
+ return isValidESBStandaloneRuntimeDir(path, version, configuration);
}
// private static boolean isValidSoapContainedESBRuntime(String path, String version){
@@ -367,21 +365,21 @@
// }
@Deprecated
- public static boolean getResttaJar(String path, String asFoldername, String version){
- return isValidESBStandaloneRuntimeDir(path, version);
+ public static boolean getResttaJar(String path, String asFoldername, String version, String configuration){
+ return isValidESBStandaloneRuntimeDir(path, version, configuration);
}
- public static boolean isValidESBStandaloneRuntimeDir(String path, String version) {
+ public static boolean isValidESBStandaloneRuntimeDir(String path, String version, String configuration) {
IESBRuntimeResolver resolver = null;
if( parserMap.get(version) != null){
resolver = (IESBRuntimeResolver)parserMap.get(version);
}
if(resolver != null){
- return resolver.isValidESBRuntime(path, version);
+ return resolver.isValidESBRuntime(path, version, configuration);
}
else{
ESBProjectCorePlugin.log("No ESB runtime resolver defined for ESB "+ version, null, Status.WARNING);
@@ -410,11 +408,6 @@
// return true;
}
- private static boolean isVersion45(IPath sarLocation){
- IPath libPath = sarLocation.append("lib");
- File jbossesbConfigModel110 = libPath.append("jbossesb-config-model-1.1.0.jar").toFile();
- return jbossesbConfigModel110 != null && jbossesbConfigModel110.exists();
- }
public String getESBVersionNumber(File rosettaJar){
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2009-12-08 06:12:57 UTC (rev 19093)
@@ -33,7 +33,8 @@
org.jboss.tools.esb.project.core;bundle-version="1.0.0",
org.eclipse.jdt.ui;bundle-version="3.4.1",
org.jboss.ide.eclipse.as.ui;bundle-version="1.0.0",
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.esb.project.ui
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-12-08 06:12:57 UTC (rev 19093)
@@ -4,7 +4,8 @@
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_Version=Version:
+JBoss_Runtime_List_Field_Editor_Configuration=Configuration:
JBoss_Runtime_List_Field_Editor_Path=Path
JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List=inputElement must be an instance of List<JBossRuntime>.
JBoss_Runtime_Delete_Confirm_Title=Confirm Runtime Delete
@@ -13,6 +14,7 @@
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
+JBoss_Runtime_List_Field_Editor_Configuration_Description=Only for JBoss AS contained 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_Runtime_Already_Exists=JBoss ESB Runtime ''{0}'' already exists
JBoss_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
@@ -72,4 +74,4 @@
ESBExportWizard_NotValidProject=Project "{0}" is not a valid ESB Project
ESBExportWizard_Title=ESB Export
ESBExportWizard_Description=Export an ESB project to the local file system.
-ESBExportWizard_ESBProject=ESB Project:
\ No newline at end of file
+ESBExportWizard_ESBProject=ESB Project\:
\ No newline at end of file
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -37,6 +37,7 @@
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_Configuration_Description;
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;
@@ -51,6 +52,7 @@
public static String JBoss_Composite_Editor_This_Method_Can_Be_Invoked;
public static String JBoss_Button_Field_Editor_Browse;
public static String JBoss_ESBRuntime_Classpath_Container_5;
+ public static String JBoss_Runtime_List_Field_Editor_Configuration;
public static String JBoss_ESBRuntime_Classpath_Container_Description;
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -99,6 +99,7 @@
JBossRuntime o = changed.get(c);
o.setHomeDir(c.getHomeDir());
o.setVersion(c.getVersion());
+ o.setConfiguration(c.getConfiguration());
String oldName = o.getName();
String newName = c.getName();
if (!oldName.equals(newName)) {
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -43,6 +43,8 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
@@ -52,10 +54,12 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -424,6 +428,10 @@
IFieldEditor version = createComboEditor(SRT_VERSION,
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Version, getESBFacetVersions(), ""); //$NON-NLS-1$
+
+// IFieldEditor configuration = createComboEditor(SRT_CONFIGURATION,
+// JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Configuration, getESBFacetVersions(), ""); //$NON-NLS-1$
+ Combo configuration;
IFieldEditor homeDir = createBrowseFolderEditor(
SRT_HOMEDIR,
@@ -431,16 +439,17 @@
""); //$NON-NLS-1$
JBossRuntime current = null;
-
+ JBossRuntime source = null;
IFieldEditor jars = null;
- public JBossWSRuntimeWizardPage(List<JBossRuntime> editedList) {
+ public JBossWSRuntimeWizardPage(List<JBossRuntime> editedList, JBossRuntime source) {
super(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
setMessage(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Create_A_Runtime);
setTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Runtime);
value = editedList;
+ this.source = source;
}
/**
@@ -464,12 +473,32 @@
version.addPropertyChangeListener(this);
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
+
+ new Label(root, SWT.NONE).setText(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Configuration);
+ Composite cfgComposite = new Composite(root, SWT.NONE);
+ cfgComposite.setLayout(new GridLayout(2, false));
+ cfgComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ configuration = new Combo(cfgComposite, SWT.READ_ONLY);
+ GridData gd = new GridData();
+ gd.widthHint = 150;
+ configuration.setLayoutData(gd);
+ new Label(cfgComposite, SWT.NONE).setText(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Configuration_Description);
+ configuration.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ checkPageComplete();
+ }
+ });
+
+
jars = new JBossLibraryListFieldEditor("", "", current); //$NON-NLS-1$ //$NON-NLS-2$
jars.doFillIntoGrid(root);
jars.addPropertyChangeListener(this);
setPageComplete(false);
setControl(root);
+
+ updateConfigrations(homeDir.getValueAsString());
}
/**
@@ -491,7 +520,13 @@
}
name.setValue(homeDirName);
}
+ updateConfigrations(homeDir.getValueAsString());
}
+
+ checkPageComplete();
+ }
+
+ private void checkPageComplete(){
if (name.getValueAsString() == null || "".equals(//$NON-NLS-1$
name.getValueAsString().toString().trim())) {
@@ -532,6 +567,7 @@
&& current.getVersion().equals(version.getValueAsString())
&& current.isUserConfigClasspath() == jarJbws
.isUserConfigClasspath()
+ && current.getConfiguration().equals(configuration.getText())
&& (!jarJbws.isUserConfigClasspath() || hasSameLibraies(
current.getLibraries(), jarJbws.getLibraries()))) {
@@ -554,7 +590,7 @@
return;
}
- if (!runtimeExist(homeDir.getValueAsString(), (String)version.getValue())) {
+ if (!runtimeExist(homeDir.getValueAsString(), (String)version.getValue(), configuration.getText())) {
setErrorMessage(NLS.bind(JBossESBUIMessages.Label_JBoss_Runtime_Load_Error, version.getValue()));
setPageComplete(false);
return;
@@ -584,6 +620,59 @@
return versions;
}
+
+
+ private List<String> updateConfigrations(String location){
+
+ ArrayList<String> configList = new ArrayList<String>();
+ IPath locationPath = new Path(location);
+ IPath asPath = locationPath.append("jboss-as").append("server");
+ if(!asPath.toFile().exists()){
+ asPath = locationPath.append("server");
+ }
+
+// IPath asPath = locationPath.append("server");
+ File serverDirectory = asPath.toFile();
+
+ if (serverDirectory.exists()) {
+
+ File types[] = serverDirectory.listFiles();
+ for (int i = 0; i < types.length; i++) {
+ File serviceDescriptor = new File(types[i]
+ .getAbsolutePath()
+ + File.separator
+ + "conf" //$NON-NLS-1$
+ + File.separator
+ + "jboss-service.xml"); //$NON-NLS-1$
+
+ if (types[i].isDirectory() && serviceDescriptor.exists()) {
+ String configuration = types[i].getName();
+ configList.add(configuration);
+ }
+ }
+
+ if (configList.size() > 0) {
+ getControl().setEnabled(true);
+ }
+ }
+
+ if(configuration != null && !configuration.isDisposed()){
+ configuration.removeAll();
+
+ for(String config : configList){
+ configuration.add(config);
+ if("default".equals(config)){
+ configuration.select(configList.indexOf(config));
+ }
+ }
+ if(source != null && source.getConfiguration() != null){
+ configuration.setText(source.getConfiguration());
+ }
+ }
+
+ return configList;
+
+ }
/**
* Return JBossWS Runtime instance initialized by user input
*
@@ -594,6 +683,7 @@
newRt.setName(name.getValueAsString());
newRt.setVersion(version.getValueAsString());
newRt.setHomeDir(homeDir.getValueAsString());
+ newRt.setConfiguration(configuration.getText());
JBossRuntime rt = (JBossRuntime) jars.getValue();
newRt.setLibraries(rt.getLibraries());
newRt.setUserConfigClasspath(rt.isUserConfigClasspath());
@@ -654,14 +744,14 @@
};
}
- private boolean runtimeExist(String path, String version) {
+ private boolean runtimeExist(String path, String version, String configuration) {
File jbosswsHomeDir = new File(path);
if (!jbosswsHomeDir.isDirectory())
return false;
- if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path, version)
- && !JBossRuntimeManager.isValidESBServer(path, version)){
+ if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path, version, configuration)
+ && !JBossRuntimeManager.isValidESBServer(path, version, configuration)){
return false;
}
@@ -689,7 +779,7 @@
List<JBossRuntime> added) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
- page1 = new JBossWSRuntimeWizardPage(exist);
+ page1 = new JBossWSRuntimeWizardPage(exist, null);
addPage(page1);
this.value = exist;
this.added = added;
@@ -745,7 +835,7 @@
Map<JBossRuntime, JBossRuntime> changed) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Edit_Runtime);
- page1 = new JBossWSRuntimeWizardPage(existing);
+ page1 = new JBossWSRuntimeWizardPage(existing, source);
page1
.setMessage(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Modify_Runtime);
page1
@@ -774,6 +864,7 @@
source.setName(rt.getName());
source.setHomeDir(rt.getHomeDir());
source.setVersion(rt.getVersion());
+ source.setConfiguration(rt.getConfiguration());
source.setUserConfigClasspath(rt.isUserConfigClasspath());
source.setLibraries(rt.getLibraries());
} else {
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.Dialog;
@@ -56,6 +57,7 @@
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
@@ -364,8 +366,10 @@
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
.findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
+ IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString(), getSelectedESBVersion().getVersionString())) {
+ .getLocation().toOSString(), getSelectedESBVersion().getVersionString(), jbossRuntime.getJBossConfiguration())) {
hasRuntime = true;
setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, getSelectedESBVersion().getVersionString()), WARNING);
setPageComplete(isPageComplete());
@@ -388,8 +392,10 @@
}
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
.findRuntime(runtime.getProperty("id"));
+ IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString(), getSelectedESBVersion().getVersionString())) {
+ .getLocation().toOSString(), getSelectedESBVersion().getVersionString(), jbossRuntime.getJBossConfiguration())) {
setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, getSelectedESBVersion().getVersionString()), WARNING);
hasRuntime = true;
setPageComplete(isPageComplete());
Modified: branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-08 06:10:44 UTC (rev 19092)
+++ branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-08 06:12:57 UTC (rev 19093)
@@ -15,6 +15,7 @@
import java.util.List;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
@@ -44,6 +45,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerUICore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
@@ -167,8 +169,9 @@
IPath location = ((IRuntime)element).getLocation();
String runtimeType = ((IRuntime)element).getRuntimeType().getId();
if(location == null) return false;
-
- return JBossRuntimeManager.isValidESBServer(location.toOSString(), runtimeType);
+ IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)((IRuntime)element).loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+
+ return JBossRuntimeManager.isValidESBServer(location.toOSString(), runtimeType, jbossRuntime.getJBossConfiguration());
}
return true;
}
15 years, 1 month
JBoss Tools SVN: r19092 - trunk/esb/plugins/org.jboss.tools.esb.project.core.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-12-08 01:10:44 -0500 (Tue, 08 Dec 2009)
New Revision: 19092
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
Log:
JBIDE-5410:Can not deploy ESB 4.7 project to server using Run As -> Run on Server
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-12-08 02:57:57 UTC (rev 19091)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-12-08 06:10:44 UTC (rev 19092)
@@ -200,7 +200,7 @@
projects="true">
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
</moduleFactory>
</extension>
15 years, 1 month
JBoss Tools SVN: r19091 - in trunk/smooks/tests/org.jboss.tools.smooks.core.test: src/org/jboss/tools/smooks/test/csvparser and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-07 21:57:57 -0500 (Mon, 07 Dec 2009)
New Revision: 19091
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.core.test/.classpath
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/csvparser/CsvParserTest.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/ediparser/EDIParserTest.java
trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/jsonparse/JsonParserTest.java
Log:
JBIDE-5304
Remove Dom4J jar and replace all Dom4J api with org.w3c API
Modified: trunk/smooks/tests/org.jboss.tools.smooks.core.test/.classpath
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.core.test/.classpath 2009-12-08 02:56:20 UTC (rev 19090)
+++ trunk/smooks/tests/org.jboss.tools.smooks.core.test/.classpath 2009-12-08 02:57:57 UTC (rev 19091)
@@ -3,6 +3,5 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/csvparser/CsvParserTest.java
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/csvparser/CsvParserTest.java 2009-12-08 02:56:20 UTC (rev 19090)
+++ trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/csvparser/CsvParserTest.java 2009-12-08 02:57:57 UTC (rev 19091)
@@ -14,7 +14,6 @@
import javax.xml.parsers.ParserConfigurationException;
-import org.dom4j.DocumentException;
import org.eclipse.emf.ecore.resource.Resource;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.csv.CSVDataParser;
@@ -30,7 +29,7 @@
*/
public class CsvParserTest extends BaseTestCase {
- public void testCsvParser() throws IOException, DocumentException, ParserConfigurationException {
+ public void testCsvParser() throws IOException, ParserConfigurationException {
Resource smooksResource = new SmooksResourceFactoryImpl().createResource(null);
smooksResource.load(CsvParserTest.class.getResourceAsStream("smooks-config.xml"), null);
Modified: trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/ediparser/EDIParserTest.java
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/ediparser/EDIParserTest.java 2009-12-08 02:56:20 UTC (rev 19090)
+++ trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/ediparser/EDIParserTest.java 2009-12-08 02:57:57 UTC (rev 19091)
@@ -17,7 +17,6 @@
import javax.xml.parsers.ParserConfigurationException;
-import org.dom4j.DocumentException;
import org.eclipse.emf.ecore.resource.Resource;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.edi.EDIDataParser;
@@ -33,7 +32,7 @@
*/
public class EDIParserTest extends BaseTestCase {
- public void testEDIParser() throws IOException, DocumentException, ParserConfigurationException {
+ public void testEDIParser() throws IOException, ParserConfigurationException {
Resource smooksResource = new SmooksResourceFactoryImpl().createResource(null);
Modified: trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/jsonparse/JsonParserTest.java
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/jsonparse/JsonParserTest.java 2009-12-08 02:56:20 UTC (rev 19090)
+++ trunk/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/jsonparse/JsonParserTest.java 2009-12-08 02:57:57 UTC (rev 19091)
@@ -7,7 +7,6 @@
import javax.xml.parsers.ParserConfigurationException;
-import org.dom4j.DocumentException;
import org.eclipse.emf.ecore.resource.Resource;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.uitls.JsonInputDataParser;
@@ -17,8 +16,7 @@
import org.jboss.tools.smooks.test.model11.BaseTestCase;
public class JsonParserTest extends BaseTestCase {
- public void testParser1() throws IOException, ParserConfigurationException, DocumentException,
- InvocationTargetException {
+ public void testParser1() throws IOException, ParserConfigurationException, InvocationTargetException {
Resource smooksResource = new SmooksResourceFactoryImpl().createResource(null);
smooksResource.load(JsonParserTest.class.getResourceAsStream("smooks-config.xml"), null);
15 years, 1 month
JBoss Tools SVN: r19090 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui: libs and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-07 21:56:20 -0500 (Mon, 07 Dec 2009)
New Revision: 19090
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLUtils.java
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j-1.6.1.jar
trunk/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer2.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/.classpath
trunk/smooks/plugins/org.jboss.tools.smooks.ui/.project
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataParser.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JsonInputDataParser.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractXMLObject.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagObject.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagPropertyObject.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLModelAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLTagObject.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLTemplateEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLNodeGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateContentProvider.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateGraphicalModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/XSLTemplateCreationWizard.java
Log:
JBIDE-5304
Remove Dom4J jar and replace all Dom4J api with org.w3c API
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/.classpath
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/.classpath 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/.classpath 2009-12-08 02:56:20 UTC (rev 19090)
@@ -1,11 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="libs/xstream-1.2.2.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="smooks-csv"/>
- <classpathentry kind="src" path="smooks-core"/>
- <classpathentry exported="true" kind="lib" path="libs/dom4j-1.6.1.jar"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="libs/xstream-1.2.2.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="smooks-csv"/>
+ <classpathentry kind="src" path="smooks-core"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/.project
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/.project 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/.project 2009-12-08 02:56:20 UTC (rev 19090)
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.jboss.tools.smooks.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
- <linkedResources>
- <link>
- <name>smooks-core</name>
- <type>2</type>
- <location>/Users/tfennelly/milyn/trunk/smooks-core/src/main/java</location>
- </link>
- <link>
- <name>smooks-csv</name>
- <type>2</type>
- <location>/Users/tfennelly/milyn/trunk/smooks-cartridges/csv/src/main/java</location>
- </link>
- </linkedResources>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.smooks.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>smooks-core</name>
+ <type>2</type>
+ <location>D:/Users/tfennelly/milyn/trunk/smooks-core/src/main/java</location>
+ </link>
+ <link>
+ <name>smooks-csv</name>
+ <type>2</type>
+ <location>D:/Users/tfennelly/milyn/trunk/smooks-cartridges/csv/src/main/java</location>
+ </link>
+ </linkedResources>
+</projectDescription>
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/libs/dom4j.license 2009-12-08 02:56:20 UTC (rev 19090)
@@ -1,13 +0,0 @@
-BSD style license
-
-Redistribution and use of this software and associated documentation ("Software"), with or without modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain copyright statements and notices. Redistributions must also contain a copy of this document.
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- 3. The name "DOM4J" must not be used to endorse or promote products derived from this Software without prior written permission of MetaStuff, Ltd. For written permission, please contact dom4j-info(a)metastuff.com.
- 4. Products derived from this Software may not be called "DOM4J" nor may "DOM4J" appear in their names without prior written permission of MetaStuff, Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
- 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
-
-THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved. \ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataParser.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataParser.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/csv/CSVDataParser.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.csv;
-import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
@@ -20,9 +19,9 @@
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
-import org.dom4j.DocumentException;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.configuration.editors.xml.TagList;
import org.jboss.tools.smooks.configuration.editors.xml.XMLObjectAnalyzer;
@@ -31,7 +30,7 @@
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
import org.milyn.Smooks;
import org.milyn.csv.CSVReaderConfigurator;
-import org.milyn.payload.StringResult;
+import org.w3c.dom.Document;
/**
* @author Dart (dpeng(a)redhat.com)
@@ -56,12 +55,11 @@
public static final String RECORD_NAME = "recordName"; //$NON-NLS-1$
public TagList parseCSV(String filePath, SmooksResourceListType resourceList)
- throws FileNotFoundException, DocumentException, InvocationTargetException, ParserConfigurationException {
+ throws FileNotFoundException, InvocationTargetException, ParserConfigurationException {
return parseCSV(new FileInputStream(SmooksUIUtils.parseFilePath(filePath)), resourceList);
}
- public TagList parseCSV(InputStream inputStream, Object readerObj) throws ParserConfigurationException,
- DocumentException {
+ public TagList parseCSV(InputStream inputStream, Object readerObj) throws ParserConfigurationException {
String fields = null;
String separator = null;
String quoteChar = null;
@@ -94,7 +92,7 @@
}
public TagList parseCSV(InputStream stream, SmooksResourceListType resourceList)
- throws DocumentException, ParserConfigurationException {
+ throws ParserConfigurationException {
List<AbstractReader> readers = resourceList.getAbstractReader();
int count = 0;
int index = -1;
@@ -122,13 +120,13 @@
}
public TagList parseCSV(String filePath, String fields, String rootName, String recordName, String separator,
- String quoteChar, String skiplines, String encoding) throws DocumentException, FileNotFoundException {
+ String quoteChar, String skiplines, String encoding) throws FileNotFoundException {
return parseCSV(new FileInputStream(filePath), fields, rootName, recordName, separator, quoteChar, skiplines,
encoding);
}
public TagList parseCSV(InputStream stream, String fields, String rootName, String recordName, String separator,
- String quoteChar, String skiplines, String encoding) throws DocumentException {
+ String quoteChar, String skiplines, String encoding) {
Smooks smooks = new Smooks();
@@ -171,18 +169,15 @@
smooks.setReaderConfig(readerConfigurator);
- StringResult result = new StringResult();
+ DOMResult result = new DOMResult();
smooks.filterSource(new StreamSource(stream), result);
+
+ Document document = (Document) result.getNode();
XMLObjectAnalyzer analyzer = new XMLObjectAnalyzer();
- ByteArrayInputStream byteinputStream = new ByteArrayInputStream(result.getResult().getBytes());
- TagList tagList = analyzer.analyze(byteinputStream, null);
+ TagList tagList = analyzer.analyze(document, null);
try {
- if (byteinputStream != null) {
- byteinputStream.close();
- byteinputStream = null;
- }
if (smooks != null) {
smooks.close();
smooks = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/edi/EDIDataParser.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.edi;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -22,9 +21,9 @@
import java.util.Iterator;
import java.util.List;
+import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
-import org.dom4j.DocumentException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -38,9 +37,9 @@
import org.jboss.tools.smooks.model.smooks.AbstractReader;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
import org.milyn.Smooks;
-import org.milyn.payload.StringResult;
import org.milyn.smooks.edi.EDIReaderConfigurator;
import org.osgi.framework.Bundle;
+import org.w3c.dom.Document;
/**
* @author Dart
@@ -56,18 +55,18 @@
public static final Object VALIDATE = "validate"; //$NON-NLS-1$
public TagList parseEDIFile(InputStream stream, SmooksResourceListType resourceList, IProject project)
- throws IOException, DocumentException {
+ throws IOException {
List<AbstractReader> readers = resourceList.getAbstractReader();
int count = 0;
int index = -1;
for (Iterator<?> iterator2 = readers.iterator(); iterator2.hasNext();) {
AbstractReader abstractReader = (AbstractReader) iterator2.next();
-// if (abstractReader instanceof EDIReader) {
-// count++;
-// if (index == -1) {
-// index = readers.indexOf(abstractReader);
-// }
-// }
+ // if (abstractReader instanceof EDIReader) {
+ // count++;
+ // if (index == -1) {
+ // index = readers.indexOf(abstractReader);
+ // }
+ // }
if (abstractReader instanceof EDI12Reader) {
count++;
if (index == -1) {
@@ -86,8 +85,7 @@
return null;
}
- public TagList parseEDIFile(InputStream stream, SmooksResourceListType resourceList) throws IOException,
- DocumentException {
+ public TagList parseEDIFile(InputStream stream, SmooksResourceListType resourceList) throws IOException {
// String encoding = null;
// String mappingModel = null;
// String validate = null;
@@ -117,16 +115,15 @@
// resourceList);
}
- public TagList parseEDIFile(InputStream ediInputStream, EObject readerObj, IProject project) throws IOException,
- DocumentException {
+ public TagList parseEDIFile(InputStream ediInputStream, EObject readerObj, IProject project) throws IOException {
String encoding = null;
String mappingModel = null;
String validate = null;
-// if (readerObj instanceof EDIReader) {
-// EDIReader reader = (EDIReader) readerObj;
-// encoding = reader.getEncoding();
-// mappingModel = reader.getMappingModel();
-// }
+ // if (readerObj instanceof EDIReader) {
+ // EDIReader reader = (EDIReader) readerObj;
+ // encoding = reader.getEncoding();
+ // mappingModel = reader.getMappingModel();
+ // }
if (readerObj instanceof EDI12Reader) {
EDI12Reader reader = (EDI12Reader) readerObj;
encoding = reader.getEncoding();
@@ -135,15 +132,15 @@
return parseEDIFile(ediInputStream, mappingModel, encoding, validate, project);
}
- public TagList parseEDIFile(InputStream ediInputStream, EObject readerObj) throws IOException, DocumentException {
+ public TagList parseEDIFile(InputStream ediInputStream, EObject readerObj) throws IOException {
String encoding = null;
String mappingModel = null;
-// if (readerObj instanceof EDIReader) {
-// EDIReader reader = (EDIReader) readerObj;
-// encoding = reader.getEncoding();
-// mappingModel = reader.getMappingModel();
-// }
+ // if (readerObj instanceof EDIReader) {
+ // EDIReader reader = (EDIReader) readerObj;
+ // encoding = reader.getEncoding();
+ // mappingModel = reader.getMappingModel();
+ // }
if (readerObj instanceof EDI12Reader) {
EDI12Reader reader = (EDI12Reader) readerObj;
encoding = reader.getEncoding();
@@ -153,7 +150,7 @@
}
public TagList parseEDIFile(InputStream ediInputStream, String mappingModel, String ediFileEncoding,
- String validate, EObject emodel) throws IOException, DocumentException {
+ String validate, EObject emodel) throws IOException {
IResource resource = SmooksUIUtils.getResource(emodel);
IProject project = null;
if (resource != null) {
@@ -163,14 +160,14 @@
}
public TagList parseEDIFile(InputStream ediInputStream, String mappingModel, String ediFileEncoding,
- String validate, IProject project) throws IOException, DocumentException {
+ String validate, IProject project) throws IOException {
Smooks smooks = new Smooks();
// SmooksResourceConfiguration readerConfig = new
// SmooksResourceConfiguration("org.xml.sax.driver",
// SmooksEDIReader.class.getName());
- if (mappingModel == null){
+ if (mappingModel == null) {
throw new RuntimeException("EDI Mapping file can't be empty");
}
// If the MappingModel is absolute file path :
@@ -212,7 +209,7 @@
ediFileEncoding = "UTF-8"; //$NON-NLS-1$
}
// readerConfig.
-// readerConfig.setParameter("encoding", ediFileEncoding);
+ // readerConfig.setParameter("encoding", ediFileEncoding);
smooks.setReaderConfig(readerConfig);
// SmooksUtil.registerResource(readerConfig, smooks);
@@ -225,18 +222,13 @@
// in
// the domResult instance...
// FileInputStream stream
- StringResult result = new StringResult();
+ DOMResult result = new DOMResult();
smooks.filterSource(new StreamSource(ediInputStream), result);
- String resultXMLContent = result.getResult();
+ Document resultXMLContent = (Document) result.getNode();
XMLObjectAnalyzer analyzer = new XMLObjectAnalyzer();
- ByteArrayInputStream byteinputStream = new ByteArrayInputStream(resultXMLContent.getBytes());
- TagList tagList = analyzer.analyze(byteinputStream, null);
+ TagList tagList = analyzer.analyze(resultXMLContent, null);
try {
- if (byteinputStream != null) {
- byteinputStream.close();
- byteinputStream = null;
- }
if (smooks != null) {
smooks.close();
smooks = null;
@@ -254,7 +246,7 @@
}
public TagList parseEDIFile(String path, SmooksResourceListType smooksResourceListType)
- throws InvocationTargetException, FileNotFoundException, IOException, DocumentException {
+ throws InvocationTargetException, FileNotFoundException, IOException {
String filePath = SmooksUIUtils.parseFilePath(path);
return parseEDIFile(new FileInputStream(filePath), smooksResourceListType);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JsonInputDataParser.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JsonInputDataParser.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/JsonInputDataParser.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -3,7 +3,6 @@
*/
package org.jboss.tools.smooks.configuration.editors.uitls;
-import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
@@ -18,9 +17,9 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
-import org.dom4j.DocumentException;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.xml.TagList;
import org.jboss.tools.smooks.configuration.editors.xml.XMLObjectAnalyzer;
@@ -31,7 +30,7 @@
import org.milyn.Smooks;
import org.milyn.cdr.Parameter;
import org.milyn.json.JSONReaderConfigurator;
-import org.milyn.payload.StringResult;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
@@ -52,7 +51,7 @@
public static final String ROOT_NAME = "rootName"; //$NON-NLS-1$
public IXMLStructuredObject parseJsonFile(InputStream inputStream, Object readerObj)
- throws ParserConfigurationException, DocumentException {
+ throws ParserConfigurationException {
String rootName = null;
String arrayElementName = null;
String keyWhitspaceReplacement = null;
@@ -114,7 +113,7 @@
}
public IXMLStructuredObject parseJsonFile(InputStream stream, SmooksResourceListType resourceList)
- throws FileNotFoundException, ParserConfigurationException, DocumentException, InvocationTargetException {
+ throws FileNotFoundException, ParserConfigurationException, InvocationTargetException {
List<AbstractReader> readers = resourceList.getAbstractReader();
int count = 0;
@@ -140,7 +139,7 @@
}
public IXMLStructuredObject parseJsonFile(String filePath, SmooksResourceListType resourceList)
- throws FileNotFoundException, ParserConfigurationException, DocumentException, InvocationTargetException {
+ throws FileNotFoundException, ParserConfigurationException, InvocationTargetException {
FileInputStream stream = new FileInputStream(filePath);
return this.parseJsonFile(stream, resourceList);
}
@@ -148,7 +147,7 @@
public IXMLStructuredObject parseJsonFile(String filePath, String rootName, String arrayElementName,
String keyWhitspaceReplacement, String keyPrefixOnNumeric, String illegalElementNameCharReplacement,
String nullValueReplacement, Map<String, String> keyMap, String indent, String encoding)
- throws FileNotFoundException, ParserConfigurationException, DocumentException, InvocationTargetException {
+ throws FileNotFoundException, ParserConfigurationException, InvocationTargetException {
return this.parseJsonFile(new FileInputStream(SmooksUIUtils.parseFilePath(filePath)), rootName,
arrayElementName, keyWhitspaceReplacement, keyPrefixOnNumeric, illegalElementNameCharReplacement,
nullValueReplacement, keyMap, indent, encoding);
@@ -157,7 +156,7 @@
public IXMLStructuredObject parseJsonFile(InputStream inputStream, String rootName, String arrayElementName,
String keyWhitspaceReplacement, String keyPrefixOnNumeric, String illegalElementNameCharReplacement,
String nullValueReplacement, Map<String, String> keyMap, String indent, String encoding)
- throws ParserConfigurationException, DocumentException {
+ throws ParserConfigurationException {
Smooks smooks = new Smooks();
@@ -197,21 +196,18 @@
// Use a DOM result to capture the message model for the supplied CSV
// message...
- StringResult result = new StringResult();
+ DOMResult result = new DOMResult();
// Filter the message through Smooks and capture the result as a DOM in
// the domResult instance...
smooks.filterSource(new StreamSource(inputStream), result);
+ Document document = (Document) result.getNode();
+
XMLObjectAnalyzer analyzer = new XMLObjectAnalyzer();
- ByteArrayInputStream byteinputStream = new ByteArrayInputStream(result.getResult().getBytes());
- TagList tagList = analyzer.analyze(byteinputStream, null);
+ TagList tagList = analyzer.analyze(document, null);
try {
- if (byteinputStream != null) {
- byteinputStream.close();
- byteinputStream = null;
- }
if (smooks != null) {
smooks.close();
smooks = null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractXMLObject.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractXMLObject.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractXMLObject.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -15,10 +15,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.QName;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
+import org.w3c.dom.Element;
/**
* @author Dart Peng
@@ -31,9 +29,9 @@
protected Element referenceElement = null;
protected boolean canEdit = false;
-
+
private String namespaceURI = null;
-
+
private String namespacePrefix = null;
public boolean isCanEdit() {
@@ -55,8 +53,7 @@
public String getNamespaceURI() {
Element element = this.getReferenceElement();
if (element != null) {
- Namespace ns = element.getNamespace();
- return ns.getURI();
+ return element.getNamespaceURI();
}
return namespaceURI;
}
@@ -64,9 +61,9 @@
public void setNamespaceURI(String namespaceURL) {
Element element = this.getReferenceElement();
if (element != null) {
- Namespace ns = element.getNamespace();
- Namespace nns = new Namespace(ns.getPrefix(), namespaceURL);
- element.setQName(new QName(name, nns));
+ // Namespace ns = element.getNamespace();
+ // Namespace nns = new Namespace(ns.getPrefix(), namespaceURL);
+ // element.setQName(new QName(name, nns));
}
this.namespaceURI = namespaceURL;
}
@@ -77,8 +74,7 @@
public String getNameSpacePrefix() {
Element element = this.getReferenceElement();
if (element != null) {
- Namespace ns = element.getNamespace();
- return ns.getPrefix();
+ return element.getPrefix();
}
return namespacePrefix;
}
@@ -90,9 +86,9 @@
public void setNameSpacePrefix(String nameSpacePrefix) {
Element element = this.getReferenceElement();
if (element != null) {
- Namespace ns = element.getNamespace();
- Namespace nns = new Namespace(nameSpacePrefix, ns.getURI());
- element.setQName(new QName(name, nns));
+ // Namespace ns = element.getNamespace();
+ // Namespace nns = new Namespace(nameSpacePrefix, ns.getURI());
+ // element.setQName(new QName(name, nns));
}
this.namespacePrefix = nameSpacePrefix;
}
@@ -111,17 +107,17 @@
this.name = name;
Element element = this.getReferenceElement();
if (element != null) {
- element.setQName(new QName(name, element.getNamespace()));
+ // element.setQName(new QName(name, element.getNamespace()));
}
}
- public void setQName(QName name) {
- this.name = name.getName();
- Element element = this.getReferenceElement();
- if (element != null) {
- element.setQName(name);
- }
- }
+ // public void setQName(QName name) {
+ // this.name = name.getName();
+ // Element element = this.getReferenceElement();
+ // if (element != null) {
+ // element.setQName(name);
+ // }
+ // }
public List<AbstractXMLObject> getXMLNodeChildren() {
return children;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagObject.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagObject.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagObject.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -14,9 +14,9 @@
import java.util.Iterator;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.Element;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
/**
* @author Dart Peng
@@ -37,13 +37,13 @@
this.getProperties().add(pro);
if (pro != null)
pro.setParent(this);
- Attribute attribute = pro.getReferenceAttibute();
+ Attr attribute = pro.getReferenceAttibute();
Element parentElement = getReferenceElement();
if (attribute != null && parentElement != null) {
- if (attribute.getParent() == parentElement) {
+ if (attribute.getParentNode() == parentElement) {
return;
}
- parentElement.add(attribute);
+ parentElement.appendChild(attribute);
}
}
@@ -52,10 +52,10 @@
if (pro != null)
pro.setParent(null);
- Attribute attribute = pro.getReferenceAttibute();
+ Attr attribute = pro.getReferenceAttibute();
Element parentElement = getReferenceElement();
if (attribute != null && parentElement != null) {
- parentElement.remove(attribute);
+ parentElement.removeAttributeNode(attribute);
}
}
@@ -66,10 +66,10 @@
Element childElement = tag.getReferenceElement();
Element parentElement = getReferenceElement();
if (childElement != null && parentElement != null) {
- if (childElement.getParent() == parentElement) {
+ if (childElement.getParentNode() == parentElement) {
return;
}
- parentElement.add(childElement);
+ parentElement.appendChild(childElement);
}
}
@@ -81,16 +81,16 @@
Element childElement = tag.getReferenceElement();
Element parentElement = getReferenceElement();
if (childElement != null && parentElement != null) {
- parentElement.remove(childElement);
+ parentElement.removeChild(childElement);
}
}
@Override
public List<IXMLStructuredObject> getChildren() {
- List all = new ArrayList();
- List tags = this.getXMLNodeChildren();
- List properties = this.getProperties();
+ List<IXMLStructuredObject> all = new ArrayList<IXMLStructuredObject>();
+ List<AbstractXMLObject> tags = this.getXMLNodeChildren();
+ List<TagPropertyObject> properties = this.getProperties();
all.addAll(properties);
all.addAll(tags);
return all;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagPropertyObject.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagPropertyObject.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/TagPropertyObject.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -13,12 +13,9 @@
import java.util.Collections;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.QName;
-import org.dom4j.dom.DOMDocumentFactory;
+import org.w3c.dom.Attr;
+
/**
* @author Dart Peng
* @Date Jul 25, 2008
@@ -29,10 +26,10 @@
protected String value = null;
- protected Attribute referenceAttibute;
+ protected Attr referenceAttibute;
public String getValue() {
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
return attribute.getValue();
}
@@ -41,7 +38,7 @@
public void setValue(String value) {
this.value = value;
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
attribute.setValue(value);
}
@@ -50,7 +47,7 @@
/**
* @return the referenceAttibute
*/
- public Attribute getReferenceAttibute() {
+ public Attr getReferenceAttibute() {
return referenceAttibute;
}
@@ -63,7 +60,7 @@
*/
@Override
public String getName() {
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
return attribute.getName();
} else {
@@ -79,9 +76,9 @@
*/
@Override
public String getNameSpacePrefix() {
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
- return attribute.getNamespacePrefix();
+ return attribute.getPrefix();
}
return null;
}
@@ -94,7 +91,7 @@
*/
@Override
public String getNamespaceURI() {
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
return attribute.getNamespaceURI();
}
@@ -114,17 +111,17 @@
return;
}
super.setName(name);
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
- String namespace = attribute.getNamespaceURI();
- String namespacePrefix = attribute.getNamespacePrefix();
- Element container = attribute.getParent();
- String value = attribute.getValue();
- container.remove(attribute);
- Attribute newAttribute = DOMDocumentFactory.getInstance().createAttribute(container,
- new QName(name, new Namespace(namespacePrefix, namespace)), value);
- container.add(newAttribute);
- this.setReferenceAttibute(newAttribute);
+// String namespace = attribute.getNamespaceURI();
+// String namespacePrefix = attribute.getNamespacePrefix();
+// Element container = attribute.getParent();
+// String value = attribute.getValue();
+// container.remove(attribute);
+// Attr newAttribute = DOMDocumentFactory.getInstance().createAttribute(container,
+// new QName(name, new Namespace(namespacePrefix, namespace)), value);
+// container.add(newAttribute);
+// this.setReferenceAttibute(newAttribute);
}
}
@@ -136,9 +133,9 @@
*/
@Override
public void setNameSpacePrefix(String nameSpacePrefix) {
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
- attribute.setNamespace(new Namespace(nameSpacePrefix, attribute.getNamespaceURI()));
+ attribute.setPrefix(nameSpacePrefix);
}
}
@@ -150,9 +147,9 @@
*/
@Override
public void setNamespaceURI(String namespaceURI) {
- Attribute attribute = getReferenceAttibute();
+ Attr attribute = getReferenceAttibute();
if (attribute != null) {
- attribute.setNamespace(new Namespace(attribute.getNamespacePrefix(), namespaceURI));
+// attribute.setNamespace(new Namespace(attribute.getNamespacePrefix(), namespaceURI));
}
}
@@ -160,7 +157,7 @@
* @param referenceAttibute
* the referenceAttibute to set
*/
- public void setReferenceAttibute(Attribute referenceAttibute) {
+ public void setReferenceAttibute(Attr referenceAttibute) {
this.referenceAttibute = referenceAttibute;
}
@@ -184,7 +181,7 @@
@Override
public List<AbstractXMLObject> getXMLNodeChildren() {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
@Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -11,53 +11,73 @@
package org.jboss.tools.smooks.configuration.editors.xml;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+
/**
* @author Dart Peng
* @Date Jul 25, 2008
*/
public class XMLObjectAnalyzer {
- public TagList analyze(String xmlFilePath,String[] ignoreNodeNames)
- throws FileNotFoundException, DocumentException {
+ public TagList analyze(String xmlFilePath, String[] ignoreNodeNames) throws ParserConfigurationException, SAXException, IOException {
FileInputStream stream = new FileInputStream(xmlFilePath);
- TagList list = this.analyze(stream,ignoreNodeNames);
+ TagList list = this.analyze(stream, ignoreNodeNames);
try {
stream.close();
} catch (IOException e) {
}
return list;
}
-
- public TagList analyze(InputStream stream , String[] ignoreNodeNames) throws DocumentException {
- SAXReader reader = new SAXReader();
- Document doc = reader.read(stream);
- Element rootElement = doc.getRootElement();
+
+ public TagList analyze(Document doc , String[] ignoreNodeNames){
+ if(doc == null) return null;
+ Element rootElement = doc.getDocumentElement();
TagList dco = new TagList();
dco.setName("Docuement"); //$NON-NLS-1$
- dco.addRootTag( parseElement(rootElement, null , ignoreNodeNames));
+ dco.addRootTag(parseElement(rootElement, null, ignoreNodeNames));
return dco;
}
-
- public TagObject analyzeFregment(InputStream stream,String[] ignoreNodeNames) throws DocumentException {
- SAXReader reader = new SAXReader();
- Document doc = reader.read(stream);
- Element rootElement = doc.getRootElement();
- return parseElement(rootElement, null ,ignoreNodeNames);
+
+ public TagList analyze(InputStream stream, String[] ignoreNodeNames) throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilder builder = createDocumentBuildingFactory();
+ Document doc = builder.parse(stream);
+ return analyze(doc, ignoreNodeNames);
}
- protected TagObject getChildTagByName(String name, TagObject tag , String[] ignoreNodeNames) {
- if(isIgnoreNode(name, ignoreNodeNames)) return null;
+ public DocumentBuilder createDocumentBuildingFactory() throws ParserConfigurationException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(true);
+
+ factory.setExpandEntityReferences(false);
+ return factory.newDocumentBuilder();
+ }
+
+ public TagObject analyzeFregment(InputStream stream, String[] ignoreNodeNames) throws ParserConfigurationException,
+ SAXException, IOException {
+ DocumentBuilder builder = createDocumentBuildingFactory();
+ org.w3c.dom.Document doc = builder.parse(stream);
+ Element rootElement = doc.getDocumentElement();
+ return parseElement(rootElement, null, ignoreNodeNames);
+ }
+
+ protected TagObject getChildTagByName(String name, TagObject tag, String[] ignoreNodeNames) {
+ if (isIgnoreNode(name, ignoreNodeNames))
+ return null;
if (tag == null)
return null;
List<?> list = tag.getXMLNodeChildren();
@@ -68,45 +88,51 @@
}
return null;
}
-
- private boolean isIgnoreNode(Element element , String[] ignoreNodeNames){
- return isIgnoreNode(element.getName(), ignoreNodeNames);
+
+ private boolean isIgnoreNode(Element element, String[] ignoreNodeNames) {
+ return isIgnoreNode(element.getNodeName(), ignoreNodeNames);
}
-
-// private boolean isIgnoreNode(TagObject element , String[] ignoreNodeNames){
-// return isIgnoreNode(element.getName(), ignoreNodeNames);
-// }
-
- private boolean isIgnoreNode(String name , String[] ignoreNodeNames){
- if(ignoreNodeNames == null) return false;
+
+ // private boolean isIgnoreNode(TagObject element , String[]
+ // ignoreNodeNames){
+ // return isIgnoreNode(element.getName(), ignoreNodeNames);
+ // }
+
+ private boolean isIgnoreNode(String name, String[] ignoreNodeNames) {
+ if (ignoreNodeNames == null)
+ return false;
for (int i = 0; i < ignoreNodeNames.length; i++) {
String ignore = ignoreNodeNames[i];
- if(ignore.trim().equalsIgnoreCase(name)) return true;
+ if (ignore.trim().equalsIgnoreCase(name))
+ return true;
}
return false;
}
- protected TagObject parseElement(Element element, TagObject parentTag , String[] ignoreNodeNames) {
-
- if(isIgnoreNode(element, ignoreNodeNames))
+ protected TagObject parseElement(Element element, TagObject parentTag, String[] ignoreNodeNames) {
+
+ if (isIgnoreNode(element, ignoreNodeNames))
return null;
boolean canAdd = false;
- TagObject tag = getChildTagByName(element.getName(), parentTag , ignoreNodeNames);
+ TagObject tag = getChildTagByName(element.getNodeName(), parentTag, ignoreNodeNames);
if (tag == null) {
tag = new TagObject();
canAdd = true;
}
tag.setReferenceElement(element);
- tag.setName(element.getName());
- fillProperties(element, tag ,ignoreNodeNames);
+ tag.setName(element.getNodeName());
+ fillProperties(element, tag, ignoreNodeNames);
tag.setNamespaceURI(element.getNamespaceURI());
- List<?> list = element.elements();
- for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
- Element childElement = (Element) iterator.next();
- TagObject t = parseElement(childElement, tag , ignoreNodeNames);
- if (t != null){
- t.setReferenceElement(childElement);
- tag.addChildTag(t);
+ NodeList nodeList = element.getChildNodes();
+ for(int i = 0 ; i < nodeList.getLength() ; i++){
+ Node node = nodeList.item(i);
+ if(node instanceof Element){
+ Element childElement = (Element)node;
+ TagObject t = parseElement(childElement, tag, ignoreNodeNames);
+ if (t != null) {
+ t.setReferenceElement(childElement);
+ tag.addChildTag(t);
+ }
}
}
if (canAdd)
@@ -125,21 +151,25 @@
return false;
}
- protected void fillProperties(Element element, TagObject tag , String[] ignoreNodeNames) {
- Iterator<?> it = element.attributeIterator();
- for (Iterator<?> iterator = it; iterator.hasNext();) {
- Attribute attr = (Attribute) iterator.next();
- String attrName = attr.getName();
- String value = attr.getValue();
- if(isIgnoreNode(attrName, ignoreNodeNames)) continue;
- if (hasSameNameProperty(attrName, tag)) {
- continue;
+ protected void fillProperties(Element element, TagObject tag, String[] ignoreNodeNames) {
+ NamedNodeMap attrMap = element.getAttributes();
+ for (int i = 0; i < attrMap.getLength(); i++) {
+ Node node = attrMap.item(i);
+ if(node instanceof Attr){
+ Attr attr = (Attr)node;
+ String attrName = attr.getName();
+ String value = attr.getValue();
+ if (isIgnoreNode(attrName, ignoreNodeNames))
+ continue;
+ if (hasSameNameProperty(attrName, tag)) {
+ continue;
+ }
+ TagPropertyObject pro = new TagPropertyObject();
+ pro.setName(attr.getName());
+ pro.setValue(value);
+ pro.setNamespaceURI(attr.getNamespaceURI());
+ tag.addProperty(pro);
}
- TagPropertyObject pro = new TagPropertyObject();
- pro.setName(attr.getName());
- pro.setValue(value);
- pro.setNamespaceURI(attr.getNamespaceURI());
- tag.addProperty(pro);
}
}
}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer2.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer2.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLObjectAnalyzer2.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -1,137 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors.xml;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.List;
-
-import org.dom4j.Attribute;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-/**
- * @author Dart
- *
- */
-public class XMLObjectAnalyzer2 {
- public TagList analyze(String xmlFilePath, String[] ignoreNodeNames) throws FileNotFoundException,
- DocumentException {
- FileInputStream stream = new FileInputStream(xmlFilePath);
- return this.analyze(stream, ignoreNodeNames);
- }
-
- public TagList analyze(InputStream stream, String[] ignoreNodeNames) throws DocumentException {
- SAXReader reader = new SAXReader();
- Document doc = reader.read(stream);
- Element rootElement = doc.getRootElement();
- TagList dco = new TagList();
- dco.setName("Docuement"); //$NON-NLS-1$
- dco.addRootTag(parseElement(rootElement, null, ignoreNodeNames));
- return dco;
- }
-
- public TagObject analyzeFregment(InputStream stream, String[] ignoreNodeNames) throws DocumentException {
- SAXReader reader = new SAXReader();
- Document doc = reader.read(stream);
- Element rootElement = doc.getRootElement();
- return parseElement(rootElement, null, ignoreNodeNames);
- }
-
- protected TagObject getChildTagByName(String name, TagObject tag, String[] ignoreNodeNames) {
- if (isIgnoreNode(name, ignoreNodeNames))
- return null;
- if (tag == null)
- return null;
- List<?> list = tag.getXMLNodeChildren();
- for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
- TagObject tagc = (TagObject) iterator.next();
- if (tagc.getName().equals(name))
- return tagc;
- }
- return null;
- }
-
- private boolean isIgnoreNode(Element element, String[] ignoreNodeNames) {
- return isIgnoreNode(element.getName(), ignoreNodeNames);
- }
-
- // private boolean isIgnoreNode(TagObject element , String[]
- // ignoreNodeNames){
- // return isIgnoreNode(element.getName(), ignoreNodeNames);
- // }
-
- private boolean isIgnoreNode(String name, String[] ignoreNodeNames) {
- if (ignoreNodeNames == null)
- return false;
- for (int i = 0; i < ignoreNodeNames.length; i++) {
- String ignore = ignoreNodeNames[i];
- if (ignore.trim().equalsIgnoreCase(name))
- return true;
- }
- return false;
- }
-
- protected TagObject parseElement(Element element, TagObject parentTag, String[] ignoreNodeNames) {
-
- if (isIgnoreNode(element, ignoreNodeNames))
- return null;
- boolean canAdd = false;
- TagObject tag = getChildTagByName(element.getName(), parentTag, ignoreNodeNames);
- if (tag == null) {
- tag = new TagObject();
- canAdd = true;
- }
- tag.setReferenceElement(element);
- tag.setName(element.getName());
- fillProperties(element, tag, ignoreNodeNames);
- tag.setNamespaceURI(element.getNamespaceURI());
- List<?> list = element.elements();
- for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
- Element childElement = (Element) iterator.next();
- TagObject t = parseElement(childElement, tag, ignoreNodeNames);
- if (t != null) {
- t.setReferenceElement(childElement);
- tag.addChildTag(t);
- }
- }
- if (canAdd)
- return tag;
- else
- return null;
- }
-
- protected boolean hasSameNameProperty(String proName, TagObject tag) {
- List<TagPropertyObject> pros = tag.getProperties();
- for (Iterator<TagPropertyObject> iterator = pros.iterator(); iterator.hasNext();) {
- TagPropertyObject tp = (TagPropertyObject) iterator.next();
- if (tp.getName().equals(proName))
- return true;
- }
- return false;
- }
-
- protected void fillProperties(Element element, TagObject tag, String[] ignoreNodeNames) {
- Iterator<?> it = element.attributeIterator();
- for (Iterator<?> iterator = it; iterator.hasNext();) {
- Attribute attr = (Attribute) iterator.next();
- String attrName = attr.getName();
- String value = attr.getValue();
- if (isIgnoreNode(attrName, ignoreNodeNames))
- continue;
- if (hasSameNameProperty(attrName, tag)) {
- continue;
- }
- TagPropertyObject pro = new TagPropertyObject();
- pro.setName(attr.getName());
- pro.setValue(value);
- pro.setNamespaceURI(attr.getNamespaceURI());
- tag.addProperty(pro);
- }
- }
-}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLUtils.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLUtils.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * 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.smooks.configuration.editors.xml;
+
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.xml.serialize.XMLSerializer;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.ls.LSSerializer;
+
+/**
+ * @author Dart
+ *
+ */
+public class XMLUtils {
+
+ public static DocumentBuilder getDOMBuilder() throws ParserConfigurationException {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ return dbf.newDocumentBuilder();
+ }
+
+ public static Transformer getTransformer() throws TransformerConfigurationException {
+ TransformerFactory tf = TransformerFactory.newInstance();
+ return tf.newTransformer();
+ }
+
+ public static Document createDocument() throws ParserConfigurationException {
+ return XMLUtils.getDOMBuilder().newDocument();
+ }
+
+ public static Element firstChildElement(Node node) {
+ for (Node tempNode = node.getFirstChild(); tempNode != null; tempNode = tempNode.getNextSibling()) {
+ if (tempNode.getNodeType() == Node.ELEMENT_NODE) {
+ return (Element) tempNode;
+ }
+ }
+ return null;
+ }
+
+ public static Element nextSiblingElement(Node node) {
+ for (Node tempNode = node.getNextSibling(); tempNode != null; tempNode = tempNode.getNextSibling()) {
+ if (tempNode.getNodeType() == Node.ELEMENT_NODE) {
+ return (Element) tempNode;
+ }
+ }
+ return null;
+ }
+
+ public static Element lastChildElement(Node node) {
+ for (Node tempNode = node.getLastChild(); tempNode != null; tempNode = tempNode.getPreviousSibling()) {
+ if (tempNode.getNodeType() == Node.ELEMENT_NODE) {
+ return (Element) tempNode;
+ }
+ }
+ return null;
+ }
+
+ public static Element previousSiblingElement(Node node) {
+ for (Node tempNode = node.getPreviousSibling(); tempNode != null; tempNode = tempNode.getPreviousSibling()) {
+ if (tempNode.getNodeType() == Node.ELEMENT_NODE) {
+ return (Element) tempNode;
+ }
+ }
+ return null;
+ }
+
+ public static List<Element> getAllChildElements(Node node) {
+ List<Element> v = new ArrayList<Element>();
+ Node child = XMLUtils.firstChildElement(node);
+ while (child != null) {
+ v.add((Element) child);
+ child = XMLUtils.nextSiblingElement(child);
+ }
+ return v;
+ }
+
+ public static List<Element> getChildElementsByNS(Node node, String uri, String localName) {
+ List<Element> childElements = XMLUtils.getAllChildElements(node);
+ List<Element> v = new ArrayList<Element>();
+ for (int i = 0; i < childElements.size(); i++) {
+ Element child = (Element) childElements.get(i);
+ String ln = child.getLocalName();
+ String u = child.getNamespaceURI();
+ if (uri == null) {
+ if (ln.equals(localName)) {
+ v.add(child);
+ }
+ } else {
+ if (ln.equals(localName) && u.equals(uri)) {
+ v.add(child);
+ }
+ }
+ }
+ return v;
+ }
+
+ public static String getLocalName(String nodeName) {
+ int index = nodeName.lastIndexOf(58);
+ if (index == -1) {
+ return nodeName;
+ } else {
+ return nodeName.substring(index + 1, nodeName.length());
+ }
+ }
+
+ public static String getPrefix(String nodeName) {
+ int index = nodeName.lastIndexOf(58);
+ if (index == -1) {
+ return null;
+ } else {
+ return nodeName.substring(0, index);
+ }
+ }
+
+ public static void outDOMNode(Node node, Writer writer) throws TransformerConfigurationException,
+ TransformerException {
+ Transformer transformer = XMLUtils.getTransformer();
+ Source source = new DOMSource(node);
+ Result result = new StreamResult(writer);
+ transformer.transform(source, result);
+ }
+
+ public static void outDOMNode(Node node, OutputStream os) throws TransformerConfigurationException,
+ TransformerException {
+ Transformer transformer = XMLUtils.getTransformer();
+ Source source = new DOMSource(node);
+ Result result = new StreamResult(os);
+ transformer.transform(source, result);
+ }
+}
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XMLUtils.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLModelAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLModelAnalyzer.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLModelAnalyzer.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -17,14 +17,13 @@
import java.util.Iterator;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.io.SAXReader;
+import javax.xml.parsers.DocumentBuilder;
+
+import org.apache.xerces.util.DOMEntityResolverWrapper;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
* @author Dart
@@ -60,121 +59,121 @@
}
return false;
}
-
- public TagObject parse(IFile file) throws DocumentException, CoreException {
- return parse(file.getContents());
- }
-
- public TagObject parse(String filePath) throws FileNotFoundException, DocumentException {
- File file = new File(filePath);
- return parse(new FileInputStream(file));
- }
-
- public TagObject parse(InputStream inputStream, String[] ignoreXSLElementnames) throws DocumentException {
- SAXReader reader = new SAXReader();
- Document document = reader.read(inputStream);
- Element rootElement = document.getRootElement();
- Namespace namespace = rootElement.getNamespaceForURI("http://milyn.codehaus.org/Smooks"); //$NON-NLS-1$
- TagObject tag = (TagObject) parseElement(rootElement, ignoreXSLElementnames, namespace);
- return tag;
- }
-
- public TagObject parse(InputStream inputStream) throws DocumentException {
- return parse(inputStream, new String[] { "output", "value-of" }); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private boolean isIgnoreXSLTag(Element element, String[] ignoreXSLElementNames) {
- if (isXSLElement(element) && ignoreXSLElementNames != null) {
- for (int i = 0; i < ignoreXSLElementNames.length; i++) {
- String name = ignoreXSLElementNames[i];
- String en = element.getName();
- if (en != null) {
- en = en.trim();
- }
- if (name.equalsIgnoreCase(en)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private TagObject createTagObject(Element element, boolean createAttributes, Namespace namespace) {
- XSLTagObject tag = new XSLTagObject();
- tag.setNameSpacePrefix(element.getNamespacePrefix());
- tag.setName(element.getName());
- tag.setNamespaceURI(element.getNamespaceURI());
- tag.setReferenceElement(element);
- if (namespace != null) {
- tag.setSmooksPrix(namespace.getPrefix());
- }
- List<?> attributes = element.attributes();
- if (createAttributes) {
- for (Iterator<?> iterator = attributes.iterator(); iterator.hasNext();) {
- Attribute attribute = (Attribute) iterator.next();
- TagPropertyObject pro = new TagPropertyObject();
- pro.setName(attribute.getName());
- pro.setNamespaceURI(attribute.getNamespaceURI());
- pro.setNameSpacePrefix(attribute.getNamespacePrefix());
- pro.setValue(attribute.getValue());
- pro.setReferenceAttibute(attribute);
- ((TagObject) tag).addProperty(pro);
- }
- }
-
- return tag;
- }
-
- private AbstractXMLObject parseElement(Element rootElement, String[] ignoreXSLElementNames, Namespace namespace) {
- if (rootElement != null) {
- AbstractXMLObject tag = null;
- if (isIgnoreXSLTag(rootElement, ignoreXSLElementNames)) {
- tag = new TagList();
- } else {
- tag = createTagObject(rootElement, true, namespace);
- }
-
- List<?> childrenElements = rootElement.elements();
- for (Iterator<?> iterator = childrenElements.iterator(); iterator.hasNext();) {
- Element element = (Element) iterator.next();
- TagObject xt = null;
- if (isIgnoreXSLTag(element, ignoreXSLElementNames)) {
- xt = createTagObject(element, true, namespace);
- }
- AbstractXMLObject t = parseElement(element, ignoreXSLElementNames, namespace);
- if (t != null) {
- if (tag instanceof TagList) {
- if (t instanceof XSLTagObject) {
- ((TagList) tag).addRootTag((TagObject) t);
- ((XSLTagObject) tag).addRelatedIgnoreXSLTagObject(xt);
- }
- if (t instanceof TagList) {
- List<TagObject> tagObjectList = ((TagList) t).getRootTagList();
- for (Iterator<?> iterator2 = tagObjectList.iterator(); iterator2.hasNext();) {
- TagObject tagObject = (TagObject) iterator2.next();
- ((TagList) tag).addRootTag(tagObject);
- }
- }
- }
- if (tag instanceof XSLTagObject) {
- ((XSLTagObject) tag).addRelatedIgnoreXSLTagObject(xt);
- if (t instanceof TagObject) {
- ((TagObject) tag).addChildTag((TagObject) t);
- }
- if (t instanceof TagList) {
- List<TagObject> tagObjectList = ((TagList) t).getRootTagList();
- for (Iterator<?> iterator2 = tagObjectList.iterator(); iterator2.hasNext();) {
- TagObject tagObject = (TagObject) iterator2.next();
- ((TagObject) tag).addChildTag(tagObject);
- }
- }
- }
- }
- }
-
- return tag;
- }
-
- return null;
- }
+//
+// public TagObject parse(IFile file) throws CoreException {
+// return parse(file.getContents());
+// }
+//
+// public TagObject parse(String filePath) throws FileNotFoundException {
+// File file = new File(filePath);
+// return parse(new FileInputStream(file));
+// }
+//
+// public TagObject parse(InputStream inputStream, String[] ignoreXSLElementnames) {
+// DocumentBuilder builder = XMLUtils.getDOMBuilder();
+// Document document = builder.parse(inputStream);//.read(inputStream);
+// Element rootElement = document.getDocumentElement();
+// Namespace namespace = rootElement.getNamespaceForURI("http://milyn.codehaus.org/Smooks"); //$NON-NLS-1$
+// TagObject tag = (TagObject) parseElement(rootElement, ignoreXSLElementnames, namespace);
+// return tag;
+// }
+//
+// public TagObject parse(InputStream inputStream) throws DocumentException {
+// return parse(inputStream, new String[] { "output", "value-of" }); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+//
+// private boolean isIgnoreXSLTag(Element element, String[] ignoreXSLElementNames) {
+// if (isXSLElement(element) && ignoreXSLElementNames != null) {
+// for (int i = 0; i < ignoreXSLElementNames.length; i++) {
+// String name = ignoreXSLElementNames[i];
+// String en = element.getName();
+// if (en != null) {
+// en = en.trim();
+// }
+// if (name.equalsIgnoreCase(en)) {
+// return true;
+// }
+// }
+// }
+// return false;
+// }
+//
+// private TagObject createTagObject(Element element, boolean createAttributes, Namespace namespace) {
+// XSLTagObject tag = new XSLTagObject();
+// tag.setNameSpacePrefix(element.getNamespacePrefix());
+// tag.setName(element.getName());
+// tag.setNamespaceURI(element.getNamespaceURI());
+// tag.setReferenceElement(element);
+// if (namespace != null) {
+// tag.setSmooksPrix(namespace.getPrefix());
+// }
+// List<?> attributes = element.attributes();
+// if (createAttributes) {
+// for (Iterator<?> iterator = attributes.iterator(); iterator.hasNext();) {
+// Attribute attribute = (Attribute) iterator.next();
+// TagPropertyObject pro = new TagPropertyObject();
+// pro.setName(attribute.getName());
+// pro.setNamespaceURI(attribute.getNamespaceURI());
+// pro.setNameSpacePrefix(attribute.getNamespacePrefix());
+// pro.setValue(attribute.getValue());
+// pro.setReferenceAttibute(attribute);
+// ((TagObject) tag).addProperty(pro);
+// }
+// }
+//
+// return tag;
+// }
+//
+// private AbstractXMLObject parseElement(Element rootElement, String[] ignoreXSLElementNames) {
+// if (rootElement != null) {
+// AbstractXMLObject tag = null;
+// if (isIgnoreXSLTag(rootElement, ignoreXSLElementNames)) {
+// tag = new TagList();
+// } else {
+// tag = createTagObject(rootElement, true, namespace);
+// }
+//
+// List<?> childrenElements = rootElement.elements();
+// for (Iterator<?> iterator = childrenElements.iterator(); iterator.hasNext();) {
+// Element element = (Element) iterator.next();
+// TagObject xt = null;
+// if (isIgnoreXSLTag(element, ignoreXSLElementNames)) {
+// xt = createTagObject(element, true, namespace);
+// }
+// AbstractXMLObject t = parseElement(element, ignoreXSLElementNames, namespace);
+// if (t != null) {
+// if (tag instanceof TagList) {
+// if (t instanceof XSLTagObject) {
+// ((TagList) tag).addRootTag((TagObject) t);
+// ((XSLTagObject) tag).addRelatedIgnoreXSLTagObject(xt);
+// }
+// if (t instanceof TagList) {
+// List<TagObject> tagObjectList = ((TagList) t).getRootTagList();
+// for (Iterator<?> iterator2 = tagObjectList.iterator(); iterator2.hasNext();) {
+// TagObject tagObject = (TagObject) iterator2.next();
+// ((TagList) tag).addRootTag(tagObject);
+// }
+// }
+// }
+// if (tag instanceof XSLTagObject) {
+// ((XSLTagObject) tag).addRelatedIgnoreXSLTagObject(xt);
+// if (t instanceof TagObject) {
+// ((TagObject) tag).addChildTag((TagObject) t);
+// }
+// if (t instanceof TagList) {
+// List<TagObject> tagObjectList = ((TagList) t).getRootTagList();
+// for (Iterator<?> iterator2 = tagObjectList.iterator(); iterator2.hasNext();) {
+// TagObject tagObject = (TagObject) iterator2.next();
+// ((TagObject) tag).addChildTag(tagObject);
+// }
+// }
+// }
+// }
+// }
+//
+// return tag;
+// }
+//
+// return null;
+// }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLTagObject.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLTagObject.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/XSLTagObject.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -14,11 +14,8 @@
import java.util.Iterator;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.DocumentFactory;
-import org.dom4j.Element;
-import org.dom4j.QName;
-import org.dom4j.dom.DOMDocumentFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
/**
* @author Dart
@@ -72,8 +69,8 @@
}
return null;
}
-
- public void removeSelectProperty(){
+
+ public void removeSelectProperty() {
TagPropertyObject tagPropertyObject = null;
List<TagPropertyObject> properties = this.getProperties();
for (Iterator<?> iterator = properties.iterator(); iterator.hasNext();) {
@@ -83,15 +80,15 @@
break;
}
}
- if(tagPropertyObject != null){
+ if (tagPropertyObject != null) {
Element parentElement = this.getReferenceElement();
- Attribute att = tagPropertyObject.getReferenceAttibute();
- parentElement.remove(att);
+ Attr att = tagPropertyObject.getReferenceAttibute();
+ parentElement.removeAttributeNode(att);
this.removeProperty(tagPropertyObject);
}
}
-
- public void removeMatchProperty(){
+
+ public void removeMatchProperty() {
TagPropertyObject tagPropertyObject = null;
List<TagPropertyObject> properties = this.getProperties();
for (Iterator<?> iterator = properties.iterator(); iterator.hasNext();) {
@@ -101,16 +98,16 @@
break;
}
}
- if(tagPropertyObject != null){
+ if (tagPropertyObject != null) {
Element parentElement = this.getReferenceElement();
- Attribute att = tagPropertyObject.getReferenceAttibute();
- parentElement.remove(att);
+ Attr att = tagPropertyObject.getReferenceAttibute();
+ parentElement.removeAttributeNode(att);
this.removeProperty(tagPropertyObject);
}
}
-
- public void setSelectValue(String value){
- if(value == null){
+
+ public void setSelectValue(String value) {
+ if (value == null) {
removeSelectProperty();
return;
}
@@ -123,20 +120,20 @@
break;
}
}
- if(tagPropertyObject == null){
+ if (tagPropertyObject == null) {
tagPropertyObject = new TagPropertyObject();
- DocumentFactory factory = DOMDocumentFactory.getInstance();
Element parentElement = this.getReferenceElement();
- Attribute attribute = factory.createAttribute(parentElement, new QName("select"), value); //$NON-NLS-1$
+ Attr attribute = parentElement.getOwnerDocument().createAttribute("select");//.createAttribute(parentElement, new QName("select"), value); //$NON-NLS-1$
+ attribute.setNodeValue(value);
tagPropertyObject.setReferenceAttibute(attribute);
- parentElement.add(attribute);
+ parentElement.appendChild(attribute);
this.addProperty(tagPropertyObject);
-
+
}
tagPropertyObject.setValue(value);
}
-
- public void setMatchValue(String value){
+
+ public void setMatchValue(String value) {
TagPropertyObject tagPropertyObject = null;
List<TagPropertyObject> properties = this.getProperties();
for (Iterator<?> iterator = properties.iterator(); iterator.hasNext();) {
@@ -146,12 +143,12 @@
break;
}
}
- if(tagPropertyObject == null){
+ if (tagPropertyObject == null) {
tagPropertyObject = new TagPropertyObject();
- DocumentFactory factory = DOMDocumentFactory.getInstance();
Element parentElement = this.getReferenceElement();
- Attribute attribute = factory.createAttribute(parentElement, new QName("match"), value); //$NON-NLS-1$
- parentElement.add(attribute);
+ Attr attribute = parentElement.getOwnerDocument().createAttribute("match");//.createAttribute(parentElement, new QName("select"), value); //$NON-NLS-1$
+ attribute.setNodeValue(value);
+ parentElement.appendChild(attribute);
tagPropertyObject.setReferenceAttibute(attribute);
this.addProperty(tagPropertyObject);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -17,11 +17,7 @@
import java.util.Timer;
import java.util.TimerTask;
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.io.OutputFormat;
-import org.dom4j.io.SAXReader;
-import org.dom4j.io.XMLWriter;
+import org.apache.xml.serialize.OutputFormat;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -67,6 +63,7 @@
import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.SmooksXMLEditor;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.editors.xml.XMLUtils;
import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks.configuration.validate.SmooksMarkerHelper;
import org.jboss.tools.smooks.configuration.validate.SmooksModelValidator;
@@ -98,6 +95,10 @@
import org.jboss.tools.smooks.model.validation10.provider.Validation10ItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
public class AbstractSmooksFormEditor extends FormEditor implements IEditingDomainProvider,
ISmooksModelValidateListener, ISmooksModelProvider {
@@ -232,23 +233,18 @@
}
protected ByteArrayOutputStream getFormattedXMLContentsStream(InputStream outstream) throws IOException {
- XMLWriter writer = null;
+
try {
- SAXReader parser = new SAXReader();
- Document doc = parser.read(outstream);
+ Document doc = XMLUtils.getDOMBuilder().parse(outstream);
EObject rootModel = this.getSmooksModel();
fillComments(doc, rootModel);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
- OutputFormat format = OutputFormat.createPrettyPrint();
- writer = new XMLWriter(stream, format);
- writer.write(doc);
+
+ XMLUtils.outDOMNode(doc, stream);
return stream;
} catch (Throwable t) {
} finally {
- if (writer != null) {
- writer.close();
- }
}
return null;
}
@@ -257,7 +253,7 @@
try {
if (rootModel instanceof DocumentRoot) {
EObject rootElementModel = ((DocumentRoot) rootModel).getSmooksResourceList();
- Element rootElement = document.getRootElement();
+ Element rootElement = document.getDocumentElement();
try {
fillComments(rootElementModel, rootElement);
} catch (Exception e) {
@@ -275,26 +271,28 @@
for (Iterator<?> iterator = comments.iterator(); iterator.hasNext();) {
String string = (String) iterator.next();
Integer commentIndex = ((AbstractAnyType) rootElementModel).getCommentIndex(string);
- List<?> content = rootElement.elements();
+ List<?> content = XMLUtils.getAllChildElements(rootElement);
List<Object> deletedElementList = new ArrayList<Object>();
if (commentIndex.intValue() < content.size()) {
List<Object> tempelements = new ArrayList<Object>(content);
for (int i = commentIndex.intValue(); i < content.size(); i++) {
Element deleteObj = (Element) tempelements.get(i);
- if (rootElement.remove(deleteObj)) {
- deletedElementList.add(deleteObj);
+ Node remodedObj = rootElement.removeChild(deleteObj);
+ if (remodedObj != null) {
+ deletedElementList.add(remodedObj);
}
}
}
- rootElement.addComment(string);
+ Comment comment = rootElement.getOwnerDocument().createComment(string);
+ rootElement.appendChild(comment);
for (int j = 0; j < deletedElementList.size(); j++) {
Element deleteElement = (Element) deletedElementList.get(j);
- rootElement.add(deleteElement);
+ rootElement.appendChild(deleteElement);
}
}
List<EObject> childrenModel = ((AbstractAnyType) rootElementModel).eContents();
- List<?> elements = rootElement.elements();
+ List<?> elements = XMLUtils.getAllChildElements(rootElement);
int length = Math.min(childrenModel.size(), elements.size());
for (int index = 0; index < length; index++) {
EObject child = childrenModel.get(index);
@@ -561,7 +559,7 @@
if (exception != null) {
message = exception.getMessage();
}
- if(message == null){
+ if (message == null) {
message = "Unknown error.Please check the file";
}
for (Iterator<?> iterator = this.smooksInitListener.iterator(); iterator.hasNext();) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLNodeEditPart.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLNodeEditPart.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -13,12 +13,6 @@
import java.util.Iterator;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.QName;
-import org.dom4j.dom.DOMDocumentFactory;
-import org.dom4j.tree.DefaultElement;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.IFigure;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -50,6 +44,8 @@
import org.jboss.tools.smooks.graphical.editors.commands.ChangeXSLNodeNameCommand;
import org.jboss.tools.smooks.graphical.editors.commands.DeleteXSLNodeCommand;
import org.jboss.tools.smooks.graphical.editors.model.xsl.XSLNodeGraphicalModel;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
/**
* @author Dart
@@ -153,31 +149,31 @@
if (model instanceof XSLTagObject) {
String name = ((XSLTagObject) model).getName();
String namespace = ((XSLTagObject) model).getNamespaceURI();
- String namespaceprefix = ((XSLTagObject) model).getNameSpacePrefix();
+// String namespaceprefix = ((XSLTagObject) model).getNameSpacePrefix();
if (XSLModelAnalyzer.isXSLTagObject((XSLTagObject) parentNode)
&& XSLModelAnalyzer.isXSLTagObject((XSLTagObject) model)) {
if (!canCreateAddCommand(name, parentNode.getName())) {
return null;
}
}
- Element element = new DefaultElement(new QName(name, new Namespace(namespaceprefix, namespace)));
+ Element element = ((XSLTagObject) parentNode).getReferenceElement().getOwnerDocument()
+ .createElementNS(namespace, name);
((XSLTagObject) model).setReferenceElement(element);
}
if (model instanceof TagPropertyObject) {
String name = ((TagPropertyObject) model).getName();
String namespace = ((TagPropertyObject) model).getNamespaceURI();
- String namespaceprefix = ((TagPropertyObject) model).getNameSpacePrefix();
+// String namespaceprefix = ((TagPropertyObject) model).getNameSpacePrefix();
if (XSLModelAnalyzer.isXSLTagObject((XSLTagObject) parentNode)) {
return null;
}
Element parentElement = ((XSLTagObject) parentNode).getReferenceElement();
- Attribute element = DOMDocumentFactory.getInstance().createAttribute(parentElement,
- new QName(name, new Namespace(namespaceprefix, namespace)), "");
+ Attr element = parentElement.getOwnerDocument().createAttributeNS(namespace, name);
((TagPropertyObject) model).setReferenceAttibute(element);
}
- AddSmooksGraphicalModelCommand command = new AddSmooksGraphicalModelCommand((AbstractSmooksGraphicalModel) graphModel,
- childGraphModel);
+ AddSmooksGraphicalModelCommand command = new AddSmooksGraphicalModelCommand(
+ (AbstractSmooksGraphicalModel) graphModel, childGraphModel);
return command;
}
return null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLTemplateEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLTemplateEditPart.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/xsl/XSLTemplateEditPart.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -10,11 +10,8 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.editparts.xsl;
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.QName;
-import org.dom4j.dom.DOMDocumentFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
@@ -23,6 +20,7 @@
import org.eclipse.gef.requests.CreateRequest;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.jboss.tools.smooks.configuration.editors.xml.XMLUtils;
import org.jboss.tools.smooks.configuration.editors.xml.XSLModelAnalyzer;
import org.jboss.tools.smooks.configuration.editors.xml.XSLTagObject;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
@@ -32,6 +30,8 @@
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.xsl.XSLNodeGraphicalModel;
import org.jboss.tools.smooks.model.xsl.XslPackage;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
* @author Dart
@@ -62,7 +62,7 @@
Object model = request.getNewObject();
Object graphModel = host.getModel();
if (graphModel instanceof AbstractResourceConfigGraphModel) {
- if(!((AbstractResourceConfigGraphModel)graphModel).getChildrenWithoutDynamic().isEmpty()){
+ if (!((AbstractResourceConfigGraphModel) graphModel).getChildrenWithoutDynamic().isEmpty()) {
return null;
}
if (model instanceof XSLTagObject) {
@@ -70,28 +70,35 @@
ITreeContentProvider provider1 = ((AbstractResourceConfigGraphModel) graphModel).getContentProvider();
IEditingDomainProvider provider2 = ((AbstractResourceConfigGraphModel) graphModel).getDomainProvider();
XSLNodeGraphicalModel childGraphModel = new XSLNodeGraphicalModel(model, provider1, provider, provider2);
-
- Document documentRoot = DOMDocumentFactory.getInstance().createDocument();
-
+
+ Document documentRoot = null;
+ try {
+ documentRoot = XMLUtils.createDocument();
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ }
+
String name = ((XSLTagObject) model).getName();
String namespace = ((XSLTagObject) model).getNamespaceURI();
String namespaceprefix = ((XSLTagObject) model).getNameSpacePrefix();
-
- if(XSLModelAnalyzer.isXSLTagObject((XSLTagObject)model)){
- if(!XSLConstants.STYLESHEET.equals(name)){
+
+ if (XSLModelAnalyzer.isXSLTagObject((XSLTagObject) model)) {
+ if (!XSLConstants.STYLESHEET.equals(name)) {
return null;
}
}
-
- Element element = DOMDocumentFactory.getInstance().createElement(
- new QName(name, new Namespace(namespaceprefix, namespace)));
-
- documentRoot.setRootElement(element);
-
- ((XSLTagObject) model).setReferenceElement(element);
- AddSmooksGraphicalModelCommand command = new AddSmooksGraphicalModelCommand((AbstractSmooksGraphicalModel) graphModel,
- childGraphModel);
- return command;
+
+ if (documentRoot != null) {
+
+ Element element = documentRoot.createElementNS(namespace, name);
+
+ documentRoot.appendChild(element);
+
+ ((XSLTagObject) model).setReferenceElement(element);
+ AddSmooksGraphicalModelCommand command = new AddSmooksGraphicalModelCommand(
+ (AbstractSmooksGraphicalModel) graphModel, childGraphModel);
+ return command;
+ }
}
}
return null;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLNodeGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLNodeGraphicalModel.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLNodeGraphicalModel.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -15,13 +15,6 @@
import java.util.Iterator;
import java.util.List;
-import org.dom4j.Attribute;
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.QName;
-import org.dom4j.io.OutputFormat;
-import org.dom4j.io.XMLWriter;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -34,6 +27,7 @@
import org.jboss.tools.smooks.configuration.editors.xml.AbstractXMLObject;
import org.jboss.tools.smooks.configuration.editors.xml.TagObject;
import org.jboss.tools.smooks.configuration.editors.xml.TagPropertyObject;
+import org.jboss.tools.smooks.configuration.editors.xml.XMLUtils;
import org.jboss.tools.smooks.configuration.editors.xml.XSLModelAnalyzer;
import org.jboss.tools.smooks.configuration.editors.xml.XSLTagObject;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
@@ -43,6 +37,8 @@
import org.jboss.tools.smooks.model.xsl.Template;
import org.jboss.tools.smooks.model.xsl.Xsl;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
* @author Dart
@@ -174,7 +170,7 @@
if (node == xmlObject) {
Element parentElement = ((XSLTagObject) data).getReferenceElement();
Element thisElement = ((XSLTagObject) object).getReferenceElement();
- parentElement.remove(thisElement);
+ parentElement.removeChild(thisElement);
((XSLTagObject) data).removeChildTag((XSLTagObject) object);
relatedTag = (XSLTagObject) object;
break;
@@ -229,14 +225,15 @@
if (relateTag == null) {
relateTag = new XSLTagObject();
Element element = ((XSLTagObject) data).getReferenceElement();
- Document doc = element.getDocument();
- Element rootElement = doc.getRootElement();
- Namespace namespace = rootElement.getNamespaceForURI(XSLModelAnalyzer.XSL_NAME_SPACE);
+ Document doc = element.getOwnerDocument();
+ Element rootElement = doc.getDocumentElement();
+ String namespace = rootElement.getNamespaceURI();
if (namespace == null) {
- namespace = new Namespace("xsl", XSLModelAnalyzer.XSL_NAME_SPACE);
- rootElement.addNamespace("xsl", XSLModelAnalyzer.XSL_NAME_SPACE);
+ namespace = XSLModelAnalyzer.XSL_NAME_SPACE;
}
- Element newElement = element.addElement(new QName("value-of", namespace));
+
+ Element newElement = doc.createElementNS(namespace, "value-of");
+ element.appendChild(newElement);
relateTag.setName("value-of");
relateTag.setReferenceElement(newElement);
((XSLTagObject) data).getRelatedIgnoreXSLTagObjects().add(relateTag);
@@ -254,12 +251,9 @@
if (rootElement != null) {
ByteArrayOutputStream stream = null;
- XMLWriter writer = null;
try {
stream = new ByteArrayOutputStream();
- OutputFormat format = OutputFormat.createPrettyPrint();
- writer = new XMLWriter(stream, format);
- writer.write(rootElement);
+ XMLUtils.outDOMNode(rootElement, stream);
String string = new String(stream.toByteArray());
return string;
} catch (Exception e1) {
@@ -268,8 +262,6 @@
try {
if (stream != null)
stream.close();
- if (writer != null)
- writer.close();
} catch (Throwable t) {
}
}
@@ -332,27 +324,28 @@
AbstractXMLObject xmlNode = (AbstractXMLObject) node.getData();
AbstractXMLObject thisNode = (AbstractXMLObject) this.getData();
Element element = thisNode.getReferenceElement();
- if (xmlNode instanceof TagObject) {
- Element childElement = xmlNode.getReferenceElement();
- if (element.elements().indexOf(childElement) != -1) {
- element.elements().remove(childElement);
- int size = element.attributes().size();
- int realIndex = index;
- if (!XSLModelAnalyzer.isXSLTagObject(thisNode)) {
- realIndex = index - size;
- }
- element.elements().add(realIndex, childElement);
- }
- }
- if (xmlNode instanceof TagPropertyObject) {
- Attribute attribute = ((TagPropertyObject) xmlNode).getReferenceAttibute();
- if (element.attributes().indexOf(attribute) != -1) {
- int size = element.elements().size();
- int realIndex = index - size;
- element.attributes().remove(attribute);
- element.attributes().add(realIndex, attribute);
- }
- }
+ // if (xmlNode instanceof TagObject) {
+ // Element childElement = xmlNode.getReferenceElement();
+ // if (element..indexOf(childElement) != -1) {
+ // element.elements().remove(childElement);
+ // int size = element.attributes().size();
+ // int realIndex = index;
+ // if (!XSLModelAnalyzer.isXSLTagObject(thisNode)) {
+ // realIndex = index - size;
+ // }
+ // element.elements().add(realIndex, childElement);
+ // }
+ // }
+ // if (xmlNode instanceof TagPropertyObject) {
+ // Attribute attribute = ((TagPropertyObject)
+ // xmlNode).getReferenceAttibute();
+ // if (element.attributes().indexOf(attribute) != -1) {
+ // int size = element.elements().size();
+ // int realIndex = index - size;
+ // element.attributes().remove(attribute);
+ // element.attributes().add(realIndex, attribute);
+ // }
+ // }
} catch (Exception e) {
e.printStackTrace();
}
@@ -365,14 +358,14 @@
Element rootElement = null;
Element parentElement = null;
if (data instanceof TagPropertyObject) {
- parentElement = ((TagPropertyObject) data).getReferenceAttibute().getParent();
+ parentElement = ((TagPropertyObject) data).getReferenceAttibute().getOwnerElement();
}
if (data instanceof XSLTagObject) {
parentElement = ((XSLTagObject) data).getReferenceElement();
}
if (parentElement != null) {
- Document d = parentElement.getDocument();
- rootElement = d.getRootElement();
+ Document d = parentElement.getOwnerDocument();
+ rootElement = d.getDocumentElement();
}
return getXSLContents(rootElement);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateContentProvider.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateContentProvider.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateContentProvider.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -10,13 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.model.xsl;
-import java.io.ByteArrayInputStream;
import java.util.HashMap;
import java.util.Map;
-import org.dom4j.DocumentException;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.wst.xsl.core.XSLCore;
@@ -69,26 +66,23 @@
IFile file = SmooksUIUtils.getFile(filePath, SmooksUIUtils.getResource(template).getProject());
if (file != null && XSLCore.isXSLFile(file)) {
XSLModelAnalyzer analyzer = new XSLModelAnalyzer();
- try {
- obj = analyzer.parse(file.getContents());
- } catch (DocumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+// try {
+// obj = analyzer.parse(file.getContents());
+// } catch (CoreException e) {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
}
}else{
String contents = SmooksModelUtils.getAnyTypeCDATA(template);
if(contents != null){
XSLModelAnalyzer analyzer = new XSLModelAnalyzer();
- try {
- obj = analyzer.parse(new ByteArrayInputStream(contents.getBytes()));
- } catch (DocumentException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+// try {
+// obj = analyzer.parse(new ByteArrayInputStream(contents.getBytes()));
+// } catch (DocumentException e) {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
}
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateGraphicalModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateGraphicalModel.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/xsl/XSLTemplateGraphicalModel.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -13,7 +13,6 @@
import java.io.ByteArrayInputStream;
import java.util.List;
-import org.dom4j.Element;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -29,6 +28,7 @@
import org.jboss.tools.smooks.model.xsl.Template;
import org.jboss.tools.smooks.model.xsl.Xsl;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
+import org.w3c.dom.Element;
/**
* @author Dart
@@ -52,7 +52,7 @@
@Override
protected TreeNodeModel createChildModel(Object model, ITreeContentProvider contentProvider,
ILabelProvider labelProvider) {
- return new XSLNodeGraphicalModel(model, contentProvider, labelProvider,domainProvider);
+ return new XSLNodeGraphicalModel(model, contentProvider, labelProvider, domainProvider);
}
/*
@@ -77,8 +77,8 @@
if (node instanceof XSLNodeGraphicalModel) {
Object data = node.getData();
if (data instanceof XSLTagObject) {
- Element element = ((XSLTagObject)data).getReferenceElement();
- Element rootElement = element.getDocument().getRootElement();
+ Element element = ((XSLTagObject) data).getReferenceElement();
+ Element rootElement = element.getOwnerDocument().getDocumentElement();
String contents = XSLNodeGraphicalModel.getXSLContents(rootElement);
Template template = ((Xsl) getData()).getTemplate();
String filePath = SmooksModelUtils.getAnyTypeText(template);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/XSLTemplateCreationWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/XSLTemplateCreationWizard.java 2009-12-08 00:07:42 UTC (rev 19089)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizards/XSLTemplateCreationWizard.java 2009-12-08 02:56:20 UTC (rev 19090)
@@ -14,7 +14,8 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import org.dom4j.DocumentException;
+import javax.xml.parsers.ParserConfigurationException;
+
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.configuration.editors.xml.TagList;
import org.jboss.tools.smooks.configuration.editors.xml.TagObject;
@@ -25,6 +26,7 @@
import org.jboss.tools.smooks.model.xsl.Xsl;
import org.jboss.tools.smooks.model.xsl.XslFactory;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
+import org.xml.sax.SAXException;
/**
* @author Dart
@@ -114,10 +116,14 @@
}
} catch (FileNotFoundException e) {
e.printStackTrace();
- } catch (DocumentException e) {
- e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
}
}
}
15 years, 1 month
JBoss Tools SVN: r19089 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-12-07 19:07:42 -0500 (Mon, 07 Dec 2009)
New Revision: 19089
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java
Log:
TODO comment was removed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java 2009-12-07 23:59:36 UTC (rev 19088)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java 2009-12-08 00:07:42 UTC (rev 19089)
@@ -63,7 +63,6 @@
@Override
public String getId() {
- // TODO Auto-generated method stub
return PLUGIN_ID;
}
}
\ No newline at end of file
15 years, 1 month
JBoss Tools SVN: r19088 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-12-07 18:59:36 -0500 (Mon, 07 Dec 2009)
New Revision: 19088
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java
Log:
fix for compilation errors in trunk build
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java 2009-12-07 23:16:10 UTC (rev 19087)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/JstlTemplatePlugin.java 2009-12-07 23:59:36 UTC (rev 19088)
@@ -60,4 +60,10 @@
public static JstlTemplatePlugin getDefault() {
return plugin;
}
+
+ @Override
+ public String getId() {
+ // TODO Auto-generated method stub
+ return PLUGIN_ID;
+ }
}
\ No newline at end of file
15 years, 1 month
JBoss Tools SVN: r19087 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui: src/org/jboss/tools/smooks/configuration and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2009-12-07 18:16:10 -0500 (Mon, 07 Dec 2009)
New Revision: 19087
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
Log:
OPEN - issue JBIDE-5279: Add "Run As" support for smooks configs
https://jira.jboss.org/jira/browse/JBIDE-5279
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties 2009-12-07 22:25:47 UTC (rev 19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties 2009-12-07 23:16:10 UTC (rev 19087)
@@ -94,3 +94,4 @@
_UI_XslEditor_label = Xsl Model Editor
_UI_XslEditorFilenameDefaultBase = My
_UI_XslEditorFilenameExtensions = xsl
+launch.shortcut.text=Smooks Run Configuration
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-12-07 22:25:47 UTC (rev 19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-12-07 23:16:10 UTC (rev 19087)
@@ -217,5 +217,29 @@
id="org.jboss.tools.smooks.ui.launchConfigurationTabGroup.smooksLauncher">
</launchConfigurationTabGroup>
</extension>
+ <extension
+ point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut
+ class="org.jboss.tools.smooks.launch.SmooksLaunchShortcut"
+ icon="icons/smooks-sm.gif"
+ id="org.jboss.tools.smooks.ui.launch.shortcut"
+ label="%launch.shortcut.text"
+ modes="run">
+ <configurationType
+ id="org.jboss.tools.smooks.ui.smooksLauncher">
+ </configurationType>
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <test property="org.eclipse.debug.ui.matchesPattern" value="*.xml"/>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+
+ </extension>
</plugin>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java 2009-12-07 22:25:47 UTC (rev 19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java 2009-12-07 23:16:10 UTC (rev 19087)
@@ -1,8 +1,12 @@
package org.jboss.tools.smooks.configuration;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.osgi.framework.BundleContext;
@@ -57,8 +61,8 @@
return plugin;
}
- public void log(Throwable e) {
- getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.ERROR, Messages.SmooksConfigurationActivator_Smooks_ErrorDialog_Title, e));
+ public static void log(Throwable e) {
+ log(new Status(Status.ERROR, PLUGIN_ID, Status.ERROR, Messages.SmooksConfigurationActivator_Smooks_ErrorDialog_Title, e));
}
@Override
@@ -177,4 +181,25 @@
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow workBenchWindow= getActiveWorkbenchWindow();
+ if (workBenchWindow == null)
+ return null;
+ return workBenchWindow.getShell();
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ if (plugin == null)
+ return null;
+ IWorkbench workBench= plugin.getWorkbench();
+ if (workBench == null)
+ return null;
+ return workBench.getActiveWorkbenchWindow();
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java 2009-12-07 23:16:10 UTC (rev 19087)
@@ -0,0 +1,124 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+*
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ */
+package org.jboss.tools.smooks.launch;
+
+import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+
+/**
+ * The default exception handler shows an error dialog when one of its handle methods
+ * is called. If the passed exception is a <code>CoreException</code> an error dialog
+ * pops up showing the exception's status information. For a <code>InvocationTargetException</code>
+ * a normal message dialog pops up showing the exception's message. Additionally the exception
+ * is written to the platform log.
+ *
+ * TO DO: this class is duplicated from org.eclipse.jdt.ui
+ */
+public class ExceptionHandler {
+
+ private static ExceptionHandler fgInstance= new ExceptionHandler();
+
+ /**
+ * Handles the given <code>CoreException</code>. The workbench shell is used as a parent
+ * for the dialog window.
+ *
+ * @param e the <code>CoreException</code> to be handled
+ * @param title the dialog window's window title
+ * @param message message to be displayed by the dialog window
+ */
+ public static void handle(CoreException e, String title, String message) {
+ handle(e, SmooksConfigurationActivator.getActiveWorkbenchShell(), title, message);
+ }
+
+ /**
+ * Handles the given <code>CoreException</code>.
+ *
+ * @param e the <code>CoreException</code> to be handled
+ * @param parent the dialog window's parent shell or <code>null</code>
+ * @param title the dialog window's window title
+ * @param message message to be displayed by the dialog window
+ */
+ public static void handle(CoreException e, Shell parent, String title, String message) {
+ fgInstance.perform(e, parent, title, message);
+ }
+
+ /**
+ * Handles the given <code>InvocationTargetException</code>.
+ *
+ * @param e the <code>InvocationTargetException</code> to be handled
+ * @param parent the dialog window's parent shell or <code>null</code>
+ * @param title the dialog window's window title
+ * @param message message to be displayed by the dialog window
+ */
+ public static void handle(InvocationTargetException e, Shell parent, String title, String message) {
+ fgInstance.perform(e, parent, title, message);
+ }
+
+ //---- Hooks for subclasses to control exception handling ------------------------------------
+
+ protected void perform(CoreException e, Shell shell, String title, String message) {
+ SmooksConfigurationActivator.log(e);
+ IStatus status= e.getStatus();
+ if (status != null) {
+ ErrorDialog.openError(shell, title, message, status);
+ } else {
+ displayMessageDialog(e.getMessage(), shell, title, message);
+ }
+ }
+
+ protected void perform(InvocationTargetException e, Shell shell, String title, String message) {
+ Throwable target= e.getTargetException();
+ if (target instanceof CoreException) {
+ perform((CoreException)target, shell, title, message);
+ } else {
+ SmooksConfigurationActivator.log(e);
+ if (e.getMessage() != null && e.getMessage().length() > 0) {
+ displayMessageDialog(e.getMessage(), shell, title, message);
+ } else {
+ displayMessageDialog(target.getMessage(), shell, title, message);
+ }
+ }
+ }
+
+ private void displayMessageDialog(String exceptionMessage, Shell shell, String title, String message) {
+ StringWriter msg= new StringWriter();
+ if (message != null) {
+ msg.write(message);
+ msg.write("\n\n"); //$NON-NLS-1$
+ }
+ if (exceptionMessage == null || exceptionMessage.length() == 0)
+ msg.write("An exception has occurred. Please check the log for details.");
+ else
+ msg.write(exceptionMessage);
+ MessageDialog.openError(shell, title, msg.toString());
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java 2009-12-07 23:16:10 UTC (rev 19087)
@@ -0,0 +1,183 @@
+package org.jboss.tools.smooks.launch;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.jdt.junit.launcher.JUnitLaunchShortcut;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+
+public class SmooksLaunchShortcut extends JUnitLaunchShortcut {
+
+ private static final String EMPTY_STRING= ""; //$NON-NLS-1$
+
+ private Shell getShell() {
+ return SmooksConfigurationActivator.getActiveWorkbenchShell();
+ }
+
+ private ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ private List<ILaunchConfiguration> findExistingLaunchConfigurations(ILaunchConfigurationWorkingCopy temporary) throws CoreException {
+ ILaunchConfigurationType configType= temporary.getType();
+
+ ILaunchConfiguration[] configs= getLaunchManager().getLaunchConfigurations(configType);
+ String[] attributeToCompare= getAttributeNamesToCompare();
+
+ ArrayList<ILaunchConfiguration> candidateConfigs= new ArrayList<ILaunchConfiguration>(configs.length);
+ for (int i= 0; i < configs.length; i++) {
+ ILaunchConfiguration config= configs[i];
+ if (hasSameAttributes(config, temporary, attributeToCompare)) {
+ candidateConfigs.add(config);
+ }
+ }
+ return candidateConfigs;
+ }
+
+ private static boolean hasSameAttributes(ILaunchConfiguration config1, ILaunchConfiguration config2, String[] attributeToCompare) {
+ try {
+ for (int i= 0; i < attributeToCompare.length; i++) {
+ String val1= config1.getAttribute(attributeToCompare[i], EMPTY_STRING);
+ String val2= config2.getAttribute(attributeToCompare[i], EMPTY_STRING);
+ if (!val1.equals(val2)) {
+ return false;
+ }
+ }
+ return true;
+ } catch (CoreException e) {
+ // ignore access problems here, return false
+ }
+ return false;
+ }
+
+ public void launch(ISelection selection, String mode) {
+ if (selection instanceof IStructuredSelection) {
+ launch(((IStructuredSelection) selection).toArray(), mode);
+ }
+ }
+
+ public void launch(IEditorPart editor, String mode) {
+ if (editor.getEditorInput() != null && editor.getEditorInput() instanceof IFileEditorInput) {
+ IFile file= ((IFileEditorInput)editor.getEditorInput()).getFile();
+ if (file != null) {
+ launch(new Object[] { file }, mode);
+ }
+ }
+ }
+
+ private void launch(Object[] elements, String mode) {
+ try {
+ IFile elementToLaunch= null;
+
+ if (elements.length == 1) {
+ Object selected= elements[0];
+ if (!(selected instanceof IFile) && selected instanceof IAdaptable) {
+ selected= ((IAdaptable) selected).getAdapter(IFile.class);
+ }
+ if (selected instanceof IFile) {
+ elementToLaunch = (IFile) selected;
+ }
+ }
+ performLaunch(elementToLaunch, mode);
+ } catch (InterruptedException e) {
+ // OK, silently move on
+ } catch (CoreException e) {
+ ExceptionHandler.handle(e, getShell(),
+ "Launch Failed",
+ "An exception occurred while testing the Smooks Configuration.");
+ }
+ }
+
+ private void performLaunch(IFile file, String mode) throws InterruptedException, CoreException {
+ ILaunchConfigurationWorkingCopy temparary= createLaunchConfiguration(file);
+ ILaunchConfiguration config= findExistingLaunchConfiguration(temparary, mode);
+ if (config == null) {
+ // no existing found: create a new one
+ config= temparary.doSave();
+ }
+ DebugUITools.launch(config, mode);
+ }
+
+ private ILaunchConfiguration findExistingLaunchConfiguration(ILaunchConfigurationWorkingCopy temporary, String mode) throws InterruptedException, CoreException {
+ List<?> candidateConfigs= findExistingLaunchConfigurations(temporary);
+
+ // If there are no existing configs associated with the IType, create
+ // one.
+ // If there is exactly one config associated with the IType, return it.
+ // Otherwise, if there is more than one config associated with the
+ // IType, prompt the
+ // user to choose one.
+ int candidateCount= candidateConfigs.size();
+ if (candidateCount == 0) {
+ return null;
+ } else if (candidateCount == 1) {
+ return (ILaunchConfiguration) candidateConfigs.get(0);
+ } else {
+ // Prompt the user to choose a config. A null result means the user
+ // cancelled the dialog, in which case this method returns null,
+ // since cancelling the dialog should also cancel launching
+ // anything.
+ ILaunchConfiguration config= chooseConfiguration(candidateConfigs, mode);
+ if (config != null) {
+ return config;
+ }
+ }
+ return null;
+ }
+
+ private ILaunchConfiguration chooseConfiguration(List<?> configList, String mode) throws InterruptedException {
+ IDebugModelPresentation labelProvider= DebugUITools.newDebugModelPresentation();
+ ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
+ dialog.setElements(configList.toArray());
+ dialog.setTitle("Select Runtime Configuration");
+ if (mode.equals(ILaunchManager.RUN_MODE)) {
+ dialog.setMessage("Select from the available Smooks Runtime Configurations.");
+ }
+ dialog.setMultipleSelection(false);
+ int result= dialog.open();
+ if (result == Window.OK) {
+ return (ILaunchConfiguration) dialog.getFirstResult();
+ }
+ throw new InterruptedException(); // cancelled by user
+ }
+
+ protected String getLaunchConfigurationTypeId() {
+ return "org.jboss.tools.smooks.ui.smooksLauncher";
+ }
+
+ protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IFile file) throws CoreException {
+ if (file != null) {
+
+ ILaunchConfigurationType configType= getLaunchManager().getLaunchConfigurationType(getLaunchConfigurationTypeId());
+ ILaunchConfigurationWorkingCopy wc= configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(file.getName()));
+
+ IProject project = (IProject) file.getProject();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, file.getProjectRelativePath().toPortableString());
+
+ return wc;
+ }
+
+ return null;
+
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2009-12-07 22:25:47 UTC (rev 19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2009-12-07 23:16:10 UTC (rev 19087)
@@ -1,6 +1,6 @@
-/*
+/**
* JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
* by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
@@ -15,7 +15,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
- * (C) 2005-2006, JBoss Inc.
+ * (C) 2009, JBoss Inc.
*/
package org.jboss.tools.smooks.launch;
@@ -24,12 +24,10 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.StringReader;
-import java.io.StringWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.Map.Entry;
-import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.jboss.tools.smooks.configuration.ProcessNodeType;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-07 22:25:47 UTC (rev 19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-07 23:16:10 UTC (rev 19087)
@@ -19,17 +19,27 @@
*/
package org.jboss.tools.smooks.launch;
-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.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
-
+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.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -41,11 +51,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
@@ -55,21 +60,6 @@
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.part.FileEditorInput;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.jboss.tools.smooks.configuration.RuntimeMetadata;
import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
@@ -86,8 +76,6 @@
private Button fSearchButton;
private RuntimeMetadata launchMetaData = new RuntimeMetadata();
- private ILaunchConfiguration fLaunchConfiguration;
-
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
@@ -105,12 +93,12 @@
validatePage();
}
- private void createSpacer(Composite comp) {
- Label label= new Label(comp, SWT.NONE);
- GridData gd= new GridData();
- gd.horizontalSpan= 3;
- label.setLayoutData(gd);
- }
+// private void createSpacer(Composite comp) {
+// Label label= new Label(comp, SWT.NONE);
+// GridData gd= new GridData();
+// gd.horizontalSpan= 3;
+// label.setLayoutData(gd);
+// }
private void createFormElements(Composite comp) {
GridData gd = new GridData();
@@ -199,7 +187,6 @@
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
public void initializeFrom(ILaunchConfiguration config) {
- fLaunchConfiguration = config;
try {
fProjText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "")); //$NON-NLS-1$
fConfigurationText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "")); //$NON-NLS-1$
@@ -353,7 +340,7 @@
setErrorMessage("Unknown project name '" + projectName + "'.");
return;
}
- IJavaProject javaProject= JavaCore.create(project);
+// IJavaProject javaProject= JavaCore.create(project);
String configName= fConfigurationText.getText().trim();
try {
15 years, 1 month
JBoss Tools SVN: r19085 - in trunk: cdi/plugins/org.jboss.tools.cdi.core/images and 50 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-07 17:25:46 -0500 (Mon, 07 Dec 2009)
New Revision: 19085
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/images/
trunk/cdi/plugins/org.jboss.tools.cdi.core/images/ca/
trunk/cdi/plugins/org.jboss.tools.cdi.core/images/ca/icons_CDI_EL.gif
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIPlugin.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELCorePlugin.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUiPlugin.java
trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java
trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferencePlugin.java
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIPlugin.java
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/XStudioVerificationPlugin.java
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/plugin/VerificationPlugin.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BaseUIPlugin.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/JsfTemplatePlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/MyFacesTemplatesPlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/JSFModelPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/JSTExtensionsPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebUiPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/SeamExtPlugin.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUiPagesPlugin.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamGuiPlugin.java
trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/StrutsExtensionsPlugin.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/StrutsUIPlugin.java
trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/XStudioValidatorPlugin.java
trunk/struts/plugins/org.jboss.tools.struts.verification/src/org/jboss/tools/struts/verification/StrutsVerificationPlugin.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java
trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTestPlugin.java
trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/HtmlTemplatePlugin.java
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/src/org/jboss/tools/vpe/jsp/JspTemplatePluign.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/Activator.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PalettePlugin.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/src/org/jboss/tools/vpe/jsp/test/JSPTestPlugin.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5383
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/images/ca/icons_CDI_EL.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/images/ca/icons_CDI_EL.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -90,4 +90,12 @@
return n;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIPlugin.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -57,4 +57,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BaseUIPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BaseUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/log/BaseUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -7,11 +7,15 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.common.log;
+import java.util.HashMap;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -20,15 +24,16 @@
/**
* Provides an easy way to log status of events.
*
- * NOTE: It is useful to make the static method getPluginLog()
- * which provides the interface IPluginLog for using it in your code
- * in future
- *
+ * NOTE: It is useful to make the static method getPluginLog() which provides
+ * the interface IPluginLog for using it in your code in future
+ *
* @author Sergey Vasilyev
- *
*/
+public abstract class BaseUIPlugin extends AbstractUIPlugin implements
+ IPluginLog {
-public class BaseUIPlugin extends AbstractUIPlugin implements IPluginLog {
+ // A Map to save a descriptor for each image
+ private HashMap<String, ImageDescriptor> fImageDescRegistry = null;
public void logError(String message, Throwable t) {
LogHelper.logError(this, message, t);
@@ -45,7 +50,7 @@
public void logInfo(String message, Throwable t) {
LogHelper.logInfo(this, message, t);
}
-
+
public void logInfo(String message) {
LogHelper.logInfo(this, message);
}
@@ -65,7 +70,114 @@
public void showError(String message, Throwable t) {
logError(message, t);
Shell shell = Display.getDefault().getActiveShell();
- IStatus s = StatusFactory.getInstance(IStatus.ERROR, this.getBundle().getSymbolicName(), message, t);
- ErrorDialog.openError(shell, Messages.BaseUIPlugin_ErrorDialogTitle, message, s);
+ IStatus s = StatusFactory.getInstance(IStatus.ERROR, this.getBundle()
+ .getSymbolicName(), message, t);
+ ErrorDialog.openError(shell, Messages.BaseUIPlugin_ErrorDialogTitle,
+ message, s);
}
+
+ /**
+ * Retrieves the image associated with resource from the image registry. If
+ * the image cannot be retrieved, attempt to find and load the image at the
+ * location specified in resource.
+ *
+ * @param resource
+ * the image to retrieve
+ * @return Image the image associated with resource or null if one could not
+ * be found
+ */
+ public Image getImage(String resource) {
+ Image image = getImageRegistry().get(resource);
+ if (image == null) {
+ // create an image
+ image = createImage(resource);
+ }
+ return image;
+ }
+
+ /**
+ * Creates an image from the given resource and adds the image to the image
+ * registry.
+ *
+ * @param resource
+ * @return Image
+ */
+ private Image createImage(String resource) {
+ ImageDescriptor desc = getImageDescriptorFromRegistry(resource);
+ Image image = null;
+
+ if (desc != null) {
+ image = desc.createImage();
+ // dont add the missing image descriptor image to the image
+ // registry
+ if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
+ getImageRegistry().put(resource, image);
+ }
+ }
+ return image;
+ }
+
+ /**
+ * Retrieves the image descriptor associated with resource from the image
+ * descriptor registry. If the image descriptor cannot be retrieved, attempt
+ * to find and load the image descriptor at the location specified in
+ * resource.
+ *
+ * @param resource
+ * the image descriptor to retrieve
+ * @return ImageDescriptor the image descriptor assocated with resource or
+ * the default "missing" image descriptor if one could not be found
+ */
+ public ImageDescriptor getImageDescriptorFromRegistry(String resource) {
+ ImageDescriptor imageDescriptor = null;
+ ImageDescriptor o = getImageDescriptorRegistry().get(resource);
+ if (o == null) {
+ // create a descriptor
+ imageDescriptor = createImageDescriptor(resource);
+ } else {
+ imageDescriptor = o;
+ }
+ return imageDescriptor;
+ }
+
+ /**
+ * Returns the image descriptor registry for this plugin.
+ *
+ * @return HashMap - image descriptor registry for this plugin
+ */
+ private HashMap<String, ImageDescriptor> getImageDescriptorRegistry() {
+ if (fImageDescRegistry == null) {
+ fImageDescRegistry = new HashMap<String, ImageDescriptor>();
+ }
+ return fImageDescRegistry;
+ }
+
+ /**
+ * Creates an image descriptor from the given imageFilePath and adds the
+ * image descriptor to the image descriptor registry. If an image descriptor
+ * could not be created, the default "missing" image descriptor is returned
+ * but not added to the image descriptor registry.
+ *
+ * @param imageFilePath
+ * @return ImageDescriptor image descriptor for imageFilePath or default
+ * "missing" image descriptor if resource could not be found
+ */
+ private ImageDescriptor createImageDescriptor(String imageFilePath) {
+ ImageDescriptor imageDescriptor = AbstractUIPlugin
+ .imageDescriptorFromPlugin(getId(), imageFilePath);
+ if (imageDescriptor != null) {
+ getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
+ } else {
+ imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+ }
+
+ return imageDescriptor;
+ }
+
+ /**
+ * Returns ID of the plug-in.
+ *
+ * @return
+ */
+ public abstract String getId();
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELCorePlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELCorePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELCorePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -62,4 +62,12 @@
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUiPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUiPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUiPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -58,4 +58,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.meta.ui/src/org/jboss/tools/common/meta/ui/MetaUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -35,4 +35,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return "org.jboss.tools.common.meta.ui";
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/plugin/ModelPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -185,4 +185,12 @@
}
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -80,4 +80,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferencePlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferencePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.resref.core/src/org/jboss/tools/common/resref/core/ResourceReferencePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -54,4 +54,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/ExtensionsPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -11,12 +11,10 @@
package org.jboss.tools.common.text.ext;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
-import org.osgi.framework.BundleContext;
/**
@@ -53,7 +51,6 @@
return null;
}
-
/**
* @return IPluginLog object
*/
@@ -61,4 +58,12 @@
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -19,8 +19,6 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -172,4 +170,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/CommonUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -58,4 +58,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/plugin/VerificationPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/plugin/VerificationPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/plugin/VerificationPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -37,4 +37,12 @@
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/XStudioVerificationPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/XStudioVerificationPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/XStudioVerificationPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -45,4 +45,12 @@
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -11,7 +11,6 @@
package org.jboss.tools.jbpm.convert.bpmnto;
-import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.osgi.framework.BundleContext;
@@ -61,4 +60,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/JSFModelPlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/JSFModelPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/JSFModelPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -6,14 +6,10 @@
*/
package org.jboss.tools.jsf;
-import java.util.HashMap;
import java.util.Properties;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.model.XModel;
@@ -34,14 +30,11 @@
public static final String CA_JSF_EL_IMAGE_PATH = "images/ca/icons_JSF_EL.gif"; //$NON-NLS-1$
public static final String CA_JSF_MESSAGES_IMAGE_PATH = "images/ca/icons_Message_Bundles.gif"; //$NON-NLS-1$
- // A Map to save a descriptor for each image
- private HashMap fImageDescRegistry = null;
-
public JSFModelPlugin() {
super();
INSTANCE = this;
}
-
+
protected void initializeDefaultPluginPreferences()
{
super.initializeDefaultPluginPreferences();
@@ -64,23 +57,23 @@
} catch (XModelException e) {
ModelPlugin.getPluginLog().logError(e);
}
-
+
PreferenceModelUtilities.getPreferenceModel().save();
}
}
-
+
public static void log(String msg) {
if(isDebugEnabled()) INSTANCE.getLog().log(new Status(Status.INFO, PLUGIN_ID, Status.OK, msg, null));
}
-
+
public static void log(IStatus status) {
if(isDebugEnabled() || !status.isOK()) INSTANCE.getLog().log(status);
}
-
+
public static void log(String message, Throwable exception) {
INSTANCE.getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, message, exception));
}
-
+
public static boolean isDebugEnabled() {
return INSTANCE.isDebugging();
}
@@ -88,9 +81,9 @@
public static JSFModelPlugin getDefault() {
return INSTANCE;
}
-
+
static JSFModelPlugin INSTANCE = null;
-
+
/**
* @return IPluginLog object
*/
@@ -98,104 +91,12 @@
return getDefault();
}
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
*/
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptorFromRegistry(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
- getImageRegistry().put(resource, image);
- }
- }
- return image;
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
}
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptorFromRegistry(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null) {
- fImageDescRegistry = new HashMap();
- }
- return fImageDescRegistry;
- }
-
-}
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -22,11 +22,11 @@
public JsfUiPlugin() {
}
-
+
public void start(BundleContext context) throws Exception {
super.start(context);
}
-
+
public static JsfUiPlugin getDefault() {
return PluginHolder.INSTANCE;
}
@@ -34,20 +34,28 @@
public static boolean isDebugEnabled() {
return PluginHolder.INSTANCE.isDebugging();
}
-
+
static class PluginHolder {
static JsfUiPlugin INSTANCE = (JsfUiPlugin)Platform.getPlugin(PLUGIN_ID);
}
-
public static Shell getShell() {
return PluginHolder.INSTANCE.getWorkbench().getActiveWorkbenchWindow().getShell();
}
-
+
/**
* @return IPluginLog object
*/
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/JsfTemplatePlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/JsfTemplatePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/JsfTemplatePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -54,4 +54,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/MyFacesTemplatesPlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/MyFacesTemplatesPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.myfaces/src/org/jboss/tools/jsf/vpe/myfaces/MyFacesTemplatesPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -47,4 +47,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/RichFacesTemplatesActivator.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -78,4 +78,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/src/org/jboss/tools/jsf/vpe/seam/SeamTemplatesActivator.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -80,5 +80,13 @@
}
return (url == null) ? null : url.getPath();
}
-
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsTestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -81,4 +81,12 @@
return (url == null) ? null : url.getPath();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfTestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -82,4 +82,12 @@
return (url == null) ? null : url.getPath();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesTestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -80,4 +80,13 @@
}
return (url == null) ? null : url.getPath();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.seam.test/src/org/jboss/tools/jsf/vpe/seam/test/SeamTestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -81,4 +81,12 @@
return (url == null) ? null : url.getPath();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -280,4 +280,12 @@
return fImageDescRegistry;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/JSTExtensionsPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/JSTExtensionsPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/JSTExtensionsPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -11,12 +11,10 @@
package org.jboss.tools.jst.text.ext;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
-import org.osgi.framework.BundleContext;
/**
@@ -53,7 +51,6 @@
return null;
}
-
/**
* @return IPluginLog object
*/
@@ -61,4 +58,12 @@
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebModelPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -116,4 +116,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -46,4 +46,13 @@
public static WebKbPlugin getDefault() {
return plugin;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -52,4 +52,12 @@
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebUiPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebUiPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/WebUiPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -50,5 +50,12 @@
return getDefault();
}
-
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -12,7 +12,6 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import org.eclipse.core.resources.IProject;
@@ -27,9 +26,6 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
@@ -48,15 +44,12 @@
// The shared instance
private static SeamCorePlugin plugin;
-
- // A Map to save a descriptor for each image
- private HashMap fImageDescRegistry = null;
-
public static final String CA_SEAM_EL_IMAGE_PATH = "images/ca/icons_Seam_EL.gif";
public static final String CA_SEAM_MESSAGES_IMAGE_PATH = "images/ca/icons_Message_Bundles.gif";
-
+
static final String M2_FACET_ID = "jboss.m2"; //$NON-NLS-1$
+
/**
* The constructor
*/
@@ -73,7 +66,7 @@
cleanCachedProjects();
ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
}
-
+
static void cleanCachedProjects() {
IPath path = SeamCorePlugin.getDefault().getStateLocation();
File file = new File(path.toFile(), "projects"); //$NON-NLS-1$
@@ -90,7 +83,6 @@
}
}
}
-
}
IResourceChangeListener resourceChangeListener = new RCL();
@@ -109,9 +101,7 @@
}
}
}
-
}
-
}
/*
@@ -134,23 +124,12 @@
}
/**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- /**
* @return IPluginLog object
*/
public static IPluginLog getPluginLog() {
return getDefault();
}
-
+
/**
* Factory method creating seam project instance by project resource.
* Returns null if
@@ -171,14 +150,14 @@
return null;
}
- ISeamProject seamProject;
- try {
- seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
- if(resolve) seamProject.resolve();
- return seamProject;
- } catch (CoreException e) {
- getPluginLog().logError(e);
- }
+ ISeamProject seamProject;
+ try {
+ seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
+ if(resolve) seamProject.resolve();
+ return seamProject;
+ } catch (CoreException e) {
+ getPluginLog().logError(e);
+ }
return null;
}
@@ -186,7 +165,7 @@
IScopeContext projectScope = new ProjectScope(project);
return projectScope.getNode(PLUGIN_ID);
}
-
+
/**
* @param string
* @return
@@ -194,9 +173,9 @@
public static IStatus createErrorStatus(String message, Throwable exception) {
return new Status(IStatus.ERROR, PLUGIN_ID, -1, message, exception);
}
-
+
private static List<ISeamProjectChangeListener> listeners = new ArrayList<ISeamProjectChangeListener>();
-
+
/**
*
*/
@@ -215,7 +194,7 @@
listeners.remove(listener);
}
}
-
+
public static void fire(SeamProjectChangeEvent event) {
ISeamProjectChangeListener[] ls = null;
synchronized(listeners) {
@@ -228,106 +207,6 @@
}
}
- /**
- * Creates an image from the given resource and adds the image to the
- * image registry.
- *
- * @param resource
- * @return Image
- */
- private Image createImage(String resource) {
- ImageDescriptor desc = getImageDescriptorFromRegistry(resource);
- Image image = null;
-
- if (desc != null) {
- image = desc.createImage();
- // dont add the missing image descriptor image to the image
- // registry
- if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
- getImageRegistry().put(resource, image);
- }
- }
- return image;
- }
-
- /**
- * Creates an image descriptor from the given imageFilePath and adds the
- * image descriptor to the image descriptor registry. If an image
- * descriptor could not be created, the default "missing" image descriptor
- * is returned but not added to the image descriptor registry.
- *
- * @param imageFilePath
- * @return ImageDescriptor image descriptor for imageFilePath or default
- * "missing" image descriptor if resource could not be found
- */
- private ImageDescriptor createImageDescriptor(String imageFilePath) {
- ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, imageFilePath);
- if (imageDescriptor != null) {
- getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
- }
- else {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
-
- return imageDescriptor;
- }
-
- /**
- * Retrieves the image associated with resource from the image registry.
- * If the image cannot be retrieved, attempt to find and load the image at
- * the location specified in resource.
- *
- * @param resource
- * the image to retrieve
- * @return Image the image associated with resource or null if one could
- * not be found
- */
- public Image getImage(String resource) {
- Image image = getImageRegistry().get(resource);
- if (image == null) {
- // create an image
- image = createImage(resource);
- }
- return image;
- }
-
- /**
- * Retrieves the image descriptor associated with resource from the image
- * descriptor registry. If the image descriptor cannot be retrieved,
- * attempt to find and load the image descriptor at the location specified
- * in resource.
- *
- * @param resource
- * the image descriptor to retrieve
- * @return ImageDescriptor the image descriptor assocated with resource or
- * the default "missing" image descriptor if one could not be
- * found
- */
- public ImageDescriptor getImageDescriptorFromRegistry(String resource) {
- ImageDescriptor imageDescriptor = null;
- Object o = getImageDescriptorRegistry().get(resource);
- if (o == null) {
- // create a descriptor
- imageDescriptor = createImageDescriptor(resource);
- }
- else {
- imageDescriptor = (ImageDescriptor) o;
- }
- return imageDescriptor;
- }
-
- /**
- * Returns the image descriptor registry for this plugin.
- *
- * @return HashMap - image descriptor registry for this plugin
- */
- private HashMap getImageDescriptorRegistry() {
- if (fImageDescRegistry == null) {
- fImageDescRegistry = new HashMap();
- }
- return fImageDescRegistry;
- }
-
public boolean hasM2Facet(IProject project) {
try {
return FacetedProjectFramework.hasProjectFacet(project, M2_FACET_ID);
@@ -336,4 +215,12 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/SeamExtPlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/SeamExtPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/SeamExtPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -54,4 +54,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamGuiPlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamGuiPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamGuiPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -82,4 +82,13 @@
}
});
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUiPagesPlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUiPagesPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/SeamUiPagesPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -13,7 +13,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.osgi.framework.BundleContext;
@@ -56,4 +55,13 @@
public static Shell getShell() {
return INSTANCE.getWorkbench().getActiveWorkbenchWindow().getShell();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsModelPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -67,4 +67,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/StrutsExtensionsPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/StrutsExtensionsPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/struts/plugins/org.jboss.tools.struts.text.ext/src/org/jboss/tools/struts/text/ext/StrutsExtensionsPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -77,9 +77,17 @@
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
-
+
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/StrutsUIPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/StrutsUIPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/StrutsUIPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -43,4 +43,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/XStudioValidatorPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/XStudioValidatorPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/struts/plugins/org.jboss.tools.struts.validator.ui/src/org/jboss/tools/struts/validator/ui/XStudioValidatorPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -29,4 +29,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/struts/plugins/org.jboss.tools.struts.verification/src/org/jboss/tools/struts/verification/StrutsVerificationPlugin.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.verification/src/org/jboss/tools/struts/verification/StrutsVerificationPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/struts/plugins/org.jboss.tools.struts.verification/src/org/jboss/tools/struts/verification/StrutsVerificationPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -7,17 +7,17 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.struts.verification;
+
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
-
public class StrutsVerificationPlugin extends BaseUIPlugin {
public static final String PLUGIN_ID = "org.jboss.tools.struts.verification";
-
+
private static StrutsVerificationPlugin plugin = null;
-
+
public StrutsVerificationPlugin() {
plugin = this;
}
@@ -25,7 +25,18 @@
public static StrutsVerificationPlugin getDefault() {
return plugin;
}
-
+
public static IPluginLog getPluginLog() {
return getDefault();
- }}
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTestPlugin.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/struts/tests/org.jboss.tools.struts.vpe.struts.test/src/org/jboss/tools/struts/vpe/struts/test/StrutsTestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -84,4 +84,12 @@
return (url == null) ? null : url.getPath();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -116,6 +116,13 @@
}
return (url == null) ? null : url.getPath();
}
-
-
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/HtmlTemplatePlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/HtmlTemplatePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/src/org/jboss/tools/vpe/html/HtmlTemplatePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -47,4 +47,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.jsp/src/org/jboss/tools/vpe/jsp/JspTemplatePluign.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.jsp/src/org/jboss/tools/vpe/jsp/JspTemplatePluign.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.jsp/src/org/jboss/tools/vpe/jsp/JspTemplatePluign.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -47,4 +47,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/Activator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/Activator.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/Activator.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -47,4 +47,12 @@
return plugin;
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PalettePlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PalettePlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PalettePlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -38,4 +38,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -74,4 +74,13 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/src/org/jboss/tools/vpe/jsp/test/JSPTestPlugin.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/src/org/jboss/tools/vpe/jsp/test/JSPTestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/tests/org.jboss.tools.vpe.jsp.test/src/org/jboss/tools/vpe/jsp/test/JSPTestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -76,4 +76,12 @@
return (url == null) ? null : url.getPath();
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java 2009-12-07 22:21:00 UTC (rev 19084)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VPETestPlugin.java 2009-12-07 22:25:46 UTC (rev 19085)
@@ -73,4 +73,13 @@
}
return (url == null) ? null : url.getPath();
}
-}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.log.BaseUIPlugin#getId()
+ */
+ @Override
+ public String getId() {
+ return PLUGIN_ID;
+ }
+}
\ No newline at end of file
15 years, 1 month
JBoss Tools SVN: r19086 - branches/jbosstools-3.1.0.RC1/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-12-07 17:25:47 -0500 (Mon, 07 Dec 2009)
New Revision: 19086
Modified:
branches/jbosstools-3.1.0.RC1/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5402 Create new Portlet wizard - portlet source not generated
Modified: branches/jbosstools-3.1.0.RC1/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java 2009-12-07 22:25:46 UTC (rev 19085)
+++ branches/jbosstools-3.1.0.RC1/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java 2009-12-07 22:25:47 UTC (rev 19086)
@@ -58,4 +58,12 @@
protected Object getTemplateImplementation() {
return null;
}
+
+ @Override
+ protected String generateTemplateSource(WTPPlugin plugin,
+ CreateJavaEEArtifactTemplateModel templateModel,
+ String templateFile, Object templateImpl, IProgressMonitor monitor)
+ throws JETException {
+ return generateTemplateSource(plugin, templateModel, templateFile, monitor);
+ }
}
15 years, 1 month