Started approach 2 of OSGi integration:
Embed ADempiere in Equinox OSGi * Status: Swing client can be started in Equinox - not tested much * turned base, client and tools projects into bundles * sorted out some glitches in resource loading * a copy of Adempiere class in client was required to correctly fire up swing * first ideas for the service interfaces (see base/org.adempiere.base package) https://sourceforge.net/tracker/?func=detail&aid=2700937&group_id=176962&atid=879334
This commit is contained in:
parent
f4598da280
commit
75f9f57cbc
|
@ -24,5 +24,6 @@
|
|||
<classpathentry kind="lib" path="/tools/lib/commons-collections-3.1.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/activemq-core-5.0.0.jar"/>
|
||||
<classpathentry kind="src" path="/JasperReportsTools"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="build"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,26 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>base</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>dbPort</project>
|
||||
<project>looks</project>
|
||||
<project>print</project>
|
||||
<project>tools</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.ibm.etools.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>base</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>dbPort</project>
|
||||
<project>looks</project>
|
||||
<project>print</project>
|
||||
<project>tools</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.ibm.etools.validation.validationbuilder</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.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: org.adempiere.base
|
||||
Bundle-SymbolicName: org.adempiere.base;singleton:=true
|
||||
Bundle-Version: 0.0.0.2
|
||||
Bundle-ClassPath: base.jar,
|
||||
lib/commons-net-1.4.0.jar,
|
||||
lib/ant.jar,
|
||||
lib/jpedal.jar,
|
||||
lib/jnlp.jar,
|
||||
lib/junit.jar,
|
||||
client/jbossall-client.jar,
|
||||
lib/postgresql.jar,
|
||||
lib/ocrs12.jar,
|
||||
lib/ojdbc14.jar,
|
||||
lib/c3p0-0.9.1.2.jar,
|
||||
lib/script-api.jar,
|
||||
lib/barbecue-1.5-beta1.jar,
|
||||
lib/poi-3.0.1-FINAL-20070705.jar,
|
||||
lib/jcommon-1.0.14.jar,
|
||||
lib/jfreechart-1.0.11.jar,
|
||||
lib/swingx-0.9.0.jar,
|
||||
lib/looks-2.0.4.jar,
|
||||
lib/commons-collections-3.1.jar,
|
||||
lib/activemq-core-5.0.0.jar
|
||||
Export-Package: com.jgoodies.looks,
|
||||
com.jgoodies.looks.common,
|
||||
com.jgoodies.looks.plastic,
|
||||
com.jgoodies.looks.plastic.theme,
|
||||
com.jgoodies.looks.windows,
|
||||
org.adempiere.apps.graph,
|
||||
org.adempiere.as,
|
||||
org.adempiere.base,
|
||||
org.adempiere.exceptions,
|
||||
org.adempiere.impexp,
|
||||
org.adempiere.model,
|
||||
org.adempiere.pdf,
|
||||
org.adempiere.pdf.viewer,
|
||||
org.adempiere.pipo,
|
||||
org.adempiere.pipo.exception,
|
||||
org.adempiere.pipo.handler,
|
||||
org.adempiere.plaf,
|
||||
org.adempiere.print.export,
|
||||
org.adempiere.process,
|
||||
org.adempiere.process.rpl,
|
||||
org.adempiere.process.rpl.exp,
|
||||
org.adempiere.process.rpl.imp,
|
||||
org.adempiere.util,
|
||||
org.compiere,
|
||||
org.compiere.FA,
|
||||
org.compiere.acct,
|
||||
org.compiere.cm,
|
||||
org.compiere.db,
|
||||
org.compiere.dbPort,
|
||||
org.compiere.impexp,
|
||||
org.compiere.interfaces,
|
||||
org.compiere.model,
|
||||
org.compiere.plaf,
|
||||
org.compiere.print,
|
||||
org.compiere.print.layout,
|
||||
org.compiere.process,
|
||||
org.compiere.report,
|
||||
org.compiere.report.core,
|
||||
org.compiere.sla,
|
||||
org.compiere.swing,
|
||||
org.compiere.tools,
|
||||
org.compiere.util,
|
||||
org.compiere.wf
|
||||
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
|
||||
org.adempiere.tools;bundle-version="0.0.0"
|
|
@ -0,0 +1,74 @@
|
|||
source.base.jar = src/
|
||||
bin.includes = META-INF/,\
|
||||
../tools/lib/commons-net-1.4.0.jar,\
|
||||
../tools/lib/ant.jar,\
|
||||
../tools/lib/jpedal.jar,\
|
||||
../tools/lib/jnlp.jar,\
|
||||
../tools/lib/junit.jar,\
|
||||
client/jbossall-client.jar,\
|
||||
../tools/lib/postgresql.jar,\
|
||||
../tools/lib/ocrs12.jar,\
|
||||
../tools/lib/ojdbc14.jar,\
|
||||
../tools/lib/c3p0-0.9.1.2.jar,\
|
||||
../tools/lib/script-api.jar,\
|
||||
../tools/lib/barbecue-1.5-beta1.jar,\
|
||||
../tools/lib/poi-3.0.1-FINAL-20070705.jar,\
|
||||
../tools/lib/jcommon-1.0.14.jar,\
|
||||
../tools/lib/jfreechart-1.0.11.jar,\
|
||||
../tools/lib/swingx-0.9.0.jar,\
|
||||
../tools/lib/looks-2.0.4.jar,\
|
||||
../tools/lib/commons-collections-3.1.jar,\
|
||||
../tools/lib/activemq-core-5.0.0.jar,\
|
||||
base.jar,\
|
||||
lib/looks-2.0.4.jar,\
|
||||
plugin.xml
|
||||
jars.extra.classpath = platform:/plugin/org.adempiere.tools/lib/activation.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/activemq-core-5.0.0.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/ant-commons-net.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/ant-contrib-1.0b1.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/ant-launcher.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/ant.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/barbecue-1.5-beta1.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/bsh-2.0b5.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/bsh-engine.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/c3p0-0.9.1.2.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/c3p0-oracle-thin-extras-0.9.1.2.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/cglib.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/commons-codec.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/commons-collections-3.1.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/commons-logging.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/commons-net-1.4.0.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/groovy-all-1.5.1.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/groovy-engine.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/iText-2.1.7.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/javaee.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jcommon-1.0.14.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jfreechart-1.0.11.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jgraph.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jnlp.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jpayment.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jpedal.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jsp-api.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jstl.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/junit.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jython-engine.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/jython.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/log4j.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/logkit.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/looks-2.0.4.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/mail.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/miglayout-3.7.1-swing.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/ocrs12.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/ojdbc14.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/poi-3.0.1-FINAL-20070705.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/postgresql.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/script-api.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/servlet-api.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/standard.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/swingx-0.9.0.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/Verisign.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/wizard.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/xercesImpl.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/xjavadoc-1.1.jar,\
|
||||
platform:/plugin/org.adempiere.tools/lib/xml-apis.jar
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension-point id="org.adempiere.base.ResourceFinder" name="org.adempiere.base.ResourceFinder" schema="schema/ResourceFinder.exsd"/>
|
||||
|
||||
</plugin>
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="org.adempiere.base" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="org.adempiere.base" id="ResourceFinder" name="ResourceFinder"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<choice>
|
||||
<element ref="client"/>
|
||||
</choice>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="client">
|
||||
<complexType>
|
||||
<attribute name="class" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":org.compiere.util.IResourceFinder"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
|
@ -0,0 +1,25 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
public interface IResourceFinder {
|
||||
|
||||
URL getResource(String name);
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base;
|
||||
|
||||
|
||||
/**
|
||||
* A service locator looks up services.
|
||||
* This is the central authority for adempiere service definition,
|
||||
* because each service defined has to be looked up via this interface.
|
||||
* @author viola
|
||||
*
|
||||
*/
|
||||
public interface IServiceLocator {
|
||||
|
||||
IResourceFinder getResourceFinder();
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base;
|
||||
|
||||
import org.adempiere.base.equinox.EquinoxServiceLocator;
|
||||
|
||||
/**
|
||||
* This is a very simple factory for service locators
|
||||
* @author viola
|
||||
*
|
||||
*/
|
||||
public class Service {
|
||||
|
||||
private static IServiceLocator theLocator;
|
||||
|
||||
public static IServiceLocator locator() {
|
||||
if (theLocator==null) {
|
||||
synchronized (Service.class) {
|
||||
if (theLocator==null) {
|
||||
theLocator = new EquinoxServiceLocator();
|
||||
}
|
||||
}
|
||||
}
|
||||
return theLocator;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base.equinox;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.adempiere.base.IResourceFinder;
|
||||
|
||||
public class EquinoxResourceFinder implements IResourceFinder {
|
||||
|
||||
public URL getResource(String name) {
|
||||
ExtensionList<IResourceFinder> list = new ExtensionList<IResourceFinder>(IResourceFinder.class, "org.adempiere.base.ResourceFinder");
|
||||
for (IResourceFinder rf : list) {
|
||||
URL url = rf.getResource(name);
|
||||
if (url!=null)
|
||||
return url;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base.equinox;
|
||||
|
||||
import org.adempiere.base.IResourceFinder;
|
||||
import org.adempiere.base.IServiceLocator;
|
||||
|
||||
|
||||
public class EquinoxServiceLocator implements IServiceLocator {
|
||||
|
||||
public IResourceFinder getResourceFinder() {
|
||||
return new EquinoxResourceFinder();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.adempiere.base.equinox;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
public class ExtensionList<T> implements Iterable<T>{
|
||||
|
||||
public class ExtensionIterator<T> implements Iterator<T> {
|
||||
|
||||
private int index = 0;
|
||||
|
||||
public boolean hasNext() {
|
||||
return index<elements.length;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T next() {
|
||||
IConfigurationElement e = elements[index++];
|
||||
try {
|
||||
return (T) e.createExecutableExtension("class");
|
||||
} catch (CoreException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private IConfigurationElement[] elements;
|
||||
|
||||
public ExtensionList(Class<T> clazz, String id) {
|
||||
try {
|
||||
elements = Platform.getExtensionRegistry().getConfigurationElementsFor(id);
|
||||
} catch (Exception ex) {
|
||||
System.out.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public Iterator<T> iterator() {
|
||||
return new ExtensionIterator<T>();
|
||||
}
|
||||
|
||||
}
|
|
@ -30,6 +30,7 @@ import javax.jnlp.ServiceManager;
|
|||
import javax.jnlp.UnavailableServiceException;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import org.adempiere.base.Service;
|
||||
import org.compiere.db.CConnection;
|
||||
import org.compiere.model.MClient;
|
||||
import org.compiere.model.MSystem;
|
||||
|
@ -43,7 +44,7 @@ import org.compiere.util.Ini;
|
|||
import org.compiere.util.Login;
|
||||
import org.compiere.util.SecureEngine;
|
||||
import org.compiere.util.SecureInterface;
|
||||
import org.compiere.util.Splash;
|
||||
//import org.compiere.util.Splash;
|
||||
import org.compiere.util.Util;
|
||||
|
||||
/**
|
||||
|
@ -336,7 +337,8 @@ public final class Adempiere
|
|||
if (s_imageLogo == null)
|
||||
{
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
URL url = org.compiere.Adempiere.class.getResource(s_file100x30);
|
||||
URL url = Service.locator().getResourceFinder().getResource(s_file100x30);
|
||||
// URL url = org.compiere.Adempiere.class.getResource(s_file100x30);
|
||||
// System.out.println(url);
|
||||
if (url == null)
|
||||
return null;
|
||||
|
@ -580,37 +582,41 @@ public final class Adempiere
|
|||
return true;
|
||||
} // startupEnvironment
|
||||
|
||||
public static URL getResource(String name) {
|
||||
return Service.locator().getResourceFinder().getResource(name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main Method
|
||||
*
|
||||
* @param args optional start class
|
||||
*/
|
||||
public static void main (String[] args)
|
||||
{
|
||||
Splash.getSplash();
|
||||
startup(true); // error exit and initUI
|
||||
|
||||
// Start with class as argument - or if nothing provided with Client
|
||||
String className = "org.compiere.apps.AMenu";
|
||||
for (int i = 0; i < args.length; i++)
|
||||
{
|
||||
if (!args[i].equals("-debug")) // ignore -debug
|
||||
{
|
||||
className = args[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
try
|
||||
{
|
||||
Class<?> startClass = Class.forName(className);
|
||||
startClass.newInstance();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println("ADempiere starting: " + className + " - " + e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
} // main
|
||||
// public static void main (String[] args)
|
||||
// {
|
||||
// Splash.getSplash();
|
||||
// startup(true); // error exit and initUI
|
||||
//
|
||||
// // Start with class as argument - or if nothing provided with Client
|
||||
// String className = "org.compiere.apps.AMenu";
|
||||
// for (int i = 0; i < args.length; i++)
|
||||
// {
|
||||
// if (!args[i].equals("-debug")) // ignore -debug
|
||||
// {
|
||||
// className = args[i];
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// //
|
||||
// try
|
||||
// {
|
||||
// Class<?> startClass = Class.forName(className);
|
||||
// startClass.newInstance();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// System.err.println("ADempiere starting: " + className + " - " + e.toString());
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// } // main
|
||||
} // Adempiere
|
||||
|
|
|
@ -46,6 +46,8 @@ import javax.swing.JFrame;
|
|||
import javax.swing.RepaintManager;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.adempiere.base.IResourceFinder;
|
||||
import org.adempiere.base.Service;
|
||||
import org.compiere.Adempiere;
|
||||
import org.compiere.db.CConnection;
|
||||
import org.compiere.model.MClient;
|
||||
|
@ -54,6 +56,10 @@ import org.compiere.model.MRole;
|
|||
import org.compiere.model.MSession;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.swing.CFrame;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
import com.sun.xml.internal.ws.util.ServiceFinder;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1479,7 +1485,10 @@ public final class Env
|
|||
*/
|
||||
public static Image getImage (String fileNameInImageDir)
|
||||
{
|
||||
URL url = Adempiere.class.getResource("images/" + fileNameInImageDir);
|
||||
IResourceFinder rf = Service.locator().getResourceFinder();
|
||||
URL url = rf.getResource("images/" + fileNameInImageDir);
|
||||
|
||||
// URL url = Adempiere.class.getResource("images/" + fileNameInImageDir);
|
||||
if (url == null)
|
||||
{
|
||||
s_log.log(Level.SEVERE, "Not found: " + fileNameInImageDir);
|
||||
|
@ -1497,7 +1506,9 @@ public final class Env
|
|||
*/
|
||||
public static ImageIcon getImageIcon (String fileNameInImageDir)
|
||||
{
|
||||
URL url = Adempiere.class.getResource("images/" + fileNameInImageDir);
|
||||
IResourceFinder rf = Service.locator().getResourceFinder();
|
||||
URL url = rf.getResource("images/" + fileNameInImageDir);
|
||||
// URL url = Adempiere.class.getResource("images/" + fileNameInImageDir);
|
||||
if (url == null)
|
||||
{
|
||||
s_log.log(Level.INFO, "Not found: " + fileNameInImageDir);
|
||||
|
@ -1517,9 +1528,12 @@ public final class Env
|
|||
*/
|
||||
public static ImageIcon getImageIcon2 (String fileName)
|
||||
{
|
||||
URL url = Adempiere.class.getResource("images/" + fileName+".gif");
|
||||
IResourceFinder rf = Service.locator().getResourceFinder();
|
||||
URL url = rf.getResource("images/" + fileName+".gif");
|
||||
// URL url = Adempiere.class.getResource("images/" + fileName+".gif");
|
||||
if (url == null)
|
||||
url = Adempiere.class.getResource("images/" + fileName+".png");
|
||||
url = rf.getResource("images/" + fileName+".png");
|
||||
// url = Adempiere.class.getResource("images/" + fileName+".png");
|
||||
if (url == null)
|
||||
{
|
||||
s_log.log(Level.INFO, "GIF/PNG Not found: " + fileName);
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path="/base"/>
|
||||
<classpathentry kind="src" path="/tools"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/swingx-0.9.0.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/groovy-all-1.5.1.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/jcommon-1.0.14.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/jfreechart-1.0.11.jar"/>
|
||||
<classpathentry kind="output" path="build"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path="/base"/>
|
||||
<classpathentry kind="src" path="/tools"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/swingx-0.9.0.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/groovy-all-1.5.1.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/jcommon-1.0.14.jar"/>
|
||||
<classpathentry kind="lib" path="/tools/lib/jfreechart-1.0.11.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="build"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,23 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>client</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>base</project>
|
||||
<project>dbPort</project>
|
||||
<project>extend</project>
|
||||
<project>looks</project>
|
||||
<project>print</project>
|
||||
<project>tools</project>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>client</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
<project>base</project>
|
||||
<project>dbPort</project>
|
||||
<project>extend</project>
|
||||
<project>looks</project>
|
||||
<project>print</project>
|
||||
<project>tools</project>
|
||||
</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.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -0,0 +1,202 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: org.adempiere.client
|
||||
Bundle-SymbolicName: org.adempiere.client;singleton:=true
|
||||
Bundle-Version: 0.0.0.2
|
||||
Bundle-ClassPath: client.jar,
|
||||
lib/swingx-0.9.0.jar,
|
||||
lib/groovy-all-1.5.1.jar,
|
||||
lib/jcommon-1.0.14.jar,
|
||||
lib/jfreechart-1.0.11.jar
|
||||
Export-Package: com.keypoint,
|
||||
de.schaeffer.compiere.tools,
|
||||
groovy.inspect,
|
||||
groovy.inspect.swingui,
|
||||
groovy.io,
|
||||
groovy.lang,
|
||||
groovy.mock,
|
||||
groovy.mock.interceptor,
|
||||
groovy.model,
|
||||
groovy.security,
|
||||
groovy.servlet,
|
||||
groovy.sql,
|
||||
groovy.swing,
|
||||
groovy.swing.binding,
|
||||
groovy.swing.factory,
|
||||
groovy.swing.impl,
|
||||
groovy.text,
|
||||
groovy.time,
|
||||
groovy.ui,
|
||||
groovy.ui.icons,
|
||||
groovy.ui.text,
|
||||
groovy.ui.view,
|
||||
groovy.util,
|
||||
groovy.util.slurpersupport,
|
||||
groovy.xml,
|
||||
groovy.xml.dom,
|
||||
groovy.xml.streamingmarkupsupport,
|
||||
groovyjarjarantlr,
|
||||
groovyjarjarantlr.ASdebug,
|
||||
groovyjarjarantlr.actions.cpp,
|
||||
groovyjarjarantlr.actions.csharp,
|
||||
groovyjarjarantlr.actions.java,
|
||||
groovyjarjarantlr.actions.python,
|
||||
groovyjarjarantlr.build,
|
||||
groovyjarjarantlr.collections,
|
||||
groovyjarjarantlr.collections.impl,
|
||||
groovyjarjarantlr.debug,
|
||||
groovyjarjarantlr.debug.misc,
|
||||
groovyjarjarantlr.preprocessor,
|
||||
groovyjarjarasm.asm,
|
||||
groovyjarjarasm.asm.signature,
|
||||
groovyjarjarasm.asm.tree,
|
||||
groovyjarjarcommonscli,
|
||||
org.adempiere.apps.graph,
|
||||
org.codehaus.groovy,
|
||||
org.codehaus.groovy.ant,
|
||||
org.codehaus.groovy.antlr,
|
||||
org.codehaus.groovy.antlr.java,
|
||||
org.codehaus.groovy.antlr.parser,
|
||||
org.codehaus.groovy.antlr.treewalker,
|
||||
org.codehaus.groovy.ast,
|
||||
org.codehaus.groovy.ast.expr,
|
||||
org.codehaus.groovy.ast.stmt,
|
||||
org.codehaus.groovy.binding,
|
||||
org.codehaus.groovy.bsf,
|
||||
org.codehaus.groovy.classgen,
|
||||
org.codehaus.groovy.control,
|
||||
org.codehaus.groovy.control.io,
|
||||
org.codehaus.groovy.control.messages,
|
||||
org.codehaus.groovy.groovydoc,
|
||||
org.codehaus.groovy.reflection,
|
||||
org.codehaus.groovy.runtime,
|
||||
org.codehaus.groovy.runtime.metaclass,
|
||||
org.codehaus.groovy.runtime.typehandling,
|
||||
org.codehaus.groovy.runtime.wrappers,
|
||||
org.codehaus.groovy.syntax,
|
||||
org.codehaus.groovy.tools,
|
||||
org.codehaus.groovy.tools.groovydoc,
|
||||
org.codehaus.groovy.tools.javac,
|
||||
org.codehaus.groovy.tools.shell,
|
||||
org.codehaus.groovy.tools.shell.commands,
|
||||
org.codehaus.groovy.tools.shell.util,
|
||||
org.codehaus.groovy.tools.xml,
|
||||
org.codehaus.groovy.vmplugin,
|
||||
org.codehaus.groovy.vmplugin.v4,
|
||||
org.codehaus.groovy.vmplugin.v5,
|
||||
org.compiere,
|
||||
org.compiere.acct,
|
||||
org.compiere.apps,
|
||||
org.compiere.apps.form,
|
||||
org.compiere.apps.search,
|
||||
org.compiere.apps.wf,
|
||||
org.compiere.grid,
|
||||
org.compiere.grid.ed,
|
||||
org.compiere.grid.tree,
|
||||
org.compiere.images,
|
||||
org.compiere.install,
|
||||
org.compiere.minigrid,
|
||||
org.compiere.pos,
|
||||
org.compiere.print,
|
||||
org.eevolution.form,
|
||||
org.jdesktop.beans,
|
||||
org.jdesktop.swingx,
|
||||
org.jdesktop.swingx.action,
|
||||
org.jdesktop.swingx.auth,
|
||||
org.jdesktop.swingx.auth.resources,
|
||||
org.jdesktop.swingx.autocomplete,
|
||||
org.jdesktop.swingx.autocomplete.workarounds,
|
||||
org.jdesktop.swingx.border,
|
||||
org.jdesktop.swingx.calendar,
|
||||
org.jdesktop.swingx.calendar.resources,
|
||||
org.jdesktop.swingx.color,
|
||||
org.jdesktop.swingx.combobox,
|
||||
org.jdesktop.swingx.decorator,
|
||||
org.jdesktop.swingx.editors,
|
||||
org.jdesktop.swingx.error,
|
||||
org.jdesktop.swingx.event,
|
||||
org.jdesktop.swingx.geom,
|
||||
org.jdesktop.swingx.graphics,
|
||||
org.jdesktop.swingx.icon,
|
||||
org.jdesktop.swingx.image,
|
||||
org.jdesktop.swingx.multislider,
|
||||
org.jdesktop.swingx.multisplitpane,
|
||||
org.jdesktop.swingx.painter,
|
||||
org.jdesktop.swingx.painter.effects,
|
||||
org.jdesktop.swingx.plaf,
|
||||
org.jdesktop.swingx.plaf.basic,
|
||||
org.jdesktop.swingx.plaf.basic.resources,
|
||||
org.jdesktop.swingx.plaf.linux,
|
||||
org.jdesktop.swingx.plaf.macosx,
|
||||
org.jdesktop.swingx.plaf.metal,
|
||||
org.jdesktop.swingx.plaf.misc,
|
||||
org.jdesktop.swingx.plaf.motif,
|
||||
org.jdesktop.swingx.plaf.nimbus,
|
||||
org.jdesktop.swingx.plaf.resources,
|
||||
org.jdesktop.swingx.plaf.windows,
|
||||
org.jdesktop.swingx.plaf.windows.resources,
|
||||
org.jdesktop.swingx.renderer,
|
||||
org.jdesktop.swingx.resources,
|
||||
org.jdesktop.swingx.table,
|
||||
org.jdesktop.swingx.table.resources,
|
||||
org.jdesktop.swingx.tips,
|
||||
org.jdesktop.swingx.tree,
|
||||
org.jdesktop.swingx.treetable,
|
||||
org.jdesktop.swingx.util,
|
||||
org.jfree,
|
||||
org.jfree.base,
|
||||
org.jfree.base.config,
|
||||
org.jfree.base.log,
|
||||
org.jfree.base.modules,
|
||||
org.jfree.chart,
|
||||
org.jfree.chart.annotations,
|
||||
org.jfree.chart.axis,
|
||||
org.jfree.chart.block,
|
||||
org.jfree.chart.demo,
|
||||
org.jfree.chart.editor,
|
||||
org.jfree.chart.encoders,
|
||||
org.jfree.chart.entity,
|
||||
org.jfree.chart.event,
|
||||
org.jfree.chart.imagemap,
|
||||
org.jfree.chart.labels,
|
||||
org.jfree.chart.needle,
|
||||
org.jfree.chart.plot,
|
||||
org.jfree.chart.plot.dial,
|
||||
org.jfree.chart.renderer,
|
||||
org.jfree.chart.renderer.category,
|
||||
org.jfree.chart.renderer.xy,
|
||||
org.jfree.chart.resources,
|
||||
org.jfree.chart.servlet,
|
||||
org.jfree.chart.title,
|
||||
org.jfree.chart.urls,
|
||||
org.jfree.chart.util,
|
||||
org.jfree.data,
|
||||
org.jfree.data.category,
|
||||
org.jfree.data.contour,
|
||||
org.jfree.data.function,
|
||||
org.jfree.data.gantt,
|
||||
org.jfree.data.general,
|
||||
org.jfree.data.io,
|
||||
org.jfree.data.jdbc,
|
||||
org.jfree.data.resources,
|
||||
org.jfree.data.statistics,
|
||||
org.jfree.data.time,
|
||||
org.jfree.data.time.ohlc,
|
||||
org.jfree.data.xml,
|
||||
org.jfree.data.xy,
|
||||
org.jfree.date,
|
||||
org.jfree.io,
|
||||
org.jfree.layout,
|
||||
org.jfree.resources,
|
||||
org.jfree.text,
|
||||
org.jfree.threads,
|
||||
org.jfree.ui,
|
||||
org.jfree.ui.about,
|
||||
org.jfree.ui.about.resources,
|
||||
org.jfree.ui.action,
|
||||
org.jfree.ui.tabbedui,
|
||||
org.jfree.util
|
||||
Require-Bundle: org.adempiere.base;bundle-version="0.0.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.5.0",
|
||||
org.adempiere.tools;bundle-version="0.0.0"
|
||||
Bundle-Activator: org.adempiere.client.Activator
|
|
@ -0,0 +1,8 @@
|
|||
source.client.jar = src/
|
||||
bin.includes = META-INF/,\
|
||||
lib/swingx-0.9.0.jar,\
|
||||
lib/groovy-all-1.5.1.jar,\
|
||||
lib/jcommon-1.0.14.jar,\
|
||||
lib/jfreechart-1.0.11.jar,\
|
||||
client.jar,\
|
||||
plugin.xml
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension
|
||||
id="RF"
|
||||
name="RF"
|
||||
point="org.adempiere.base.ResourceFinder">
|
||||
<client
|
||||
class="org.compiere.util.ResourceFinder">
|
||||
</client>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
|
@ -0,0 +1,12 @@
|
|||
package org.adempiere.client;
|
||||
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
public class Activator extends Plugin {
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
System.out.println("Starting client");
|
||||
org.compiere.AdempiereClient.main(new String[]{});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,219 @@
|
|||
/******************************************************************************
|
||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms version 2 of the GNU General Public License as published *
|
||||
* by the Free Software Foundation. This program is distributed in the hope *
|
||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||
* See the GNU General Public License for more details. *
|
||||
* You should have received a copy of the GNU General Public License along *
|
||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||
* For the text or an alternative of this public license, you may reach us *
|
||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||
*****************************************************************************/
|
||||
package org.compiere;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.Toolkit;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import javax.jnlp.BasicService;
|
||||
import javax.jnlp.ServiceManager;
|
||||
import javax.jnlp.UnavailableServiceException;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import org.compiere.db.CConnection;
|
||||
import org.compiere.model.MClient;
|
||||
import org.compiere.model.MSystem;
|
||||
import org.compiere.model.ModelValidationEngine;
|
||||
import org.compiere.util.CLogFile;
|
||||
import org.compiere.util.CLogMgt;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Ini;
|
||||
import org.compiere.util.Login;
|
||||
import org.compiere.util.SecureEngine;
|
||||
import org.compiere.util.SecureInterface;
|
||||
import org.compiere.util.Splash;
|
||||
import org.compiere.util.Util;
|
||||
|
||||
/**
|
||||
* Adempiere Control Class
|
||||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: Adempiere.java,v 1.8 2006/08/11 02:58:14 jjanke Exp $
|
||||
*
|
||||
*/
|
||||
public final class AdempiereClient
|
||||
{
|
||||
/** Logging */
|
||||
private static CLogger log = null;
|
||||
|
||||
/*************************************************************************
|
||||
* Startup Client.
|
||||
* - Print greeting,
|
||||
* - Check Java version and
|
||||
* - load ini parameters
|
||||
* If it is a client, load/set PLAF and exit if error.
|
||||
* If Client, you need to call startupEnvironment explicitly!
|
||||
* For testing call method startupEnvironment
|
||||
* @param isClient true for client
|
||||
* @return successful startup
|
||||
*/
|
||||
public static synchronized boolean startup (boolean isClient)
|
||||
{
|
||||
// Already started
|
||||
if (log != null)
|
||||
return true;
|
||||
|
||||
// Check Version
|
||||
if (!Login.isJavaOK(isClient) && isClient)
|
||||
System.exit(1);
|
||||
|
||||
CLogMgt.initialize(isClient);
|
||||
Ini.setClient (isClient); // Ini requires Logging
|
||||
// Init Log
|
||||
log = CLogger.getCLogger(AdempiereClient.class);
|
||||
// Greeting
|
||||
log.info(Adempiere.getSummaryAscii());
|
||||
// log.info(getAdempiereHome() + " - " + getJavaInfo() + " - " + getOSInfo());
|
||||
|
||||
// Load System environment
|
||||
// EnvLoader.load(Ini.ENV_PREFIX);
|
||||
|
||||
// System properties
|
||||
Ini.loadProperties (false);
|
||||
|
||||
// Set up Log
|
||||
CLogMgt.setLevel(Ini.getProperty(Ini.P_TRACELEVEL));
|
||||
if (isClient && Ini.isPropertyBool(Ini.P_TRACEFILE)
|
||||
&& CLogFile.get(false, null, isClient) == null)
|
||||
CLogMgt.addHandler(CLogFile.get (true, Ini.findAdempiereHome(), isClient));
|
||||
|
||||
// Set UI
|
||||
if (isClient)
|
||||
{
|
||||
if (CLogMgt.isLevelAll())
|
||||
log.log(Level.FINEST, System.getProperties().toString());
|
||||
}
|
||||
|
||||
// Set Default Database Connection from Ini
|
||||
DB.setDBTarget(CConnection.get(Adempiere.getCodeBaseHost()));
|
||||
|
||||
if (isClient) // don't test connection
|
||||
return false; // need to call
|
||||
|
||||
return startupEnvironment(isClient);
|
||||
} // startup
|
||||
|
||||
/**
|
||||
* Startup Adempiere Environment.
|
||||
* Automatically called for Server connections
|
||||
* For testing call this method.
|
||||
* @param isClient true if client connection
|
||||
* @return successful startup
|
||||
*/
|
||||
public static boolean startupEnvironment (boolean isClient)
|
||||
{
|
||||
startup(isClient); // returns if already initiated
|
||||
if (!DB.isConnected())
|
||||
{
|
||||
log.severe ("No Database");
|
||||
return false;
|
||||
}
|
||||
MSystem system = MSystem.get(Env.getCtx()); // Initializes Base Context too
|
||||
if (system == null)
|
||||
return false;
|
||||
|
||||
// Initialize main cached Singletons
|
||||
ModelValidationEngine.get();
|
||||
try
|
||||
{
|
||||
String className = system.getEncryptionKey();
|
||||
if (className == null || className.length() == 0)
|
||||
{
|
||||
className = System.getProperty(SecureInterface.ADEMPIERE_SECURE);
|
||||
if (className != null && className.length() > 0
|
||||
&& !className.equals(SecureInterface.ADEMPIERE_SECURE_DEFAULT))
|
||||
{
|
||||
SecureEngine.init(className); // test it
|
||||
system.setEncryptionKey(className);
|
||||
system.save();
|
||||
}
|
||||
}
|
||||
SecureEngine.init(className);
|
||||
|
||||
//
|
||||
if (isClient)
|
||||
MClient.get(Env.getCtx(),0); // Login Client loaded later
|
||||
else
|
||||
MClient.getAll(Env.getCtx());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warning("Environment problems: " + e.toString());
|
||||
}
|
||||
|
||||
// Start Workflow Document Manager (in other package) for PO
|
||||
String className = null;
|
||||
try
|
||||
{
|
||||
className = "org.compiere.wf.DocWorkflowManager";
|
||||
Class.forName(className);
|
||||
// Initialize Archive Engine
|
||||
className = "org.compiere.print.ArchiveEngine";
|
||||
Class.forName(className);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warning("Not started: " + className + " - " + e.getMessage());
|
||||
}
|
||||
|
||||
if (!isClient)
|
||||
DB.updateMail();
|
||||
return true;
|
||||
} // startupEnvironment
|
||||
|
||||
|
||||
/**
|
||||
* Main Method
|
||||
*
|
||||
* @param args optional start class
|
||||
*/
|
||||
public static void main (String[] args)
|
||||
{
|
||||
Splash.getSplash();
|
||||
startup(true); // error exit and initUI
|
||||
|
||||
// Start with class as argument - or if nothing provided with Client
|
||||
String className = "org.compiere.apps.AMenu";
|
||||
for (int i = 0; i < args.length; i++)
|
||||
{
|
||||
if (!args[i].equals("-debug")) // ignore -debug
|
||||
{
|
||||
className = args[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
try
|
||||
{
|
||||
Class<?> startClass = Class.forName(className);
|
||||
startClass.newInstance();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println("ADempiere starting: " + className + " - " + e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
} // main
|
||||
} // Adempiere
|
|
@ -122,7 +122,7 @@ public class AcctViewer extends CFrame
|
|||
/** State Info */
|
||||
private AcctViewerData m_data = null;
|
||||
/** Image Icon */
|
||||
private ImageIcon m_iFind = new ImageIcon(org.compiere.Adempiere.class.getResource("images/Find16.gif"));
|
||||
private ImageIcon m_iFind = new ImageIcon(org.compiere.Adempiere.getResource("images/Find16.gif"));
|
||||
|
||||
/** Logger */
|
||||
private static CLogger log = CLogger.getCLogger(AcctViewer.class);
|
||||
|
@ -210,7 +210,7 @@ public class AcctViewer extends CFrame
|
|||
*/
|
||||
private void jbInit() throws Exception
|
||||
{
|
||||
ImageIcon ii = new ImageIcon(org.compiere.Adempiere.class.getResource("images/InfoAccount16.gif"));
|
||||
ImageIcon ii = new ImageIcon(org.compiere.Adempiere.getResource("images/InfoAccount16.gif"));
|
||||
setIconImage(ii.getImage());
|
||||
//
|
||||
mainLayout.setHgap(5);
|
||||
|
|
|
@ -63,7 +63,7 @@ public class FieldRecordInfo extends CDialog
|
|||
|
||||
public static final String CHANGE_LOG_COMMAND = "ChangeLog";
|
||||
/** The Menu Icon */
|
||||
private static Icon s_icon = new ImageIcon(org.compiere.Adempiere.class.getResource("images/ChangeLog16.png"));
|
||||
private static Icon s_icon = new ImageIcon(org.compiere.Adempiere.getResource("images/ChangeLog16.png"));
|
||||
|
||||
private int AD_Table_ID;
|
||||
private int AD_Column_ID;
|
||||
|
|
|
@ -310,22 +310,22 @@ public final class Find extends CDialog
|
|||
spaceN = Box.createVerticalStrut(8);
|
||||
spaceW = Box.createHorizontalStrut(8);
|
||||
spaceS = Box.createVerticalStrut(8);
|
||||
bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Ignore24.gif")));
|
||||
bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Ignore24.gif")));
|
||||
bIgnore.setMargin(new Insets(2, 2, 2, 2));
|
||||
bIgnore.setToolTipText(Msg.getMsg(Env.getCtx(),"Ignore"));
|
||||
bIgnore.addActionListener(this);
|
||||
fQueryName.setToolTipText (Msg.getMsg(Env.getCtx(),"QueryName"));
|
||||
fQueryName.setEditable(true);
|
||||
fQueryName.addActionListener(this);
|
||||
bSave.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Save24.gif")));
|
||||
bSave.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Save24.gif")));
|
||||
bSave.setMargin(new Insets(2, 2, 2, 2));
|
||||
bSave.setToolTipText(Msg.getMsg(Env.getCtx(),"Save"));
|
||||
bSave.addActionListener(this);
|
||||
bNew.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/New24.gif")));
|
||||
bNew.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/New24.gif")));
|
||||
bNew.setMargin(new Insets(2, 2, 2, 2));
|
||||
bNew.setToolTipText(Msg.getMsg(Env.getCtx(),"New"));
|
||||
bNew.addActionListener(this);
|
||||
bDelete.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Delete24.gif")));
|
||||
bDelete.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Delete24.gif")));
|
||||
bDelete.setMargin(new Insets(2, 2, 2, 2));
|
||||
bDelete.setToolTipText(Msg.getMsg(Env.getCtx(),"Delete"));
|
||||
bDelete.addActionListener(this);
|
||||
|
|
|
@ -402,7 +402,7 @@ public abstract class Info extends CDialog
|
|||
//
|
||||
popup.add(calcMenu);
|
||||
calcMenu.setText(Msg.getMsg(Env.getCtx(), "Calculator"));
|
||||
calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Calculator16.gif")));
|
||||
calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Calculator16.gif")));
|
||||
calcMenu.addActionListener(this);
|
||||
//
|
||||
p_table.getSelectionModel().addListSelectionListener(this);
|
||||
|
|
|
@ -226,15 +226,15 @@ public final class VAccountDialog extends CDialog
|
|||
toolBar.setRequestFocusEnabled(false);
|
||||
toolBar.setBorderPainted(false);
|
||||
toolBar.setMargin(new Insets(5, 5, 5, 5));
|
||||
bSave.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Save24.gif")));
|
||||
bSave.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Save24.gif")));
|
||||
bSave.setMargin(new Insets(2, 2, 2, 2));
|
||||
bSave.setToolTipText(Msg.getMsg(Env.getCtx(),"AccountNewUpdate"));
|
||||
bSave.addActionListener(this);
|
||||
bRefresh.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Refresh24.gif")));
|
||||
bRefresh.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Refresh24.gif")));
|
||||
bRefresh.setMargin(new Insets(2, 2, 2, 2));
|
||||
bRefresh.setToolTipText(Msg.getMsg(Env.getCtx(),"Refresh"));
|
||||
bRefresh.addActionListener(this);
|
||||
bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Ignore24.gif")));
|
||||
bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Ignore24.gif")));
|
||||
bIgnore.setMargin(new Insets(2, 2, 2, 2));
|
||||
bIgnore.setToolTipText(Msg.getMsg(Env.getCtx(),"Ignore"));
|
||||
bIgnore.addActionListener(this);
|
||||
|
|
|
@ -144,7 +144,7 @@ public class VLocator extends JComponent
|
|||
m_text.addActionListener(this);
|
||||
this.add(m_text, BorderLayout.CENTER);
|
||||
|
||||
m_button.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Locator10.gif")));
|
||||
m_button.setIcon(new ImageIcon(org.compiere.Adempiere.getResource("images/Locator10.gif")));
|
||||
m_button.setMargin(new Insets(0, 0, 0, 0));
|
||||
m_button.setPreferredSize(new Dimension(height, height));
|
||||
m_button.addActionListener(this);
|
||||
|
|
|
@ -162,7 +162,7 @@ public class ValuePreference extends CDialog
|
|||
/** The Name of the Editor */
|
||||
public static final String NAME = "ValuePreference";
|
||||
/** The Menu Icon */
|
||||
private static Icon s_icon = new ImageIcon(org.compiere.Adempiere.class.getResource("images/VPreference16.gif"));
|
||||
private static Icon s_icon = new ImageIcon(org.compiere.AdempiereClient.class.getResource("images/VPreference16.gif"));
|
||||
/** Logger */
|
||||
private static CLogger log = CLogger.getCLogger(ValuePreference.class);
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package org.compiere.util;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
import org.adempiere.base.IResourceFinder;
|
||||
import org.compiere.AdempiereClient;
|
||||
|
||||
public class ResourceFinder implements IResourceFinder {
|
||||
|
||||
public ResourceFinder() {
|
||||
}
|
||||
|
||||
public URL getResource(String name) {
|
||||
URL resource = AdempiereClient.class.getResource(name);
|
||||
return resource;
|
||||
}
|
||||
|
||||
}
|
|
@ -36,6 +36,7 @@ import java.net.URL;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.compiere.Adempiere;
|
||||
import org.compiere.AdempiereClient;
|
||||
|
||||
/**
|
||||
* Splash Screen.
|
||||
|
@ -94,6 +95,7 @@ public class Splash extends Frame
|
|||
public Splash (String text)
|
||||
{
|
||||
super("Adempiere");
|
||||
System.out.println(text);
|
||||
message.setText(text);
|
||||
try
|
||||
{
|
||||
|
@ -268,9 +270,9 @@ public class Splash extends Frame
|
|||
public AImage()
|
||||
{
|
||||
super();
|
||||
URL url = org.compiere.Adempiere.class.getResource("images/Java_anim.gif");
|
||||
URL url = org.compiere.AdempiereClient.class.getResource("images/Java_anim.gif");
|
||||
if (url == null)
|
||||
url = org.compiere.Adempiere.class.getResource("images/Java_logo.gif");
|
||||
url = org.compiere.AdempiereClient.class.getResource("images/Java_logo.gif");
|
||||
if (url != null)
|
||||
{
|
||||
m_image = Toolkit.getDefaultToolkit().getImage(url);
|
|
@ -25,5 +25,9 @@
|
|||
<classpathentry exported="true" kind="lib" path="lib/jcommon-1.0.14.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/jfreechart-1.0.11.jar"/>
|
||||
<classpathentry exported="true" kind="lib" path="lib/javaee.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="lib" path="lib/c3p0-0.9.1.2.jar"/>
|
||||
<classpathentry kind="lib" path="lib/ojdbc14.jar"/>
|
||||
<classpathentry kind="lib" path="lib/postgresql.jar"/>
|
||||
<classpathentry kind="output" path="build"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,22 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tools</name>
|
||||
<comment>Tools Project</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.ibm.etools.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>tools</name>
|
||||
<comment>Tools Project</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.ibm.etools.validation.validationbuilder</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.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,53 @@
|
|||
source.tools.jar = src/
|
||||
bin.includes = META-INF/,\
|
||||
lib/jstl.jar,\
|
||||
lib/Verisign.jar,\
|
||||
lib/standard.jar,\
|
||||
lib/barbecue-1.5-beta1.jar,\
|
||||
lib/poi-3.0.1-FINAL-20070705.jar,\
|
||||
lib/jnlp.jar,\
|
||||
lib/iText-2.1.7.jar,\
|
||||
lib/swingx-0.9.0.jar,\
|
||||
lib/miglayout-3.7.1-swing.jar,\
|
||||
lib/log4j.jar,\
|
||||
lib/activation.jar,\
|
||||
lib/mail.jar,\
|
||||
lib/jpayment.jar,\
|
||||
lib/bsh-2.0b5.jar,\
|
||||
lib/script-api.jar,\
|
||||
lib/bsh-engine.jar,\
|
||||
lib/groovy-all-1.5.1.jar,\
|
||||
lib/groovy-engine.jar,\
|
||||
lib/jython.jar,\
|
||||
lib/jython-engine.jar,\
|
||||
lib/jcommon-1.0.14.jar,\
|
||||
lib/jfreechart-1.0.11.jar,\
|
||||
lib/javaee.jar,\
|
||||
tools.jar,\
|
||||
lib/activemq-core-5.0.0.jar,\
|
||||
lib/ant-commons-net.jar,\
|
||||
lib/ant-contrib-1.0b1.jar,\
|
||||
lib/ant-launcher.jar,\
|
||||
lib/ant.jar,\
|
||||
lib/c3p0-0.9.1.2.jar,\
|
||||
lib/c3p0-oracle-thin-extras-0.9.1.2.jar,\
|
||||
lib/cglib.jar,\
|
||||
lib/commons-codec.jar,\
|
||||
lib/commons-collections-3.1.jar,\
|
||||
lib/commons-logging.jar,\
|
||||
lib/commons-net-1.4.0.jar,\
|
||||
lib/copyLibraries.bat,\
|
||||
lib/jgraph.jar,\
|
||||
lib/jpedal.jar,\
|
||||
lib/jsp-api.jar,\
|
||||
lib/junit.jar,\
|
||||
lib/logkit.jar,\
|
||||
lib/looks-2.0.4.jar,\
|
||||
lib/ocrs12.jar,\
|
||||
lib/ojdbc14.jar,\
|
||||
lib/postgresql.jar,\
|
||||
lib/servlet-api.jar,\
|
||||
lib/wizard.jar,\
|
||||
lib/xercesImpl.jar,\
|
||||
lib/xjavadoc-1.1.jar,\
|
||||
lib/xml-apis.jar
|
Loading…
Reference in New Issue