commit
048f982f79
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="lib" path="poi/poi-3.9-20121203.jar"/>
|
||||
<classpathentry kind="lib" path="poi/poi-ooxml-3.9-20121203.jar"/>
|
||||
<classpathentry kind="lib" path="poi/poi-ooxml-schemas-3.9-20121203.jar"/>
|
||||
<classpathentry kind="lib" path="poi/ojdbc8-19.3.0.0.jar"/>
|
||||
<classpathentry kind="lib" path="poi/classes12.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="lib" path="poi/commons-codec-1.10.jar"/>
|
||||
<classpathentry kind="lib" path="poi/commons-logging-1.1.jar"/>
|
||||
<classpathentry kind="lib" path="poi/dom4j-1.6.1.jar"/>
|
||||
<classpathentry kind="lib" path="poi/jsr173_1.0_api.jar"/>
|
||||
<classpathentry kind="lib" path="poi/xmlbeans-2.5.0.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
@ -0,0 +1 @@
|
||||
/target/
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.connor.pro105.plm</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
@ -0,0 +1,264 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Plm
|
||||
Bundle-SymbolicName: com.connor.pro105.plm;singleton:=true
|
||||
Bundle-Version: 1.0.0
|
||||
Bundle-Activator: com.connor.pro105.plm.Activator
|
||||
Bundle-Vendor: CONNOR
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.core.expressions;bundle-version="3.4.400",
|
||||
org.eclipse.ui;bundle-version="3.8.0",
|
||||
com.teamcenter.rac.aifrcp;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.common;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.kernel;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.util;bundle-version="11000.2.0",
|
||||
org.apache.log4j;bundle-version="1.2.15",
|
||||
com.teamcenter.rac.ui;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.ui.commands;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.project;bundle-version="11000.2.0",
|
||||
TcSoaProjectManagementLoose;bundle-version="11000.2.0",
|
||||
TcSoaProjectManagementRac;bundle-version="11000.2.0",
|
||||
TcSoaProjectManagementTypes;bundle-version="11000.2.0",
|
||||
com.teamcenter.rac.schedule;bundle-version="11000.2.0",
|
||||
org.eclipse.core.databinding.beans;bundle-version="1.2.200",
|
||||
org.eclipse.core.databinding.observable;bundle-version="1.4.1",
|
||||
org.eclipse.jface.databinding;bundle-version="1.6.0",
|
||||
org.eclipse.ui.views;bundle-version="3.6.100",
|
||||
com.teamcenter.rac.cme.stylesheet;bundle-version="11000.2.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package:
|
||||
com.connor.pro105.plm,
|
||||
javax.sql,
|
||||
javax.xml.stream,
|
||||
javax.xml.stream.events,
|
||||
javax.xml.stream.util,
|
||||
oracle.core.lmx,
|
||||
oracle.core.lvf,
|
||||
oracle.jdbc,
|
||||
oracle.jdbc.connector,
|
||||
oracle.jdbc.driver,
|
||||
oracle.jdbc.internal,
|
||||
oracle.jdbc.oci,
|
||||
oracle.jdbc.oracore,
|
||||
oracle.jdbc.pool,
|
||||
oracle.jdbc.util,
|
||||
oracle.jdbc.xa,
|
||||
oracle.jdbc.xa.client,
|
||||
oracle.jpub.runtime,
|
||||
oracle.net.TNSAddress,
|
||||
oracle.net.ano,
|
||||
oracle.net.aso,
|
||||
oracle.net.jndi,
|
||||
oracle.net.nl,
|
||||
oracle.net.nl.mesg,
|
||||
oracle.net.ns,
|
||||
oracle.net.nt,
|
||||
oracle.net.resolver,
|
||||
oracle.security.o3logon,
|
||||
oracle.sql,
|
||||
oracle.sql.converter,
|
||||
org.apache.commons.codec,
|
||||
org.apache.commons.codec.binary,
|
||||
org.apache.commons.codec.digest,
|
||||
org.apache.commons.codec.language,
|
||||
org.apache.commons.codec.language.bm,
|
||||
org.apache.commons.codec.net,
|
||||
org.apache.commons.logging,
|
||||
org.apache.commons.logging.impl,
|
||||
org.apache.poi,
|
||||
org.apache.poi.common.usermodel,
|
||||
org.apache.poi.ddf,
|
||||
org.apache.poi.dev,
|
||||
org.apache.poi.extractor,
|
||||
org.apache.poi.hpsf,
|
||||
org.apache.poi.hpsf.extractor,
|
||||
org.apache.poi.hpsf.wellknown,
|
||||
org.apache.poi.hssf,
|
||||
org.apache.poi.hssf.dev,
|
||||
org.apache.poi.hssf.eventmodel,
|
||||
org.apache.poi.hssf.eventusermodel,
|
||||
org.apache.poi.hssf.eventusermodel.dummyrecord,
|
||||
org.apache.poi.hssf.extractor,
|
||||
org.apache.poi.hssf.model,
|
||||
org.apache.poi.hssf.record,
|
||||
org.apache.poi.hssf.record.aggregates,
|
||||
org.apache.poi.hssf.record.cf,
|
||||
org.apache.poi.hssf.record.chart,
|
||||
org.apache.poi.hssf.record.common,
|
||||
org.apache.poi.hssf.record.cont,
|
||||
org.apache.poi.hssf.record.crypto,
|
||||
org.apache.poi.hssf.record.pivottable,
|
||||
org.apache.poi.hssf.usermodel,
|
||||
org.apache.poi.hssf.util,
|
||||
org.apache.poi.openxml4j.exceptions,
|
||||
org.apache.poi.openxml4j.opc,
|
||||
org.apache.poi.openxml4j.opc.internal,
|
||||
org.apache.poi.openxml4j.opc.internal.marshallers,
|
||||
org.apache.poi.openxml4j.opc.internal.signature,
|
||||
org.apache.poi.openxml4j.opc.internal.unmarshallers,
|
||||
org.apache.poi.openxml4j.opc.signature,
|
||||
org.apache.poi.openxml4j.util,
|
||||
org.apache.poi.poifs.common,
|
||||
org.apache.poi.poifs.crypt,
|
||||
org.apache.poi.poifs.dev,
|
||||
org.apache.poi.poifs.eventfilesystem,
|
||||
org.apache.poi.poifs.filesystem,
|
||||
org.apache.poi.poifs.nio,
|
||||
org.apache.poi.poifs.property,
|
||||
org.apache.poi.poifs.storage,
|
||||
org.apache.poi.ss,
|
||||
org.apache.poi.ss.extractor,
|
||||
org.apache.poi.ss.format,
|
||||
org.apache.poi.ss.formula,
|
||||
org.apache.poi.ss.formula.atp,
|
||||
org.apache.poi.ss.formula.constant,
|
||||
org.apache.poi.ss.formula.eval,
|
||||
org.apache.poi.ss.formula.eval.forked,
|
||||
org.apache.poi.ss.formula.function,
|
||||
org.apache.poi.ss.formula.functions,
|
||||
org.apache.poi.ss.formula.ptg,
|
||||
org.apache.poi.ss.formula.udf,
|
||||
org.apache.poi.ss.usermodel,
|
||||
org.apache.poi.ss.usermodel.charts,
|
||||
org.apache.poi.ss.util,
|
||||
org.apache.poi.ss.util.cellwalk,
|
||||
org.apache.poi.util,
|
||||
org.apache.poi.xslf,
|
||||
org.apache.poi.xslf.extractor,
|
||||
org.apache.poi.xslf.model,
|
||||
org.apache.poi.xslf.model.geom,
|
||||
org.apache.poi.xslf.usermodel,
|
||||
org.apache.poi.xslf.util,
|
||||
org.apache.poi.xssf.dev,
|
||||
org.apache.poi.xssf.eventusermodel,
|
||||
org.apache.poi.xssf.extractor,
|
||||
org.apache.poi.xssf.model,
|
||||
org.apache.poi.xssf.streaming,
|
||||
org.apache.poi.xssf.usermodel,
|
||||
org.apache.poi.xssf.usermodel.charts,
|
||||
org.apache.poi.xssf.usermodel.extensions,
|
||||
org.apache.poi.xssf.usermodel.helpers,
|
||||
org.apache.poi.xssf.util,
|
||||
org.apache.poi.xwpf.extractor,
|
||||
org.apache.poi.xwpf.model,
|
||||
org.apache.poi.xwpf.usermodel,
|
||||
org.apache.xmlbeans,
|
||||
org.apache.xmlbeans.impl.common,
|
||||
org.apache.xmlbeans.impl.config,
|
||||
org.apache.xmlbeans.impl.inst2xsd,
|
||||
org.apache.xmlbeans.impl.inst2xsd.util,
|
||||
org.apache.xmlbeans.impl.jam,
|
||||
org.apache.xmlbeans.impl.jam.annotation,
|
||||
org.apache.xmlbeans.impl.jam.internal,
|
||||
org.apache.xmlbeans.impl.jam.internal.classrefs,
|
||||
org.apache.xmlbeans.impl.jam.internal.elements,
|
||||
org.apache.xmlbeans.impl.jam.internal.javadoc,
|
||||
org.apache.xmlbeans.impl.jam.internal.parser,
|
||||
org.apache.xmlbeans.impl.jam.internal.reflect,
|
||||
org.apache.xmlbeans.impl.jam.mutable,
|
||||
org.apache.xmlbeans.impl.jam.provider,
|
||||
org.apache.xmlbeans.impl.jam.visitor,
|
||||
org.apache.xmlbeans.impl.jam.xml,
|
||||
org.apache.xmlbeans.impl.piccolo.io,
|
||||
org.apache.xmlbeans.impl.piccolo.util,
|
||||
org.apache.xmlbeans.impl.piccolo.xml,
|
||||
org.apache.xmlbeans.impl.regex,
|
||||
org.apache.xmlbeans.impl.richParser,
|
||||
org.apache.xmlbeans.impl.schema,
|
||||
org.apache.xmlbeans.impl.soap,
|
||||
org.apache.xmlbeans.impl.store,
|
||||
org.apache.xmlbeans.impl.tool,
|
||||
org.apache.xmlbeans.impl.util,
|
||||
org.apache.xmlbeans.impl.validator,
|
||||
org.apache.xmlbeans.impl.values,
|
||||
org.apache.xmlbeans.impl.xb.ltgfmt,
|
||||
org.apache.xmlbeans.impl.xb.ltgfmt.impl,
|
||||
org.apache.xmlbeans.impl.xb.substwsdl,
|
||||
org.apache.xmlbeans.impl.xb.substwsdl.impl,
|
||||
org.apache.xmlbeans.impl.xb.xmlconfig,
|
||||
org.apache.xmlbeans.impl.xb.xmlconfig.impl,
|
||||
org.apache.xmlbeans.impl.xb.xmlschema,
|
||||
org.apache.xmlbeans.impl.xb.xmlschema.impl,
|
||||
org.apache.xmlbeans.impl.xb.xsdownload,
|
||||
org.apache.xmlbeans.impl.xb.xsdownload.impl,
|
||||
org.apache.xmlbeans.impl.xb.xsdschema,
|
||||
org.apache.xmlbeans.impl.xb.xsdschema.impl,
|
||||
org.apache.xmlbeans.impl.xpathgen,
|
||||
org.apache.xmlbeans.impl.xsd2inst,
|
||||
org.apache.xmlbeans.soap,
|
||||
org.apache.xmlbeans.xml.stream,
|
||||
org.apache.xmlbeans.xml.stream.events,
|
||||
org.apache.xmlbeans.xml.stream.utils,
|
||||
org.dom4j,
|
||||
org.dom4j.bean,
|
||||
org.dom4j.datatype,
|
||||
org.dom4j.dom,
|
||||
org.dom4j.dtd,
|
||||
org.dom4j.io,
|
||||
org.dom4j.jaxb,
|
||||
org.dom4j.rule,
|
||||
org.dom4j.rule.pattern,
|
||||
org.dom4j.swing,
|
||||
org.dom4j.tree,
|
||||
org.dom4j.util,
|
||||
org.dom4j.xpath,
|
||||
org.dom4j.xpp,
|
||||
org.openxmlformats.schemas.drawingml.x2006.chart,
|
||||
org.openxmlformats.schemas.drawingml.x2006.chart.impl,
|
||||
org.openxmlformats.schemas.drawingml.x2006.main,
|
||||
org.openxmlformats.schemas.drawingml.x2006.main.impl,
|
||||
org.openxmlformats.schemas.drawingml.x2006.picture,
|
||||
org.openxmlformats.schemas.drawingml.x2006.picture.impl,
|
||||
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing,
|
||||
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.impl,
|
||||
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing,
|
||||
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.impl,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.customProperties,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.customProperties.impl,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.docPropsVTypes.impl,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.extendedProperties,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.impl,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.relationships,
|
||||
org.openxmlformats.schemas.officeDocument.x2006.relationships.impl,
|
||||
org.openxmlformats.schemas.presentationml.x2006.main,
|
||||
org.openxmlformats.schemas.presentationml.x2006.main.impl,
|
||||
org.openxmlformats.schemas.spreadsheetml.x2006.main,
|
||||
org.openxmlformats.schemas.spreadsheetml.x2006.main.impl,
|
||||
org.openxmlformats.schemas.wordprocessingml.x2006.main,
|
||||
org.openxmlformats.schemas.wordprocessingml.x2006.main.impl,
|
||||
org.w3c.dom,
|
||||
repackage,
|
||||
schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707,
|
||||
schemaorg_apache_xmlbeans.system.sXMLCONFIG,
|
||||
schemaorg_apache_xmlbeans.system.sXMLLANG,
|
||||
schemaorg_apache_xmlbeans.system.sXMLSCHEMA,
|
||||
schemaorg_apache_xmlbeans.system.sXMLTOOLS,
|
||||
schemasMicrosoftComOfficeExcel,
|
||||
schemasMicrosoftComOfficeExcel.impl,
|
||||
schemasMicrosoftComOfficeOffice,
|
||||
schemasMicrosoftComOfficeOffice.impl,
|
||||
schemasMicrosoftComVml,
|
||||
schemasMicrosoftComVml.impl
|
||||
Import-Package: com.teamcenter.rac.kernel,
|
||||
com.teamcenter.rac.workflow.processdesigner.plugin,
|
||||
com.teamcenter.services.rac.core,
|
||||
com.teamcenter.services.rac.core._2006_03,
|
||||
com.teamcenter.services.rac.core._2008_06,
|
||||
org.eclipse.core.databinding
|
||||
Bundle-ClassPath: src/com/teamcenter/rac/schedule/common/,
|
||||
poi/classes12.jar,
|
||||
poi/commons-codec-1.10.jar,
|
||||
poi/commons-logging-1.1.jar,
|
||||
poi/dom4j-1.6.1.jar,
|
||||
poi/jsr173_1.0_api.jar,
|
||||
poi/jxl_1.0.0.jar,
|
||||
poi/poi-3.9-20121203.jar,
|
||||
poi/poi-examples-3.9-20121203.jar,
|
||||
poi/poi-excelant-3.9-20121203.jar,
|
||||
poi/poi-ooxml-3.9-20121203.jar,
|
||||
poi/poi-ooxml-schemas-3.9-20121203.jar,
|
||||
poi/poi-scratchpad-3.9-20121203.jar,
|
||||
poi/xmlbeans-2.5.0.jar,
|
||||
.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml,\
|
||||
poi/classes12.jar,\
|
||||
poi/commons-codec-1.10.jar,\
|
||||
poi/commons-logging-1.1.jar,\
|
||||
poi/dom4j-1.6.1.jar,\
|
||||
poi/jsr173_1.0_api.jar,\
|
||||
poi/jxl_1.0.0.jar,\
|
||||
poi/poi-3.9-20121203.jar,\
|
||||
poi/poi-examples-3.9-20121203.jar,\
|
||||
poi/poi-excelant-3.9-20121203.jar,\
|
||||
poi/poi-ooxml-3.9-20121203.jar,\
|
||||
poi/poi-ooxml-schemas-3.9-20121203.jar,\
|
||||
poi/poi-scratchpad-3.9-20121203.jar,\
|
||||
poi/xmlbeans-2.5.0.jar
|
@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<category
|
||||
name="Sample Category"
|
||||
id="com.connor.hxc.plm.commands.category">
|
||||
</category>
|
||||
|
||||
<command name="新建" categoryId="com.connor.pro105.plm.commands.category" id="creatTechWordM"> </command>
|
||||
<command name="编辑" categoryId="com.connor.pro105.plm.commands.category" id="alterTechWordM"> </command>
|
||||
|
||||
<command name="新建" categoryId="com.connor.pro105.plm.commands.category" id="creatTechWordC"> </command>
|
||||
<command name="编辑" categoryId="com.connor.pro105.plm.commands.category" id="alterTechWordC"> </command>
|
||||
|
||||
<command name="新建" categoryId="com.connor.pro105.plm.commands.category" id="creatTechWordW"> </command>
|
||||
<command name="编辑" categoryId="com.connor.pro105.plm.commands.category" id="alterTechWordW"> </command>
|
||||
|
||||
<command name="新建" categoryId="com.connor.pro105.plm.commands.category" id="creatTechWordS"> </command>
|
||||
<command name="编辑" categoryId="com.connor.pro105.plm.commands.category" id="alterTechWordS"> </command>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
|
||||
<handler commandId="creatTechWordM" class="com.connor.pro105.plm.creatTechWord.CreatTechWordHandler"></handler>
|
||||
<handler commandId="creatTechWordC" class="com.connor.pro105.plm.creatTechWord.CreatTechWordHandler"></handler>
|
||||
<handler commandId="alterTechWordM" class="com.connor.pro105.plm.creatTechWord.AlterTechWordHandler"></handler>
|
||||
<handler commandId="alterTechWordC" class="com.connor.pro105.plm.creatTechWord.AlterTechWordHandler"></handler>
|
||||
<handler commandId="creatTechWordW" class="com.connor.pro105.plm.creatTechWord.CreatTechWordHandler"></handler>
|
||||
<handler commandId="creatTechWordS" class="com.connor.pro105.plm.creatTechWord.CreatTechWordHandler"></handler>
|
||||
<handler commandId="alterTechWordW" class="com.connor.pro105.plm.creatTechWord.AlterTechWordHandler"></handler>
|
||||
<handler commandId="alterTechWordS" class="com.connor.pro105.plm.creatTechWord.AlterTechWordHandler"></handler>
|
||||
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=additions">
|
||||
<menu label="文档管理" mnemonic="M" id="com.connor.pro105.plm.menus.createTechWord">
|
||||
<menu id="TechWordM" label="军机文档">
|
||||
<command commandId="creatTechWordM" mnemonic="S" id="com.connor.pro105.plm.menus.creatTechWordM">
|
||||
|
||||
</command>
|
||||
<command commandId="alterTechWordM" mnemonic="S" id="com.connor.pro105.plm.menus.alterTechWordM">
|
||||
|
||||
</command>
|
||||
</menu>
|
||||
<menu id="TechWordC" label="民机文档">
|
||||
<command commandId="creatTechWordC" mnemonic="S" id="com.connor.pro105.plm.menus.creatTechWordC">
|
||||
|
||||
</command>
|
||||
<command commandId="alterTechWordC" mnemonic="S" id="com.connor.pro105.plm.menus.alterTechWordC">
|
||||
|
||||
</command>
|
||||
</menu>
|
||||
<menu id="TechWordW" label="无型别文档">
|
||||
<!--创建无型别-->
|
||||
<command commandId="creatTechWordW" mnemonic="S" id="com.connor.pro105.plm.menus.creatTechWordW">
|
||||
|
||||
</command>
|
||||
<command commandId="alterTechWordW" mnemonic="S" id="com.connor.pro105.plm.menus.alterTechWordW">
|
||||
|
||||
</command>
|
||||
</menu>
|
||||
<menu id="TechWordS" label="软件类文档">
|
||||
<command commandId="creatTechWordS" mnemonic="S" id="com.connor.pro105.plm.menus.creatTechWordS">
|
||||
|
||||
</command>
|
||||
<command commandId="alterTechWordS" mnemonic="S" id="com.connor.pro105.plm.menus.alterTechWordS">
|
||||
|
||||
</command>
|
||||
</menu>
|
||||
<separator name="sp2" visible="false"> </separator>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
|
||||
|
||||
|
||||
|
||||
</extension>
|
||||
</plugin>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,30 @@
|
||||
package com.connor.pro105.plm;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
public class Activator implements BundleActivator {
|
||||
|
||||
private static BundleContext context;
|
||||
|
||||
static BundleContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = bundleContext;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.common.actions.AbstractAIFAction;
|
||||
|
||||
public class AlterTechWordAction extends AbstractAIFAction {
|
||||
private AbstractAIFApplication app;
|
||||
private String commandID;
|
||||
|
||||
public AlterTechWordAction( String commandID, AbstractAIFApplication app, String String) {
|
||||
super(app, String);
|
||||
this.commandID=commandID;
|
||||
this.app=app;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if(commandID.equals("alterTechWordC")) {
|
||||
|
||||
|
||||
AlterTechWordDialogC dialog=new AlterTechWordDialogC(app);
|
||||
new Thread(dialog).start();
|
||||
}else if(commandID.equals("alterTechWordM")) {
|
||||
|
||||
AlterTechWordDialogM dialog=new AlterTechWordDialogM(app);
|
||||
new Thread(dialog).start();
|
||||
}else if(commandID.equals("alterTechWordW")) {
|
||||
|
||||
AlterTechWordDialogW dialog=new AlterTechWordDialogW(app);
|
||||
new Thread(dialog).start();
|
||||
}else if(commandID.equals("alterTechWordS")) {
|
||||
|
||||
AlterTechWordDialogS dialog=new AlterTechWordDialogS(app);
|
||||
new Thread(dialog).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.core.commands.common.NotDefinedException;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class AlterTechWordHandler extends AbstractHandler {
|
||||
;
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
String commandID=arg0.getCommand().getId();
|
||||
AbstractAIFApplication app=AIFUtility.getCurrentApplication();
|
||||
if(app.getTargetComponent()==null) {
|
||||
MessageBox.post("请选择文档版本","",MessageBox.INFORMATION);
|
||||
}else {
|
||||
|
||||
try {
|
||||
System.out.println(app.getTargetComponent().getProperty("object_type"));
|
||||
if(commandID.equals("alterTechWordC")) {
|
||||
if( app.getTargetComponent().getProperty("object_type").equals("民机技术文档版本")||app.getTargetComponent().getProperty("object_type").equals("Civil Doc Revision")
|
||||
) {
|
||||
if(((TCComponent)app.getTargetComponent()).getProperty("release_status_list").length()>0) {
|
||||
MessageBox.post("此文件已发布,不可修改","",MessageBox.INFORMATION);
|
||||
} else {
|
||||
|
||||
AlterTechWordAction action=new AlterTechWordAction(commandID,app,null);
|
||||
new Thread(action).start();
|
||||
}
|
||||
}else {
|
||||
MessageBox.post("请选择民机技术文档版本","",MessageBox.INFORMATION);
|
||||
}
|
||||
}else if(commandID.equals("alterTechWordM")) {
|
||||
if( app.getTargetComponent().getProperty("object_type").equals("军机技术文档版本")||app.getTargetComponent().getProperty("object_type").equals("Military Doc Revision")
|
||||
) {
|
||||
if(((TCComponent)app.getTargetComponent()).getProperty("release_status_list").length()>0) {
|
||||
MessageBox.post("此文件已发布,不可修改","",MessageBox.INFORMATION);
|
||||
} else {
|
||||
|
||||
AlterTechWordAction action=new AlterTechWordAction(commandID,app,null);
|
||||
new Thread(action).start();
|
||||
}
|
||||
}else {
|
||||
MessageBox.post("请选择军机技术文档版本","",MessageBox.INFORMATION);
|
||||
}
|
||||
}else if(commandID.equals("alterTechWordW")) {
|
||||
if( app.getTargetComponent().getProperty("object_type").equals("无型别技术文档版本")||app.getTargetComponent().getProperty("object_type").equals("General Doc Revision")
|
||||
) {
|
||||
if(((TCComponent)app.getTargetComponent()).getProperty("release_status_list").length()>0) {
|
||||
MessageBox.post("此文件已发布,不可修改","",MessageBox.INFORMATION);
|
||||
} else {
|
||||
|
||||
AlterTechWordAction action=new AlterTechWordAction(commandID,app,null);
|
||||
new Thread(action).start();
|
||||
}
|
||||
}else {
|
||||
MessageBox.post("请选择无型别技术文档版本","",MessageBox.INFORMATION);
|
||||
}
|
||||
}else if(commandID.equals("alterTechWordS")) {
|
||||
if( app.getTargetComponent().getProperty("object_type").equals("软件技术文档版本")||app.getTargetComponent().getProperty("object_type").equals("Soft Tech Doc Revision")
|
||||
) {
|
||||
if(((TCComponent)app.getTargetComponent()).getProperty("release_status_list").length()>0) {
|
||||
MessageBox.post("此文件已发布,不可修改","",MessageBox.INFORMATION);
|
||||
} else {
|
||||
|
||||
AlterTechWordAction action=new AlterTechWordAction(commandID,app,null);
|
||||
new Thread(action).start();
|
||||
}
|
||||
}else {
|
||||
MessageBox.post("请选择软件技术文档版本","",MessageBox.INFORMATION);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.common.actions.AbstractAIFAction;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMLine;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMViewRevision;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
|
||||
|
||||
public class CreatTechWordAction extends AbstractAIFAction {
|
||||
private AbstractAIFApplication app;
|
||||
String opType;
|
||||
String commandID;
|
||||
|
||||
public CreatTechWordAction(String commandID,String opType, AbstractAIFApplication app, String String) {
|
||||
super(app, String);
|
||||
this.opType=opType;
|
||||
this.app=app;
|
||||
this.commandID=commandID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if(commandID.equals("creatTechWordC")) {
|
||||
|
||||
CreatTechWordDialogC dialog=new CreatTechWordDialogC(opType,app);
|
||||
new Thread(dialog).start();
|
||||
}else if(commandID.equals("creatTechWordM")) {
|
||||
|
||||
CreatTechWordDialogM dialog=new CreatTechWordDialogM(opType,app);
|
||||
new Thread(dialog).start();
|
||||
}else if(commandID.equals("creatTechWordW")) {
|
||||
|
||||
CreatTechWordDialogW dialog=new CreatTechWordDialogW(opType,app);
|
||||
new Thread(dialog).start();
|
||||
}else if(commandID.equals("creatTechWordS")) {
|
||||
|
||||
CreatTechWordDialogS dialog=new CreatTechWordDialogS(opType,app);
|
||||
new Thread(dialog).start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
public class CreatTechWordBean {
|
||||
|
||||
private String item_id;//项目风险号
|
||||
public String getItem_id() {
|
||||
return item_id;
|
||||
}
|
||||
public void setItem_id(String item_id) {
|
||||
this.item_id = item_id;
|
||||
}
|
||||
public String getXmlh() {
|
||||
return xmlh;
|
||||
}
|
||||
public void setXmlh(String xmlh) {
|
||||
this.xmlh = xmlh;
|
||||
}
|
||||
public String getHxc8jingli() {
|
||||
return hxc8jingli;
|
||||
}
|
||||
public void setHxc8jingli(String hxc8jingli) {
|
||||
this.hxc8jingli = hxc8jingli;
|
||||
}
|
||||
public String getHxc8cp() {
|
||||
return hxc8cp;
|
||||
}
|
||||
public void setHxc8cp(String hxc8cp) {
|
||||
this.hxc8cp = hxc8cp;
|
||||
}
|
||||
public String getHxc8kh() {
|
||||
return hxc8kh;
|
||||
}
|
||||
public void setHxc8kh(String hxc8kh) {
|
||||
this.hxc8kh = hxc8kh;
|
||||
}
|
||||
public String getHxc8cxdm() {
|
||||
return hxc8cxdm;
|
||||
}
|
||||
public void setHxc8cxdm(String hxc8cxdm) {
|
||||
this.hxc8cxdm = hxc8cxdm;
|
||||
}
|
||||
public String getHxc8scjd() {
|
||||
return hxc8scjd;
|
||||
}
|
||||
public void setHxc8scjd(String hxc8scjd) {
|
||||
this.hxc8scjd = hxc8scjd;
|
||||
}
|
||||
public String getHxc8ycl() {
|
||||
return hxc8ycl;
|
||||
}
|
||||
public void setHxc8ycl(String hxc8ycl) {
|
||||
this.hxc8ycl = hxc8ycl;
|
||||
}
|
||||
public String getHxc8jieduan() {
|
||||
return hxc8jieduan;
|
||||
}
|
||||
public void setHxc8jieduan(String hxc8jieduan) {
|
||||
this.hxc8jieduan = hxc8jieduan;
|
||||
}
|
||||
public String getHxc8miaoshu() {
|
||||
return hxc8miaoshu;
|
||||
}
|
||||
public void setHxc8miaoshu(String hxc8miaoshu) {
|
||||
this.hxc8miaoshu = hxc8miaoshu;
|
||||
}
|
||||
public String getHxc8result() {
|
||||
return hxc8result;
|
||||
}
|
||||
public void setHxc8result(String hxc8result) {
|
||||
this.hxc8result = hxc8result;
|
||||
}
|
||||
public String getHxc8risk() {
|
||||
return hxc8risk;
|
||||
}
|
||||
public void setHxc8risk(String hxc8risk) {
|
||||
this.hxc8risk = hxc8risk;
|
||||
}
|
||||
public String getHxc8plan() {
|
||||
return hxc8plan;
|
||||
}
|
||||
public void setHxc8plan(String hxc8plan) {
|
||||
this.hxc8plan = hxc8plan;
|
||||
}
|
||||
public String getHxc8finish() {
|
||||
return hxc8finish;
|
||||
}
|
||||
public void setHxc8finish(String hxc8finish) {
|
||||
this.hxc8finish = hxc8finish;
|
||||
}
|
||||
public String getHxc8zr() {
|
||||
return hxc8zr;
|
||||
}
|
||||
public void setHxc8zr(String hxc8zr) {
|
||||
this.hxc8zr = hxc8zr;
|
||||
}
|
||||
public String getHxc8open() {
|
||||
return hxc8open;
|
||||
}
|
||||
public void setHxc8open(String hxc8open) {
|
||||
this.hxc8open = hxc8open;
|
||||
}
|
||||
private String xmlh;//项目令号
|
||||
private String hxc8jingli;//项目经理
|
||||
private String hxc8cp;//产品名称
|
||||
private String hxc8kh;//客户
|
||||
private String hxc8cxdm;//车型代码
|
||||
private String hxc8scjd;//生产基地
|
||||
private String hxc8ycl;//年预测量
|
||||
private String hxc8jieduan;//项目阶段
|
||||
private String hxc8miaoshu;//风险/问题描述
|
||||
private String hxc8result;//影响/后果
|
||||
private String hxc8risk;//风险等级
|
||||
private String hxc8plan;//响应措施/计划
|
||||
private String hxc8finish;//计划完成日期
|
||||
private String hxc8zr;//责任人
|
||||
private String hxc8open;//开放/关闭
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentFolder;
|
||||
import com.teamcenter.rac.kernel.TCComponentPseudoFolder;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class CreatTechWordHandler extends AbstractHandler {
|
||||
;
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
System.out.println("CreatTechWordHandler");
|
||||
try {
|
||||
String commandID = arg0.getCommand().getId();
|
||||
String opType = arg0.getCommand().getName();
|
||||
System.out.println("------------"+opType);
|
||||
/*
|
||||
* if(true) { return 0; }
|
||||
*/
|
||||
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
||||
TCComponent compX = (TCComponent) app.getTargetComponent();
|
||||
if(compX == null) {
|
||||
MessageBox.post(AIFUtility.getActiveDesktop(), "请选择文件夹或伪文件夹", "ERROR", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
/*TCComponent[] compS= (TCComponent[]) app.getTargetComponents();
|
||||
TCComponentTask task;
|
||||
task.performTaskAction(i, s, s1, s2, tccomponent, list, list1);
|
||||
for (int i = 0; i < compS.length; i++) {
|
||||
try {
|
||||
connorAutoWorkflow(compS[i]);
|
||||
} catch (TCException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
TCComponent parent = compX;
|
||||
if(compX instanceof TCComponentPseudoFolder) {
|
||||
parent = compX.getRelatedComponent("owning_object");
|
||||
}
|
||||
TCSession session = (TCSession) app.getSession();
|
||||
if(!session.getTCAccessControlService().checkPrivilege(parent, "WRITE")) {
|
||||
MessageBox.post(AIFUtility.getActiveDesktop(), parent + " 无修改权限!", "ERROR", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
if(compX instanceof TCComponentFolder || compX instanceof TCComponentPseudoFolder) {
|
||||
CreatTechWordAction action = new CreatTechWordAction(commandID, opType, app, null);
|
||||
new Thread(action).start();
|
||||
}else {
|
||||
MessageBox.post(AIFUtility.getActiveDesktop(), "请选择文件夹或伪文件夹", "ERROR", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MessageBox.post(AIFUtility.getActiveDesktop(), "错误:"+e.toString(), "ERROR", MessageBox.ERROR);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 调用c刷新属性
|
||||
*
|
||||
* @param item
|
||||
* 问题点版本
|
||||
* @param statusName
|
||||
* 属性信息
|
||||
* @throws TCException
|
||||
|
||||
public void connorAutoWorkflow(TCComponent task ) throws TCException {
|
||||
AbstractAIFUIApplication app = AIFUtility.getCurrentApplication();
|
||||
TCSession session = (TCSession) app.getSession();
|
||||
TCUserService userservice = session.getUserService();
|
||||
|
||||
Object[] obj = new Object[1];
|
||||
obj[0] = task;
|
||||
userservice.call("connor_auto_workflow", obj);
|
||||
|
||||
}*/
|
||||
|
||||
}
|
@ -0,0 +1,239 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
||||
import org.apache.poi.xssf.usermodel.XSSFColor;
|
||||
import org.apache.poi.xssf.usermodel.XSSFFont;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.AbstractAIFOperation;
|
||||
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentDataset;
|
||||
import com.teamcenter.rac.kernel.TCComponentItem;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||
import com.teamcenter.rac.kernel.TCComponentTcFile;
|
||||
import com.teamcenter.rac.kernel.TCComponentUser;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCPreferenceService;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class CreatTechWordOperation extends AbstractAIFOperation {
|
||||
private AbstractAIFApplication app;
|
||||
private String exportFile;
|
||||
private TCSession session;
|
||||
private TCPreferenceService tcPreferenceService;
|
||||
private List<CreatTechWordBean> valueLists = new ArrayList<CreatTechWordBean>();//所有工时信息的集合
|
||||
|
||||
private FileInputStream fis;
|
||||
private FileOutputStream fos;
|
||||
private XSSFWorkbook workBook;
|
||||
private ProgressBarThread wait;
|
||||
int total=0;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||
public CreatTechWordOperation(ProgressBarThread wait,
|
||||
AbstractAIFApplication app, String exportFile) {
|
||||
this.app = app;
|
||||
this.exportFile = exportFile;
|
||||
this.session = (TCSession) app.getSession();
|
||||
this.wait = wait;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void executeOperation() throws Exception {
|
||||
|
||||
//获取数据
|
||||
//把所有流程放入首选项HX_Process
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
String ssx = "hxc_risks";// 模板的首选项名称whdlh$E4aTDHqA AzWlG7qWYvbLjA
|
||||
//搜索系统所有的Hxc8XM ,找到关系问题点Hxc8wtd和风险点Hxc8fengxian
|
||||
TCComponent[] projects=session.search("常规...", new String[] {"类型"}, new String[] {"Hxc8XM"});
|
||||
System.out.println("共有项目--------"+projects.length);
|
||||
for(int i=0;i<projects.length;i++) {
|
||||
TCComponent project=projects[i];
|
||||
TCComponent[] problems=project.getTCProperty("Hxc8fengxian").getReferenceValueArray();
|
||||
String xmlh=project.getProperty("item_id");//项目令号
|
||||
for(int j=0;j<problems.length;j++) {
|
||||
if(problems[j].getType().equals("Hxc8risk")) {
|
||||
CreatTechWordBean bean=new CreatTechWordBean();
|
||||
TCComponentItem item=(TCComponentItem)problems[j];
|
||||
String item_id=item.getLatestItemRevision().getProperty("item_id");//项目风险号
|
||||
String hxc8jingli=item.getLatestItemRevision().getProperty("hxc8jingli");//项目经理
|
||||
String hxc8cp=item.getLatestItemRevision().getProperty("hxc8cp");//产品名称
|
||||
String hxc8kh=item.getLatestItemRevision().getProperty("hxc8kh");//客户
|
||||
String hxc8cxdm=item.getLatestItemRevision().getProperty("hxc8cxdm");//车型代码
|
||||
String hxc8scjd=item.getLatestItemRevision().getProperty("hxc8scjd");//生产基地
|
||||
String hxc8ycl=item.getLatestItemRevision().getProperty("hxc8ycl");//年与测量
|
||||
String hxc8jieduan=item.getLatestItemRevision().getProperty("hxc8jieduan");//项目阶段
|
||||
String hxc8miaoshu=item.getLatestItemRevision().getProperty("hxc8miaoshu");//风险/问题描述
|
||||
String hxc8result=item.getLatestItemRevision().getProperty("hxc8result");//影响/后果
|
||||
String hxc8risk=item.getLatestItemRevision().getProperty("hxc8risk");//风险等级
|
||||
String hxc8plan=item.getLatestItemRevision().getProperty("hxc8plan");//相应措施/计划
|
||||
String hxc8finish=item.getLatestItemRevision().getProperty("hxc8finish").split(" ")[0];//计划完成日期
|
||||
String hxc8zr=item.getLatestItemRevision().getProperty("hxc8zr");//责任人
|
||||
String hxc8open=item.getLatestItemRevision().getProperty("hxc8open");//开放/关闭
|
||||
bean.setXmlh(xmlh);
|
||||
bean.setItem_id(item_id);
|
||||
bean.setHxc8jingli(hxc8jingli);
|
||||
bean.setHxc8cp(hxc8cp);
|
||||
bean.setHxc8kh(hxc8kh);
|
||||
bean.setHxc8cxdm(hxc8cxdm);
|
||||
bean.setHxc8scjd(hxc8scjd);
|
||||
bean.setHxc8ycl(hxc8ycl);
|
||||
bean.setHxc8jieduan(hxc8jieduan);
|
||||
bean.setHxc8risk(hxc8risk);
|
||||
bean.setHxc8plan(hxc8plan);
|
||||
bean.setHxc8finish(hxc8finish);
|
||||
bean.setHxc8zr(hxc8zr);
|
||||
bean.setHxc8open(hxc8open);
|
||||
bean.setHxc8miaoshu(hxc8miaoshu);
|
||||
bean.setHxc8result(hxc8result);
|
||||
valueLists.add(bean);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File fmsFile = getExcle(ssx);// 查找模板
|
||||
if (fmsFile == null) {
|
||||
MessageBox.post("模板错误,请联系管理员", "错误", MessageBox.ERROR);
|
||||
return;
|
||||
}
|
||||
tcPreferenceService = session.getPreferenceService();
|
||||
|
||||
int row = valueLists.size();
|
||||
fis = new FileInputStream(fmsFile);
|
||||
workBook = new XSSFWorkbook(fis);
|
||||
XSSFSheet sheet = workBook.getSheet("风险看板");
|
||||
XSSFCellStyle sty2 = workBook.createCellStyle();
|
||||
sty2.setBorderBottom((short) 1);
|
||||
sty2.setBorderTop((short) 1);
|
||||
sty2.setBorderLeft((short) 1);
|
||||
sty2.setBorderRight((short) 1);
|
||||
sty2.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);// 垂直居中
|
||||
sty2.setAlignment(XSSFCellStyle.ALIGN_CENTER);// 水平居左
|
||||
sty2.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND);
|
||||
sty2.setFillForegroundColor(IndexedColors.WHITE.getIndex());//背景变白
|
||||
for (int i = 0; i < row; i++) {
|
||||
//新建单元格,合并单元格
|
||||
XSSFRow r=sheet.getRow(i+2);
|
||||
if(r==null) {
|
||||
r = sheet.createRow(i+2);
|
||||
}
|
||||
for (int j = 0; j < 17; j++) {
|
||||
XSSFCell ce = r.createCell(j);
|
||||
ce.setCellStyle(sty2);
|
||||
|
||||
}
|
||||
r.getCell(0).setCellValue(i+1);
|
||||
r.getCell(1).setCellValue(valueLists.get(i).getItem_id());
|
||||
r.getCell(2).setCellValue(valueLists.get(i).getXmlh());
|
||||
|
||||
r.getCell(3).setCellValue(valueLists.get(i).getHxc8cp());
|
||||
r.getCell(4).setCellValue(valueLists.get(i).getHxc8jingli());
|
||||
|
||||
r.getCell(5).setCellValue(valueLists.get(i).getHxc8kh());
|
||||
r.getCell(6).setCellValue(valueLists.get(i).getHxc8cxdm());
|
||||
|
||||
r.getCell(7).setCellValue(valueLists.get(i).getHxc8scjd());
|
||||
r.getCell(8).setCellValue(valueLists.get(i).getHxc8ycl());
|
||||
|
||||
r.getCell(9).setCellValue(valueLists.get(i).getHxc8jieduan());
|
||||
r.getCell(10).setCellValue(valueLists.get(i).getHxc8miaoshu());
|
||||
|
||||
r.getCell(11).setCellValue(valueLists.get(i).getHxc8result());
|
||||
r.getCell(12).setCellValue(valueLists.get(i).getHxc8risk());
|
||||
|
||||
r.getCell(13).setCellValue(valueLists.get(i).getHxc8plan());
|
||||
r.getCell(14).setCellValue(valueLists.get(i).getHxc8finish());
|
||||
r.getCell(15).setCellValue(valueLists.get(i).getHxc8zr());
|
||||
r.getCell(16).setCellValue(valueLists.get(i).getHxc8open());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
File file = null;
|
||||
String timeNow=GetNowDate();
|
||||
file = new File(exportFile + "\\" + "系统风险点报表"+timeNow + ".xlsx");
|
||||
|
||||
fos = new FileOutputStream(file);
|
||||
workBook.write(fos);
|
||||
|
||||
|
||||
long end = System.currentTimeMillis();
|
||||
float time = (end - start) / 1000.00f;
|
||||
System.out.println("耗时:" + time + "秒");
|
||||
this.wait.setBool(true);
|
||||
this.wait.interrupt();
|
||||
MessageBox.post("报表已经导出,共有"+row+"条", "成功", MessageBox.INFORMATION);
|
||||
|
||||
Runtime.getRuntime().exec(new String[] { "cmd.exe", "/c", exportFile + "\\" + "系统风险点报表" + timeNow +".xlsx" });// 下载完成后直接打开
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String GetNowDate(){
|
||||
String temp_str="";
|
||||
Date dt = new Date();
|
||||
//最后的aa表示“上午”或“下午” HH表示24小时制 如果换成hh表示12小时制 "yyyy-MM-ddHH:mm:ss aa"
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm");
|
||||
temp_str=sdf.format(dt);
|
||||
return temp_str;
|
||||
}
|
||||
private File getExcle(String ssx) {
|
||||
File fmsFile = null;
|
||||
tcPreferenceService = session.getPreferenceService();
|
||||
String puid = tcPreferenceService.getStringValue(ssx);
|
||||
if (puid == null) {
|
||||
MessageBox.post("请联系管理员检查首选项", "错误", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
TCComponentDataset dateset = null;
|
||||
|
||||
try {
|
||||
dateset = (TCComponentDataset) session.stringToComponent(puid);
|
||||
} catch (TCException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (dateset == null) {
|
||||
MessageBox.post("未找到数据集,请联系管理员检查首选项", "错误", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
TCComponentTcFile[] file = dateset.getTcFiles();
|
||||
if (file.length == 0 || file.length != 1) {
|
||||
MessageBox.post("数据集没有命名引用的文件或文件过多,请检查!", "WARNING", MessageBox.WARNING);
|
||||
return null;
|
||||
} else {
|
||||
fmsFile = file[0].getFmsFile();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return fmsFile;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,320 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.DefaultListSelectionModel;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.ListCellRenderer;
|
||||
import javax.swing.ListSelectionModel;
|
||||
import javax.swing.plaf.basic.BasicComboPopup;
|
||||
import javax.swing.plaf.basic.ComboPopup;
|
||||
import javax.swing.plaf.metal.MetalComboBoxUI;
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked"})
|
||||
public class MultiCombo extends JComboBox<String> implements FocusListener {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected HashSet<Integer> set = new HashSet<>();
|
||||
private String[] cns;
|
||||
private String[] ens;
|
||||
private String value;
|
||||
|
||||
public MultiCombo(String str[]) {
|
||||
int len = str.length;
|
||||
cns = new String[len];
|
||||
ens = new String[len];
|
||||
for(int i=0; i<len; i++){
|
||||
String[] split = str[i].split(":");
|
||||
if(split.length<2){
|
||||
cns[i] = str[i];
|
||||
ens[i] = str[i];
|
||||
continue;
|
||||
}
|
||||
cns[i] = split[0];
|
||||
ens[i] = split[1];
|
||||
}
|
||||
setModel(new RwDefaultComboBoxModel(cns));
|
||||
setUI(new RwMetalComboBoxUI(this));
|
||||
setRenderer(new RwJCheckBox());
|
||||
setSelectedIndex(-1);
|
||||
value = "";
|
||||
// ((JTextField)getEditor().getEditorComponent()).setEditable(true);
|
||||
// 禁止编辑的代码
|
||||
}
|
||||
|
||||
public void resetCombox(boolean zh) {
|
||||
this.removeAllItems();
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
if(zh){
|
||||
for(int i=0; i<cns.length; i++) {
|
||||
this.addItem(cns[i]);
|
||||
if(this.set.contains(i))
|
||||
sb.append(";").append(cns[i]);
|
||||
}
|
||||
}else{
|
||||
for(int i=0; i<ens.length; i++) {
|
||||
this.addItem(ens[i]);
|
||||
if(this.set.contains(i))
|
||||
sb.append(";").append(ens[i]);
|
||||
}
|
||||
}
|
||||
JTextField jTextField = (JTextField) this.getEditor().getEditorComponent();
|
||||
jTextField.setText("");
|
||||
if(sb.length()>0)
|
||||
jTextField.setText(sb.substring(1));
|
||||
}
|
||||
|
||||
public String getValue(){
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value){
|
||||
if(value==null || value.isEmpty()){
|
||||
this.value = "";
|
||||
return;
|
||||
}
|
||||
this.value = value;
|
||||
String[] split = value.split(":");
|
||||
boolean find = false;
|
||||
for(String s : split[0].split(";")){
|
||||
for(int i=0; i<cns.length; i++){
|
||||
if(!s.equals(cns[i]))
|
||||
continue;
|
||||
this.set.add(i);
|
||||
find = true;
|
||||
}
|
||||
}
|
||||
if(!find){
|
||||
this.value = "";
|
||||
return;
|
||||
}
|
||||
JTextField jTextField = (JTextField) this.getEditor().getEditorComponent();
|
||||
jTextField.setText(split[0]);
|
||||
}
|
||||
|
||||
public void focusGained(FocusEvent e) {
|
||||
|
||||
}
|
||||
|
||||
public void focusLost(FocusEvent e) {
|
||||
// 这是一种特殊情况下的使用方法
|
||||
// java.awt.Container container=(java.awt.Container)getEditor().getEditorComponent();
|
||||
// while(container!=null&&!(container instanceof javax.swing.JLabel))
|
||||
// {
|
||||
// container=container.getParent();
|
||||
// }
|
||||
// ((cLabel)container).setValue(((javax.swing.JTextField)getEditor().getEditorComponent()).getText());
|
||||
}
|
||||
|
||||
public void setEditable(boolean b) {
|
||||
super.setEditable(b);
|
||||
((JTextField)getEditor().getEditorComponent()).setEditable(false);
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return ((JTextField) this.getEditor().getEditorComponent()).getText();
|
||||
}
|
||||
|
||||
private static class RwMetalComboBoxUI extends MetalComboBoxUI {
|
||||
private RwMetalComboBoxUI(MultiCombo MultiCombo) {
|
||||
this.comboBox = MultiCombo;
|
||||
}
|
||||
|
||||
protected ComboPopup createPopup() {
|
||||
return new RwBasicComboPopup(comboBox);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RwBasicComboPopup extends BasicComboPopup {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RwBasicComboPopup(JComboBox combo) {
|
||||
super(combo);
|
||||
}
|
||||
|
||||
protected void configureList() {
|
||||
super.configureList();
|
||||
list.setSelectionModel(new RwDefaultListSelectionModel(comboBox));
|
||||
}
|
||||
|
||||
protected MouseListener createListMouseListener() {
|
||||
return new RwMouseAdapter(list, comboBox);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RwDefaultListSelectionModel extends DefaultListSelectionModel {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
protected MultiCombo MultiCombo;
|
||||
|
||||
public RwDefaultListSelectionModel(JComboBox comboBox) {
|
||||
this.MultiCombo = (MultiCombo) comboBox;
|
||||
}
|
||||
|
||||
public boolean isSelectedIndex(int index) {
|
||||
return MultiCombo.set.contains(index);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RwMouseAdapter extends MouseAdapter {
|
||||
protected JList list;
|
||||
protected MultiCombo MultiCombo;
|
||||
|
||||
private RwMouseAdapter(JList list, JComboBox comboBox) {
|
||||
this.list = list;
|
||||
this.MultiCombo = (MultiCombo) comboBox;
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent anEvent) {
|
||||
// System.out.println("RwMouseAdapter");
|
||||
StringBuilder sb, sb1, sb2;
|
||||
int k, index;
|
||||
index = list.getSelectedIndex();
|
||||
JTextField jTextField = (JTextField) MultiCombo.getEditor().getEditorComponent();
|
||||
sb = new StringBuilder(jTextField.getText());
|
||||
|
||||
if (sb.length() > 0 && ';' != sb.charAt(0))
|
||||
sb.insert(0, ";");
|
||||
if (sb.length() > 0 && ';' != sb.charAt(sb.length() - 1))
|
||||
sb.append(";");
|
||||
if (sb.length() > 0 && ";".equals(sb.toString()))
|
||||
sb = new StringBuilder();
|
||||
if (list.getSelectionMode() == ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) {
|
||||
if (MultiCombo.set.contains(index)) {
|
||||
MultiCombo.set.remove(index);
|
||||
sb1 = new StringBuilder();
|
||||
sb1.append(";").append(MultiCombo.getModel().getElementAt(index)).append(",");
|
||||
k = sb.indexOf(sb1.toString());
|
||||
while (k != -1) {
|
||||
sb.replace(k, k + sb1.length(), ";");
|
||||
k = sb.indexOf(sb1.toString());
|
||||
}
|
||||
} else {
|
||||
MultiCombo.set.add(index);
|
||||
if (sb.length() == 0)
|
||||
sb.append(";").append(MultiCombo.getModel().getElementAt(index)).append(";");
|
||||
else
|
||||
sb.append(MultiCombo.getModel().getElementAt(index)).append(";");
|
||||
}
|
||||
} else {
|
||||
if (!MultiCombo.set.contains(index)) {
|
||||
MultiCombo.set.clear();
|
||||
MultiCombo.set.add(index);
|
||||
}
|
||||
}
|
||||
Object obj;
|
||||
sb2 = new StringBuilder(sb);
|
||||
// 替换完正常的可选值
|
||||
for (int i = 0; i < list.getModel().getSize(); i++) {
|
||||
obj = list.getModel().getElementAt(i);
|
||||
sb1 = new StringBuilder();
|
||||
sb1.append(";").append(obj).append(";");
|
||||
k = sb2.indexOf(sb1.toString());
|
||||
while (k != -1) {
|
||||
sb2.replace(k, k + sb1.length(), ";");
|
||||
k = sb2.indexOf(sb1.toString());
|
||||
}
|
||||
}
|
||||
ArrayList list1 = new ArrayList(MultiCombo.set);
|
||||
Collections.sort(list1);
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
obj = MultiCombo.getModel().getElementAt(Integer.parseInt(list1.get(i).toString()));
|
||||
sb1 = new StringBuilder();
|
||||
sb1.append(";").append(obj).append(";");
|
||||
k = sb.indexOf(sb1.toString());
|
||||
if (k != -1 && sb2.indexOf(sb1.toString()) == -1) {
|
||||
sb2.append(obj).append(";");
|
||||
}
|
||||
}
|
||||
sb = new StringBuilder(sb2);
|
||||
if (sb.length() > 0 && ';' == sb.charAt(0))
|
||||
sb.deleteCharAt(0);
|
||||
if (sb.length() > 0 && ';' == sb.charAt(sb.length() - 1))
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
if (sb.length() > 0 && ";".equals(sb.toString()))
|
||||
sb = new StringBuilder();
|
||||
jTextField.setText(sb.toString());
|
||||
// java.awt.Container container =jTextField;
|
||||
// while(container!=null&&!(container instanceof javax.swing.JLabel))
|
||||
// {
|
||||
// container=container.getParent();
|
||||
// }
|
||||
// ((cLabel)container).setValue(sb.toString());
|
||||
if(MultiCombo.set.size()>0){
|
||||
StringBuilder val = new StringBuilder("");
|
||||
for(int i=0; i<MultiCombo.cns.length; i++){
|
||||
if(MultiCombo.set.contains(i)){
|
||||
val.append(MultiCombo.cns[i]).append(";");
|
||||
}
|
||||
}
|
||||
// val.deleteCharAt(val.length()-1).append(":");
|
||||
// for(int i=0; i<MultiCombo.ens.length; i++){
|
||||
// if(MultiCombo.set.contains(i)){
|
||||
// val.append(MultiCombo.ens[i]).append(";");
|
||||
// }
|
||||
// }
|
||||
val.deleteCharAt(val.length()-1);
|
||||
MultiCombo.value = val.toString();
|
||||
}
|
||||
|
||||
MultiCombo.repaint();
|
||||
list.repaint();
|
||||
// System.out.println("text:"+((JTextField) MultiCombo.getEditor().getEditorComponent()).getText());
|
||||
}
|
||||
}
|
||||
|
||||
private static class RwDefaultComboBoxModel extends DefaultComboBoxModel {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private RwDefaultComboBoxModel(String[] str) {
|
||||
for (int i = 0; i < str.length; i++)
|
||||
addElement(str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RwJCheckBox extends JCheckBox implements ListCellRenderer {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
||||
setComponentOrientation(list.getComponentOrientation());
|
||||
if (isSelected) {
|
||||
setBackground(list.getSelectionBackground());
|
||||
setForeground(list.getSelectionForeground());
|
||||
} else {
|
||||
setBackground(list.getBackground());
|
||||
setForeground(list.getForeground());
|
||||
}
|
||||
setEnabled(list.isEnabled());
|
||||
setSelected(isSelected);
|
||||
setText(value == null ? "" : value.toString());
|
||||
setFont(list.getFont());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,171 @@
|
||||
/**
|
||||
* @file ProgressBar.java
|
||||
*
|
||||
* @brief Create progress bar
|
||||
*
|
||||
* @author Yanghui
|
||||
*
|
||||
* @history
|
||||
* ================================================================
|
||||
* Date Name Description of Change
|
||||
* 25-July-2008 Yanghui this class is used to create
|
||||
* progress bar.
|
||||
*/
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JProgressBar;
|
||||
import javax.swing.Timer;
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.util.PropertyLayout;
|
||||
import com.teamcenter.rac.util.Registry;
|
||||
|
||||
/**
|
||||
* @class ProgressBar
|
||||
* @brief Create progress bar
|
||||
* @author Yanghui
|
||||
*/
|
||||
public class ProgressBar extends AbstractAIFDialog implements ActionListener {
|
||||
/**
|
||||
* @var ProgressBar.progressbar
|
||||
* @brief JProgressBar
|
||||
*/
|
||||
private JProgressBar progressbar;
|
||||
|
||||
/**
|
||||
* @var ProgressBar.label
|
||||
* @brief label used to tips
|
||||
*/
|
||||
private JLabel label;
|
||||
|
||||
/**
|
||||
* @var ProgressBar.timer
|
||||
* @brief timer used to timing operation
|
||||
*/
|
||||
private Timer timer;
|
||||
|
||||
/**
|
||||
* @var ProgressBar.bool
|
||||
* @brief bool used to flag thread return
|
||||
*/
|
||||
private boolean bool = false;
|
||||
|
||||
/**
|
||||
* @var Progressbar.registry
|
||||
* @brief Registry
|
||||
*/
|
||||
private Registry registry;
|
||||
|
||||
/**
|
||||
* @fn public ProgressBar()
|
||||
* @brief constructor
|
||||
* @param[in] null
|
||||
*/
|
||||
private String showLable = null ;
|
||||
public ProgressBar(String showlable) {
|
||||
super(true);
|
||||
showLable = showlable;
|
||||
this.setAlwaysOnTop(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn public void setBool(boolean bool)
|
||||
* @brief set bool value
|
||||
* @param[in] bool
|
||||
* @param[out] null
|
||||
*/
|
||||
public void setBool(boolean bool) {
|
||||
this.bool = bool;
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn private void initUI()
|
||||
* @brief createDialog method
|
||||
* @param[in] null
|
||||
* @param[out] null
|
||||
*/
|
||||
public void initUI() {
|
||||
Container container = getContentPane();
|
||||
JPanel mainPanel = new JPanel(new PropertyLayout());
|
||||
this.label = new JLabel(showLable, JLabel.CENTER);
|
||||
this.progressbar = new JProgressBar();
|
||||
this.progressbar.setOrientation(JProgressBar.HORIZONTAL);
|
||||
this.progressbar.setMinimum(0);
|
||||
this.progressbar.setMaximum(100);
|
||||
this.progressbar.setValue(0);
|
||||
this.progressbar.setPreferredSize(new Dimension(200, 15));
|
||||
this.progressbar.setBorderPainted(true);
|
||||
this.timer = new Timer(50, (ActionListener) this);
|
||||
this.timer.setRepeats(false);
|
||||
mainPanel.add("1.1.center", new JLabel(" "));
|
||||
mainPanel.add("2.1.center", label);
|
||||
mainPanel.add("3.1.center", progressbar);
|
||||
mainPanel.add("4.1.center", new JLabel(" "));
|
||||
container.add(mainPanel);
|
||||
pack();
|
||||
setLocation(500, 200);
|
||||
TaskThread thread = new TaskThread(this);
|
||||
thread.start();
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
bool = true;
|
||||
}
|
||||
});
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @class TaskThread
|
||||
* @brief Create progressbar
|
||||
*
|
||||
*/
|
||||
class TaskThread extends Thread {
|
||||
private ProgressBar bar;
|
||||
|
||||
public TaskThread(ProgressBar bar) {
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (bool == false) {
|
||||
// Set Status is running.
|
||||
// session.setStatus(registry.getString("export Running"));
|
||||
}
|
||||
for (int i = 0; i < i + 1; i++) {
|
||||
timer.start();
|
||||
int value = progressbar.getValue();
|
||||
if (value < 100) {
|
||||
value = value + 5;
|
||||
progressbar.setValue(value);
|
||||
} else {
|
||||
timer.stop();
|
||||
progressbar.setValue(0);
|
||||
}
|
||||
try {
|
||||
sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (bool == true) {
|
||||
bar.setVisible(false);
|
||||
bar.dispose();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file ProgressBarThread.java
|
||||
*
|
||||
* @brief control progressBar.
|
||||
*
|
||||
* @author Yanghui
|
||||
*
|
||||
* @history
|
||||
* ================================================================
|
||||
* Date Name Description of Change
|
||||
* 08-Auguest-2008 Yanghui this class is used to control
|
||||
* progress bar.
|
||||
*/
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
/**
|
||||
* @class ProgressBarThread
|
||||
* @brief Create progress bar thread
|
||||
* @author Yanghui
|
||||
*/
|
||||
public class ProgressBarThread extends Thread {
|
||||
|
||||
private ProgressBar bar;
|
||||
|
||||
private String title;
|
||||
|
||||
public ProgressBarThread(String title,String showLable) {
|
||||
this.title = title;
|
||||
bar = new ProgressBar(showLable);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
bar.setTitle(title);
|
||||
bar.initUI();
|
||||
}
|
||||
|
||||
public void setBool(boolean bool) {
|
||||
bar.setBool(true);
|
||||
bar.setAlwaysOnTop(false);
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.connor.pro105.plm.creatTechWord;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMLine;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMViewRevision;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMWindow;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMWindowType;
|
||||
import com.teamcenter.rac.kernel.TCComponentContextList;
|
||||
import com.teamcenter.rac.kernel.TCComponentDataset;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemType;
|
||||
import com.teamcenter.rac.kernel.TCComponentQuery;
|
||||
import com.teamcenter.rac.kernel.TCComponentQueryType;
|
||||
import com.teamcenter.rac.kernel.TCComponentSchedule;
|
||||
import com.teamcenter.rac.kernel.TCComponentScheduleTask;
|
||||
import com.teamcenter.rac.kernel.TCComponentTcFile;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCPreferenceService;
|
||||
import com.teamcenter.rac.kernel.TCQueryClause;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.kernel.TCTextService;
|
||||
import com.teamcenter.rac.kernel.TCTypeService;
|
||||
import com.teamcenter.rac.kernel.TCUserService;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
||||
|
||||
|
||||
public class Util {
|
||||
public static TCPreferenceService service;
|
||||
public static TCSession session;
|
||||
public static TCUserService userservice;;
|
||||
|
||||
|
||||
static {
|
||||
if (session == null) {
|
||||
session = (TCSession) (AIFUtility.getCurrentApplication().getSession());
|
||||
}
|
||||
if (service == null)
|
||||
service = session.getPreferenceService();
|
||||
}
|
||||
|
||||
public static void setByPass(boolean val) throws TCException {
|
||||
userservice = session.getUserService();
|
||||
if (userservice == null) {
|
||||
userservice = session.getUserService();
|
||||
}
|
||||
Object[] obj = new Object[1];
|
||||
obj[0] = "origin";
|
||||
if (val) {
|
||||
// userservice.call("ORIGIN_set_bypass", obj);
|
||||
userservice.call("connor_open_bypass", new Object[] { "true" });
|
||||
} else {
|
||||
// userservice.call("ORIGIN_close_bypass", obj);
|
||||
userservice.call("connor_close_bypass", new Object[] { "false" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void removeClass(String icoUid) throws TCException {
|
||||
userservice = session.getUserService();
|
||||
if (userservice == null) {
|
||||
userservice = session.getUserService();
|
||||
}
|
||||
Object[] obj = new Object[1];
|
||||
obj[0] = icoUid;
|
||||
userservice.call("IcoRemove", obj);
|
||||
}
|
||||
|
||||
public static File getExcle(TCSession session, String ssx) {
|
||||
File fmsFile = null;
|
||||
String puid = session.getPreferenceService().getStringValue(ssx);
|
||||
if (puid == null) {
|
||||
MessageBox.post("请联系管理员检查首选项", "错误", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
TCComponentDataset dateset = null;
|
||||
|
||||
try {
|
||||
dateset = (TCComponentDataset) session.stringToComponent(puid);
|
||||
} catch (TCException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (dateset == null) {
|
||||
MessageBox.post("未找到数据集,请联系管理员检查首选项", "错误", MessageBox.ERROR);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
TCComponentTcFile[] file = dateset.getTcFiles();
|
||||
if (file.length == 0 || file.length != 1) {
|
||||
MessageBox.post("数据集没有命名引用的文件或文件过多,请检查!", "WARNING", MessageBox.WARNING);
|
||||
return null;
|
||||
} else {
|
||||
fmsFile = file[0].getFmsFile();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return fmsFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用service 指派责任人
|
||||
*
|
||||
* @param schedule
|
||||
* @param scheduleTask
|
||||
* @param user
|
||||
* @throws TCException
|
||||
*/
|
||||
public static void resourceAssignment(TCComponentSchedule schedule, TCComponentScheduleTask scheduleTask,
|
||||
TCComponent user) throws TCException {
|
||||
userservice = session.getUserService();
|
||||
if (userservice == null) {
|
||||
userservice = session.getUserService();
|
||||
}
|
||||
Object[] obj = new Object[3];
|
||||
obj[0] = schedule;
|
||||
obj[1] = scheduleTask;
|
||||
obj[2] = user;
|
||||
userservice.call("create_schedule_task_resource_assignment", obj);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue