JBoss Tools SVN: r27107 - trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-02 10:59:02 -0500 (Thu, 02 Dec 2010)
New Revision: 27107
Modified:
trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF
Log:
use [3.6.0,4.0.0) instead of 3.6.0 for platform dep
Modified: trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF 2010-12-02 15:57:05 UTC (rev 27106)
+++ trunk/bpmn/plugins/org.jboss.tools.bpmn2.process.diagram/META-INF/MANIFEST.MF 2010-12-02 15:59:02 UTC (rev 27107)
@@ -36,7 +36,7 @@
org.eclipse.bpmn2;visibility:=reexport,
org.eclipse.bpmn2.edit;visibility:=reexport,
org.eclipse.gef;visibility:=reexport,
- org.eclipse.jdt.ui;bundle-version="3.6.0",
+ org.eclipse.jdt.ui;bundle-version="[3.6.0,4.0.0)",
org.eclipse.ocl.ecore;visibility:=reexport
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
14 years
JBoss Tools SVN: r27106 - in trunk/jbpm/tests: org.jbpm.gd.jpdl.test/META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-02 10:57:05 -0500 (Thu, 02 Dec 2010)
New Revision: 27106
Modified:
trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF
trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF
Log:
use [3.6.0,4.0.0) instead of 3.6.0 for platform dep
Modified: trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF 2010-12-02 15:52:28 UTC (rev 27105)
+++ trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.multipage.test/META-INF/MANIFEST.MF 2010-12-02 15:57:05 UTC (rev 27106)
@@ -7,4 +7,4 @@
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit;bundle-version="3.8.2",
org.jboss.tools.flow.jpdl4.multipage;bundle-version="4.3.0",
- org.eclipse.core.runtime;bundle-version="3.6.0"
+ org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)"
Modified: trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF 2010-12-02 15:52:28 UTC (rev 27105)
+++ trunk/jbpm/tests/org.jbpm.gd.jpdl.test/META-INF/MANIFEST.MF 2010-12-02 15:57:05 UTC (rev 27106)
@@ -9,4 +9,4 @@
Require-Bundle: org.junit,
org.eclipse.ui;bundle-version="3.5.0",
org.jbpm.gd.jpdl;bundle-version="3.2.0",
- org.eclipse.core.runtime;bundle-version="3.6.0"
+ org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)"
14 years
JBoss Tools SVN: r27105 - trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-02 10:52:28 -0500 (Thu, 02 Dec 2010)
New Revision: 27105
Modified:
trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF
Log:
use [3.6.0,4.0.0) instead of 3.6.0 for platform dep
Modified: trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF 2010-12-02 15:51:36 UTC (rev 27104)
+++ trunk/jbpm/tests/org.jboss.tools.flow.jpdl4.test/META-INF/MANIFEST.MF 2010-12-02 15:52:28 UTC (rev 27105)
@@ -6,5 +6,5 @@
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.jboss.tools.flow.jpdl4;bundle-version="4.3.0",
- org.eclipse.core.runtime;bundle-version="3.6.0",
+ org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
org.junit
14 years
JBoss Tools SVN: r27104 - trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-02 10:51:36 -0500 (Thu, 02 Dec 2010)
New Revision: 27104
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF
Log:
use [3.6.0,4.0.0) instead of 3.6.0 for platform dep
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF 2010-12-02 15:48:28 UTC (rev 27103)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.common.test/META-INF/MANIFEST.MF 2010-12-02 15:51:36 UTC (rev 27104)
@@ -8,4 +8,4 @@
Require-Bundle: org.junit,
org.jboss.tools.jbpm.common,
org.eclipse.jdt.core,
- org.eclipse.core.runtime;bundle-version="3.6.0"
+ org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)"
14 years
JBoss Tools SVN: r27103 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-02 10:48:28 -0500 (Thu, 02 Dec 2010)
New Revision: 27103
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
Log:
use [3.6.0,4.0.0) instead of 3.6.0 for platform dep
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF 2010-12-02 15:16:30 UTC (rev 27102)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/META-INF/MANIFEST.MF 2010-12-02 15:48:28 UTC (rev 27103)
@@ -26,7 +26,7 @@
org.eclipse.rse.files.ui,
org.eclipse.rse.ui,
org.eclipse.wst.server.ui,
- org.eclipse.debug.ui;bundle-version="3.6.0"
+ org.eclipse.debug.ui;bundle-version="[3.6.0,4.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Localization: plugin
14 years
JBoss Tools SVN: r27102 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-12-02 10:16:30 -0500 (Thu, 02 Dec 2010)
New Revision: 27102
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/ImplementationCollector.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-7721
https://jira.jboss.org/browse/JBIDE-7721
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-12-02 15:09:46 UTC (rev 27101)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIConstants.java 2010-12-02 15:16:30 UTC (rev 27102)
@@ -70,6 +70,11 @@
public String INJECTIONPOINT_TYPE_NAME = "javax.enterprise.inject.spi.InjectionPoint";
+ public String DECORATOR_SIMPLE_NAME = "Decorator";
+ public String DECORATOR_TYPE_NAME = "javax.enterprise.inject.spi.Decorator";
+ public String INTERCEPTOR_SIMPLE_NAME = "Interceptor";
+ public String INTERCEPTOR_TYPE_NAME = "javax.enterprise.inject.spi.Interceptor";
+
public String INSTANCE_TYPE_NAME = "javax.enterprise.inject.Instance";
public String PRE_DESTROY_TYPE_NAME = "javax.annotation.PreDestroy";
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-12-02 15:09:46 UTC (rev 27101)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-12-02 15:16:30 UTC (rev 27102)
@@ -59,6 +59,7 @@
import org.jboss.tools.cdi.internal.core.impl.definition.BeansXMLDefinition;
import org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext;
import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+import org.jboss.tools.cdi.internal.core.scanner.ImplementationCollector;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
@@ -1129,12 +1130,14 @@
List<TypeDefinition> typeDefinitions = getAllTypeDefinitions();
List<IBean> beans = new ArrayList<IBean>();
Map<IType, ClassBean> newClassBeans = new HashMap<IType, ClassBean>();
+
+ ImplementationCollector ic = new ImplementationCollector(typeDefinitions);
for (TypeDefinition typeDefinition : typeDefinitions) {
ClassBean bean = null;
- if(typeDefinition.getInterceptorAnnotation() != null) {
+ if(typeDefinition.getInterceptorAnnotation() != null || ic.isInterceptor(typeDefinition.getType())) {
bean = new InterceptorBean();
- } else if(typeDefinition.getDecoratorAnnotation() != null) {
+ } else if(typeDefinition.getDecoratorAnnotation() != null || ic.isDecorator(typeDefinition.getType())) {
bean = new DecoratorBean();
} else if(typeDefinition.getStatefulAnnotation() != null || typeDefinition.getStatelessAnnotation() != null || typeDefinition.getSingletonAnnotation() != null) {
bean = new SessionBean();
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/ImplementationCollector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/ImplementationCollector.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/ImplementationCollector.java 2010-12-02 15:16:30 UTC (rev 27102)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.cdi.internal.core.scanner;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDIConstants;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IParametedType;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
+
+public class ImplementationCollector {
+ List<TypeDefinition> typeDefinitions;
+ Set<IType> decorators = new HashSet<IType>();
+ Set<IType> interceptors = new HashSet<IType>();
+
+ public ImplementationCollector(List<TypeDefinition> typeDefinitions) {
+ this.typeDefinitions = typeDefinitions;
+// long t = System.currentTimeMillis();
+ try {
+ process();
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+// long dt = System.currentTimeMillis() - t;
+// System.out.println("ImplementationCollector: " + dt + " ms for " + typeDefinitions.size() + " types.");
+ }
+
+ void process() throws JavaModelException {
+ for (TypeDefinition typeDef: typeDefinitions) {
+ IType type = typeDef.getType();
+ if(type == null || type.isInterface()) continue;
+ if(!mayBeRelevant(type)) continue;
+ Set<IParametedType> types = typeDef.getInheritedTypes();
+ for (IParametedType t: types) {
+ IType q = t.getType();
+ if(q == null) continue;
+ String cn = q.getFullyQualifiedName();
+ boolean isDecorator = CDIConstants.DECORATOR_TYPE_NAME.equals(cn);
+ boolean isInterceptor = CDIConstants.INTERCEPTOR_TYPE_NAME.equals(cn);
+ if(isDecorator || isInterceptor) {
+ List<? extends IParametedType> ps = t.getParameters();
+ if( ps != null) for (IParametedType p: ps) {
+ IType pt = p.getType();
+ if(pt != null) {
+ if(isDecorator) {
+ decorators.add(pt);
+ }
+ if(isInterceptor) {
+ interceptors.add(pt);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ boolean mayBeRelevant(IType type) throws JavaModelException {
+ String[] is = type.getSuperInterfaceNames();
+ if(is != null) for (String s: is) {
+ if(s.indexOf(CDIConstants.DECORATOR_SIMPLE_NAME) >= 0) return true;
+ if(s.indexOf(CDIConstants.INTERCEPTOR_SIMPLE_NAME) >= 0) return true;
+ }
+ return false;
+ }
+
+ public boolean isDecorator(IType type) {
+ return decorators.contains(type);
+ }
+
+ public boolean isInterceptor(IType type) {
+ return interceptors.contains(type);
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/ImplementationCollector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-02 15:09:46 UTC (rev 27101)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-02 15:16:30 UTC (rev 27102)
@@ -939,7 +939,11 @@
*/
if (bean instanceof IDecorator) {
IDecorator decorator = (IDecorator) bean;
- IAnnotationDeclaration decoratorDeclaration = decorator.getDecoratorAnnotation();
+ ITextSourceReference decoratorDeclaration = decorator.getDecoratorAnnotation();
+ if(decoratorDeclaration == null) {
+ //for custom implementations
+ decoratorDeclaration = decorator.getNameLocation();
+ }
addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, decoratorDeclaration, bean
.getResource());
for (ITextSourceReference declaration : disposerDeclarations) {
@@ -953,7 +957,11 @@
*/
if (bean instanceof IInterceptor) {
IInterceptor interceptor = (IInterceptor) bean;
- IAnnotationDeclaration interceptorDeclaration = interceptor.getInterceptorAnnotation();
+ ITextSourceReference interceptorDeclaration = interceptor.getInterceptorAnnotation();
+ if(interceptorDeclaration == null) {
+ //for custom implementations
+ interceptorDeclaration = interceptor.getNameLocation();
+ }
addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, interceptorDeclaration, bean
.getResource());
for (ITextSourceReference declaration : disposerDeclarations) {
@@ -1695,6 +1703,10 @@
if (declaration == null) {
declaration = interceptor.getInterceptorAnnotation();
}
+ if(declaration == null) {
+ //for custom implementations
+ declaration = interceptor.getNameLocation();
+ }
addError(CDIValidationMessages.INTERCEPTOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, interceptor
.getResource());
}
@@ -1787,6 +1799,10 @@
if (declaration == null) {
declaration = decorator.getDecoratorAnnotation();
}
+ if(declaration == null) {
+ //for custom implementations
+ declaration = decorator.getNameLocation();
+ }
addError(CDIValidationMessages.DECORATOR_IS_ALTERNATIVE, CDIPreferences.INTERCEPTOR_OR_DECORATOR_IS_ALTERNATIVE, declaration, decorator.getResource());
}
14 years
JBoss Tools SVN: r27101 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console: src/org/hibernate/eclipse/launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-12-02 10:09:46 -0500 (Thu, 02 Dec 2010)
New Revision: 27101
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java
Log:
https://jira.jboss.org/browse/JBIDE-7746 - fix for trunk
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml 2010-12-02 14:59:30 UTC (rev 27100)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml 2010-12-02 15:09:46 UTC (rev 27101)
@@ -1,62 +0,0 @@
-<ant-tasks>
- <task name="hbm2doc" id="org.hibernate.tools.hbm2doc">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- </task>
- <task name="hbm2cfgxml" id="org.hibernate.tools.hbm2cfgxml">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="ejb3" gui-name="ejb3" default="false"/>
- </task>
- <task name="hbm2hbmxml" id="org.hibernate.tools.hbm2hbmxml">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- </task>
- <task name="hbmtemplate" id="org.hibernate.tools.hbmtemplate">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="filepattern" gui-name="file_pattern" default=""/>
- <attribute name="foreach" gui-name="for_each" default=""/>
- <attribute name="template" gui-name="template_name" default=""/>
- <attribute name="exporterclass" gui-name="exporterclass" default=""/>
- </task>
- <task name="hbm2java" id="org.hibernate.tools.hbm2java">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="jdk5" gui-name="jdk5" default="false"/>
- <attribute name="ejb3" gui-name="ejb3" default="false"/>
- </task>
- <task name="hbm2ddl" id="org.hibernate.tools.hbm2ddl">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="export" gui-name="exportToDatabase" default="true"/>
- <attribute name="update" gui-name="schemaUpdate" default="false"/>
- <attribute name="drop" gui-name="drop" default="false"/>
- <attribute name="create" gui-name="create" default="true"/>
- <attribute name="outputfilename" gui-name="outputFileName" default=""/>
- <attribute name="delimiter" gui-name="delimiter" default=";"/>
- <attribute name="format" gui-name="format" default="false"/>
- <attribute name="haltonerror" gui-name="haltonerror" default="false"/>
- <attribute name="console" gui-name="scriptToConsole" default="true"/>
- </task>
- <task name="hbm2dao" id="org.hibernate.tools.hbm2dao">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="jdk5" gui-name="jdk5" default="false"/>
- <attribute name="ejb3" gui-name="ejb3" default="false"/>
- </task>
- <task name="query" id="org.hibernate.tools.query">
- <attribute name="destfile" gui-name="outputFileName" default=""/>
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <subtag name="hql" gui-name="query_string" default=""/>
- </task>
-</ant-tasks>
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties 2010-12-02 14:59:30 UTC (rev 27100)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties 2010-12-02 15:09:46 UTC (rev 27101)
@@ -6,9 +6,7 @@
doc/,\
META-INF/,\
about.html,\
- ant-tasks-description.xml,\
plugin.properties
src.includes = src/,\
icons/,\
- doc/,\
- ant-tasks-description.xml
+ doc/
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java 2010-12-02 14:59:30 UTC (rev 27100)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java 2010-12-02 15:09:46 UTC (rev 27101)
@@ -11,10 +11,11 @@
package org.hibernate.eclipse.launch;
import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
-import java.net.URL;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -25,9 +26,6 @@
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
@@ -40,7 +38,7 @@
/**
* path to file to store description
*/
- public static final String ANT_TASKS_DESCRIPTION_PATH = "ant-tasks-description.xml"; //$NON-NLS-1$
+ public static final String ANT_TASKS_DESCRIPTION_PATH = "org/hibernate/eclipse/launch/ant-tasks-description.xml"; //$NON-NLS-1$
public static class AttributeDescription {
public String name;
@@ -116,27 +114,44 @@
}
private static Document getDocument() {
- File resourceFile = null;
- try {
- resourceFile = getResourceItem(ANT_TASKS_DESCRIPTION_PATH);
- } catch (IOException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("getResource: ", e); //$NON-NLS-1$
- }
- if (resourceFile == null || !resourceFile.exists()) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't read file: " + ANT_TASKS_DESCRIPTION_PATH, (Throwable)null); //$NON-NLS-1$
+ InputStream input = getResInputStream(ANT_TASKS_DESCRIPTION_PATH, ExportersXMLAttributeDescription.class);
+ if (input == null) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't read resource: " + ANT_TASKS_DESCRIPTION_PATH, (Throwable)null); //$NON-NLS-1$
return null;
}
- StringBuffer cbuf = new StringBuffer((int) resourceFile.length());
+ StringBuffer cbuf = new StringBuffer();
+ InputStreamReader isReader = null;
+ BufferedReader in = null;
try {
String ls = System.getProperties().getProperty("line.separator", "\n"); //$NON-NLS-1$//$NON-NLS-2$
- BufferedReader in = new BufferedReader(new FileReader(resourceFile));
+ isReader = new InputStreamReader(input);
+ in = new BufferedReader(isReader);
String str;
while ((str = in.readLine()) != null) {
cbuf.append(str + ls);
}
- in.close();
} catch (IOException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("IOException: ", e); //$NON-NLS-1$
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ if (isReader != null) {
+ try {
+ isReader.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ try {
+ input.close();
+ } catch (IOException e) {
+ // ignore
+ }
}
Document res = null;
try {
@@ -146,17 +161,30 @@
}
return res;
}
-
- private static File getResourceItem(String strResPath) throws IOException {
- IPath resourcePath = new Path(strResPath);
- File resourceFile = resourcePath.toFile();
- URL entry = HibernateConsolePlugin.getDefault().getBundle().getEntry(
- strResPath);
- if (entry != null) {
- URL resProject = FileLocator.resolve(entry);
- strResPath = FileLocator.resolve(resProject).getFile();
+
+ /**
+ * @param resName fully qualified path of the resource
+ * @param clazz the class where the resource will exist
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static InputStream getResInputStream(final String resName, final Class clazz) {
+ InputStream input = null;
+ if (System.getSecurityManager() == null) {
+ input = getResInputStreamInternal(resName, clazz);
+ } else {
+ input = AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return getResInputStreamInternal(resName, clazz);
+ }
+ });
}
- resourceFile = new File(strResPath);
- return resourceFile;
+ return input;
}
+
+ @SuppressWarnings("rawtypes")
+ static InputStream getResInputStreamInternal(final String resName, Class clazz) {
+ ClassLoader loader = clazz.getClassLoader();
+ final InputStream input = loader == null ? ClassLoader.getSystemResourceAsStream(resName) : loader.getResourceAsStream(resName);
+ return input;
+ }
}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml 2010-12-02 15:09:46 UTC (rev 27101)
@@ -0,0 +1,62 @@
+<ant-tasks>
+ <task name="hbm2doc" id="org.hibernate.tools.hbm2doc">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ </task>
+ <task name="hbm2cfgxml" id="org.hibernate.tools.hbm2cfgxml">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="ejb3" gui-name="ejb3" default="false"/>
+ </task>
+ <task name="hbm2hbmxml" id="org.hibernate.tools.hbm2hbmxml">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ </task>
+ <task name="hbmtemplate" id="org.hibernate.tools.hbmtemplate">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="filepattern" gui-name="file_pattern" default=""/>
+ <attribute name="foreach" gui-name="for_each" default=""/>
+ <attribute name="template" gui-name="template_name" default=""/>
+ <attribute name="exporterclass" gui-name="exporterclass" default=""/>
+ </task>
+ <task name="hbm2java" id="org.hibernate.tools.hbm2java">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="jdk5" gui-name="jdk5" default="false"/>
+ <attribute name="ejb3" gui-name="ejb3" default="false"/>
+ </task>
+ <task name="hbm2ddl" id="org.hibernate.tools.hbm2ddl">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="export" gui-name="exportToDatabase" default="true"/>
+ <attribute name="update" gui-name="schemaUpdate" default="false"/>
+ <attribute name="drop" gui-name="drop" default="false"/>
+ <attribute name="create" gui-name="create" default="true"/>
+ <attribute name="outputfilename" gui-name="outputFileName" default=""/>
+ <attribute name="delimiter" gui-name="delimiter" default=";"/>
+ <attribute name="format" gui-name="format" default="false"/>
+ <attribute name="haltonerror" gui-name="haltonerror" default="false"/>
+ <attribute name="console" gui-name="scriptToConsole" default="true"/>
+ </task>
+ <task name="hbm2dao" id="org.hibernate.tools.hbm2dao">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="jdk5" gui-name="jdk5" default="false"/>
+ <attribute name="ejb3" gui-name="ejb3" default="false"/>
+ </task>
+ <task name="query" id="org.hibernate.tools.query">
+ <attribute name="destfile" gui-name="outputFileName" default=""/>
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <subtag name="hql" gui-name="query_string" default=""/>
+ </task>
+</ant-tasks>
14 years
JBoss Tools SVN: r27100 - in branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console: src/org/hibernate/eclipse/launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-12-02 09:59:30 -0500 (Thu, 02 Dec 2010)
New Revision: 27100
Added:
branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml
Removed:
branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml
Modified:
branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties
branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java
Log:
https://jira.jboss.org/browse/JBIDE-7746 - fix, for beta2
Deleted: branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml 2010-12-02 14:37:26 UTC (rev 27099)
+++ branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml 2010-12-02 14:59:30 UTC (rev 27100)
@@ -1,62 +0,0 @@
-<ant-tasks>
- <task name="hbm2doc" id="org.hibernate.tools.hbm2doc">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- </task>
- <task name="hbm2cfgxml" id="org.hibernate.tools.hbm2cfgxml">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="ejb3" gui-name="ejb3" default="false"/>
- </task>
- <task name="hbm2hbmxml" id="org.hibernate.tools.hbm2hbmxml">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- </task>
- <task name="hbmtemplate" id="org.hibernate.tools.hbmtemplate">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="filepattern" gui-name="file_pattern" default=""/>
- <attribute name="foreach" gui-name="for_each" default=""/>
- <attribute name="template" gui-name="template_name" default=""/>
- <attribute name="exporterclass" gui-name="exporterclass" default=""/>
- </task>
- <task name="hbm2java" id="org.hibernate.tools.hbm2java">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="jdk5" gui-name="jdk5" default="false"/>
- <attribute name="ejb3" gui-name="ejb3" default="false"/>
- </task>
- <task name="hbm2ddl" id="org.hibernate.tools.hbm2ddl">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="export" gui-name="exportToDatabase" default="true"/>
- <attribute name="update" gui-name="schemaUpdate" default="false"/>
- <attribute name="drop" gui-name="drop" default="false"/>
- <attribute name="create" gui-name="create" default="true"/>
- <attribute name="outputfilename" gui-name="outputFileName" default=""/>
- <attribute name="delimiter" gui-name="delimiter" default=";"/>
- <attribute name="format" gui-name="format" default="false"/>
- <attribute name="haltonerror" gui-name="haltonerror" default="false"/>
- <attribute name="console" gui-name="scriptToConsole" default="true"/>
- </task>
- <task name="hbm2dao" id="org.hibernate.tools.hbm2dao">
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <attribute name="jdk5" gui-name="jdk5" default="false"/>
- <attribute name="ejb3" gui-name="ejb3" default="false"/>
- </task>
- <task name="query" id="org.hibernate.tools.query">
- <attribute name="destfile" gui-name="outputFileName" default=""/>
- <attribute name="destdir" gui-name="outputdir" default=""/>
- <attribute name="templatepath" gui-name="template_path" default=""/>
- <attribute name="templateprefix" gui-name="templateprefix" default=""/>
- <subtag name="hql" gui-name="query_string" default=""/>
- </task>
-</ant-tasks>
Modified: branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties
===================================================================
--- branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties 2010-12-02 14:37:26 UTC (rev 27099)
+++ branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/build.properties 2010-12-02 14:59:30 UTC (rev 27100)
@@ -6,9 +6,7 @@
doc/,\
META-INF/,\
about.html,\
- ant-tasks-description.xml,\
plugin.properties
src.includes = src/,\
icons/,\
- doc/,\
- ant-tasks-description.xml
+ doc/
Modified: branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java
===================================================================
--- branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java 2010-12-02 14:37:26 UTC (rev 27099)
+++ branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExportersXMLAttributeDescription.java 2010-12-02 14:59:30 UTC (rev 27100)
@@ -11,10 +11,11 @@
package org.hibernate.eclipse.launch;
import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
import java.io.IOException;
-import java.net.URL;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@@ -25,9 +26,6 @@
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
@@ -40,7 +38,7 @@
/**
* path to file to store description
*/
- public static final String ANT_TASKS_DESCRIPTION_PATH = "ant-tasks-description.xml"; //$NON-NLS-1$
+ public static final String ANT_TASKS_DESCRIPTION_PATH = "org/hibernate/eclipse/launch/ant-tasks-description.xml"; //$NON-NLS-1$
public static class AttributeDescription {
public String name;
@@ -116,27 +114,44 @@
}
private static Document getDocument() {
- File resourceFile = null;
- try {
- resourceFile = getResourceItem(ANT_TASKS_DESCRIPTION_PATH);
- } catch (IOException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("getResource: ", e); //$NON-NLS-1$
- }
- if (resourceFile == null || !resourceFile.exists()) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't read file: " + ANT_TASKS_DESCRIPTION_PATH, (Throwable)null); //$NON-NLS-1$
+ InputStream input = getResInputStream(ANT_TASKS_DESCRIPTION_PATH, ExportersXMLAttributeDescription.class);
+ if (input == null) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't read resource: " + ANT_TASKS_DESCRIPTION_PATH, (Throwable)null); //$NON-NLS-1$
return null;
}
- StringBuffer cbuf = new StringBuffer((int) resourceFile.length());
+ StringBuffer cbuf = new StringBuffer();
+ InputStreamReader isReader = null;
+ BufferedReader in = null;
try {
String ls = System.getProperties().getProperty("line.separator", "\n"); //$NON-NLS-1$//$NON-NLS-2$
- BufferedReader in = new BufferedReader(new FileReader(resourceFile));
+ isReader = new InputStreamReader(input);
+ in = new BufferedReader(isReader);
String str;
while ((str = in.readLine()) != null) {
cbuf.append(str + ls);
}
- in.close();
} catch (IOException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("IOException: ", e); //$NON-NLS-1$
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ if (isReader != null) {
+ try {
+ isReader.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ try {
+ input.close();
+ } catch (IOException e) {
+ // ignore
+ }
}
Document res = null;
try {
@@ -146,17 +161,30 @@
}
return res;
}
-
- private static File getResourceItem(String strResPath) throws IOException {
- IPath resourcePath = new Path(strResPath);
- File resourceFile = resourcePath.toFile();
- URL entry = HibernateConsolePlugin.getDefault().getBundle().getEntry(
- strResPath);
- if (entry != null) {
- URL resProject = FileLocator.resolve(entry);
- strResPath = FileLocator.resolve(resProject).getFile();
+
+ /**
+ * @param resName fully qualified path of the resource
+ * @param clazz the class where the resource will exist
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public static InputStream getResInputStream(final String resName, final Class clazz) {
+ InputStream input = null;
+ if (System.getSecurityManager() == null) {
+ input = getResInputStreamInternal(resName, clazz);
+ } else {
+ input = AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return getResInputStreamInternal(resName, clazz);
+ }
+ });
}
- resourceFile = new File(strResPath);
- return resourceFile;
+ return input;
}
+
+ @SuppressWarnings("rawtypes")
+ static InputStream getResInputStreamInternal(final String resName, Class clazz) {
+ ClassLoader loader = clazz.getClassLoader();
+ final InputStream input = loader == null ? ClassLoader.getSystemResourceAsStream(resName) : loader.getResourceAsStream(resName);
+ return input;
+ }
}
Copied: branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml (from rev 27001, branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/ant-tasks-description.xml)
===================================================================
--- branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml (rev 0)
+++ branches/jbosstools-3.2.0.Beta2/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ant-tasks-description.xml 2010-12-02 14:59:30 UTC (rev 27100)
@@ -0,0 +1,62 @@
+<ant-tasks>
+ <task name="hbm2doc" id="org.hibernate.tools.hbm2doc">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ </task>
+ <task name="hbm2cfgxml" id="org.hibernate.tools.hbm2cfgxml">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="ejb3" gui-name="ejb3" default="false"/>
+ </task>
+ <task name="hbm2hbmxml" id="org.hibernate.tools.hbm2hbmxml">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ </task>
+ <task name="hbmtemplate" id="org.hibernate.tools.hbmtemplate">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="filepattern" gui-name="file_pattern" default=""/>
+ <attribute name="foreach" gui-name="for_each" default=""/>
+ <attribute name="template" gui-name="template_name" default=""/>
+ <attribute name="exporterclass" gui-name="exporterclass" default=""/>
+ </task>
+ <task name="hbm2java" id="org.hibernate.tools.hbm2java">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="jdk5" gui-name="jdk5" default="false"/>
+ <attribute name="ejb3" gui-name="ejb3" default="false"/>
+ </task>
+ <task name="hbm2ddl" id="org.hibernate.tools.hbm2ddl">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="export" gui-name="exportToDatabase" default="true"/>
+ <attribute name="update" gui-name="schemaUpdate" default="false"/>
+ <attribute name="drop" gui-name="drop" default="false"/>
+ <attribute name="create" gui-name="create" default="true"/>
+ <attribute name="outputfilename" gui-name="outputFileName" default=""/>
+ <attribute name="delimiter" gui-name="delimiter" default=";"/>
+ <attribute name="format" gui-name="format" default="false"/>
+ <attribute name="haltonerror" gui-name="haltonerror" default="false"/>
+ <attribute name="console" gui-name="scriptToConsole" default="true"/>
+ </task>
+ <task name="hbm2dao" id="org.hibernate.tools.hbm2dao">
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <attribute name="jdk5" gui-name="jdk5" default="false"/>
+ <attribute name="ejb3" gui-name="ejb3" default="false"/>
+ </task>
+ <task name="query" id="org.hibernate.tools.query">
+ <attribute name="destfile" gui-name="outputFileName" default=""/>
+ <attribute name="destdir" gui-name="outputdir" default=""/>
+ <attribute name="templatepath" gui-name="template_path" default=""/>
+ <attribute name="templateprefix" gui-name="templateprefix" default=""/>
+ <subtag name="hql" gui-name="query_string" default=""/>
+ </task>
+</ant-tasks>
14 years
JBoss Tools SVN: r27099 - branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-02 09:37:26 -0500 (Thu, 02 Dec 2010)
New Revision: 27099
Modified:
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
Log:
[JBIDE-7693] remove listner to model before loading images from server. images would get added twice otherwise
Modified: branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
--- branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-02 14:33:09 UTC (rev 27098)
+++ branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-02 14:37:26 UTC (rev 27099)
@@ -70,16 +70,18 @@
if (!initialized) {
DeltaCloud cloud = (DeltaCloud)getElement();
try {
+ // do not listen to model when loading. we would add images twice otherwise.
+ cloud.removeImageListListener(this);
DeltaCloudImage[] images = filter(cloud.getImages());
- cloud.removeImageListListener(this);
addImages(images);
initialized = true;
- cloud.addImageListListener(this);
} catch (Exception e) {
ErrorUtils.handleError(
"Error",
"Colud not get images from cloud " + cloud.getName(),
e, Display.getDefault().getActiveShell());
+ } finally {
+ cloud.addImageListListener(this);
}
}
return super.getChildren();
Modified: branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
--- branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-02 14:33:09 UTC (rev 27098)
+++ branches/jbosstools-3.2.0.Beta2/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-02 14:37:26 UTC (rev 27099)
@@ -78,13 +78,14 @@
DeltaCloudInstance[] instances = filter(cloud.getInstances());
addInstances(instances);
initialized = true;
- cloud.addInstanceListListener(this);
} catch (Exception e) {
// TODO: internationalize strings
ErrorUtils.handleError(
"Error",
"Colud not get instances from cloud " + cloud.getName(),
e, Display.getDefault().getActiveShell());
+ } finally {
+ cloud.addInstanceListListener(this);
}
}
return super.getChildren();
14 years
JBoss Tools SVN: r27098 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-02 09:33:09 -0500 (Thu, 02 Dec 2010)
New Revision: 27098
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
Log:
[JBIDE-7789] fixed NPE when invalid cloud is selected in combo. images was NULL
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-02 14:21:09 UTC (rev 27097)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-02 14:33:09 UTC (rev 27098)
@@ -1,5 +1,8 @@
2010-12-02 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
+ (inputChanged):
+ [JBIDE-7789] fixed NPE when invalid cloud is selected in combo. images was NULL
* src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java (getChildren):
[JBIDE-7780] synchronized children initialisation
* src/org/jboss/tools/deltacloud/ui/views/CloudViewElement.java (getName):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-12-02 14:21:09 UTC (rev 27097)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-12-02 14:33:09 UTC (rev 27098)
@@ -26,12 +26,13 @@
/**
* @author Jeff Johnston
+ * @author André Dietisheim
*/
public class ImageViewLabelAndContentProvider extends BaseLabelProvider implements ITableContentAndLabelProvider {
private DeltaCloud cloud;
private IImageFilter localFilter;
- private DeltaCloudImage[] images = new DeltaCloudImage[]{};
+ private DeltaCloudImage[] images = new DeltaCloudImage[] {};
public enum Column {
NAME(0, 20),
@@ -73,6 +74,9 @@
@Override
public Object[] getElements(Object inputElement) {
+ if (images == null) {
+ return new DeltaCloudImage[] {};
+ }
return images;
}
@@ -85,36 +89,48 @@
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput != null) {
- if (newInput instanceof DeltaCloudImage[]) {
- images = filter((DeltaCloudImage[]) newInput);
- } else if (newInput instanceof DeltaCloud){
- cloud = (DeltaCloud) newInput;
- try {
- images = filter(cloud.getImages());
- } catch (Exception e) {
- ErrorUtils.handleError(
- "Error",
- "Could not display images for cloud " + cloud.getName(),
- e, Display.getDefault().getActiveShell());
- }
+ if (newInput instanceof DeltaCloud) {
+ this.cloud = (DeltaCloud) newInput;
}
+ this.images = filter(cloud, getImages(newInput));
}
}
+ private DeltaCloudImage[] getImages(Object newInput) {
+ DeltaCloudImage[] images = new DeltaCloudImage[] {};
+ if (newInput instanceof DeltaCloudImage[]) {
+ images = ((DeltaCloudImage[]) newInput);
+ } else if (newInput instanceof DeltaCloud) {
+ cloud = (DeltaCloud) newInput;
+ try {
+ return cloud.getImages();
+ } catch (Exception e) {
+ ErrorUtils.handleError(
+ "Error",
+ "Could not display images for cloud " + cloud.getName(),
+ e, Display.getDefault().getActiveShell());
+ }
+
+ }
+ return images;
+ }
+
// Allow override of filter for Finding Images
public void setFilter(IImageFilter filter) {
this.localFilter = filter;
}
- private DeltaCloudImage[] filter(DeltaCloudImage[] input) {
+ private DeltaCloudImage[] filter(DeltaCloud cloud, DeltaCloudImage[] input) {
ArrayList<DeltaCloudImage> array = new ArrayList<DeltaCloudImage>();
IImageFilter f = localFilter;
- if (localFilter == null)
+ if (localFilter == null && cloud != null) {
f = cloud.getImageFilter();
+ }
for (int i = 0; i < input.length; ++i) {
DeltaCloudImage image = input[i];
- if (f.isVisible(image))
+ if (f != null && f.isVisible(image)) {
array.add(image);
+ }
}
return array.toArray(new DeltaCloudImage[array.size()]);
}
14 years