@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry exported="true" kind="lib" path="log4j.jar"/>
|
||||||
|
<classpathentry kind="lib" path="ojdbc6.jar"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="lib" path="jxl.jar"/>
|
||||||
|
<classpathentry kind="lib" path="poi-3.7-20101029.jar"/>
|
||||||
|
<classpathentry kind="lib" path="poi-examples-3.7-20101029.jar"/>
|
||||||
|
<classpathentry kind="lib" path="poi-ooxml-3.7-20101029.jar"/>
|
||||||
|
<classpathentry kind="lib" path="poi-ooxml-schemas-3.7-20101029.jar"/>
|
||||||
|
<classpathentry kind="lib" path="xmlbeans-2.3.0.jar"/>
|
||||||
|
<classpathentry kind="lib" path="dom4j-1.6.1.jar"/>
|
||||||
|
<classpathentry kind="output" path="classes"/>
|
||||||
|
</classpath>
|
@ -0,0 +1,8 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxBlameSettings">
|
||||||
|
<option name="version" value="2" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ASMSmaliIdeaPluginConfiguration">
|
||||||
|
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
|
||||||
|
<groovy codeStyle="LEGACY" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="openjdk-22" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/classes" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>TCImportHistoryDatas</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.pde.PluginNature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
@ -0,0 +1,3 @@
|
|||||||
|
#Tue May 18 15:00:24 CST 2010
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=GBK
|
@ -0,0 +1,7 @@
|
|||||||
|
#Tue May 18 15:00:09 CST 2010
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.5
|
@ -0,0 +1,239 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-ManifestVersion: 2
|
||||||
|
Bundle-Name: TCImportHistoryDatas Plug-in
|
||||||
|
Bundle-SymbolicName: TCImportHistoryDatas;singleton:=true
|
||||||
|
Bundle-Version: 1.0.0
|
||||||
|
Bundle-Activator: tcimporthistorydatas.Activator
|
||||||
|
Require-Bundle: org.eclipse.ui;bundle-version="3.8.0",
|
||||||
|
org.eclipse.core.runtime;bundle-version="3.8.0",
|
||||||
|
com.teamcenter.rac.kernel;bundle-version="8000.3.0",
|
||||||
|
com.teamcenter.rac.tcapps;bundle-version="8000.3.0",
|
||||||
|
com.teamcenter.rac.util;bundle-version="8000.3.0",
|
||||||
|
com.teamcenter.rac.aifrcp;bundle-version="8000.3.0",
|
||||||
|
com.teamcenter.rac.common;bundle-version="8000.3.0"
|
||||||
|
Bundle-ActivationPolicy: lazy
|
||||||
|
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||||
|
Export-Package: com.connor.dev.imp,
|
||||||
|
com.connor.dev.imp.bom,
|
||||||
|
com.connor.dev.imp.ob,
|
||||||
|
com.connor.dev.imp.re,
|
||||||
|
com.connor.dev.imp.solution.handler,
|
||||||
|
com.connor.dev.imp.toolkit,
|
||||||
|
common,
|
||||||
|
common.log,
|
||||||
|
jxl,
|
||||||
|
jxl.biff,
|
||||||
|
jxl.biff.drawing,
|
||||||
|
jxl.biff.formula,
|
||||||
|
jxl.demo,
|
||||||
|
jxl.format,
|
||||||
|
jxl.read.biff,
|
||||||
|
jxl.write,
|
||||||
|
jxl.write.biff,
|
||||||
|
org.apache.log4j,
|
||||||
|
org.apache.log4j.chainsaw,
|
||||||
|
org.apache.log4j.config,
|
||||||
|
org.apache.log4j.helpers,
|
||||||
|
org.apache.log4j.jdbc,
|
||||||
|
org.apache.log4j.jmx,
|
||||||
|
org.apache.log4j.lf5,
|
||||||
|
org.apache.log4j.lf5.util,
|
||||||
|
org.apache.log4j.lf5.viewer,
|
||||||
|
org.apache.log4j.lf5.viewer.categoryexplorer,
|
||||||
|
org.apache.log4j.lf5.viewer.configure,
|
||||||
|
org.apache.log4j.net,
|
||||||
|
org.apache.log4j.nt,
|
||||||
|
org.apache.log4j.or,
|
||||||
|
org.apache.log4j.or.sax,
|
||||||
|
org.apache.log4j.spi,
|
||||||
|
org.apache.log4j.varia,
|
||||||
|
org.apache.log4j.xml,
|
||||||
|
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.examples,
|
||||||
|
org.apache.poi.hpsf.extractor,
|
||||||
|
org.apache.poi.hpsf.wellknown,
|
||||||
|
org.apache.poi.hslf.examples,
|
||||||
|
org.apache.poi.hsmf.examples,
|
||||||
|
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.eventusermodel.examples,
|
||||||
|
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.constant,
|
||||||
|
org.apache.poi.hssf.record.cont,
|
||||||
|
org.apache.poi.hssf.record.crypto,
|
||||||
|
org.apache.poi.hssf.record.formula,
|
||||||
|
org.apache.poi.hssf.record.formula.atp,
|
||||||
|
org.apache.poi.hssf.record.formula.eval,
|
||||||
|
org.apache.poi.hssf.record.formula.function,
|
||||||
|
org.apache.poi.hssf.record.formula.functions,
|
||||||
|
org.apache.poi.hssf.record.formula.udf,
|
||||||
|
org.apache.poi.hssf.record.pivottable,
|
||||||
|
org.apache.poi.hssf.usermodel,
|
||||||
|
org.apache.poi.hssf.usermodel.examples,
|
||||||
|
org.apache.poi.hssf.util,
|
||||||
|
org.apache.poi.hssf.view,
|
||||||
|
org.apache.poi.hssf.view.brush,
|
||||||
|
org.apache.poi.hwpf,
|
||||||
|
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.poibrowser,
|
||||||
|
org.apache.poi.poifs.property,
|
||||||
|
org.apache.poi.poifs.storage,
|
||||||
|
org.apache.poi.ss,
|
||||||
|
org.apache.poi.ss.examples,
|
||||||
|
org.apache.poi.ss.examples.html,
|
||||||
|
org.apache.poi.ss.extractor,
|
||||||
|
org.apache.poi.ss.format,
|
||||||
|
org.apache.poi.ss.formula,
|
||||||
|
org.apache.poi.ss.formula.eval,
|
||||||
|
org.apache.poi.ss.formula.eval.forked,
|
||||||
|
org.apache.poi.ss.usermodel,
|
||||||
|
org.apache.poi.ss.util,
|
||||||
|
org.apache.poi.util,
|
||||||
|
org.apache.poi.xslf,
|
||||||
|
org.apache.poi.xslf.extractor,
|
||||||
|
org.apache.poi.xslf.usermodel,
|
||||||
|
org.apache.poi.xssf.dev,
|
||||||
|
org.apache.poi.xssf.eventusermodel,
|
||||||
|
org.apache.poi.xssf.eventusermodel.examples,
|
||||||
|
org.apache.poi.xssf.extractor,
|
||||||
|
org.apache.poi.xssf.model,
|
||||||
|
org.apache.poi.xssf.usermodel,
|
||||||
|
org.apache.poi.xssf.usermodel.examples,
|
||||||
|
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.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.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,
|
||||||
|
tcimporthistorydatas
|
||||||
|
Bundle-ClassPath: jxl.jar,
|
||||||
|
.,
|
||||||
|
log4j.jar,
|
||||||
|
poi-3.7-20101029.jar,
|
||||||
|
poi-examples-3.7-20101029.jar,
|
||||||
|
poi-ooxml-3.7-20101029.jar,
|
||||||
|
poi-ooxml-schemas-3.7-20101029.jar,
|
||||||
|
xmlbeans-2.3.0.jar,
|
||||||
|
dom4j-1.6.1.jar,
|
||||||
|
ojdbc6.jar
|
@ -0,0 +1,14 @@
|
|||||||
|
source.. = src/
|
||||||
|
output.. = classes/
|
||||||
|
bin.includes = META-INF/,\
|
||||||
|
.,\
|
||||||
|
plugin.xml,\
|
||||||
|
jxl.jar,\
|
||||||
|
log4j.jar,\
|
||||||
|
poi-3.7-20101029.jar,\
|
||||||
|
poi-examples-3.7-20101029.jar,\
|
||||||
|
poi-ooxml-3.7-20101029.jar,\
|
||||||
|
poi-ooxml-schemas-3.7-20101029.jar,\
|
||||||
|
xmlbeans-2.3.0.jar,\
|
||||||
|
dom4j-1.6.1.jar,\
|
||||||
|
ojdbc6.jar
|
After Width: | Height: | Size: 866 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 703 B |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 138 B |
After Width: | Height: | Size: 969 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 759 B |
After Width: | Height: | Size: 848 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 138 B |
After Width: | Height: | Size: 769 B |
After Width: | Height: | Size: 849 B |
@ -0,0 +1,121 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse version="3.2"?>
|
||||||
|
<plugin>
|
||||||
|
<extension point="org.eclipse.ui.menus">
|
||||||
|
<menuContribution locationURI="menu:org.eclipse.ui.main.menu">
|
||||||
|
<menu id="ImportCustomization" label="历史数据导入">
|
||||||
|
<separator name="newCustomizationStart" visible="true"> </separator>
|
||||||
|
<separator name="newCustomizationEnd" visible="true"></separator>
|
||||||
|
<visibleWhen
|
||||||
|
checkEnabled="true">
|
||||||
|
<reference
|
||||||
|
definitionId="com.teamcenter.rac.ui.inMainPerspective">
|
||||||
|
</reference>
|
||||||
|
</visibleWhen>
|
||||||
|
</menu>
|
||||||
|
</menuContribution>
|
||||||
|
<menuContribution locationURI="menu:ImportCustomization?after=newCustomizationStart">
|
||||||
|
<command commandId="com.teamcenter.rac.ui.ImportObjectsCommand" id="com.teamcenter.rac.ui.ImportObjectsCommand" label="导入对象" style="push">
|
||||||
|
<visibleWhen>
|
||||||
|
<with variable="rac_command_suppression">
|
||||||
|
<not>
|
||||||
|
<iterate operator="or">
|
||||||
|
<equals value="com.teamcenter.rac.ui.ImportObjectsCommand"/>
|
||||||
|
</iterate>
|
||||||
|
</not>
|
||||||
|
</with>
|
||||||
|
</visibleWhen>
|
||||||
|
</command>
|
||||||
|
<command commandId="com.teamcenter.rac.ui.ImportBomsCommand" id="com.teamcenter.rac.ui.ImportBomsCommand" label="BOM导入" style="push">
|
||||||
|
<visibleWhen>
|
||||||
|
<with variable="rac_command_suppression">
|
||||||
|
<not>
|
||||||
|
<iterate operator="or">
|
||||||
|
<equals value="com.teamcenter.rac.ui.ImportBomsCommand"/>
|
||||||
|
</iterate>
|
||||||
|
</not>
|
||||||
|
</with>
|
||||||
|
</visibleWhen>
|
||||||
|
</command>
|
||||||
|
<!-->
|
||||||
|
<command commandId="com.teamcenter.rac.ui.ImportBomsForProECommand" id="com.teamcenter.rac.ui.ImportBomsForProECommand" label="ProE图纸BOM导入" style="push">
|
||||||
|
<visibleWhen>
|
||||||
|
<with variable="rac_command_suppression">
|
||||||
|
<not>
|
||||||
|
<iterate operator="or">
|
||||||
|
<equals value="com.teamcenter.rac.ui.ImportBomsForProECommand"/>
|
||||||
|
</iterate>
|
||||||
|
</not>
|
||||||
|
</with>
|
||||||
|
</visibleWhen>
|
||||||
|
</command>
|
||||||
|
<!-->
|
||||||
|
<command commandId="com.teamcenter.rac.ui.ImportRelationsCommand" id="com.teamcenter.rac.ui.ImportRelationsCommand" label="导入关系" style="push">
|
||||||
|
<visibleWhen>
|
||||||
|
<with variable="rac_command_suppression">
|
||||||
|
<not>
|
||||||
|
<iterate operator="or">
|
||||||
|
<equals value="com.teamcenter.rac.ui.ImportRelationsCommand"/>
|
||||||
|
</iterate>
|
||||||
|
</not>
|
||||||
|
</with>
|
||||||
|
|
||||||
|
</visibleWhen>
|
||||||
|
</command>
|
||||||
|
|
||||||
|
|
||||||
|
<command commandId="importClassification" id="com.teamcenter.rac.ui.importClassification" label="导入分类" style="push">
|
||||||
|
<visibleWhen>
|
||||||
|
<with variable="rac_command_suppression">
|
||||||
|
<not>
|
||||||
|
<iterate operator="or">
|
||||||
|
<equals value="importClassification"/>
|
||||||
|
</iterate>
|
||||||
|
</not>
|
||||||
|
</with>
|
||||||
|
|
||||||
|
</visibleWhen>
|
||||||
|
</command>
|
||||||
|
<command commandId="importProject" id="com.teamcenter.rac.ui.importProject" label="导入项目" style="push">
|
||||||
|
<visibleWhen>
|
||||||
|
<with variable="rac_command_suppression">
|
||||||
|
<not>
|
||||||
|
<iterate operator="or">
|
||||||
|
<equals value="importProject"/>
|
||||||
|
</iterate>
|
||||||
|
</not>
|
||||||
|
</with>
|
||||||
|
|
||||||
|
</visibleWhen>
|
||||||
|
</command>
|
||||||
|
|
||||||
|
</menuContribution>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension point="org.eclipse.ui.commands">
|
||||||
|
<command id="com.teamcenter.rac.ui.ImportObjectsCommand" name="导入对象"> </command>
|
||||||
|
<command id="com.teamcenter.rac.ui.ImportBomsCommand" name="BOM导入"> </command>
|
||||||
|
<!-->
|
||||||
|
<command id="com.teamcenter.rac.ui.ImportBomsCommand" name="非ProE数据BOM导入"> </command>
|
||||||
|
<!-->
|
||||||
|
<!---->
|
||||||
|
<!-->
|
||||||
|
<command id="com.teamcenter.rac.ui.ImportBomsForProECommand" name="ProE图纸BOM导入"> </command>
|
||||||
|
<!-->
|
||||||
|
<!---->
|
||||||
|
<command id="com.teamcenter.rac.ui.ImportRelationsCommand" name="导入关系"> </command>
|
||||||
|
<command id="importClassification" name="导入分类"> </command>
|
||||||
|
<command id="importProject" name="导入项目"> </command>
|
||||||
|
<command id="Importtest" name="test"> </command>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
<extension point="org.eclipse.ui.handlers">
|
||||||
|
<handler class="com.connor.dev.imp.solution.handler.ImportObjectsHandler" commandId="com.teamcenter.rac.ui.ImportObjectsCommand"></handler>
|
||||||
|
<handler class="com.connor.dev.imp.solution.handler.ImportBOMsHandler" commandId="com.teamcenter.rac.ui.ImportBomsCommand"> </handler>
|
||||||
|
<handler class="com.connor.dev.imp.solution.handler.ImportRelationHandler" commandId="com.teamcenter.rac.ui.ImportRelationsCommand"> </handler>
|
||||||
|
<handler class="com.connor.dev.imp.solution.handler.ImportClassificationHandler" commandId="importClassification"> </handler>
|
||||||
|
<handler class="com.connor.dev.imp.solution.handler.ImportProjectHandler" commandId="importProject"> </handler>
|
||||||
|
<handler class="com.connor.dev.test.ImporttestHandler" commandId="Importtest"> </handler>
|
||||||
|
</extension>
|
||||||
|
|
||||||
|
</plugin>
|
@ -0,0 +1,110 @@
|
|||||||
|
package com.connor.dev.imp;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public abstract class ImportSettings implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private boolean saved;
|
||||||
|
|
||||||
|
private int columns;
|
||||||
|
|
||||||
|
private String dateFormat;
|
||||||
|
|
||||||
|
//private String arraySeparator;
|
||||||
|
|
||||||
|
public boolean save(File file)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileOutputStream fos = new FileOutputStream(file);
|
||||||
|
ObjectOutputStream oos = new ObjectOutputStream(fos);
|
||||||
|
oos.writeObject(this);
|
||||||
|
oos.flush();
|
||||||
|
oos.close();
|
||||||
|
|
||||||
|
saved = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (IOException ioe)
|
||||||
|
{
|
||||||
|
ioe.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImportSettings load(File file)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileInputStream fis = new FileInputStream(file);
|
||||||
|
ObjectInputStream ois = new ObjectInputStream(fis);
|
||||||
|
Object o = ois.readObject();
|
||||||
|
|
||||||
|
ois.close();
|
||||||
|
fis.close();
|
||||||
|
|
||||||
|
saved = false;
|
||||||
|
|
||||||
|
if (o instanceof ImportSettings)
|
||||||
|
{
|
||||||
|
return (ImportSettings) o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSaved(boolean saved)
|
||||||
|
{
|
||||||
|
this.saved = saved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSaved()
|
||||||
|
{
|
||||||
|
return saved;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumns(int columns)
|
||||||
|
{
|
||||||
|
this.columns = columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColumns()
|
||||||
|
{
|
||||||
|
return columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDateFormat()
|
||||||
|
{
|
||||||
|
return dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDateFormat(String dateFormat)
|
||||||
|
{
|
||||||
|
this.dateFormat = dateFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public String getArraySeparator()
|
||||||
|
// {
|
||||||
|
// return arraySeparator;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void setArraySeparator(String arraySeparator)
|
||||||
|
// {
|
||||||
|
// this.arraySeparator = arraySeparator;
|
||||||
|
// }
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.connor.dev.imp;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class MappingAttribute implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private int columnIndex;
|
||||||
|
|
||||||
|
private String columnTitle;
|
||||||
|
|
||||||
|
private String tcAttribute;
|
||||||
|
|
||||||
|
public MappingAttribute(int columnIndex, String columnTitle, String tcAttribute)
|
||||||
|
{
|
||||||
|
this.columnIndex = columnIndex;
|
||||||
|
this.columnTitle = columnTitle;
|
||||||
|
this.tcAttribute = tcAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getColumnIndex()
|
||||||
|
{
|
||||||
|
return columnIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnIndex(int columnIndex)
|
||||||
|
{
|
||||||
|
this.columnIndex = columnIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnTitle()
|
||||||
|
{
|
||||||
|
return columnTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnTitle(String columnTitle)
|
||||||
|
{
|
||||||
|
this.columnTitle = columnTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTcAttribute()
|
||||||
|
{
|
||||||
|
return tcAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTcAttribute(String tcAttribute)
|
||||||
|
{
|
||||||
|
this.tcAttribute = tcAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean equals(Object obj)
|
||||||
|
{
|
||||||
|
if (!(obj instanceof MappingAttribute))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MappingAttribute at = (MappingAttribute) obj;
|
||||||
|
return tcAttribute.equals(at.tcAttribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return "(" + columnIndex + ")" + columnTitle + " => " + tcAttribute;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
package com.connor.dev.imp.bom;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.connor.dev.imp.ImportSettings;
|
||||||
|
import com.connor.dev.imp.MappingAttribute;
|
||||||
|
|
||||||
|
public class BomsImportSettings extends ImportSettings implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private MappingAttribute parentMapping;
|
||||||
|
|
||||||
|
private MappingAttribute parentRevMapping;
|
||||||
|
|
||||||
|
private MappingAttribute childMapping;
|
||||||
|
|
||||||
|
private MappingAttribute childRevMapping;
|
||||||
|
|
||||||
|
private MappingAttribute[] bomLineMapping;
|
||||||
|
|
||||||
|
public MappingAttribute getParentMapping()
|
||||||
|
{
|
||||||
|
return parentMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentMapping(MappingAttribute parentMapping)
|
||||||
|
{
|
||||||
|
this.parentMapping = parentMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MappingAttribute getParentRevMapping()
|
||||||
|
{
|
||||||
|
return parentRevMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentRevMapping(MappingAttribute parentRevMapping)
|
||||||
|
{
|
||||||
|
this.parentRevMapping = parentRevMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MappingAttribute getChildMapping()
|
||||||
|
{
|
||||||
|
return childMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildMapping(MappingAttribute childMapping)
|
||||||
|
{
|
||||||
|
this.childMapping = childMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MappingAttribute getChildRevMapping()
|
||||||
|
{
|
||||||
|
return childRevMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildRevMapping(MappingAttribute childRevMapping)
|
||||||
|
{
|
||||||
|
this.childRevMapping = childRevMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBomLineMapping(MappingAttribute[] bomLineMapping)
|
||||||
|
{
|
||||||
|
this.bomLineMapping = bomLineMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MappingAttribute[] getBomLineMapping()
|
||||||
|
{
|
||||||
|
return bomLineMapping;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.connor.dev.imp.bom;
|
||||||
|
|
||||||
|
|
||||||
|
import com.connor.dev.imp.AbstractImportCommand;
|
||||||
|
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
|
||||||
|
|
||||||
|
public class ImportBomsCommand extends AbstractImportCommand
|
||||||
|
{
|
||||||
|
public ImportBomsCommand(AbstractAIFUIApplication application)
|
||||||
|
{
|
||||||
|
super(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void importHistoryDatas()
|
||||||
|
{
|
||||||
|
ImportBomsDialog dialog = new ImportBomsDialog(session, "µ¼ÈëBOM");
|
||||||
|
setRunnable(dialog);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,339 @@
|
|||||||
|
package com.connor.dev.imp.bom;
|
||||||
|
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.swing.DefaultListModel;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JList;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.ListSelectionModel;
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
|
||||||
|
import com.connor.dev.imp.AbstractImportDialog;
|
||||||
|
import com.connor.dev.imp.ImportSettings;
|
||||||
|
import com.connor.dev.imp.MappingAttribute;
|
||||||
|
import com.connor.dev.imp.ob.MappingButton;
|
||||||
|
import com.teamcenter.rac.aif.AIFDesktop;
|
||||||
|
import com.teamcenter.rac.kernel.TCComponentType;
|
||||||
|
import com.teamcenter.rac.kernel.TCException;
|
||||||
|
import com.teamcenter.rac.kernel.TCPropertyDescriptor;
|
||||||
|
import com.teamcenter.rac.kernel.TCSession;
|
||||||
|
import com.teamcenter.rac.kernel.TCTypeService;
|
||||||
|
import com.teamcenter.rac.util.MessageBox;
|
||||||
|
|
||||||
|
public class ImportBomsDialog extends AbstractImportDialog
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private MappingButton parent;
|
||||||
|
|
||||||
|
private MappingButton child;
|
||||||
|
|
||||||
|
private MappingButton parentRev;
|
||||||
|
|
||||||
|
private MappingButton childRev;
|
||||||
|
|
||||||
|
public ImportBomsDialog(TCSession session, String title)
|
||||||
|
{
|
||||||
|
super(session, title, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#initializeUI()
|
||||||
|
*/
|
||||||
|
protected void initializeUI()
|
||||||
|
{
|
||||||
|
super.initializeUI();
|
||||||
|
|
||||||
|
propertiesList = new JList[1];
|
||||||
|
propertiesListModels = new DefaultListModel[1];
|
||||||
|
mappingListModels = new DefaultListModel[1];
|
||||||
|
mappingList = new JList[1];
|
||||||
|
|
||||||
|
for (int i = 0; i < propertiesList.length; i++)
|
||||||
|
{
|
||||||
|
propertiesListModels[i] = new DefaultListModel();
|
||||||
|
propertiesList[i] = new JList(propertiesListModels[i]);
|
||||||
|
propertiesList[i].setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
propertiesList[i].setVisibleRowCount(20);
|
||||||
|
mappingListModels[i] = new DefaultListModel();
|
||||||
|
mappingList[i] = new JList(mappingListModels[i]);
|
||||||
|
mappingList[i].setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = new MappingButton("Parent ID");
|
||||||
|
child = new MappingButton("Child ID");
|
||||||
|
parentRev = new MappingButton("Parent Revision ID");
|
||||||
|
childRev = new MappingButton("Child Revision ID");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#registerActionComponents()
|
||||||
|
*/
|
||||||
|
protected void registerActionComponents()
|
||||||
|
{
|
||||||
|
super.registerActionComponents();
|
||||||
|
|
||||||
|
parent.addActionListener(this);
|
||||||
|
child.addActionListener(this);
|
||||||
|
parentRev.addActionListener(this);
|
||||||
|
childRev.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#setComponentsTextProperty()
|
||||||
|
*/
|
||||||
|
protected void setComponentsTextProperty()
|
||||||
|
{
|
||||||
|
super.setComponentsTextProperty();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TCTypeService service = session.getTypeService();
|
||||||
|
TCComponentType type = service.getTypeComponent("BOMLine");
|
||||||
|
TCPropertyDescriptor descriptor[] = type.getPropertyDescriptors();
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
for (int i = 0; i < descriptor.length; i++)
|
||||||
|
{
|
||||||
|
if (descriptor[i].isModifiable() && !descriptor[i].toString().equals("bl_pack_count"))
|
||||||
|
{
|
||||||
|
list.add(descriptor[i].getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.sort(list);
|
||||||
|
for (String str : list)
|
||||||
|
{
|
||||||
|
propertiesListModels[0].addElement(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (TCException te)
|
||||||
|
{
|
||||||
|
te.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#addTabbedPaneComponents()
|
||||||
|
*/
|
||||||
|
protected void addTabbedPaneComponents()
|
||||||
|
{
|
||||||
|
String[] titles = new String[] { "BOMLine" };
|
||||||
|
for (int i = 0; i < propertiesList.length; i++)
|
||||||
|
{
|
||||||
|
JPanel panel = new JPanel(new GridLayout());
|
||||||
|
panel.add(new JScrollPane(propertiesList[i]));
|
||||||
|
panel.add(new JScrollPane(mappingList[i]));
|
||||||
|
rightPane.addTab(titles[i], panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
rightPane.addTab("参数", getParameterPanel());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||||
|
*/
|
||||||
|
public void actionPerformed(ActionEvent ae)
|
||||||
|
{
|
||||||
|
if (ae.getSource() instanceof MappingButton)
|
||||||
|
{
|
||||||
|
assignMappingAttribute((MappingButton) ae.getSource());
|
||||||
|
}
|
||||||
|
else if (ae.getSource() == unlock)
|
||||||
|
{
|
||||||
|
parent.setEnabled(true);
|
||||||
|
child.setEnabled(true);
|
||||||
|
parentRev.setEnabled(true);
|
||||||
|
childRev.setEnabled(true);
|
||||||
|
|
||||||
|
super.actionPerformed(ae);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
super.actionPerformed(ae);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assignMappingAttribute(MappingButton button)
|
||||||
|
{
|
||||||
|
if (excelList.getSelectedIndex() == -1)
|
||||||
|
{
|
||||||
|
MessageBox.post(AIFDesktop.getActiveDesktop().getShell(), "请先在左边选择对应的一行数据再指定关系", "警告", 1);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String excel = excelList.getSelectedValue().toString();
|
||||||
|
int index = excelList.getSelectedIndex();
|
||||||
|
|
||||||
|
MappingAttribute ma = new MappingAttribute(index, excel, button.getPropertyName());
|
||||||
|
button.setMappingAttribute(ma);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
|
||||||
|
*/
|
||||||
|
public void stateChanged(ChangeEvent changeevent)
|
||||||
|
{
|
||||||
|
int index = rightPane.getSelectedIndex();
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
add.setEnabled(false);
|
||||||
|
remove.setEnabled(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkMappingsEditable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#openImportSettings()
|
||||||
|
*/
|
||||||
|
protected void openImportSettings()
|
||||||
|
{
|
||||||
|
if (chooser.showOpenDialog(null) == 0)
|
||||||
|
{
|
||||||
|
BomsImportSettings bis = new BomsImportSettings();
|
||||||
|
ImportSettings is = bis.load(chooser.getSelectedFile());
|
||||||
|
|
||||||
|
if (is == null)
|
||||||
|
{
|
||||||
|
MessageBox.post(AIFDesktop.getActiveDesktop().getShell(), "从文件中加载配置失败.", "错误", 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is instanceof BomsImportSettings)
|
||||||
|
{
|
||||||
|
bis = (BomsImportSettings) is;
|
||||||
|
|
||||||
|
// arraySepField.setText(bis.getArraySeparator());
|
||||||
|
|
||||||
|
for (int i = 0; i < mappingListModels.length; i++)
|
||||||
|
{
|
||||||
|
mappingListModels[i].removeAllElements();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < bis.getBomLineMapping().length; i++)
|
||||||
|
{
|
||||||
|
mappingListModels[0].addElement(bis.getBomLineMapping()[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.setMappingAttribute(bis.getParentMapping());
|
||||||
|
child.setMappingAttribute(bis.getChildMapping());
|
||||||
|
parentRev.setMappingAttribute(bis.getParentRevMapping());
|
||||||
|
childRev.setMappingAttribute(bis.getChildRevMapping());
|
||||||
|
|
||||||
|
excelList.setEnabled(false);
|
||||||
|
for (int i = 0; i < propertiesList.length; i++)
|
||||||
|
{
|
||||||
|
propertiesList[i].setEnabled(false);
|
||||||
|
mappingList[i].setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.setEnabled(false);
|
||||||
|
child.setEnabled(false);
|
||||||
|
parentRev.setEnabled(false);
|
||||||
|
childRev.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#saveImportSettings()
|
||||||
|
*/
|
||||||
|
protected void saveImportSettings()
|
||||||
|
{
|
||||||
|
BomsImportSettings bis = generateImportSettings();
|
||||||
|
|
||||||
|
if (chooser.showSaveDialog(null) == 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileOutputStream fileoutputstream = new FileOutputStream(chooser.getSelectedFile());
|
||||||
|
ObjectOutputStream objectoutputstream = new ObjectOutputStream(fileoutputstream);
|
||||||
|
objectoutputstream.writeObject(bis);
|
||||||
|
objectoutputstream.flush();
|
||||||
|
objectoutputstream.close();
|
||||||
|
}
|
||||||
|
catch (IOException ioe)
|
||||||
|
{
|
||||||
|
ioe.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.post(AIFDesktop.getActiveDesktop().getShell(), "配置已经被成功保存在\n"
|
||||||
|
+ chooser.getSelectedFile().getAbsolutePath(), "成功", 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#generateImportSettings()
|
||||||
|
*/
|
||||||
|
public BomsImportSettings generateImportSettings()
|
||||||
|
{
|
||||||
|
BomsImportSettings bis = new BomsImportSettings();
|
||||||
|
|
||||||
|
MappingAttribute[] itemMapping = new MappingAttribute[mappingListModels[0].size()];
|
||||||
|
System.arraycopy(mappingListModels[0].toArray(), 0, itemMapping, 0, itemMapping.length);
|
||||||
|
bis.setBomLineMapping(itemMapping);
|
||||||
|
|
||||||
|
bis.setChildMapping(child.getMappingAttribute());
|
||||||
|
bis.setChildRevMapping(childRev.getMappingAttribute());
|
||||||
|
bis.setParentMapping(parent.getMappingAttribute());
|
||||||
|
bis.setParentRevMapping(parentRev.getMappingAttribute());
|
||||||
|
|
||||||
|
bis.setColumns(excelList.getModel().getSize());
|
||||||
|
|
||||||
|
// bis.setArraySeparator(arraySepField.getText().trim());
|
||||||
|
bis.setDateFormat(dateFormatField.getText().trim());
|
||||||
|
|
||||||
|
return bis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#getParameterPanel()
|
||||||
|
*/
|
||||||
|
protected JPanel getParameterPanel()
|
||||||
|
{
|
||||||
|
JPanel p = super.getParameterPanel();
|
||||||
|
|
||||||
|
p.add("2.1.right.top.preferred.preferred", new JLabel("Parent ID :"));
|
||||||
|
p.add("2.2.left.top.preferred.preferred", parent);
|
||||||
|
p.add("3.1.right.top.preferred.preferred", new JLabel("Parent Revision ID :"));
|
||||||
|
p.add("3.2.left.top.preferred.preferred", parentRev);
|
||||||
|
|
||||||
|
p.add("4.1.right.top.preferred.preferred", new JLabel("Child ID :"));
|
||||||
|
p.add("4.2.left.top.preferred.preferred", child);
|
||||||
|
p.add("5.1.right.top.preferred.preferred", new JLabel("Child Revision ID :"));
|
||||||
|
p.add("5.2.left.top.preferred.preferred", childRev);
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.connor.dev.imp.bom;
|
||||||
|
|
||||||
|
|
||||||
|
import com.connor.dev.imp.AbstractImportCommand;
|
||||||
|
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
|
||||||
|
|
||||||
|
public class ImportBomsForProECommand extends AbstractImportCommand
|
||||||
|
{
|
||||||
|
public ImportBomsForProECommand(AbstractAIFUIApplication application)
|
||||||
|
{
|
||||||
|
super(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void importHistoryDatas()
|
||||||
|
{
|
||||||
|
ImportBomsForProEDialog dialog = new ImportBomsForProEDialog(session, "µ¼ÈëBOM");
|
||||||
|
setRunnable(dialog);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,340 @@
|
|||||||
|
package com.connor.dev.imp.bom;
|
||||||
|
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.ObjectOutputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.swing.DefaultListModel;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JList;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.ListSelectionModel;
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
|
||||||
|
import com.connor.dev.imp.AbstractImportDialog;
|
||||||
|
import com.connor.dev.imp.AbstractImportForProEDialog;
|
||||||
|
import com.connor.dev.imp.ImportSettings;
|
||||||
|
import com.connor.dev.imp.MappingAttribute;
|
||||||
|
import com.connor.dev.imp.ob.MappingButton;
|
||||||
|
import com.teamcenter.rac.aif.AIFDesktop;
|
||||||
|
import com.teamcenter.rac.kernel.TCComponentType;
|
||||||
|
import com.teamcenter.rac.kernel.TCException;
|
||||||
|
import com.teamcenter.rac.kernel.TCPropertyDescriptor;
|
||||||
|
import com.teamcenter.rac.kernel.TCSession;
|
||||||
|
import com.teamcenter.rac.kernel.TCTypeService;
|
||||||
|
import com.teamcenter.rac.util.MessageBox;
|
||||||
|
|
||||||
|
public class ImportBomsForProEDialog extends AbstractImportForProEDialog
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private MappingButton parent;
|
||||||
|
|
||||||
|
private MappingButton child;
|
||||||
|
|
||||||
|
private MappingButton parentRev;
|
||||||
|
|
||||||
|
private MappingButton childRev;
|
||||||
|
|
||||||
|
public ImportBomsForProEDialog(TCSession session, String title)
|
||||||
|
{
|
||||||
|
super(session, title, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#initializeUI()
|
||||||
|
*/
|
||||||
|
protected void initializeUI()
|
||||||
|
{
|
||||||
|
super.initializeUI();
|
||||||
|
|
||||||
|
propertiesList = new JList[1];
|
||||||
|
propertiesListModels = new DefaultListModel[1];
|
||||||
|
mappingListModels = new DefaultListModel[1];
|
||||||
|
mappingList = new JList[1];
|
||||||
|
|
||||||
|
for (int i = 0; i < propertiesList.length; i++)
|
||||||
|
{
|
||||||
|
propertiesListModels[i] = new DefaultListModel();
|
||||||
|
propertiesList[i] = new JList(propertiesListModels[i]);
|
||||||
|
propertiesList[i].setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
propertiesList[i].setVisibleRowCount(20);
|
||||||
|
mappingListModels[i] = new DefaultListModel();
|
||||||
|
mappingList[i] = new JList(mappingListModels[i]);
|
||||||
|
mappingList[i].setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = new MappingButton("Parent ID");
|
||||||
|
child = new MappingButton("Child ID");
|
||||||
|
parentRev = new MappingButton("Parent Revision ID");
|
||||||
|
childRev = new MappingButton("Child Revision ID");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#registerActionComponents()
|
||||||
|
*/
|
||||||
|
protected void registerActionComponents()
|
||||||
|
{
|
||||||
|
super.registerActionComponents();
|
||||||
|
|
||||||
|
parent.addActionListener(this);
|
||||||
|
child.addActionListener(this);
|
||||||
|
parentRev.addActionListener(this);
|
||||||
|
childRev.addActionListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#setComponentsTextProperty()
|
||||||
|
*/
|
||||||
|
protected void setComponentsTextProperty()
|
||||||
|
{
|
||||||
|
super.setComponentsTextProperty();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
TCTypeService service = session.getTypeService();
|
||||||
|
TCComponentType type = service.getTypeComponent("BOMLine");
|
||||||
|
TCPropertyDescriptor descriptor[] = type.getPropertyDescriptors();
|
||||||
|
List<String> list = new ArrayList<String>();
|
||||||
|
for (int i = 0; i < descriptor.length; i++)
|
||||||
|
{
|
||||||
|
if (descriptor[i].isModifiable() && !descriptor[i].toString().equals("bl_pack_count"))
|
||||||
|
{
|
||||||
|
list.add(descriptor[i].getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.sort(list);
|
||||||
|
for (String str : list)
|
||||||
|
{
|
||||||
|
propertiesListModels[0].addElement(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (TCException te)
|
||||||
|
{
|
||||||
|
te.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#addTabbedPaneComponents()
|
||||||
|
*/
|
||||||
|
protected void addTabbedPaneComponents()
|
||||||
|
{
|
||||||
|
String[] titles = new String[] { "BOMLine" };
|
||||||
|
for (int i = 0; i < propertiesList.length; i++)
|
||||||
|
{
|
||||||
|
JPanel panel = new JPanel(new GridLayout());
|
||||||
|
panel.add(new JScrollPane(propertiesList[i]));
|
||||||
|
panel.add(new JScrollPane(mappingList[i]));
|
||||||
|
rightPane.addTab(titles[i], panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
rightPane.addTab("参数", getParameterPanel());
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
|
||||||
|
*/
|
||||||
|
public void actionPerformed(ActionEvent ae)
|
||||||
|
{
|
||||||
|
if (ae.getSource() instanceof MappingButton)
|
||||||
|
{
|
||||||
|
assignMappingAttribute((MappingButton) ae.getSource());
|
||||||
|
}
|
||||||
|
else if (ae.getSource() == unlock)
|
||||||
|
{
|
||||||
|
parent.setEnabled(true);
|
||||||
|
child.setEnabled(true);
|
||||||
|
parentRev.setEnabled(true);
|
||||||
|
childRev.setEnabled(true);
|
||||||
|
|
||||||
|
super.actionPerformed(ae);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
super.actionPerformed(ae);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assignMappingAttribute(MappingButton button)
|
||||||
|
{
|
||||||
|
if (excelList.getSelectedIndex() == -1)
|
||||||
|
{
|
||||||
|
MessageBox.post(AIFDesktop.getActiveDesktop().getShell(), "请先在左边选择对应的一行数据再指定关系", "警告", 1);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String excel = excelList.getSelectedValue().toString();
|
||||||
|
int index = excelList.getSelectedIndex();
|
||||||
|
|
||||||
|
MappingAttribute ma = new MappingAttribute(index, excel, button.getPropertyName());
|
||||||
|
button.setMappingAttribute(ma);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
|
||||||
|
*/
|
||||||
|
public void stateChanged(ChangeEvent changeevent)
|
||||||
|
{
|
||||||
|
int index = rightPane.getSelectedIndex();
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
add.setEnabled(false);
|
||||||
|
remove.setEnabled(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
checkMappingsEditable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#openImportSettings()
|
||||||
|
*/
|
||||||
|
protected void openImportSettings()
|
||||||
|
{
|
||||||
|
if (chooser.showOpenDialog(null) == 0)
|
||||||
|
{
|
||||||
|
BomsImportSettings bis = new BomsImportSettings();
|
||||||
|
ImportSettings is = bis.load(chooser.getSelectedFile());
|
||||||
|
|
||||||
|
if (is == null)
|
||||||
|
{
|
||||||
|
MessageBox.post(AIFDesktop.getActiveDesktop().getShell(), "从文件中加载配置失败.", "错误", 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is instanceof BomsImportSettings)
|
||||||
|
{
|
||||||
|
bis = (BomsImportSettings) is;
|
||||||
|
|
||||||
|
// arraySepField.setText(bis.getArraySeparator());
|
||||||
|
|
||||||
|
for (int i = 0; i < mappingListModels.length; i++)
|
||||||
|
{
|
||||||
|
mappingListModels[i].removeAllElements();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < bis.getBomLineMapping().length; i++)
|
||||||
|
{
|
||||||
|
mappingListModels[0].addElement(bis.getBomLineMapping()[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.setMappingAttribute(bis.getParentMapping());
|
||||||
|
child.setMappingAttribute(bis.getChildMapping());
|
||||||
|
parentRev.setMappingAttribute(bis.getParentRevMapping());
|
||||||
|
childRev.setMappingAttribute(bis.getChildRevMapping());
|
||||||
|
|
||||||
|
excelList.setEnabled(false);
|
||||||
|
for (int i = 0; i < propertiesList.length; i++)
|
||||||
|
{
|
||||||
|
propertiesList[i].setEnabled(false);
|
||||||
|
mappingList[i].setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.setEnabled(false);
|
||||||
|
child.setEnabled(false);
|
||||||
|
parentRev.setEnabled(false);
|
||||||
|
childRev.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#saveImportSettings()
|
||||||
|
*/
|
||||||
|
protected void saveImportSettings()
|
||||||
|
{
|
||||||
|
BomsImportSettings bis = generateImportSettings();
|
||||||
|
|
||||||
|
if (chooser.showSaveDialog(null) == 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FileOutputStream fileoutputstream = new FileOutputStream(chooser.getSelectedFile());
|
||||||
|
ObjectOutputStream objectoutputstream = new ObjectOutputStream(fileoutputstream);
|
||||||
|
objectoutputstream.writeObject(bis);
|
||||||
|
objectoutputstream.flush();
|
||||||
|
objectoutputstream.close();
|
||||||
|
}
|
||||||
|
catch (IOException ioe)
|
||||||
|
{
|
||||||
|
ioe.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBox.post(AIFDesktop.getActiveDesktop().getShell(), "配置已经被成功保存在\n"
|
||||||
|
+ chooser.getSelectedFile().getAbsolutePath(), "成功", MessageBox.INFORMATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#generateImportSettings()
|
||||||
|
*/
|
||||||
|
public BomsImportSettings generateImportSettings()
|
||||||
|
{
|
||||||
|
BomsImportSettings bis = new BomsImportSettings();
|
||||||
|
|
||||||
|
MappingAttribute[] itemMapping = new MappingAttribute[mappingListModels[0].size()];
|
||||||
|
System.arraycopy(mappingListModels[0].toArray(), 0, itemMapping, 0, itemMapping.length);
|
||||||
|
bis.setBomLineMapping(itemMapping);
|
||||||
|
|
||||||
|
bis.setChildMapping(child.getMappingAttribute());
|
||||||
|
bis.setChildRevMapping(childRev.getMappingAttribute());
|
||||||
|
bis.setParentMapping(parent.getMappingAttribute());
|
||||||
|
bis.setParentRevMapping(parentRev.getMappingAttribute());
|
||||||
|
|
||||||
|
bis.setColumns(excelList.getModel().getSize());
|
||||||
|
|
||||||
|
// bis.setArraySeparator(arraySepField.getText().trim());
|
||||||
|
bis.setDateFormat(dateFormatField.getText().trim());
|
||||||
|
|
||||||
|
return bis;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see cn.com.origin.imp.AbstractImportDialog#getParameterPanel()
|
||||||
|
*/
|
||||||
|
protected JPanel getParameterPanel()
|
||||||
|
{
|
||||||
|
JPanel p = super.getParameterPanel();
|
||||||
|
|
||||||
|
p.add("2.1.right.top.preferred.preferred", new JLabel("Parent ID :"));
|
||||||
|
p.add("2.2.left.top.preferred.preferred", parent);
|
||||||
|
p.add("3.1.right.top.preferred.preferred", new JLabel("Parent Revision ID :"));
|
||||||
|
p.add("3.2.left.top.preferred.preferred", parentRev);
|
||||||
|
|
||||||
|
p.add("4.1.right.top.preferred.preferred", new JLabel("Child ID :"));
|
||||||
|
p.add("4.2.left.top.preferred.preferred", child);
|
||||||
|
p.add("5.1.right.top.preferred.preferred", new JLabel("Child Revision ID :"));
|
||||||
|
p.add("5.2.left.top.preferred.preferred", childRev);
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 866 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 396 B |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 703 B |