commit a7634aa66d1f4538183485715e50ff2f8aba64ab Author: xiongcz Date: Thu Apr 10 11:30:01 2025 +0800 美菱自动编码器 diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..6e9b950 --- /dev/null +++ b/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..70fe4c0 --- /dev/null +++ b/.project @@ -0,0 +1,28 @@ + + + cn.com.origin.autocodemanager + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..7341ab1 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +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.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000..920c6b6 --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,49 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Autocodemanager Plug-in +Bundle-SymbolicName: cn.com.origin.autocodemanager;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Activator: cn.com.origin.autocodemanager.Activator +Require-Bundle: org.eclipse.ui;bundle-version="3.8.0", + org.eclipse.core.runtime;bundle-version="3.8.0", + org.eclipse.ui.forms;bundle-version="3.5.200", + org.eclipse.core.expressions;bundle-version="3.4.400", + com.teamcenter.rac.tcapps;bundle-version="13000.1.0", + TcSoaCoreRac;bundle-version="13000.1.0", + TcSoaCoreTypes;bundle-version="13000.1.0", + com.teamcenter.rac.common;bundle-version="13000.1.0", + com.teamcenter.rac.aifrcp;bundle-version="13000.1.0", + com.teamcenter.rac.kernel;bundle-version="13000.1.0", + com.teamcenter.rac.util;bundle-version="13000.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: cn.com.origin.autocodemanager, + cn.com.origin.autocodemanager.common, + cn.com.origin.autocodemanager.common.dialog, + cn.com.origin.autocodemanager.common.encrypt, + cn.com.origin.autocodemanager.common.operations, + cn.com.origin.autocodemanager.common.progress, + cn.com.origin.autocodemanager.common.tree, + cn.com.origin.autocodemanager.common.treetable, + cn.com.origin.autocodemanager.export, + cn.com.origin.autocodemanager.handlers, + cn.com.origin.autocodemanager.imports, + cn.com.origin.autocodemanager.views, + cn.com.origin.autocodemanager.views.codestyleview, + cn.com.origin.autocodemanager.views.codeview, + cn.com.origin.autocodemanager.views.listcodeview, + cn.com.origin.autocodemanager.views.testview, + cn.com.origin.autocodemanager.views.treecodeview, + jxl, + jxl.biff, + jxl.biff.drawing, + jxl.biff.formula, + jxl.common, + jxl.common.log, + jxl.demo, + jxl.format, + jxl.read.biff, + jxl.write, + jxl.write.biff +Bundle-ClassPath: jxl.jar, + . +Bundle-ActivationPolicy: lazy diff --git a/ant/build.xml b/ant/build.xml new file mode 100644 index 0000000..19b5bd6 --- /dev/null +++ b/ant/build.xml @@ -0,0 +1,57 @@ + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..89997e4 --- /dev/null +++ b/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = classes/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + jxl.jar diff --git a/classes/cn/com/origin/autocodemanager/Activator.class b/classes/cn/com/origin/autocodemanager/Activator.class new file mode 100644 index 0000000..3b3bebf Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/Activator.class differ diff --git a/classes/cn/com/origin/autocodemanager/AutoCodeManagerPerspective.class b/classes/cn/com/origin/autocodemanager/AutoCodeManagerPerspective.class new file mode 100644 index 0000000..5433f7f Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/AutoCodeManagerPerspective.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/AbstractTreeViewPart.class b/classes/cn/com/origin/autocodemanager/common/AbstractTreeViewPart.class new file mode 100644 index 0000000..a6d231c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/AbstractTreeViewPart.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/AutoCodeConstants.class b/classes/cn/com/origin/autocodemanager/common/AutoCodeConstants.class new file mode 100644 index 0000000..1def54b Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/AutoCodeConstants.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/AutoCodeManagerImageKey.class b/classes/cn/com/origin/autocodemanager/common/AutoCodeManagerImageKey.class new file mode 100644 index 0000000..63c7c03 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/AutoCodeManagerImageKey.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/AutoCodeManagerPropertyName.class b/classes/cn/com/origin/autocodemanager/common/AutoCodeManagerPropertyName.class new file mode 100644 index 0000000..0542872 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/AutoCodeManagerPropertyName.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/AutoCodeManangerConstants.class b/classes/cn/com/origin/autocodemanager/common/AutoCodeManangerConstants.class new file mode 100644 index 0000000..7b48929 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/AutoCodeManangerConstants.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/BusinessType.class b/classes/cn/com/origin/autocodemanager/common/BusinessType.class new file mode 100644 index 0000000..4d8eade Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/BusinessType.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/CacheImage.class b/classes/cn/com/origin/autocodemanager/common/CacheImage.class new file mode 100644 index 0000000..460d4c0 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/CacheImage.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/CreateCompositeUtil$1.class b/classes/cn/com/origin/autocodemanager/common/CreateCompositeUtil$1.class new file mode 100644 index 0000000..f31da4d Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/CreateCompositeUtil$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/CreateCompositeUtil.class b/classes/cn/com/origin/autocodemanager/common/CreateCompositeUtil.class new file mode 100644 index 0000000..2732197 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/CreateCompositeUtil.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/GetChoosePath.class b/classes/cn/com/origin/autocodemanager/common/GetChoosePath.class new file mode 100644 index 0000000..351d5cc Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/GetChoosePath.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/IsShowAutocodeManagerPerspective.class b/classes/cn/com/origin/autocodemanager/common/IsShowAutocodeManagerPerspective.class new file mode 100644 index 0000000..497cb08 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/IsShowAutocodeManagerPerspective.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/PackCodeDescInfos.class b/classes/cn/com/origin/autocodemanager/common/PackCodeDescInfos.class new file mode 100644 index 0000000..97c87c2 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/PackCodeDescInfos.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/TCLOVUtil.class b/classes/cn/com/origin/autocodemanager/common/TCLOVUtil.class new file mode 100644 index 0000000..d80917b Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/TCLOVUtil.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/TCPreferenceUitl.class b/classes/cn/com/origin/autocodemanager/common/TCPreferenceUitl.class new file mode 100644 index 0000000..83e258c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/TCPreferenceUitl.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/TCQueryUtil.class b/classes/cn/com/origin/autocodemanager/common/TCQueryUtil.class new file mode 100644 index 0000000..c31b1c0 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/TCQueryUtil.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeDialog.class b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeDialog.class new file mode 100644 index 0000000..04afe5e Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog$1.class b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog$1.class new file mode 100644 index 0000000..067c0d7 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog$2.class b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog$2.class new file mode 100644 index 0000000..0142454 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog.class b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog.class new file mode 100644 index 0000000..c0ba09a Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/encrypt/EncryptOperations.class b/classes/cn/com/origin/autocodemanager/common/encrypt/EncryptOperations.class new file mode 100644 index 0000000..d3e4565 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/encrypt/EncryptOperations.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/ExcelOperation.class b/classes/cn/com/origin/autocodemanager/common/operations/ExcelOperation.class new file mode 100644 index 0000000..b03d8be Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/operations/ExcelOperation.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/GetCodeNumber.class b/classes/cn/com/origin/autocodemanager/common/operations/GetCodeNumber.class new file mode 100644 index 0000000..3f2807b Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/operations/GetCodeNumber.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/PackCodeNodeInfo.class b/classes/cn/com/origin/autocodemanager/common/operations/PackCodeNodeInfo.class new file mode 100644 index 0000000..f093d7c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/operations/PackCodeNodeInfo.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/PlmLocale.class b/classes/cn/com/origin/autocodemanager/common/operations/PlmLocale.class new file mode 100644 index 0000000..ee79743 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/operations/PlmLocale.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/TreeAndListCodeOperation.class b/classes/cn/com/origin/autocodemanager/common/operations/TreeAndListCodeOperation.class new file mode 100644 index 0000000..c221856 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/operations/TreeAndListCodeOperation.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/ViewControlOperation.class b/classes/cn/com/origin/autocodemanager/common/operations/ViewControlOperation.class new file mode 100644 index 0000000..8555ffa Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/operations/ViewControlOperation.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/operations/operations_locale.properties b/classes/cn/com/origin/autocodemanager/common/operations/operations_locale.properties new file mode 100644 index 0000000..8f13221 --- /dev/null +++ b/classes/cn/com/origin/autocodemanager/common/operations/operations_locale.properties @@ -0,0 +1,384 @@ +# +#Tue Feb 23 11:21:13 CST 2021 +CodeSegmentName=Code segment name +CodeValue=Code value +Remarks=Remarks +C&U=C&U +ProductCategory=Product category +Self-aligningBallBearing=Self-aligning ball bearing +12Series=12 Series +22Series=22 Series +13Series=13 Series +14Series=14 Series +Other=Other +SphericalRollerBearing=Spherical roller bearing +TypeC=Type C +TypeCK=Type CK +TypeCK30=Type CK30 +TypeC/W33=Type C/W33 +TypeCK/W33=Type CK/W33 +TypeCK30/W33=Type CK30/W33 +TypeCK+H=Type CK+H +TypeCK/W33+H=Type CK/W33+H +TypeCC=Type CC +TypeCCK=Type CCK +TypeCCK30=Type CCK30 +TypeCC/W33=Type CC/W33 +TypeCCK/W33=Type CCK/W33 +TypeCCK30/W33=Type CCK30/W33 +TypeCCK+H=Type CCK+H +TypeCCK/W33+H =Type CCK/W33+H +TypeCA(includingTypeCAC)=Type CA (including type CAC) +TypeCAK(includingTypeCACK)=Type CAK (including type CACK) +TypeCAK30(includingTypeCACK30)=Type CAK30 (including type CACK30) +TypeCA/W33(includingTypeCAC/W33)=Type CA/W33 (including type CAC/W33) +TypeCAK/W33(includingCACK/W33type)=Type CAK/W33 (including CACK/W33 type) +TypeCAK30/W33(includingTypeCACK30/W33)=Type CAK30/W33 (including type CACK30/W33) +TypeCAK+H(includingTypeCACK+H)=Type CAK+H (including type CACK+H) +TypeCAK/W33+H(includingTypeCACK/W33+H)=Type CAK/W33+H (including type CACK/W33+H) +SingleRowSphericalRollerBearing=Single row spherical roller bearing +SplitSphericalRollerBearings=Split spherical roller bearings +TypeYA(includingYA1\u3001YA2)=Type YA (including YA1\u3001YA2) +TypeYAK(includingYA1K\u3001YA2K)=Type YAK (including YA1K\u3001YA2K) +TypeYAK30(includingYA1K30\u3001YA2K30)=Type YAK30 (including YA1K30\u3001YA2K30) +TypeYA/W3(includingYA1/W33\u3001YA2/W33)=Type YA/W33 (including YA1/W33\u3001YA2/W33) +TypeYAK/W33(includingYA1K/W33\u3001YA2K/W33)=Type YAK/W33 (including YA1K/W33\u3001YA2K/W33) +TypeYAK30/W33(includingYA1K30/W33\u3001YA2K30/W33)=Type YAK30/W33 (including YA1K30/W33\u3001YA2K30/W33) +TypeYAK+H(includingYA1K+H\u3001YA2K+H)=Type YAK+H (including YA1K+H\u3001YA2K+H) +TypeYAK/W33+H(includingYA1K/W33+H\u3001YA2K/W33+H)=Type YAK/W33+H (including YA1K/W33+H\u3001YA2K/W33+H) +LNSeries(lowNoiseIndustry)=LN Series (low noise industry) +VDSeries(VibrationMachinery)=VD Series (Vibration machinery) +TaperedRollerBearing=Tapered roller bearing +3SingleRowTaperedRollerBearingType3=3:Single row tapered roller bearing type 3 +35DoubleInnerRingDoubleRowTaperedRollerBearingType35=35:Double inner ring double row tapered roller bearing type 35 +37DoubleOuterRingDoubleRowTaperedRollerBearingsModel37=37:Double outer ring double row tapered roller bearings model 37 +38FourRowTaperedRollerBearingType38=38:Four row tapered roller bearing type 38 +TSTSTypeSingleRowBritishTaperedRollerBearing=TS:TS type single row British tapered roller bearing +TSFTSFSingleRowEnglishTaperedRollerBearingWithFlangeOuterRing=TSF:TSF single row English tapered roller bearing with flange outer ring +TDOTDODoubleRowOuterRingBritishTaperedRollerBearing=TDO:TDO double row outer ring British tapered roller bearing +TDITDIDoubleRRowInnerRingBritishTaperedRollerBearing=TDI:TDI double row inner ring British tapered roller bearing +2TS-DMFrontMountingOf2TS-DMTwoSingleRowBearingCombinations=2TS-DM:Front mounting of 2TS-DM two single row bearing combinations +2TS-IM2TS-IMTwoSingleRowBearingCombinationReverseInstallation=2TS-IM:2TS-IM two single row bearing combination reverse installation +2TS-TMInstallationOf2TS-TMTwoSingleRowBearingsInSeries=2TS-TM:Installation of 2TS-TM two single row bearings in series +TwoDoubleRacewayInnerRingsOfTQOFourRowEnglishTaperedRollerBearing=Two double raceway inner rings of TQO four row English tapered roller bearing +TQITSFourRowEnglishTaperedRollerBearingTwoDoubleRollToOuterRing=TQITS four row English tapered roller bearing two double roll to outer ring +JJSeriesMetricTaperedRollerBearings=J:J series Metric tapered roller bearings +EEEESeriesTaperedRollerBearingWithInnerRingRibAndClosedGuide=EE:EE series tapered roller bearing with inner ring rib and closed guide +CC-CC-SeriesCarburizedSteelBearing=CC-:CC- series carburized steel bearing +HEHESeriesHighEfficiencyBearing=HE:HE series high efficiency bearing +EXNewGenerationOfEXUpgradeProducts=EX:New generation of EX upgrade products +Other=Other +CylindricalRollerBearing=Cylindrical roller bearing +TypeN=Type N +TypeNH=Type NH +TypeNF=Type NF +TypeNU=Type NU +TypeNJ=Type NJ +TypeNUP=Type NUP +TypeRNU=Type RNU +TypeRN=Type RN +TypeNN=Type NN +TypeNN...W33=Type NN...W33 +TypeNN...K=Type NN...K +TypeNN...K/W33=Type NN...K/W33 +TypeNNU=Type NNU +TypeNNU...K=Type NNU...K +TypeNNU...K/W33=Type NNU...K/W33 +TypeFC=Type FC +TypeFCD=Type FCD +TypeFCDP=Type FCDP +TypeNB=Type NB +TypeNFP=Type NFP +TypeNJP=Type NJP +TypeNCL=Type NCL +TypeNNUP=Type NNUP +TypeNNP=Type NNP +TypeNNF=Type NNF +TypeNNQB=Type NNQB +TypeNNTB=Type NNTB +TypeNNTUP=Type NNTUP +TypeNNQP=Type NNQP +SingleRowFullRollerCylindricaRollerBearing=Single row full roller cylindrical roller bearing +DoubleRowFullRollerCylindricalRollerBearing=Double row full roller cylindrical roller bearing +Multi-rowFullRollerCylindricalRollerBearing=Multi-row full roller cylindrical roller bearing +SplitCylindricalRollerBearing=Split cylindrical roller bearing +NCLAndSLType=NCL and SL type +TDSeriesLongLifeCylindricalRollerBearing=TD series long life cylindrical roller bearing +NFLSeriesCylindricalRollerBearing=NFL series cylindrical roller bearing +TMSeriesGearboxBearing=TM series gearbox bearing +NNFLSeriesDoubleRowCylindricalRollerBearing=NNFL series double row cylindrical roller bearing +BSeriesBackBackedBearing=B series back backed bearing +TypeNUHJ=Type NUHJ +HCHybridInsulatedBearing=HC hybrid insulated bearing +ThrustBallBearing=Thrust Ball Bearing +ThrustBallBearing=Thrust Ball Bearing +BidirectionalThrustBallBearing=Bidirectional Thrust Ball Bearing +ThrustBallBearingWithSphericalRing=Thrust Ball Bearing with spherical ring +BidirectionalThrustBallBearingWithSphericalRing=Bidirectional Thrust Ball Bearing with spherical ring +ThrustBallBearingUnit=Thrust Ball Bearing Unit +DeepGrooveBallBearing=Deep groove ball bearing +Series60DeepGrooveBallBearings=Series 60 deep groove ball bearings +Series62DeepGrooveBallBearings=Series 62 deep groove ball bearings +Series63DeepGrooveBallBearings=Series 63 deep groove ball bearings +Series64DeepGrooveBallBearings=Series 64 deep groove ball bearings +Series617DeepGrooveBallBearings=Series 617 deep groove ball bearings +Series618DeepGrooveBallBearings=Series 618 deep groove ball bearings +Series619DeepGrooveBallBearings=Series 619 deep groove ball bearings +Series622DeepGrooveBallBearings=Series 622 deep groove ball bearings +Series630DeepGrooveBallBearings=Series 630 deep groove ball bearings +Series160DeepGrooveBallBearings=Series 160 deep groove ball bearings +Series161DeepGrooveBallBearings=Series 161 deep groove ball bearings +6/Non-standardd=6/Non-standard d +Series40DeepGrooveBallBearings=Series 40 deep groove ball bearings +Series42DeepGrooveBallBearings=Series 42 deep groove ball bearings +Series43DeepGrooveBallBearings=Series 43 deep groove ball bearings +Series44DeepGrooveBallBearings=Series 44 deep groove ball bearings +4/Non-standardd=4/Non-standard d +RInchSeriesDeepGrooveBallBearings=R Inch series deep groove ball bearings +AngularContactBallBearings=Angular contact ball bearings +SingleRowAngularContactBearingType7=Single row angular contact bearing type 7 +OuterRingSeparationAngularContactBallBearingTypeS7=Outer ring separation angular contact ball bearing type S7 +InneRingSeparationAngularContactBallBearingTypeSN7=Inner ring separation angular contact ball bearing type SN7 +AngularContactBallBearingB78WithLockInInnerRing=Angular contact ball bearing B78 with lock in inner ring +DoubleHalfOuterRingFourPointContactBallBearingQJF=Double half outer ring four point contact ball bearing QJF +DoubleHalfOuterRingThreePointContactBallBearingQJT=Double half outer ring three point contact ball bearing QJT +FourPointContactBallBearingQJ=Four point contact ball bearing QJ +DoubleHalfInnerRingThreePointContactBallBearingQJS=Double half inner ring three point contact ball bearing QJS +32,33SeriesDoubleRowAngularContactBalBearings=32,33 series double row angular contact ball bearings +TypeHP=Type HP +CeramicAngularContactBallBearing=Ceramic angular contact ball bearing +AutomobileSiliconeFanDoubleRowAngularContactBallBearings=Automobile silicone fan Double row angular contact ball bearings +AutomobileGeneratorDoubleRowAngularContactBallBearings=Automobile generator Double row angular contact ball bearings +AutomobileGearboxDoubleRowAngularContactBallBearings=Automobile gearbox Double row angular contact ball bearings +HCHybridInsulatedBearing=HC hybrid insulated bearing +ThrustCRB=Thrust CRB +One-waySingle-rowThrustCRB=One-way single-row thrust CRB +Double-rowOrmulti-rowCRBWithOne-wayThrust=Double-row or multi-row CRB with one-way thrust +BidirectionalThrustCRB=Bidirectional thrust CRB +One-waySingleRowThrustCRBAndCageAssembly=One-way single row thrust CRB and cage assembly +CRBAndCageAssemblyWithTwoOrMoreRowsOfUnidirectionalthrust=CRB and cage assembly with two or more rows of unidirectional thrust +RadialNeedleRollerBearing=Radial needle roller bearing +1SeriesDrawnCupHK(perforatedType)=1 series drawn cup HK (perforated type) +1SeriesDrawnCupJ(imperialPerforatedType)=1 series drawn cup J (imperial perforated type) +1SeriesDrawnCupBK(sealingType)=1 series drawn cup BK (sealing type) +1SeriesDrawnCupMJ(imperialSealingType)=1 series drawn cup MJ (imperial sealing type) +1SeriesDrawnCupF(perforatedTipFullNeedle,RibLimit)=1 series drawn cup F (perforated tip full needle, rib limit) +1SeriesDrawnCupB(imperialPerforatedTipFullNeedle,RibLimit)=1 series drawn cup B (imperial perforated tip full needle, rib limit) +1SeriesDrawnCupMF(sealingTipFullNeedle,RibLimit)=1 series drawn cup MF (sealing tip full needle, rib limit) +1SeriesDrawnCupM(imperialSealingTipfullNeedle,RibLimit)=1 series drawn cup M (imperial sealing tip full needle, rib limit) +1SeriesDrawnCupFY(perforatedFlatHeadFullNeedleGreaseLimit)=1 series drawn cup FY (perforated flat head full needle grease limit) +1SeriesDrawnCupMFY(sealingFlatHeadFullNeedleGreaseLimit)=1 series drawn cup MFY (sealing flat head full needle grease limit) +1SeriesDrawnCupHFtype(needleClutch)=1 series drawn cup HF type (needle clutch) +1SeriesDrawnCupHFL(needleClutchAssembly)=1 series drawn cup HFL (needle clutch assembly) +2SeriesDrawnCupHKH(perforatedType)=2 series drawn cup HKH (perforated type) +2SeriesDrawnCupJH(imperialPerforatedType)=2 series drawn cup JH (imperial perforated type) +2SeriesDrawnCupBKH(sealingType)=2 series drawn cup BKH (sealing type) +2SeriesDrawnCupMJH(imperialSealingType)=2 series drawn cup MJH (imperial sealing type) +2SeriesDrawnCupFH(sealingTipFullNeedle,RibLimit)=2 series drawn cup FH (sealing tip full needle, rib limit) +2SeriesDrawnCupBH(imperialSealingTipFullNeedle,RibLimit=2 series drawn cup BH (imperial sealing tip full needle, rib limit) +2SeriesDrawnCupMFH(sealingtipFullNeedle,RibLimit)=2 series drawn cup MFH (sealing tip full needle, rib limit) +2SeriesDrawnCupMH(imperialSealingTipFullNeedle,RibLimit=2 series drawn cup MH (imperial sealing tip full needle, rib limit) +2SeriesDrawnCupFYH(perforatedFlatHeadFullNeedleGreaseLimit)=2 series drawn cup FYH (perforated flat head full needle grease limit) +2SeriesDrawnCupMFYH(sealingFlatHeadFullNeedleGreaseLimit)=2 series drawn cup MFYH (sealing flat head full needle grease limit) +2SeriesDrawnCupHFH(needleClutch)=2 series drawn cup HFH (needle clutch) +2SeriesDrawnCupHFLH(needleClutchAssembly)=2 series drawn cup HFLH (needle clutch assembly) +EntityNAType(ordinaryType)=Entity NA type (ordinary type) +EntityRNAType(withoutInnerCircle)=Entity RNA type (without inner circle) +PhysicalNAVType(FullNeedle) =Physical NAV type (full needle) +SolidRNAVType(noInnerRing,FullNeedle)=Solid RNAV type (no inner ring, full needle) +EntityNAOType(outerRingWithoutRibs)=Entity NAO type (outer ring without ribs) +SolidRNAOType(noInnerRing,NoRibs)=Solid RNAO type (no inner ring, no ribs) +SolidRNAPType(withoutInnerRing,withFlatWasher)=Solid RNAP type (without inner ring, with flat washer) +SolidNAVPType(withFlatWasher,FullNeedle)=Solid NAVP type (with flat washer, full needle) +SolidRNAVPType(withoutInnerRing,WithFlatWasher,FullNeedle)=Solid RNAVP type (without inner ring, with flat washer, full needle) +EntityNAOV(ORWithoutRibs,IRWithDoubleRibs,FullStitches)=Entity NAOV (OR without ribs, IR with double ribs, full stitches) +K-shapedRadialNeedleRollerAndCageAssembly(commonAssembly)=K-shaped radial needle roller and cage assembly (common assembly) +KZKTypeRadialNeedleRollerAndCageAssembly(forCrankPinSupport)=KZK type radial needle roller and cage assembly (for crank pin support) +KBKRadialNeedleRollerAndCageAssembly(forPistonPinSupport)=KBK radial needle roller and cage assembly (for piston pin support) +ThrustNeedleRollerBearing=Thrust needle roller bearing +AXKThrust needle roller and cage assembly=AXK:Thrust needle roller and cage assembly +AXWThrust needle roller bearing(with center sleeve) = AXW:Thrust needle roller bearing(with center sleeve) +AXThrust needle roller bearing(with two washers) = AX:Thrust needle roller bearing(with two washers) +SAXThrust needle roller bearing(with one washer) = SAX:Thrust needle roller bearing(with one washer) +ThrustAngularContactBallBearing=Thrust angular contact ball bearing +OneWayThrustAngularContactBallBearing=One way thrust angular contact ball bearing +23SeriesBidirectionalThrustAngularContactBallBearing=23 series bidirectional thrust angular contact ball bearing +KOW=KOW +TaperRollerThrustBearing=Taper roller thrust bearing +One-wayThrustTaperedRollerBearings=One-way thrust tapered roller bearings +DoubleThrustTaperedRollerBearings=Double thrust tapered roller bearings +ThrustSphericalRollerBearing=Thrust spherical roller bearing +Series292=Series292 +Series293=Series293 +Series294=Series294 +WaterPumpBearing=Water pump bearing +TypeWB(doubleRowBall)=Type WB (double row ball) +TypeWR(leftRoller-rightBall)=Type WR (left roller-right ball) +TypeWBBR(doubleRowBallSingleRowRoller)=Type WBBR (double row ball single row roller) +TypeWBRR(singleRowBallDoubleRowRoller)=Type WBRR (single row ball double row roller) +TypeWZ(leftBall-rightRoller)=Type WZ (left ball-right roller) +TensionWheelBearing=Tension wheel bearing +TypeBT=Type BT +TypeBTB=Type BTB +TypeZL=Type ZL +TypeDL=Type DL +TypeZD=Type ZD +TypeDD=Type DD +TypeZZ=Type ZZ +HubBearing=Hub bearing +TypeDAC(FirstGenerationHubBearingWithDoubleRowBallStructure)=Type DAC(First generation hub bearing with double row ball structure) +TypeDACF(SecondGenerationHubBearingWithDoubleRowBallStructure)=Type DACF(Second generation hub bearing with double row ball structure) +TypeDU(FirstGenerationHubBearingWithDoubleRowTaperedStructure)=Type DU(First generation hub bearing with double row tapered structure) +TypeDUF(SecondGenerationHubBearingWithDoubleRowTaperedStructure)=Type DUF(Second generation hub bearing with double row tapered structure) +TypeDAC2F(ThirdGenerationHubBearingWithDoubleRowBallStructure)=Type DAC2F(Third generation hub bearing with double row ball structure) +TypeDUC2F(ThirdGenerationHubBearingWithDoubleRowTaperedStructure)=Type DUC2F(Third generation hub bearing with double row tapered structure) +AutomotiveElectromagneticClutchBearing=Automotive electromagnetic clutch bearing +TypeDA=Type DA +ExternalSphericalBallBearing=External Spherical Ball Bearing +TypeUCExternalSphericalBallBearingsWithTopWire=Type UC:External spherical ball bearings with top wire +TypeUELExternalSphericalBallbearingWithEccentricSleevee=Type UEL:External spherical ball bearing with eccentric sleevee +TypeUKExternalSphericalBallBearingsWithTaperedHoles=Type UK:External spherical ball bearings with tapered holes +TypeUBOneEndFlatHeadOuterSphericalBallBearingWithTopWire=Type UB:One end flat head outer spherical ball bearing with top wire +TypeUELightDutyOuterSphericalBallBearingsWithWccentricSleeve=Type UE:Light duty outer spherical ball bearings with eccentric sleeve +TypeUDFlatHeadOuterBphericalBallBearingsAtBothEnds=Type UD:Flat head outer spherical ball bearings at both ends +JointBearing=Joint bearing +TypeGECentripetalJointBearing=Type GE:Centripetal joint bearing +TypeGACAngularContactJointBearing=Type GAC:Angular contact joint bearing +TypeGXThrustJointBearing=Type GX:Thrust joint bearing +TypeSIAssemblyTypeStemEndJointBearingWithInternalThread=Type SI:Assembly type stem end joint bearing with internal thread +TypeSAAssemblyRodEndJointBearingWithExternalThread=Type SA:Assembly rod end joint bearing with external thread +TypeSIBIntegralTypeRodEndJointBearingWithInternalThread=Type SIB:Integral type rod end joint bearing with internal thread +TypeSABIntegralTypeRodEndJointBearingWithExternalThread=Type SAB:Integral type rod end joint bearing with external thread +TypeSILAssemblyRodEndJointBearingWithLeftInternalThread=Type SIL:Assembly rod end joint bearing with left internal thread +TypeSALAssemblyTypeRodEndJointBearingWithLeft-handExternalThread=Type SAL:Assembly type rod end joint bearing with left-hand external thread +TypeSILBIntegralRodEndJointBearingWithLeftInternalThread=Type SILB:Integral rod end joint bearing with left internal thread +TypeSALBIntegralRodEndJointBearingWithLeftExternalThread=Type SALB:Integral rod end joint bearing with left external thread +TypeSQBentRodTypeBallHeadRodEndJointBearing=Type SQ:Bent rod type ball head rod end joint bearing +TypeSQZStraightRodTypeBallHeadRodEndJointBearing=Type SQZ:Straight rod type ball head rod end joint bearing +TypeSQDSingleRodTypeBallHeadRodEndJointBearing=Type SQD:Single rod type ball head rod end joint bearing +TypeSQLLeft-handedCurvedRodTypeBallHeadRodEndJointBearing=Type SQL:Left-handed curved rod type ball head rod end joint bearing +TypeSQLDLeft-handedSingle-RodBallHead=Type SQLD:Left-handed single - rod ball head +TypeSKRodEndJointBearingWithCylindricalWelding(Cylindrical)=Type SK:Rod end joint bearing with cylindrical welding (cylindrical) +TypeSFWeldedRodEndJointBearingWithFlatBase(SquareType)=Type SF:Welded rod end joint bearing with flat base (square type) +TypeSIRRod-EndArticulatedBearingWithLatch=Type SIR:Rod-end articulated bearing with latch +ForkliftBearing=Forklift bearing +TypeMGMastGuideBearing=Type MG Mast Guide Bearing +TypeCGChainGuideBearings=Type CG Chain Guide Bearings +TypeSRSideRollerBearings=Type SR Side Roller Bearings +TypeCRARollerStructure(MainRoller)+RollerBearing(SideRoller)=Type CRA:roller structure (main roller) +roller bearing(side roller) +TypeCRBRollerStructure(MainRoller)+SliderTypeSlidingBearing(SideRoller)=Type CRB:roller structure(main roller)+slider type sliding bearing(side roller) +TypeCRCRollerStructure(MainRoller)WithoutSideRoller=Type CRC:roller structure (main roller) without side roller +TypeCBABallStructure(MainRoller)+RollerBearing(SideRoller)=Type CBA:ball structure (main roller) +roller bearing(side roller) +TypeCBBBallStructure(MainRoller)+SliderTypeSlidingBearing(SideRoller)=Type CBB:ball structure (main roller) +slider type sliding bearing(side roller) +TypeCBCBallStructure(MainRoller)WithoutSideRoller=Type CBC:ball structure (main roller) without side roller +SlewingBearingAndWindPowerBearing=Slewing bearing and wind power bearing +Type010ToothlessSingle-rowFour-pointcontactBallStyle=Type 010 toothless single-row four-point contact ball style +Type020ToothlessDoubleRejectionBallStyle=Type 020 toothless double rejection ball style +Type110ToothlessSingleRowCrossRollerStyle=Type 110 toothless single row cross roller style +Type130ToothlessThreeRowsOfRollers=Type 130 toothless three rows of rollers +Type011SmallMeshModulusOfExternalTeethSingle-row4Pstyle=Type 011 small mesh modulus of external teeth single-row 4P style +Type012LargeMeshModulusOfExternalTeethSingle-row4Pstyle=Type 012 large mesh modulus of external teeth single-row 4P style +Type013SmallMeshingModulusOfInnerTeethSingle-row4Pstyle=Type 013 small meshing modulus of inner teeth single-row 4P style +Type014LargeMeshingModulusOfInnerTeethSingle-row4Pstyle=Type 014 large meshing modulus of inner teeth single-row 4P style +Type021SmallMeshModulusOfExternalTeethDoubleRejectionBallStyle=Type 021 small mesh modulus of external teeth double rejection ball style +Type022LargeMeshModulusOfExternalTeethDoubleRejectionBallStyle=Type 022 large mesh modulus of external teeth double rejection ball style +Type023SmallMeshingModulusOfInnerTeethDoubleRejectionBallStyle=Type 023 small meshing modulus of inner teeth double rejection ball style +Type024LargeMeshingModulusOfInnerTeethDoubleRejectionBallStyle=Type 024 large meshing modulus of inner teeth double rejection ball style +Type111SmallMeshModulusOfExternalTeethSingleRowCrossRollerStyle=Type 111 small mesh modulus of external teeth single row cross roller style +Type112LargeMeshModulusOfExternalTeethSingleRowCrossRollerStyle=Type 112 large mesh modulus of external teeth single row cross roller style +Type113SmallMeshingModulusOfInnerTeethSingleRowCrossRollerStyle=Type 113 small meshing modulus of inner teeth single row cross roller style +Type114LargeMeshingModulusOfInnerTeethSingleRowCrossRollerStyle=Type 114 large meshing modulus of inner teeth single row cross roller style +Type131SmallMeshModulusOfExternalTeethThreeRowsOfRollers=Type 131 small mesh modulus of external teeth three rows of rollers +Type132LargeMeshModulusOfExternalTeethThreeRowsOfRollers=Type 132 large mesh modulus of external teeth three rows of rollers +Type133SmallMeshingModulusOfInnerTeethThreeRowsOfRollers=Type 133 small meshing modulus of inner teeth three rows of rollers +Type134LargeMeshingModulusOfInnerTeethThreeRowsOfRollers=Type 134 large meshing modulus of inner teeth three rows of rollers +Type030ToothlessDoubleRowFourPointContactBallStyle=Type 030 toothless double row four point contact ball style +Type031SmallMeshModulusOfExternalTeethdoublerow4Pstyle=Type 031 small mesh modulus of external teeth double row 4P style +Type032LargeMeshModulusOfExternalTeethdoublerow4Pstyle=Type 032 large mesh modulus of external teeth double row 4P style +Type033SmallMeshingModulusOfInnerTeethdoublerow4Pstyle=Type 033 small meshing modulus of inner teeth double row 4P style +Type034LargeMeshingModulusOfInnerTeethdoublerow4Pstyle=Type 034 large meshing modulus of inner teeth double row 4P style +UnilateralBearing=Unilateral bearing +TypeDXZ(OneRowNeedleAndOneRowBall)=Type DXZ (one row needle and one row ball) +TypeDX(SeparatedOuterRingType)=Type DX (Separated outer ring type) +TypeOW(OneRowAbnormityRollerAndOneRowBall)=Type OW(one row abnormity roller and one row ball) +TypeNB(SingleShortNeedle)=Type NB (single short needle) +TypeBB(SingleLongNeedle)=Type BB(single long needle) +TypeCSK(SingleAbnormityRoller)=Type CSK (single abnormity roller) +ClutchReleaseBearingForAutomobiles=Clutch release bearing for automobiles +TypeTPush-styleClutchReleaseBearing=Type T:Push-style clutch release bearing +TypeWTNon-aligningPush-styleOuterRingRotaryClutchReleaseBearingUnit=Type WT:Non-aligning push-style outer ring rotary clutch release bearing unit +TypeNTNon-aligningPush-styleInnerRingRotaryClutchReleaseBearingUnit=Type NT:Non-aligning push-style inner ring rotary clutch release bearing unit +TypeNLNon-aligningDraw-styleClutchReleaseBearingUnit=Type NL:Non-aligning draw-style clutch release bearing unit +TypeCTSelf-aligningPush-styleClutchReleaseBearingUnit=Type CT:Self-aligning push-style clutch release bearing unit +TypeCLSelf-aligningDraw-styleClutchReleaseBearingUnit=Type CL:Self-aligning draw-style clutch release bearing unit +LinearBallBearings=Linear ball bearings +TypeLBLinearMotionBallBearing=Type LB:Linear motion ball bearing +TypeLRLinearMotionRollerBearing=Type LR:Linear motion roller bearing +TypeLBSLinearMotionBallRailBearing=Type LBS:Linear motion ball rail bearing +TypeLRSLinearMotionRollerRailBearing=Type LRS:Linear motion roller rail bearing +TypeLNSLinearMotionNeedleRollerRailBearing=Type LNS:Linear motion needle roller rail bearing +TypeLBDDrawnCupLinearBearing=Type LBD:Drawn cup linear bearing +AutomobileShockAbsorberBearing=Automobile shock absorber bearing +SuspensionStrutBearing=Suspension strut bearing +BallCageAndBallCageAssembly=Ball cage and ball cage assembly +SeriesBJBallCageBearing=Series BJ ball cage bearing +SeriesEBJBallCageBearing=Series EBJ ball cage bearing +SeriesUJBallCageBearing=Series UJ ball cage bearing +SeriesEUJBallCageBearing=Series EUJ ball cage bearing +SeriesRFBallCageBearing=Series RF ball cage bearing +SeriesDOJBallCageBearing=Series DOJ ball cage bearing +SeriesDOJLBallCageBearing=Series DOJL ball cage bearing +SeriesEDOJBallCageBearing=Series EDOJ ball cage bearing +SeriesTJBallCageBearing=Series TJ ball cage bearing +SeriesETJBallCageBearing=Series ETJ ball cage bearing +SeriesVLBallCageBearing=Series VL ball cage bearing +SeriesFTJBallCageBearing=Series FTJ ball cage bearing +(Series)CageBearingAssembly=(Series)Cage bearing assembly +RepairKit=Repair Kit +CeramicBearing=Ceramic bearing +None=None +MiniatureDeepGrooveBallBearing=Miniature deep groove ball bearing +Series60MiniatureBallBearings=Series 60 miniature ball bearings +Series62MiniatureBallBearings=Series 62 miniature ball bearings +Series63MiniatureBallBearings=Series 63 miniature ball bearings +Series67MiniatureBallBearings=Series 67 miniature ball bearings +Series68MiniatureBallBearings=Series 68 miniature ball bearings +Series69MiniatureBallBearings=Series 69 miniature ball bearings +RISeriesMiniatureBallBearings=RI Series miniature ball bearings +OtherPartsAndProducts=Other parts and products +IRSolidFlatBushing=IR Solid flat bushing +IRSSolidBushing(withShaftShoulder)=IRS Solid bushing (with shaft shoulder) +IJStampingCollar=IJ Stamping collar +ASGsketOrWasher=AS Gsket or washer +LXWheelCoreAndWheelCoreSsembly=LX Wheel core and wheel core ssembly +NPNeedleOrPinRoller=NP Needle or pin roller +AutoRockArmBearing=Auto rock arm bearing +TypeNKSolidCoreShaftRockerArmBearing=Type NK Solid core shaft rocker arm bearing +TypeNKOHollowShaftRockerArmBearing=Type NKO hollow shaft rocker arm bearing +BearingOfTextileMachinery=Bearing of textile machinery +TypeBZRotorBearing=Type BZ Rotor bearing +TypeGZOpeningRollerBearing=Type GZ Opening roller Bearing +TypeSLTopRollerBearing=Type SL Top roller bearing +TypelZBottomRollerBearing=Type lZ Bottom roller bearing +TypeDZSpindleBearing=Type DZ spindle bearing +WindingHeadBearing=Winding head bearing +RollerBearing=Roller bearing +TypeFGeneralBearingForSpinningMachine=Type F General bearing for spinning machine +OtherNon-standardBearingsOrNonBearingProducts=Other non-standard bearings or non bearing products +Non-standardBearings=Non-standard bearings +ComponentBearing=Component bearing +BearingGeneralParts=Bearing general parts +Ball=Ball +TaperedRoller=Tapered roller +Needle=Needle +CylindricalRoller=Cylindrical roller +SphericalRoller=Spherical roller +CeramicBall=Ceramic ball +Special-shapedRoller=Special-shaped roller +WheelBolt=Wheel bolt +O-ring=O-ring +StopRing=Stop ring +Rivet=Rivet +AdapterSleeve=Adapter sleeve +WithdrawalSleeve=Withdrawal sleeve +Grease=Grease diff --git a/classes/cn/com/origin/autocodemanager/common/operations/operations_locale_zh_CN.properties b/classes/cn/com/origin/autocodemanager/common/operations/operations_locale_zh_CN.properties new file mode 100644 index 0000000..70907ea --- /dev/null +++ b/classes/cn/com/origin/autocodemanager/common/operations/operations_locale_zh_CN.properties @@ -0,0 +1,384 @@ +# +#Tue Feb 23 11:21:13 CST 2021 +CodeSegmentName=\u7801\u6BB5\u540D\u79F0 +CodeValue=\u7801\u503C +Remarks=\u5907\u6CE8 +C&U=\u4EBA\u672C\u96C6\u56E2 +ProductCategory=\u4EA7\u54C1\u7C7B +Self-aligningBallBearing=\u8C03\u5FC3\u7403\u8F74\u627F +12Series=12\u7CFB\u5217 +22Series=22\u7CFB\u5217 +13Series=13\u7CFB\u5217 +14Series=14\u7CFB\u5217 +Other=\u5176\u4ED6 +SphericalRollerBearing=\u8C03\u5FC3\u6EDA\u5B50\u8F74\u627F +TypeC=C\u578B +TypeCK=CK\u578B +TypeCK30=CK30\u578B +TypeC/W33=C/W33\u578B +TypeCK/W33=CK/W33\u578B +TypeCK30/W33=CK30/W33\u578B +TypeCK+H=CK+H\u578B +TypeCK/W33+H=CK/W33+H\u578B +TypeCC=CC\u578B +TypeCCK=CCK\u578B +TypeCCK30=CCK30\u578B +TypeCC/W33=CC/W33\u578B +TypeCCK/W33=CCK/W33\u578B +TypeCCK30/W33=CCK30/W33\u578B +TypeCCK+H=CCK+H\u578B +TypeCCK/W33+H=CCK/W33+H\u578B +TypeCA(includingTypeCAC)=CA\u578B\uFF08\u5305\u62ECCAC\u578B\uFF09 +TypeCAK(includingTypeCACK)=CAK\u578B\uFF08\u5305\u62ECCACK\u578B\uFF09 +TypeCAK30(includingTypeCACK30)=CAK30\u578B\uFF08\u5305\u62ECCACK30\u578B\uFF09 +TypeCA/W33(includingTypeCAC/W33)=CA/W33\u578B\uFF08\u5305\u62ECCAC/W33\u578B\uFF09 +TypeCAK/W33(includingCACK/W33type)=CAK/W33\u578B\uFF08\u5305\u62ECCACK/W33\u578B\uFF09 +TypeCAK30/W33(includingTypeCACK30/W33)=CAK30/W33\u578B\uFF08\u5305\u62ECCACK30/W33\u578B\uFF09 +TypeCAK+H(includingTypeCACK+H)=CAK+H\u578B\uFF08\u5305\u62ECCACK+H\u578B\uFF09 +TypeCAK/W33+H(includingTypeCACK/W33+H)=CAK/W33+H\u578B\uFF08\u5305\u62ECCACK/W33+H\u578B\uFF09 +SingleRowSphericalRollerBearing=\u5355\u5217\u8C03\u5FC3\u6EDA\u5B50\u8F74\u627F +SplitSphericalRollerBearings=\u5256\u5206\u5F0F\u8C03\u5FC3\u6EDA\u5B50\u8F74\u627F +TypeYA(includingYA1\u3001YA2)=YA\u578B\uFF08\u5305\u62ECYA1\u3001YA2\uFF09 +TypeYAK(includingYA1K\u3001YA2K)=YAK\u578B\uFF08\u5305\u62ECYA1K\u3001YA2K\uFF09 +TypeYAK30(includingYA1K30\u3001YA2K30)=YAK30\u578B\uFF08\u5305\u62ECYA1K30\u3001YA2K30\uFF09 +TypeYA/W3(includingYA1/W33\u3001YA2/W33)=YA/W33\u578B\uFF08\u5305\u62ECYA1/W33\u3001YA2/W33\uFF09 +TypeYAK/W33(includingYA1K/W33\u3001YA2K/W33)=YAK/W33\u578B\uFF08\u5305\u62ECYA1K/W33\u3001YA2K/W33\uFF09 +TypeYAK30/W33(includingYA1K30/W33\u3001YA2K30/W33)=YAK30/W33\u578B\uFF08\u5305\u62ECYA1K30/W33\u3001YA2K30/W33\uFF09 +TypeYAK+H(includingYA1K+H\u3001YA2K+H)=YAK+H\u578B\uFF08\u5305\u62ECYA1K+H\u3001YA2K+H\uFF09 +TypeYAK/W33+H(includingYA1K/W33+H\u3001YA2K/W33+H)=YAK/W33+H\u578B\uFF08\u5305\u62ECYA1K/W33+H\u3001YA2K/W33+H\uFF09 +LNSeries(lowNoiseIndustry)=LN\u7CFB\u5217\uFF08\u4F4E\u566A\u97F3\u884C\u4E1A\uFF09 +VDSeries(VibrationMachinery)=VD\u7CFB\u5217\uFF08\u632F\u52A8\u673A\u68B0\uFF09 +TaperedRollerBearing=\u5706\u9525\u6EDA\u5B50\u8F74\u627F +3SingleRowTaperedRollerBearingType3=\u5355\u5217\u5706\u9525\u6EDA\u5B50\u8F74\u627F3\u578B +35DoubleInnerRingDoubleRowTaperedRollerBearingType35=\u53CC\u5185\u5708\u53CC\u5217\u5706\u9525\u6EDA\u5B50\u8F74\u627F35\u578B +37DoubleOuterRingDoubleRowTaperedRollerBearingsModel37=\u53CC\u5916\u5708\u53CC\u5217\u5706\u9525\u6EDA\u5B50\u8F74\u627F37\u578B +38FourRowTaperedRollerBearingType38=\u56DB\u5217\u5706\u9525\u6EDA\u5B50\u8F74\u627F38\u578B +TSTSTypeSingleRowBritishTaperedRollerBearing=TS\u578B\u5355\u5217\u82F1\u5236\u5706\u9525\u6EDA\u5B50\u8F74\u627F +TSFTSFSingleRowEnglishTaperedRollerBearingWithFlangeOuterRing=TSF\u5E26\u51F8\u7F18\u5916\u5708\u7684\u5355\u5217\u82F1\u5236\u5706\u9525\u6EDA\u5B50\u8F74\u627F +TDOTDODoubleRowOuterRingBritishTaperedRollerBearing=TDO\u53CC\u5217\u5916\u5708\u82F1\u5236\u5706\u9525\u6EDA\u5B50\u8F74\u627F +TDITDIDoubleRRowInnerRingBritishTaperedRollerBearing=TDI\u53CC\u5217\u5185\u5708\u82F1\u5236\u5706\u9525\u6EDA\u5B50\u8F74\u627F +2TS-DMFrontMountingOf2TS-DMTwoSingleRowBearingCombinations=2TS-DM\u4E24\u4E2A\u5355\u5217\u8F74\u627F\u7EC4\u5408\u6B63\u9762\u5B89\u88C5 +2TS-IM2TS-IMTwoSingleRowBearingCombinationReverseInstallation=2TS-IM\u4E24\u4E2A\u5355\u5217\u8F74\u627F\u7EC4\u5408\u53CD\u9762\u5B89\u88C5 +2TS-TMInstallationOf2TS-TMTwoSingleRowBearingsInSeries=2TS-TM\u4E24\u4E2A\u5355\u5217\u8F74\u627F\u7EC4\u5408\u4E32\u8054\u5B89\u88C5 +TwoDoubleRacewayInnerRingsOfTQOFourRowEnglishTaperedRollerBearing=TQO\u56DB\u5217\u82F1\u5236\u5706\u9525\u6EDA\u5B50\u8F74\u627F\u4E24\u4E2A\u53CC\u6EDA\u9053\u5185\u5708 +TQITSFourRowEnglishTaperedRollerBearingTwoDoubleRollToOuterRing=TQITS\u56DB\u5217\u82F1\u5236\u5706\u9525\u6EDA\u5B50\u8F74\u627F\u4E24\u4E2A\u53CC\u6EDA\u5230\u5916\u5708 +JJSeriesMetricTaperedRollerBearings=J\u7CFB\u5217\u516C\u5236\u5316\u7684\u5706\u9525\u6EDA\u5B50\u8F74\u627F +EEEESeriesTaperedRollerBearingWithInnerRingRibAndClosedGuide=EE\u7CFB\u5217\u5185\u5708\u6321\u8FB9\u5C01\u95ED\u5F15\u5BFC\u5706\u9525\u6EDA\u5B50\u8F74\u627F +CC-CC-SeriesCarburizedSteelBearing=CC-\u7CFB\u5217\u6E17\u78B3\u94A2\u8F74\u627F +HEHESeriesHighEfficiencyBearing=HE\u7CFB\u5217\u9AD8\u6548\u8F74\u627F +EXNewGenerationOfEXUpgradeProducts=EX\u65B0\u4E00\u4EE3\u5347\u7EA7\u4EA7\u54C1 +CylindricalRollerBearing=\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +TypeN=N\u578B +TypeNH=NH\u578B +TypeNF=NF\u578B +TypeNU=NU\u578B +TypeNJ=NJ\u578B +TypeNUP=NUP\u578B +TypeRNU=RNU\u578B +TypeRN=RN\u578B +TypeNN=NN\u578B +TypeNN...W33=NN...W33\u578B +TypeNN...K=NN...K\u578B +TypeNN...K/W33=NN...K/W33\u578B +TypeNNU=NNU\u578B +TypeNNU...K=NNU...K\u578B +TypeNNU...K/W33=NNU...K\uFF0FW33\u578B +TypeFC=FC\u578B +TypeFCD=FCD\u578B +TypeFCDP=FCDP\u578B +TypeNB=NB\u578B +TypeNFP=NFP\u578B +TypeNJP=NJP\u578B +TypeNCL=NCL\u578B +TypeNNUP=NNUP\u578B +TypeNNP=NNP\u578B +TypeNNF=NNF\u578B +TypeNNQB=NNQB\u578B +TypeNNTB=NNTB\u578B +TypeNNTUP=NNTUP\u578B +TypeNNQP=NNQP\u578B +SingleRowFullRollerCylindricaRollerBearing=\u5355\u5217\u6EE1\u6EDA\u5B50\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +DoubleRowFullRollerCylindricalRollerBearing=\u53CC\u5217\u6EE1\u6EDA\u5B50\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +Multi-rowFullRollerCylindricalRollerBearing=\u591A\u5217\u6EE1\u6EDA\u5B50\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +SplitCylindricalRollerBearing=\u5256\u5206\u5F0F\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +NCLAndSLType=NCL\u548CSL\u578B +TDSeriesLongLifeCylindricalRollerBearing=TD\u7CFB\u5217\u957F\u5BFF\u547D\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +NFLSeriesCylindricalRollerBearing=NFL\u7CFB\u5217\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +TMSeriesGearboxBearing=TM\u7CFB\u5217\u53D8\u901F\u7BB1\u8F74\u627F +NNFLSeriesDoubleRowCylindricalRollerBearing=NNFL\u7CFB\u5217\u53CC\u5217\u56ED\u67F1\u6EDA\u5B50\u8F74\u627F +BSeriesBackBackedBearing=B\u7CFB\u5217\u80CC\u886C\u8F74\u627F +TypeNUHJ=NUHJ\u578B +HCHybridInsulatedBearing=HC\u6DF7\u5408\u7EDD\u7F18\u8F74\u627F +ThrustBallBearing=\u63A8\u529B\u7403\u8F74\u627F +ThrustBallBearing=\u63A8\u529B\u7403\u8F74\u627F +BidirectionalThrustBallBearing=\u53CC\u5411\u63A8\u529B\u7403\u8F74\u627F +ThrustBallBearingWithSphericalRing=\u5E26\u7403\u9762\u5EA7\u5708\u7684\u63A8\u529B\u7403\u8F74\u627F +BidirectionalThrustBallBearingWithSphericalRing=\u5E26\u7403\u9762\u5EA7\u5708\u7684\u53CC\u5411\u63A8\u529B\u7403\u8F74\u627F +ThrustBallBearingUnit=\u63A8\u529B\u7403\u7EC4\u4EF6 +DeepGrooveBallBearing=\u6DF1\u6C9F\u7403\u8F74\u627F +Series60DeepGrooveBallBearings=60\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series62DeepGrooveBallBearings=62\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series63DeepGrooveBallBearings=63\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series64DeepGrooveBallBearings=64\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series617DeepGrooveBallBearings=617\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series618DeepGrooveBallBearings=618\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series619DeepGrooveBallBearings=619\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series622DeepGrooveBallBearings=622\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series630DeepGrooveBallBearings=630\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series160DeepGrooveBallBearings=160\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series161DeepGrooveBallBearings=161\u7CFB\u5217\u666E\u901A\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +6/Non-standardd=6/:\u975E\u6807\u51C6\u5185\u5F84 +Series40DeepGrooveBallBearings=40\u7CFB\u5217\u666E\u901A\u53CC\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series42DeepGrooveBallBearings=42\u7CFB\u5217\u666E\u901A\u53CC\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series43DeepGrooveBallBearings=43\u7CFB\u5217\u666E\u901A\u53CC\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +Series44DeepGrooveBallBearings=44\u7CFB\u5217\u666E\u901A\u53CC\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +4/Non-standardd=4/:\u975E\u6807\u51C6\u5185\u5F84 +RInchSeriesDeepGrooveBallBearings=R\u82F1\u5236\u7CFB\u5217\u5355\u5217\u6DF1\u6C9F\u7403\u8F74\u627F +AngularContactBallBearings=\u89D2\u63A5\u89E6\u7403\u8F74\u627F +SingleRowAngularContactBearingType7=\u5355\u5217\u89D2\u63A5\u89E6\u7403\u8F74\u627F7\u578B +OuterRingSeparationAngularContactBallBearingTypeS7=\u5916\u5708\u5206\u79BB\u89D2\u63A5\u89E6\u7403\u8F74\u627FS7\u578B +InneRingSeparationAngularContactBallBearingTypeSN7=\u5185\u5708\u5206\u79BB\u89D2\u63A5\u89E6\u7403\u8F74\u627FSN7\u578B +AngularContactBallBearingB78WithLockInInnerRing=\u9501\u53E3\u5728\u5185\u5708\u89D2\u63A5\u89E6\u7403\u8F74\u627FB78 +DoubleHalfOuterRingFourPointContactBallBearingQJF=\u53CC\u534A\u5916\u5708\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627FQJF +DoubleHalfOuterRingThreePointContactBallBearingQJT=\u53CC\u534A\u5916\u5708\u4E09\u70B9\u63A5\u89E6\u7403\u8F74\u627FQJT +FourPointContactBallBearingQJ=\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627FQJ +DoubleHalfInnerRingThreePointContactBallBearingQJS=\u53CC\u534A\u5185\u5708\u4E09\u70B9\u63A5\u89E6\u7403\u8F74\u627FQJS +32,33SeriesDoubleRowAngularContactBalBearings=32\u300133\u7B49\u7CFB\u5217\u53CC\u5217\u89D2\u63A5\u89E6\u7403\u8F74\u627F +TypeHP=HP\u578B +CeramicAngularContactBallBearing=\u9676\u74F7\u89D2\u63A5\u7403\u8F74\u627F +AutomobileSiliconeFanDoubleRowAngularContactBallBearings=DC\u7CFB\u5217\u53CC\u5217\u89D2\u63A5\u89E6\u7403\u8F74\u627F +AutomobileGeneratorDoubleRowAngularContactBallBearings=SA\u7CFB\u5217\u53CC\u5217\u89D2\u63A5\u89E6\u7403\u8F74\u627F +AutomobileGearboxDoubleRowAngularContactBallBearings=TM\u7CFB\u5217\u53CC\u5217\u89D2\u63A5\u89E6\u7403\u8F74\u627F +HCHybridInsulatedBearing=HC\u6DF7\u5408\u7EDD\u7F18\u8F74\u627F +ThrustCRB=\u63A8\u529B\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +One-waySingle-rowThrustCRB=\u5355\u5411\u5355\u5217\u63A8\u529B\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +Double-rowOrmulti-rowCRBWithOne-wayThrust=\u53CC\u5217\u6216\u591A\u5217\u5355\u5411\u63A8\u529B\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +BidirectionalThrustCRB=\u53CC\u5411\u63A8\u529B\u5706\u67F1\u6EDA\u5B50\u8F74\u627F +One-waySingleRowThrustCRBAndCageAssembly=\u5355\u5411\u5355\u5217\u63A8\u529B\u5706\u67F1\u6EDA\u5B50\u548C\u4FDD\u6301\u67B6\u7EC4\u4EF6 +CRBAndCageAssemblyWithTwoOrMoreRowsOfUnidirectionalthrust=\u53CC\u5217\u6216\u591A\u5217\u5355\u5411\u63A8\u529B\u5706\u67F1\u6EDA\u5B50\u548C\u4FDD\u6301\u67B6\u7EC4\u4EF6 +RadialNeedleRollerBearing=\u5411\u5FC3\u6EDA\u9488\u8F74\u627F +1SeriesDrawnCupHK(perforatedType)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708HK\u578B\uFF08\u7A7F\u5B54\u578B\uFF09 +1SeriesDrawnCupJ(imperialPerforatedType)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708J\u578B(\u82F1\u5236\u7A7F\u5B54\u578B) +1SeriesDrawnCupBK(sealingType)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708BK\u578B\uFF08\u5C01\u53E3\u578B\uFF09 +1SeriesDrawnCupMJ(imperialSealingType)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708MJ\u578B\uFF08\u82F1\u5236\u5C01\u53E3\u578B\uFF09 +1SeriesDrawnCupF(perforatedTipFullNeedle,RibLimit)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708F\u578B\uFF08\u7A7F\u5B54\u5C16\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +1SeriesDrawnCupB(imperialPerforatedTipFullNeedle,RibLimit)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708B\u578B\uFF08\u82F1\u5236\u7A7F\u5B54\u9488\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +1SeriesDrawnCupMF(sealingTipFullNeedle,RibLimit)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708MF\u578B\uFF08\u5C01\u53E3\u5C16\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +1SeriesDrawnCupM(imperialSealingTipfullNeedle,RibLimit)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708M\u578B\uFF08\u82F1\u5236\u5C01\u53E3\u5C16\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +1SeriesDrawnCupFY(perforatedFlatHeadFullNeedleGreaseLimit)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708FY\u578B\uFF08\u7A7F\u5B54\u5E73\u5934\u6EE1\u9488\u6CB9\u8102\u9650\u4F4D\uFF09 +1SeriesDrawnCupMFY(sealingFlatHeadFullNeedleGreaseLimit)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708MFY\u578B\uFF08\u5C01\u53E3\u5E73\u5934\u6EE1\u9488\u6CB9\u8102\u9650\u4F4D\uFF09 +1SeriesDrawnCupHFtype(needleClutch)=1\u7CFB\u51B2\u538B\u5916\u5708HF\u578B\uFF08\u6EDA\u9488\u79BB\u5408\u5668\uFF09 +1SeriesDrawnCupHFL(needleClutchAssembly)=1\u7CFB\u5217\u51B2\u538B\u5916\u5708HFL\u578B\uFF08\u6EDA\u9488\u79BB\u5408\u5668\u7EC4\u4EF6\uFF09 +2SeriesDrawnCupHKH(perforatedType)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708HKH\u578B\uFF08\u7A7F\u5B54\u578B\uFF09 +2SeriesDrawnCupJH(imperialPerforatedType)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708JH\u578B(\u82F1\u5236\u7A7F\u5B54\u578B) +2SeriesDrawnCupBKH(sealingType)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708BKH\u578B\uFF08\u5C01\u53E3\u578B\uFF09 +2SeriesDrawnCupMJH(imperialSealingType)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708MJH\u578B\uFF08\u82F1\u5236\u5C01\u53E3\u578B\uFF09 +2SeriesDrawnCupFH(sealingTipFullNeedle,RibLimit)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708FH\u578B\uFF08\u7A7F\u5B54\u5C16\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +2SeriesDrawnCupBH(imperialSealingTipFullNeedle,RibLimit=2\u7CFB\u5217\u51B2\u538B\u5916\u5708BH\u578B\uFF08\u82F1\u5236\u7A7F\u5B54\u9488\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +2SeriesDrawnCupMFH(sealingtipFullNeedle,RibLimit)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708MFH\u578B\uFF08\u5C01\u53E3\u5C16\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +2SeriesDrawnCupMH(imperialSealingTipFullNeedle,RibLimit=2\u7CFB\u5217\u51B2\u538B\u5916\u5708MH\u578B\uFF08\u82F1\u5236\u5C01\u53E3\u5C16\u5934\u6EE1\u9488\u3001\u6321\u8FB9\u9650\u4F4D\uFF09 +2SeriesDrawnCupFYH(perforatedFlatHeadFullNeedleGreaseLimit)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708FYH\u578B\uFF08\u7A7F\u5B54\u5E73\u5934\u6EE1\u9488\u6CB9\u8102\u9650\u4F4D\uFF09 +2SeriesDrawnCupMFYH(sealingFlatHeadFullNeedleGreaseLimit)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708MFYH\u578B\uFF08\u5C01\u53E3\u5E73\u5934\u6EE1\u9488\u6CB9\u8102\u9650\u4F4D\uFF09 +2SeriesDrawnCupHFH(needleClutch)=2\u7CFB\u51B2\u538B\u5916\u5708HFH\u578B\uFF08\u6EDA\u9488\u79BB\u5408\u5668\uFF09 +2SeriesDrawnCupHFLH(needleClutchAssembly)=2\u7CFB\u5217\u51B2\u538B\u5916\u5708HFLH\u578B\uFF08\u6EDA\u9488\u79BB\u5408\u5668\u7EC4\u4EF6\uFF09 +EntityNAType(ordinaryType)=\u5B9E\u4F53NA\u578B\uFF08\u666E\u901A\u578B\uFF09 +EntityRNAType(withoutInnerCircle)=\u5B9E\u4F53RNA\u578B\uFF08\u65E0\u5185\u5708\uFF09 +PhysicalNAVType(FullNeedle)=\u5B9E\u4F53NAV\u578B\uFF08\u6EE1\u9488\uFF09 +SolidRNAVType(noInnerRing,FullNeedle)=\u5B9E\u4F53RNAV\u578B\uFF08\u65E0\u5185\u5708\uFF0C\u6EE1\u9488\uFF09 +EntityNAOType(outerRingWithoutRibs)=\u5B9E\u4F53NAO\u578B\uFF08\u5916\u5708\u65E0\u6321\u8FB9\uFF09 +SolidRNAOType(noInnerRing,NoRibs)=\u5B9E\u4F53RNAO\u578B\uFF08\u65E0\u5185\u5708\uFF0C\u65E0\u6321\u8FB9\uFF09 +SolidRNAPType(withoutInnerRing,withFlatWasher)=\u5B9E\u4F53RNAP\u578B\uFF08\u65E0\u5185\u5708\uFF0C\u5E26\u5E73\u57AB\u5708\uFF09 +SolidNAVPType(withFlatWasher,FullNeedle)=\u5B9E\u4F53NAVP\u578B\uFF08\u5E26\u5E73\u57AB\u5708\uFF0C\u6EE1\u9488\uFF09 +SolidRNAVPType(withoutInnerRing,WithFlatWasher,FullNeedle)=\u5B9E\u4F53RNAVP\u578B\uFF08\u65E0\u5185\u5708\uFF0C\u5E26\u5E73\u57AB\u5708\uFF0C\u6EE1\u9488\uFF09 +EntityNAOV(ORWithoutRibs,IRWithDoubleRibs,FullStitches)=\u5B9E\u4F53NAOV\u578B\uFF08\u5916\u5708\u53BB\u6321\u8FB9\uFF0C\u5185\u5708\u53CC\u6321\u8FB9\uFF0C\u6EE1\u9488\uFF09 +K-shapedRadialNeedleRollerAndCageAssembly(commonAssembly)=K\u578B\u5411\u5FC3\u6EDA\u9488\u548C\u4FDD\u6301\u67B6\u7EC4\u4EF6\uFF08\u901A\u7528\u7EC4\u4EF6\uFF09 +KZKTypeRadialNeedleRollerAndCageAssembly(forCrankPinSupport)=KZK\u578B\u5411\u5FC3\u6EDA\u9488\u548C\u4FDD\u6301\u67B6\u7EC4\u4EF6\uFF08\u66F2\u67C4\u9500\u652F\u627F\u7528\uFF09 +KBKRadialNeedleRollerAndCageAssembly(forPistonPinSupport)=KBK\u578B\u5411\u5FC3\u6EDA\u9488\u548C\u4FDD\u6301\u67B6\u7EC4\u4EF6\uFF08\u6D3B\u585E\u9500\u652F\u627F\u7528\uFF09 +ThrustNeedleRollerBearing=\u63A8\u529B\u6EDA\u9488\u8F74\u627F +AXKThrustneedlerollerandcageassembly=AXK\u578B\uFF08\u63A8\u529B\u6EDA\u9488\u7EC4\u4EF6\uFF09 +AXWThrustneedlerollerbearing(withcentersleeve)=AXW\u578B\uFF08\u63A8\u529B\u6EDA\u9488\u8F74\u627F\u5E26\u4E2D\u5FC3\u5957\uFF09 +AXThrustneedlerollerbearing(withtwowashers)=AX\u578B\uFF08\u63A8\u529B\u6EDA\u9488\u8F74\u627F\u5E26\u4E0A\u4E0B\u57AB\u5708\uFF09 +SAXThrustneedlerollerbearing(withonewasher)=SAX\u578B\uFF08\u63A8\u529B\u6EDA\u9488\u8F74\u627F\u5E26\u4E0A\u6216\u4E0B\u57AB\u5708\uFF09 +ThrustAngularContactBallBearing=\u63A8\u529B\u89D2\u63A5\u89E6\u7403\u8F74\u627F +OneWayThrustAngularContactBallBearing=\u5355\u5411\u63A8\u529B\u89D2\u63A5\u89E6\u7403\u8F74\u627F +23SeriesBidirectionalThrustAngularContactBallBearing=23\u7CFB\u5217\u53CC\u5411\u63A8\u529B\u89D2\u63A5\u89E6\u7403\u8F74\u627F +KOW=KOW +TaperRollerThrustBearing=\u63A8\u529B\u5706\u9525\u6EDA\u5B50\u8F74\u627F +One-wayThrustTaperedRollerBearings=\u5355\u5411\u63A8\u529B\u5706\u9525\u6EDA\u5B50\u8F74\u627F +DoubleThrustTaperedRollerBearings=\u53CC\u5411\u63A8\u529B\u5706\u9525\u6EDA\u5B50\u8F74\u627F +ThrustSphericalRollerBearing=\u63A8\u529B\u8C03\u5FC3\u6EDA\u5B50\u8F74\u627F +Series292=292\u7CFB\u5217 +Series293=293\u7CFB\u5217 +Series294=294\u7CFB\u5217 +WaterPumpBearing=\u6C34\u6CF5\u8F74\u627F +TypeWB(doubleRowBall)=WB\u578B +TypeWR(leftRoller-rightBall)=WR\u578B +TypeWBBR(doubleRowBallSingleRowRoller)=WBBR\u578B +TypeWBRR(singleRowBallDoubleRowRoller)=WBRR\u578B +TypeWZ(leftBall-rightRoller)=WZ\u578B +TensionWheelBearing=\u5F20\u7D27\u8F6E\u8F74\u627F +TypeBT=BT\u578B +TypeBTB=BTB\u578B +TypeZL=ZL\u578B +TypeDL=DL\u578B +TypeZD=ZD\u578B +TypeDD=DD\u578B +TypeZZ=ZZ\u578B +HubBearing=\u8F6E\u6BC2\u8F74\u627F +TypeDAC(FirstGenerationHubBearingWithDoubleRowBallStructure)=DAC\u578B +TypeDACF(SecondGenerationHubBearingWithDoubleRowBallStructure)=DACF\u578B +TypeDU(FirstGenerationHubBearingWithDoubleRowTaperedStructure)=DU\u578B +TypeDUF(SecondGenerationHubBearingWithDoubleRowTaperedStructure)=DUF\u578B +TypeDAC2F(ThirdGenerationHubBearingWithDoubleRowBallStructure)=DAC2F\u578B +TypeDUC2F(ThirdGenerationHubBearingWithDoubleRowTaperedStructure)=DUC2F\u578B +AutomotiveElectromagneticClutchBearing=\u7535\u78C1\u79BB\u5408\u5668\u8F74\u627F +TypeDA=DA\u578B +ExternalSphericalBallBearing=\u5916\u7403\u9762\u7403\u8F74\u627F +TypeUCExternalSphericalBallBearingsWithTopWire=UC\u578B\uFF08\u5E26\u9876\u4E1D\u5916\u7403\u9762\u7403\u8F74\u627F\uFF09 +TypeUELExternalSphericalBallbearingWithEccentricSleevee=UEL\u578B\uFF08\u5E26\u504F\u5FC3\u5957\u5916\u7403\u9762\u7403\u8F74\u627F\uFF09 +TypeUKExternalSphericalBallBearingsWithTaperedHoles=UK\u578B\uFF08\u6709\u5706\u9525\u5B54\u5916\u7403\u9762\u7403\u8F74\u627F\uFF09 +TypeUBOneEndFlatHeadOuterSphericalBallBearingWithTopWire=UB\u578B\uFF08\u4E00\u7AEF\u5E73\u5934\u5E26\u9876\u4E1D\u5916\u7403\u9762\u7403\u8F74\u627F\uFF09 +TypeUELightDutyOuterSphericalBallBearingsWithWccentricSleeve=UE\u578B\uFF08\u8F7B\u578B\u5E26\u504F\u5FC3\u5957\u5916\u7403\u9762\u7403\u8F74\u627F\uFF09 +TypeUDFlatHeadOuterBphericalBallBearingsAtBothEnds=UD\u578B\uFF08\u4E24\u7AEF\u5E73\u5934\u5916\u7403\u9762\u7403\u8F74\u627F\uFF09 +JointBearing=\u5173\u8282\u8F74\u627F +TypeGECentripetalJointBearing=GE\u578B\u5411\u5FC3\u5173\u8282\u8F74\u627F +TypeGACAngularContactJointBearing=GAC\u578B\u89D2\u63A5\u89E6\u5173\u8282\u8F74\u627F +TypeGXThrustJointBearing=GX\u578B\u63A8\u529B\u5173\u8282\u8F74\u627F +TypeSIAssemblyTypeStemEndJointBearingWithInternalThread=SI\u578B\u5185\u87BA\u7EB9\u7EC4\u88C5\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSAAssemblyRodEndJointBearingWithExternalThread=SA\u578B\u5916\u87BA\u7EB9\u7EC4\u88C5\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSIBIntegralTypeRodEndJointBearingWithInternalThread=SIB\u578B\u5185\u87BA\u7EB9\u6574\u4F53\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSABIntegralTypeRodEndJointBearingWithExternalThread=SAB\u578B\u5916\u87BA\u7EB9\u6574\u4F53\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSILAssemblyRodEndJointBearingWithLeftInternalThread=SIL\u578B\u5DE6\u65CB\u5185\u87BA\u7EB9\u7EC4\u88C5\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSALAssemblyTypeRodEndJointBearingWithLeft-handExternalThread=SAL\u578B\u5DE6\u65CB\u5916\u87BA\u7EB9\u7EC4\u88C5\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSILBIntegralRodEndJointBearingWithLeftInternalThread=SILB\u578B\u5DE6\u65CB\u5185\u87BA\u7EB9\u6574\u4F53\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSALBIntegralRodEndJointBearingWithLeftExternalThread=SALB\u578B\u5DE6\u65CB\u5916\u87BA\u7EB9\u6574\u4F53\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSQBentRodTypeBallHeadRodEndJointBearing=SQ\u578B\u5F2F\u6746\u578B\u7403\u5934\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSQZStraightRodTypeBallHeadRodEndJointBearing=SQZ\u578B\u76F4\u6746\u578B\u7403\u5934\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSQDSingleRodTypeBallHeadRodEndJointBearing=SQD\u578B\u5355\u6746\u578B\u7403\u5934\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSQLLeft-handedCurvedRodTypeBallHeadRodEndJointBearing=SQL\u578B\u5DE6\u65CB\u5F2F\u6746\u578B\u7403\u5934\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSQLDLeft-handedSingle-RodBallHead=SQLD\u578B\u5DE6\u65CB\u5355\u6746\u578B\u7403\u5934\u6746\u7AEF\u5173\u8282\u8F74\u627F +TypeSKRodEndJointBearingWithCylindricalWelding(Cylindrical)=SK\u578B\u5E26\u5706\u67F1\u710A\u63A5\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F\uFF08\u5706\u67F1\u578B\uFF09 +TypeSFWeldedRodEndJointBearingWithFlatBase(SquareType)=SF\u578B\u5E26\u5E73\u5E95\u5EA7\u710A\u63A5\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F\uFF08\u65B9\u578B\uFF09 +TypeSIRRod-EndArticulatedBearingWithLatch=SIR\u578B\u5E26\u9501\u53E3\u578B\u6746\u7AEF\u5173\u8282\u8F74\u627F +ForkliftBearing=\u53C9\u8F66\u8F74\u627F +TypeMGMastGuideBearing=MG\u578B\u53C9\u8F66\u95E8\u67B6\u6EDA\u8F6E\u8F74\u627F +TypeCGChainGuideBearings=CG\u578B\u53C9\u8F66\u95E8\u67B6\u94FE\u8F6E\u8F74\u627F +TypeSRSideRollerBearings=SR\u578B\u53C9\u8F66\u95E8\u67B6\u4FA7\u5411\u6EDA\u8F6E +TypeCRARollerStructure(MainRoller)+RollerBearing(SideRoller)=CRA\u578B\u4E3B\u6EDA\u8F6E\u8F74\u627F\u4E3A\u6EDA\u5B50\u7ED3\u6784\u4FA7\u6EDA\u8F6E\u4E3A\u6EDA\u8F6E\u8F74\u627F +TypeCRBRollerStructure(MainRoller)+SliderTypeSlidingBearing(SideRoller)=CRB\u578B\u4E3B\u6EDA\u8F6E\u8F74\u627F\u4E3A\u6EDA\u5B50\u7ED3\u6784\u4FA7\u6EDA\u8F6E\u4E3A\u6ED1\u5757\u5F0F\u7684\u6ED1\u52A8\u8F74\u627F +TypeCRCRollerStructure(MainRoller)WithoutSideRoller=CRC\u578B\u4E3B\u6EDA\u8F6E\u8F74\u627F\u4E3A\u6EDA\u5B50\u7ED3\u6784\u65E0\u4FA7\u6EDA\u8F6E\u3001\u6ED1\u8F6E\u7684\u5176\u4ED6\u5F62\u5F0F +TypeCBABallStructure(MainRoller)+RollerBearing(SideRoller)=CBA\u578B\u4E3B\u6EDA\u8F6E\u8F74\u627F\u4E3A\u94A2\u7403\u7ED3\u6784\u4FA7\u6EDA\u8F6E\u4E3A\u6EDA\u8F6E\u8F74\u627F +TypeCBBBallStructure(MainRoller)+SliderTypeSlidingBearing(SideRoller)=CBB\u578B\u4E3B\u6EDA\u8F6E\u8F74\u627F\u4E3A\u94A2\u7403\u7ED3\u6784\u4FA7\u6EDA\u8F6E\u4E3A\u6ED1\u5757\u5F0F\u7684\u6ED1\u52A8\u8F74\u627F +TypeCBCBallStructure(MainRoller)WithoutSideRoller=CBC\u578B\u4E3B\u6EDA\u8F6E\u8F74\u627F\u4E3A\u94A2\u7403\u7ED3\u6784\u65E0\u4FA7\u6EDA\u8F6E\u3001\u6ED1\u8F6E\u7684\u5176\u4ED6\u5F62\u5F0F +SlewingBearingAndWindPowerBearing=\u56DE\u8F6C\u652F\u627F\u4E0E\u98CE\u7535\u8F74\u627F +Type010ToothlessSingle-rowFour-pointcontactBallStyle=010\u578B\u65E0\u9F7F\u5F0F\u5355\u6392\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627F +Type020ToothlessDoubleRejectionBallStyle=020\u578B\u65E0\u9F7F\u5F0F\u53CC\u6392\u5F02\u5F84\u7403\u8F74\u627F +Type110ToothlessSingleRowCrossRollerStyle=110\u578B\u65E0\u9F7F\u5F0F\u5355\u6392\u4EA4\u53C9\u6EDA\u5B50\u8F74\u627F +Type130ToothlessThreeRowsOfRollers=130\u578B\u65E0\u9F7F\u5F0F\u4E09\u6392\u6EDA\u5B50\u8F74\u627F +Type011SmallMeshModulusOfExternalTeethSingle-row4Pstyle=011\u578B\u5916\u9F7F\u5C0F\u6A21\u6570\u5F0F\u5355\u6392\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627F +Type012LargeMeshModulusOfExternalTeethSingle-row4Pstyle=012\u578B\u5916\u9F7F\u5927\u6A21\u6570\u5F0F\u5355\u6392\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627F +Type013SmallMeshingModulusOfInnerTeethSingle-row4Pstyle=013\u578B\u5185\u9F7F\u5C0F\u6A21\u6570\u5F0F\u5355\u6392\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627F +Type014LargeMeshingModulusOfInnerTeethSingle-row4Pstyle=014\u578B\u5185\u9F7F\u5927\u6A21\u6570\u5F0F\u5355\u6392\u56DB\u70B9\u63A5\u89E6\u7403\u8F74\u627F +Type021SmallMeshModulusOfExternalTeethDoubleRejectionBallStyle=021\u578B\u5916\u9F7F\u5C0F\u6A21\u6570\u5F0F\u53CC\u6392\u5F02\u5F84\u7403\u8F74\u627F +Type022LargeMeshModulusOfExternalTeethDoubleRejectionBallStyle=022\u578B\u5916\u9F7F\u5927\u6A21\u6570\u5F0F\u53CC\u6392\u5F02\u5F84\u7403\u8F74\u627F +Type023SmallMeshingModulusOfInnerTeethDoubleRejectionBallStyle=023\u578B\u5185\u9F7F\u5C0F\u6A21\u6570\u5F0F\u53CC\u6392\u5F02\u5F84\u7403\u8F74\u627F +Type024LargeMeshingModulusOfInnerTeethDoubleRejectionBallStyle=024\u578B\u5185\u9F7F\u5927\u6A21\u6570\u5F0F\u53CC\u6392\u5F02\u5F84\u7403\u8F74\u627F +Type111SmallMeshModulusOfExternalTeethSingleRowCrossRollerStyle=111\u578B\u5916\u9F7F\u5C0F\u6A21\u6570\u5F0F\u5355\u6392\u4EA4\u53C9\u6EDA\u5B50\u8F74\u627F +Type112LargeMeshModulusOfExternalTeethSingleRowCrossRollerStyle=112\u578B\u5916\u9F7F\u5927\u6A21\u6570\u5F0F\u5355\u6392\u4EA4\u53C9\u6EDA\u5B50\u8F74\u627F +Type113SmallMeshingModulusOfInnerTeethSingleRowCrossRollerStyle=113\u578B\u5185\u9F7F\u5C0F\u6A21\u6570\u5F0F\u5355\u6392\u4EA4\u53C9\u6EDA\u5B50\u8F74\u627F +Type114LargeMeshingModulusOfInnerTeethSingleRowCrossRollerStyle=114\u578B\u5185\u9F7F\u5927\u6A21\u6570\u5F0F\u5355\u6392\u4EA4\u53C9\u6EDA\u5B50\u8F74\u627F +Type131SmallMeshModulusOfExternalTeethThreeRowsOfRollers=131\u578B\u5916\u9F7F\u5C0F\u6A21\u6570\u5F0F\u4E09\u6392\u6EDA\u5B50\u8F74\u627F +Type132LargeMeshModulusOfExternalTeethThreeRowsOfRollers=132\u578B\u5916\u9F7F\u5927\u6A21\u6570\u5F0F\u4E09\u6392\u6EDA\u5B50\u8F74\u627F +Type133SmallMeshingModulusOfInnerTeethThreeRowsOfRollers=133\u578B\u5185\u9F7F\u5C0F\u6A21\u6570\u5F0F\u4E09\u6392\u6EDA\u5B50\u8F74\u627F +Type134LargeMeshingModulusOfInnerTeethThreeRowsOfRollers=134\u578B\u5185\u9F7F\u5927\u6A21\u6570\u5F0F\u4E09\u6392\u6EDA\u5B50\u8F74\u627F +Type030ToothlessDoubleRowFourPointContactBallStyle=030\u578B\u65E0\u9F7F\u5F0F\u53CC\u6392\u56DB\u70B9\u63A5\u89E6\u8F74\u627F +Type031SmallMeshModulusOfExternalTeethdoublerow4Pstyle=031\u578B\u5916\u9F7F\u5C0F\u6A21\u6570\u5F0F\u53CC\u6392\u56DB\u70B9\u63A5\u89E6\u8F74\u627F +Type032LargeMeshModulusOfExternalTeethdoublerow4Pstyle=032\u578B\u5916\u9F7F\u5927\u6A21\u6570\u5F0F\u53CC\u6392\u56DB\u70B9\u63A5\u89E6\u8F74\u627F +Type033SmallMeshingModulusOfInnerTeethdoublerow4Pstyle=033\u578B\u5185\u9F7F\u5C0F\u6A21\u6570\u5F0F\u53CC\u6392\u56DB\u70B9\u63A5\u89E6\u8F74\u627F +Type034LargeMeshingModulusOfInnerTeethdoublerow4Pstyle=034\u578B\u5185\u9F7F\u5927\u6A21\u6570\u5F0F\u53CC\u6392\u56DB\u70B9\u63A5\u89E6\u8F74\u627F +UnilateralBearing=\u5355\u5411\u8F74\u627F +TypeDXZ(OneRowNeedleAndOneRowBall)=DXZ\u578B\uFF08\u4E00\u5217\u6EDA\u9488\u4E00\u5217\u94A2\u7403\uFF09 +TypeDX(SeparatedOuterRingType)=DX\u578B\uFF08\u5916\u5708\u5206\u79BB\u578B\uFF09 +TypeOW(OneRowAbnormityRollerAndOneRowBall)=OW\u578B\uFF08\u4E00\u5217\u5F02\u5F62\u6EDA\u5B50\u4E00\u5217\u94A2\u7403\uFF09 +TypeNB(SingleShortNeedle)=NB\u578B\uFF08\u5355\u5217\u77ED\u6EDA\u9488\uFF09 +TypeBB(SingleLongNeedle)=BB\u578B\uFF08\u5355\u5217\u957F\u6EDA\u9488\uFF09 +TypeCSK(SingleAbnormityRoller)=CSK\u578B\uFF08\u5355\u5217\u5F02\u5F62\u6EDA\u5B50\uFF09 +ClutchReleaseBearingForAutomobiles=\u6C7D\u8F66\u79BB\u5408\u5668\u8F74\u627F +TypeTPush-styleClutchReleaseBearing=T\u578B\uFF08\u63A8\u5F0F\u79BB\u5408\u5668\u5206\u79BB\u8F74\u627F\uFF09 +TypeWTNon-aligningPush-styleOuterRingRotaryClutchReleaseBearingUnit=WT\u578B\uFF08\u975E\u8C03\u5FC3\u63A8\u5F0F\u5916\u5708\u65CB\u8F6C\u7684\u79BB\u5408\u5668\u5206\u79BB\u8F74\u627F\u5355\u5143\uFF09 +TypeNTNon-aligningPush-styleInnerRingRotaryClutchReleaseBearingUnit=NT\u578B\uFF08\u975E\u8C03\u5FC3\u63A8\u5F0F\u5185\u5708\u65CB\u8F6C\u7684\u79BB\u5408\u5668\u5206\u79BB\u8F74\u627F\u5355\u5143\uFF09 +TypeNLNon-aligningDraw-styleClutchReleaseBearingUnit=NL\u578B\uFF08\u975E\u8C03\u5FC3\u62C9\u5F0F\u79BB\u5408\u5668\u5206\u79BB\u8F74\u627F\u5355\u5143\uFF09 +TypeCTSelf-aligningPush-styleClutchReleaseBearingUnit=CT\u578B\uFF08\u81EA\u52A8\u8C03\u5FC3\u63A8\u5F0F\u79BB\u5408\u5668\u5206\u79BB\u8F74\u627F\u5355\u5143\uFF09 +TypeCLSelf-aligningDraw-styleClutchReleaseBearingUnit=CL\u578B\uFF08\u81EA\u52A8\u8C03\u5FC3\u62C9\u5F0F\u79BB\u5408\u5668\u5206\u79BB\u8F74\u627F\u5355\u5143 +LinearBallBearings=\u76F4\u7EBF\u8F74\u627F +TypeLBLinearMotionBallBearing=LB\u578B\uFF08\u76F4\u7EBF\u8FD0\u52A8\u7403\u8F74\u627F\uFF09 +TypeLRLinearMotionRollerBearing=LR\u578B\uFF08\u76F4\u7EBF\u8FD0\u52A8\u6EDA\u5B50\u8F74\u627F\uFF09 +TypeLBSLinearMotionBallRailBearing=LBS\u578B\uFF08\u76F4\u7EBF\u8FD0\u52A8\u7403\u5BFC\u8F68\u652F\u6491\uFF09 +TypeLRSLinearMotionRollerRailBearing=LRS\u578B\uFF08\u76F4\u7EBF\u8FD0\u52A8\u6EDA\u5B50\u5BFC\u8F68\u652F\u6491\uFF09 +TypeLNSLinearMotionNeedleRollerRailBearing=LNS\u578B\uFF08\u76F4\u7EBF\u8FD0\u52A8\u6EDA\u9488\u5BFC\u8F68\u652F\u6491\uFF09 +TypeLBDDrawnCupLinearBearing=LBD\u51B2\u538B\u5916\u5708\u76F4\u7EBF\u8F74\u627F +AutomobileShockAbsorberBearing=\u6C7D\u8F66\u51CF\u9707\u5668\u8F74\u627F +SuspensionStrutBearing=SSB\u578B +BallCageAndBallCageAssembly=\u7403\u7B3C\u53CA\u7403\u7B3C\u603B\u6210 +SeriesBJBallCageBearing=BJ\u7CFB\u5217\u7403\u7B3C +SeriesEBJBallCageBearing=EBJ\u7CFB\u5217\u7403\u7B3C +SeriesUJBallCageBearing=UJ\u7CFB\u5217\u7403\u7B3C +SeriesEUJBallCageBearing=EUJ\u7CFB\u5217\u7403\u7B3C +SeriesRFBallCageBearing=RF\u7CFB\u5217\u7403\u7B3C +SeriesDOJBallCageBearing=DOJ\u7CFB\u5217\u7403\u7B3C +SeriesDOJLBallCageBearing=DOJL\u7CFB\u5217\u7403\u7B3C +SeriesEDOJBallCageBearing=EDOJ\u7CFB\u5217\u7403\u7B3C +SeriesTJBallCageBearing=TJ\u7CFB\u5217\u7403\u7B3C +SeriesETJBallCageBearing=ETJ\u7CFB\u5217\u7403\u7B3C +SeriesVLBallCageBearing=VL\u7CFB\u5217\u7403\u7B3C +SeriesFTJBallCageBearing=FTJ\u7CFB\u5217\u7403\u7B3C +(Series)CageBearingAssembly=\uFF08\u5404\u7C7B\uFF09\u7403\u7B3C\u603B\u6210 +RepairKit=\u4FEE\u7406\u5305 +CeramicBearing=\u9676\u74F7\u8F74\u627F +None=\u65E0 +MiniatureDeepGrooveBallBearing=\u5FAE\u578B\u6DF1\u6C9F\u7403\u8F74\u627F +Series60MiniatureBallBearings=60\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +Series62MiniatureBallBearings=62\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +Series63MiniatureBallBearings=63\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +Series67MiniatureBallBearings=67\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +Series68MiniatureBallBearings=68\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +Series69MiniatureBallBearings=69\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +RISeriesMiniatureBallBearings=\u82F1\u5236RI\u7CFB\u5217\u5FAE\u578B\u7403\u8F74\u627F +OtherPartsAndProducts=\u5176\u4ED6\u96F6\u4EF6\u4EA7\u54C1 +IRSolidFlatBushing=IR\u578B\u5B9E\u4F53\u5E73\u5957\u5708 +IRSSolidBushing(withShaftShoulder)=IRS\u5B9E\u4F53\u8F74\u5957\uFF08\u5E26\u8F74\u80A9\uFF09 +IJStampingCollar=IJ\u578B\u51B2\u538B\u8F74\u5957 +ASGsketOrWasher=AS\u578B\u57AB\u7247\u6216\u57AB\u5708 +LXWheelCoreAndWheelCoreSsembly=LX\u578B\u8F6E\u82AF +NPNeedleOrPinRoller=NP\u6EDA\u9488\u6216\u9500\u8F74 +AutoRockArmBearing=\u6C7D\u8F66\u6447\u81C2\u8F74\u627F +TypeNKSolidCoreShaftRockerArmBearing=NK\u5B9E\u82AF\u8F74\u6447\u81C2\u8F74\u627F +TypeNKOHollowShaftRockerArmBearing=NKO\u7A7A\u82AF\u8F74\u6447\u81C2\u8F74\u627F +BearingOfTextileMachinery=\u7EBA\u7EC7\u673A\u68B0\u8F74\u627F +TypeBZRotorBearing=BZ\u8F6C\u676F\u8F74\u627F +TypeGZOpeningRollerBearing=GZ\u5206\u68B3\u8F8A\u8F74\u627F +TypeSLTopRollerBearing=SL\u4E0A\u7F57\u62C9\u8F74\u627F +TypelZBottomRollerBearing=LZ\u4E0B\u7F57\u62C9\u8F74\u627F +TypeDZSpindleBearing=DZ\u7EBA\u952D\u8F74\u627F +WindingHeadBearing=\u5377\u7ED5\u5934\u8F74\u627F +RollerBearing=\u6EDA\u8F6E\u8F74\u627F +TypeFGeneralBearingForSpinningMachine=F\u578B\u7EBA\u673A\u901A\u7528\u8F74\u627F +OtherNon-standardBearingsOrNonBearingProducts=\u5176\u4ED6\u975E\u6807\u7C7B\u8F74\u627F\u6216\u975E\u8F74\u627F\u7C7B\u4EA7\u54C1 +Non-standardBearings=\u975E\u6807\u7C7B\u8F74\u627F +ComponentBearing=\u7EC4\u4EF6\u8F74\u627F +BearingGeneralParts=\u8F74\u627F\u901A\u7528\u96F6\u4EF6 +Ball=\u94A2\u7403 +TaperedRoller=\u5706\u9525\u6EDA\u5B50 +Needle=\u6EDA\u9488 +CylindricalRoller=\u5706\u67F1\u6EDA\u5B50 +SphericalRoller=\u7403\u9762\u6EDA\u5B50 +CeramicBall=\u9676\u74F7\u7403 +Special-shapedRoller=\u5F02\u5F62\u6EDA\u5B50 +WheelBolt=\u8F66\u8F6E\u87BA\u6813 +O-ring=O\u578B\u5708 +StopRing=\u6B62\u52A8\u73AF +Rivet=\u94C6\u9489 +AdapterSleeve=\u7D27\u5B9A\u5957 +WithdrawalSleeve=\u9000\u5378\u5957 +Grease=\u6DA6\u6ED1\u8102 + diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar$1$1.class b/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar$1$1.class new file mode 100644 index 0000000..7048d68 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar$1$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar$1.class b/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar$1.class new file mode 100644 index 0000000..c50a814 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar.class b/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar.class new file mode 100644 index 0000000..7dc8cfd Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ExpandProgressBar.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ImportORExportProgressBar$1.class b/classes/cn/com/origin/autocodemanager/common/progress/ImportORExportProgressBar$1.class new file mode 100644 index 0000000..cc780da Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ImportORExportProgressBar$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ImportORExportProgressBar.class b/classes/cn/com/origin/autocodemanager/common/progress/ImportORExportProgressBar.class new file mode 100644 index 0000000..d581996 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ImportORExportProgressBar.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ProgressBarEvent.class b/classes/cn/com/origin/autocodemanager/common/progress/ProgressBarEvent.class new file mode 100644 index 0000000..4ac1853 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ProgressBarEvent.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/progress/ProgressBarListener.class b/classes/cn/com/origin/autocodemanager/common/progress/ProgressBarListener.class new file mode 100644 index 0000000..d49e003 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/progress/ProgressBarListener.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView$1.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView$1.class new file mode 100644 index 0000000..c986b27 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView$2.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView$2.class new file mode 100644 index 0000000..26fb453 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView.class new file mode 100644 index 0000000..1cdc376 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractCreateTreeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeData.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeData.class new file mode 100644 index 0000000..42a2f61 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeData.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$AddChildrenNodeAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$AddChildrenNodeAction.class new file mode 100644 index 0000000..4c6a50d Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$AddChildrenNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$CopyCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$CopyCodeNodeAction.class new file mode 100644 index 0000000..756b26f Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$CopyCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$EidtCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$EidtCodeNodeAction.class new file mode 100644 index 0000000..ef6a2ce Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$EidtCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$LockCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$LockCodeNodeAction.class new file mode 100644 index 0000000..b84520c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$LockCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$RemoveCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$RemoveCodeNodeAction.class new file mode 100644 index 0000000..894271a Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$RemoveCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$UnLockCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$UnLockCodeNodeAction.class new file mode 100644 index 0000000..8281b8a Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction$UnLockCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction.class b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction.class new file mode 100644 index 0000000..2f8949a Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/ORTreeContentProvider.class b/classes/cn/com/origin/autocodemanager/common/tree/ORTreeContentProvider.class new file mode 100644 index 0000000..8e9311a Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/ORTreeContentProvider.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/ORTreeLabelProvider.class b/classes/cn/com/origin/autocodemanager/common/tree/ORTreeLabelProvider.class new file mode 100644 index 0000000..58d9a9d Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/ORTreeLabelProvider.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/tree/TreeViewOperation.class b/classes/cn/com/origin/autocodemanager/common/tree/TreeViewOperation.class new file mode 100644 index 0000000..981cd8f Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/tree/TreeViewOperation.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/treetable/AbstractTreeTable.class b/classes/cn/com/origin/autocodemanager/common/treetable/AbstractTreeTable.class new file mode 100644 index 0000000..dafb963 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/treetable/AbstractTreeTable.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/treetable/ORNewItemTreeTableLabelProvider.class b/classes/cn/com/origin/autocodemanager/common/treetable/ORNewItemTreeTableLabelProvider.class new file mode 100644 index 0000000..49e9f92 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/treetable/ORNewItemTreeTableLabelProvider.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/treetable/ORTreeTableContentProvider.class b/classes/cn/com/origin/autocodemanager/common/treetable/ORTreeTableContentProvider.class new file mode 100644 index 0000000..be9c698 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/treetable/ORTreeTableContentProvider.class differ diff --git a/classes/cn/com/origin/autocodemanager/common/treetable/ORTreeTableLabelProvider.class b/classes/cn/com/origin/autocodemanager/common/treetable/ORTreeTableLabelProvider.class new file mode 100644 index 0000000..9331993 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/common/treetable/ORTreeTableLabelProvider.class differ diff --git a/classes/cn/com/origin/autocodemanager/export/ExportNodeOperation.class b/classes/cn/com/origin/autocodemanager/export/ExportNodeOperation.class new file mode 100644 index 0000000..80c3312 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/export/ExportNodeOperation.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/CodeCopyHandler.class b/classes/cn/com/origin/autocodemanager/handlers/CodeCopyHandler.class new file mode 100644 index 0000000..56ff41f Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/CodeCopyHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/DeleteNodeHandler.class b/classes/cn/com/origin/autocodemanager/handlers/DeleteNodeHandler.class new file mode 100644 index 0000000..1226f0c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/DeleteNodeHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/DownListNodeHandler.class b/classes/cn/com/origin/autocodemanager/handlers/DownListNodeHandler.class new file mode 100644 index 0000000..d6106f3 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/DownListNodeHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/ExportNodeHandler.class b/classes/cn/com/origin/autocodemanager/handlers/ExportNodeHandler.class new file mode 100644 index 0000000..c6a0bb0 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/ExportNodeHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/ImportCodeNextIdHandler.class b/classes/cn/com/origin/autocodemanager/handlers/ImportCodeNextIdHandler.class new file mode 100644 index 0000000..7a39f67 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/ImportCodeNextIdHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/ImportNodeHandler.class b/classes/cn/com/origin/autocodemanager/handlers/ImportNodeHandler.class new file mode 100644 index 0000000..d6ad487 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/ImportNodeHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/handlers/UpListNodeHandler.class b/classes/cn/com/origin/autocodemanager/handlers/UpListNodeHandler.class new file mode 100644 index 0000000..f3dae86 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/handlers/UpListNodeHandler.class differ diff --git a/classes/cn/com/origin/autocodemanager/imports/ImportNodeOperation.class b/classes/cn/com/origin/autocodemanager/imports/ImportNodeOperation.class new file mode 100644 index 0000000..9dbb1a2 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/imports/ImportNodeOperation.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/AutoCodeListCodeView.class b/classes/cn/com/origin/autocodemanager/views/AutoCodeListCodeView.class new file mode 100644 index 0000000..0163cdd Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/AutoCodeListCodeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/AutoCodeSegmentView.class b/classes/cn/com/origin/autocodemanager/views/AutoCodeSegmentView.class new file mode 100644 index 0000000..bbe34a5 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/AutoCodeSegmentView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/AutoCodeTestView.class b/classes/cn/com/origin/autocodemanager/views/AutoCodeTestView.class new file mode 100644 index 0000000..124f1e6 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/AutoCodeTestView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/AutoCodeTreeCodeView.class b/classes/cn/com/origin/autocodemanager/views/AutoCodeTreeCodeView.class new file mode 100644 index 0000000..802bd85 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/AutoCodeTreeCodeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codestyleview/CreateCodeStyleView.class b/classes/cn/com/origin/autocodemanager/views/codestyleview/CreateCodeStyleView.class new file mode 100644 index 0000000..ac8e619 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codestyleview/CreateCodeStyleView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog$1.class b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog$1.class new file mode 100644 index 0000000..9b929fe Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog.class b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog.class new file mode 100644 index 0000000..6791bd3 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction$NewCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction$NewCodeNodeAction.class new file mode 100644 index 0000000..d571b50 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction$NewCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction.class b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction.class new file mode 100644 index 0000000..f2c1840 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CopyCodeNodeDialog.class b/classes/cn/com/origin/autocodemanager/views/codeview/CopyCodeNodeDialog.class new file mode 100644 index 0000000..5d5e5f9 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CopyCodeNodeDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$1.class b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$1.class new file mode 100644 index 0000000..f949d89 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$2.class b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$2.class new file mode 100644 index 0000000..75298d9 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$3.class b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$3.class new file mode 100644 index 0000000..5b4be37 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView$3.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView.class b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView.class new file mode 100644 index 0000000..12516dd Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/NewCodeNodeDialog.class b/classes/cn/com/origin/autocodemanager/views/codeview/NewCodeNodeDialog.class new file mode 100644 index 0000000..314a8c7 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/NewCodeNodeDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/codeview/NewCodeTestView.class b/classes/cn/com/origin/autocodemanager/views/codeview/NewCodeTestView.class new file mode 100644 index 0000000..67db847 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/codeview/NewCodeTestView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$CancelDefaultSelectedAction.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$CancelDefaultSelectedAction.class new file mode 100644 index 0000000..fbf060c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$CancelDefaultSelectedAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$NewCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$NewCodeNodeAction.class new file mode 100644 index 0000000..a40299a Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$NewCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$NewCodeNodeValueAction.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$NewCodeNodeValueAction.class new file mode 100644 index 0000000..6ce1475 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$NewCodeNodeValueAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$SetDefaultSelectedAction.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$SetDefaultSelectedAction.class new file mode 100644 index 0000000..3ccef2c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction$SetDefaultSelectedAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction.class new file mode 100644 index 0000000..b2187ce Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$1.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$1.class new file mode 100644 index 0000000..0125d45 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$2.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$2.class new file mode 100644 index 0000000..0babbe5 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$3.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$3.class new file mode 100644 index 0000000..9cd3783 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView$3.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView.class new file mode 100644 index 0000000..bfd46ed Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$1.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$1.class new file mode 100644 index 0000000..6e39308 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$2.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$2.class new file mode 100644 index 0000000..d7d1772 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$MySimpleContentProposalProvider.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$MySimpleContentProposalProvider.class new file mode 100644 index 0000000..3881ed5 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView$MySimpleContentProposalProvider.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView.class new file mode 100644 index 0000000..bc54fb3 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyNodeDialog.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyNodeDialog.class new file mode 100644 index 0000000..82c69da Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyNodeDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyValueNodeDialog.class b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyValueNodeDialog.class new file mode 100644 index 0000000..a01c174 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyValueNodeDialog.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$1.class b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$1.class new file mode 100644 index 0000000..3786212 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$2.class b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$2.class new file mode 100644 index 0000000..f4e2ede Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$3.class b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$3.class new file mode 100644 index 0000000..25b38f7 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1$3.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1.class b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1.class new file mode 100644 index 0000000..ae50367 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView.class b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView.class new file mode 100644 index 0000000..a45eae0 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction$NewCodeNodeAction.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction$NewCodeNodeAction.class new file mode 100644 index 0000000..3628f9c Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction$NewCodeNodeAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction.class new file mode 100644 index 0000000..76fcccd Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView$1.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView$1.class new file mode 100644 index 0000000..d58f5fc Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView.class new file mode 100644 index 0000000..094a84e Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView$1.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView$1.class new file mode 100644 index 0000000..2e4edae Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView$1.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView$2.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView$2.class new file mode 100644 index 0000000..ab37a87 Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView$2.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView.class new file mode 100644 index 0000000..82157aa Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView.class differ diff --git a/classes/cn/com/origin/autocodemanager/views/treecodeview/NewTreeCodeNodeDialog.class b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewTreeCodeNodeDialog.class new file mode 100644 index 0000000..56f2b5f Binary files /dev/null and b/classes/cn/com/origin/autocodemanager/views/treecodeview/NewTreeCodeNodeDialog.class differ diff --git a/classes/icons/add.png b/classes/icons/add.png new file mode 100644 index 0000000..bc58bd7 Binary files /dev/null and b/classes/icons/add.png differ diff --git a/classes/icons/addgroup_16.png b/classes/icons/addgroup_16.png new file mode 100644 index 0000000..71b9d47 Binary files /dev/null and b/classes/icons/addgroup_16.png differ diff --git a/classes/icons/addnode_16.png b/classes/icons/addnode_16.png new file mode 100644 index 0000000..d84fdfd Binary files /dev/null and b/classes/icons/addnode_16.png differ diff --git a/classes/icons/adduser_16.png b/classes/icons/adduser_16.png new file mode 100644 index 0000000..b184734 Binary files /dev/null and b/classes/icons/adduser_16.png differ diff --git a/classes/icons/addvalue_16.png b/classes/icons/addvalue_16.png new file mode 100644 index 0000000..3cf9bd3 Binary files /dev/null and b/classes/icons/addvalue_16.png differ diff --git a/classes/icons/autocode_16.png b/classes/icons/autocode_16.png new file mode 100644 index 0000000..44938f5 Binary files /dev/null and b/classes/icons/autocode_16.png differ diff --git a/classes/icons/autocode_24.png b/classes/icons/autocode_24.png new file mode 100644 index 0000000..2ac939f Binary files /dev/null and b/classes/icons/autocode_24.png differ diff --git a/classes/icons/autocode_32.png b/classes/icons/autocode_32.png new file mode 100644 index 0000000..528106c Binary files /dev/null and b/classes/icons/autocode_32.png differ diff --git a/classes/icons/classficationcode_16.png b/classes/icons/classficationcode_16.png new file mode 100644 index 0000000..d28e0f0 Binary files /dev/null and b/classes/icons/classficationcode_16.png differ diff --git a/classes/icons/close_16.png b/classes/icons/close_16.png new file mode 100644 index 0000000..9935027 Binary files /dev/null and b/classes/icons/close_16.png differ diff --git a/classes/icons/code2_16.png b/classes/icons/code2_16.png new file mode 100644 index 0000000..242a122 Binary files /dev/null and b/classes/icons/code2_16.png differ diff --git a/classes/icons/code_16.png b/classes/icons/code_16.png new file mode 100644 index 0000000..c1757aa Binary files /dev/null and b/classes/icons/code_16.png differ diff --git a/classes/icons/codenode_16.png b/classes/icons/codenode_16.png new file mode 100644 index 0000000..d28e0f0 Binary files /dev/null and b/classes/icons/codenode_16.png differ diff --git a/classes/icons/delete_16.png b/classes/icons/delete_16.png new file mode 100644 index 0000000..dc602bc Binary files /dev/null and b/classes/icons/delete_16.png differ diff --git a/classes/icons/down_16.png b/classes/icons/down_16.png new file mode 100644 index 0000000..35ef44f Binary files /dev/null and b/classes/icons/down_16.png differ diff --git a/classes/icons/edit_16.png b/classes/icons/edit_16.png new file mode 100644 index 0000000..d133306 Binary files /dev/null and b/classes/icons/edit_16.png differ diff --git a/classes/icons/exceltemplate_16.png b/classes/icons/exceltemplate_16.png new file mode 100644 index 0000000..d0f4a26 Binary files /dev/null and b/classes/icons/exceltemplate_16.png differ diff --git a/classes/icons/exceltemplate_32.png b/classes/icons/exceltemplate_32.png new file mode 100644 index 0000000..f961043 Binary files /dev/null and b/classes/icons/exceltemplate_32.png differ diff --git a/classes/icons/export_16.png b/classes/icons/export_16.png new file mode 100644 index 0000000..baa7c0f Binary files /dev/null and b/classes/icons/export_16.png differ diff --git a/classes/icons/exporttoexcel_16.png b/classes/icons/exporttoexcel_16.png new file mode 100644 index 0000000..9cc4cd1 Binary files /dev/null and b/classes/icons/exporttoexcel_16.png differ diff --git a/classes/icons/exporttoexcel_24.png b/classes/icons/exporttoexcel_24.png new file mode 100644 index 0000000..4ec0c15 Binary files /dev/null and b/classes/icons/exporttoexcel_24.png differ diff --git a/classes/icons/folder_16.png b/classes/icons/folder_16.png new file mode 100644 index 0000000..e7499ce Binary files /dev/null and b/classes/icons/folder_16.png differ diff --git a/classes/icons/grant_16.png b/classes/icons/grant_16.png new file mode 100644 index 0000000..f7a63ad Binary files /dev/null and b/classes/icons/grant_16.png differ diff --git a/classes/icons/group_16.png b/classes/icons/group_16.png new file mode 100644 index 0000000..71a4bfb Binary files /dev/null and b/classes/icons/group_16.png differ diff --git a/classes/icons/home_data.png b/classes/icons/home_data.png new file mode 100644 index 0000000..2e436a7 Binary files /dev/null and b/classes/icons/home_data.png differ diff --git a/classes/icons/import_16.png b/classes/icons/import_16.png new file mode 100644 index 0000000..e3213a6 Binary files /dev/null and b/classes/icons/import_16.png differ diff --git a/classes/icons/importhistory_16.png b/classes/icons/importhistory_16.png new file mode 100644 index 0000000..57a85f8 Binary files /dev/null and b/classes/icons/importhistory_16.png differ diff --git a/classes/icons/item_16.png b/classes/icons/item_16.png new file mode 100644 index 0000000..6ff9793 Binary files /dev/null and b/classes/icons/item_16.png differ diff --git a/classes/icons/linkageNode_16.png b/classes/icons/linkageNode_16.png new file mode 100644 index 0000000..2bf5ddd Binary files /dev/null and b/classes/icons/linkageNode_16.png differ diff --git a/classes/icons/linkage_16.png b/classes/icons/linkage_16.png new file mode 100644 index 0000000..3d6c823 Binary files /dev/null and b/classes/icons/linkage_16.png differ diff --git a/classes/icons/list_16.png b/classes/icons/list_16.png new file mode 100644 index 0000000..8c83db0 Binary files /dev/null and b/classes/icons/list_16.png differ diff --git a/classes/icons/listproperty_16.png b/classes/icons/listproperty_16.png new file mode 100644 index 0000000..eccc1f1 Binary files /dev/null and b/classes/icons/listproperty_16.png differ diff --git a/classes/icons/listvalue_16.png b/classes/icons/listvalue_16.png new file mode 100644 index 0000000..ead21d5 Binary files /dev/null and b/classes/icons/listvalue_16.png differ diff --git a/classes/icons/lock_16.png b/classes/icons/lock_16.png new file mode 100644 index 0000000..197232e Binary files /dev/null and b/classes/icons/lock_16.png differ diff --git a/classes/icons/newclassfication_16.png b/classes/icons/newclassfication_16.png new file mode 100644 index 0000000..3c91d1c Binary files /dev/null and b/classes/icons/newclassfication_16.png differ diff --git a/classes/icons/newcodetreenode_16.png b/classes/icons/newcodetreenode_16.png new file mode 100644 index 0000000..92353fc Binary files /dev/null and b/classes/icons/newcodetreenode_16.png differ diff --git a/classes/icons/newlistproperty_16.png b/classes/icons/newlistproperty_16.png new file mode 100644 index 0000000..8c83db0 Binary files /dev/null and b/classes/icons/newlistproperty_16.png differ diff --git a/classes/icons/newlistvalue_16.png b/classes/icons/newlistvalue_16.png new file mode 100644 index 0000000..3cd33d0 Binary files /dev/null and b/classes/icons/newlistvalue_16.png differ diff --git a/classes/icons/ok_16.png b/classes/icons/ok_16.png new file mode 100644 index 0000000..380ce66 Binary files /dev/null and b/classes/icons/ok_16.png differ diff --git a/classes/icons/organization_16.png b/classes/icons/organization_16.png new file mode 100644 index 0000000..88d3093 Binary files /dev/null and b/classes/icons/organization_16.png differ diff --git a/classes/icons/person_16.png b/classes/icons/person_16.png new file mode 100644 index 0000000..fa412c8 Binary files /dev/null and b/classes/icons/person_16.png differ diff --git a/classes/icons/remove_16.png b/classes/icons/remove_16.png new file mode 100644 index 0000000..4ff8845 Binary files /dev/null and b/classes/icons/remove_16.png differ diff --git a/classes/icons/role_16.png b/classes/icons/role_16.png new file mode 100644 index 0000000..78c754d Binary files /dev/null and b/classes/icons/role_16.png differ diff --git a/classes/icons/seq_16.png b/classes/icons/seq_16.png new file mode 100644 index 0000000..fad4c83 Binary files /dev/null and b/classes/icons/seq_16.png differ diff --git a/classes/icons/tree_16.png b/classes/icons/tree_16.png new file mode 100644 index 0000000..6d82492 Binary files /dev/null and b/classes/icons/tree_16.png differ diff --git a/classes/icons/treenode_16.png b/classes/icons/treenode_16.png new file mode 100644 index 0000000..822f6d0 Binary files /dev/null and b/classes/icons/treenode_16.png differ diff --git a/classes/icons/unlock_16.png b/classes/icons/unlock_16.png new file mode 100644 index 0000000..fbf2acc Binary files /dev/null and b/classes/icons/unlock_16.png differ diff --git a/classes/icons/up_16.png b/classes/icons/up_16.png new file mode 100644 index 0000000..96d82de Binary files /dev/null and b/classes/icons/up_16.png differ diff --git a/jxl.jar b/jxl.jar new file mode 100644 index 0000000..4a1fc64 Binary files /dev/null and b/jxl.jar differ diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..8d825fd --- /dev/null +++ b/plugin.xml @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schema/dsds.exsd b/schema/dsds.exsd new file mode 100644 index 0000000..298620c --- /dev/null +++ b/schema/dsds.exsd @@ -0,0 +1,84 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/src/cn/com/origin/autocodemanager/Activator.java b/src/cn/com/origin/autocodemanager/Activator.java new file mode 100644 index 0000000..ade7222 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/Activator.java @@ -0,0 +1,52 @@ +package cn.com.origin.autocodemanager; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "cn.com.origin.autocodemanager.AutoCodeManagerPerspective"; + + // The shared instance + private static Activator plugin; + + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/src/cn/com/origin/autocodemanager/AutoCodeManagerPerspective.java b/src/cn/com/origin/autocodemanager/AutoCodeManagerPerspective.java new file mode 100644 index 0000000..2257c62 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/AutoCodeManagerPerspective.java @@ -0,0 +1,44 @@ +package cn.com.origin.autocodemanager; + +import org.eclipse.ui.IFolderLayout; +import org.eclipse.ui.IPageLayout; + +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.IsShowAutocodeManagerPerspective; + +import com.teamcenter.rac.aifrcp.perspective.AbstractRACPerspective; +import com.teamcenter.rac.util.MessageBox; + +public class AutoCodeManagerPerspective extends AbstractRACPerspective { + /** The perspective ID */ + + public static final String ID = "cn.com.origin.autocodemanager.AutoCodeManagerPerspective"; + + @Override + public void createInitialLayout(IPageLayout layout) { + layout.setEditorAreaVisible(false); + layout.setFixed(false); + String editorArea = layout.getEditorArea(); + if (new IsShowAutocodeManagerPerspective().getValue()) { + layout.addStandaloneView(AutoCodeManangerConstants.AutoCodeManagerView_ID, true, IPageLayout.LEFT, 0.24f, editorArea); + IFolderLayout middleFolder = layout.createFolder("ͼ", IPageLayout.LEFT, 0.68f, editorArea); + + middleFolder.addView(AutoCodeManangerConstants.AutoCodeManagerTreeCodeView_ID); + middleFolder.addView(AutoCodeManangerConstants.AutoCodeManagerListCodeView_ID); + + middleFolder.addView(AutoCodeManangerConstants.AutoCodeTestView_ID); + + layout.getViewLayout(AutoCodeManangerConstants.AutoCodeManagerView_ID).setCloseable(false); + layout.getViewLayout(AutoCodeManangerConstants.AutoCodeManagerView_ID).setMoveable(false); + + layout.getViewLayout(AutoCodeManangerConstants.AutoCodeManagerTreeCodeView_ID).setCloseable(false); + layout.getViewLayout(AutoCodeManangerConstants.AutoCodeManagerTreeCodeView_ID).setMoveable(false); + +// layout.getViewLayout(AutoCodeManangerConstants.AutoCodeTestView_ID).setCloseable(false); + layout.getViewLayout(AutoCodeManangerConstants.AutoCodeTestView_ID).setMoveable(false); + } else { + MessageBox.post("ûȨ!", "INFO", MessageBox.WARNING); + } + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/AbstractTreeViewPart.java b/src/cn/com/origin/autocodemanager/common/AbstractTreeViewPart.java new file mode 100644 index 0000000..320c867 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/AbstractTreeViewPart.java @@ -0,0 +1,31 @@ +/** + * @author tyl + * @Action ini + * 2011-3-22 + */ +package cn.com.origin.autocodemanager.common; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.part.ViewPart; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; + +public class AbstractTreeViewPart extends ViewPart { + public AbstractCreateTreeView createView; + + public AbstractTreeViewPart() { + super(); + } + + @Override + public void createPartControl(Composite parent) { + } + + @Override + public void setFocus() { + + } + + public AbstractCreateTreeView getCreateView() { + return createView; + } +} diff --git a/src/cn/com/origin/autocodemanager/common/AutoCodeConstants.java b/src/cn/com/origin/autocodemanager/common/AutoCodeConstants.java new file mode 100644 index 0000000..82e38d3 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/AutoCodeConstants.java @@ -0,0 +1,32 @@ +package cn.com.origin.autocodemanager.common; + +public interface AutoCodeConstants { + // AutoCode + public static final String AutoCode_APPLICATION_ID = "cn.com.origin.autocode"; + + public static final String AutoCodeCodeView_ID = "cn.com.origin.autocode.views.AutoCodeView"; + public static final String AutoCodeCodeView_Name = ""; + + public static final String AutoCodeItemTypeView_ID = "cn.com.origin.autocode.views.AutoCodeItemTypeView"; + public static final String AutoCodeItemTypeView_Name = ""; + + public static final String AutoCodeGroupView_ID = "cn.com.origin.autocode.views.AutoCodeGroupView"; + public static final String AutoCodeGroupView_Name = "Աָ"; + + public static final String AutoCodeSegmentView_ID = "cn.com.origin.autocodemanager.views.AutoCodeSegmentView"; + public static final String AutoCodeSegmentView_Name = ""; + + + + public static final String as1[] = { "Item" ,"Part","Design"};// +// public static final String as2[] = { "Part", "Design", "PSSignal", "PSConnection", "Schedule", "ScheduleTask", "Architecture", "AllocationMap", "CAEItem", "CAEBCItem", "CAEConnItem", "CAELoadItem", "MEOP", "MEProcess", "MEWorkarea", "MEContext", "MEGenericBOP", "MEProductBOP", +// "Vendor", "BidPackage", "SwDesignComp", "PhysicalPart", "ChangeItem", "ParmDef", "ParmDefBCD", "ParmDefBitDef", "ParmDefBool", "ParmDefDate", "ParmDefDbl", "ParmDefHex", "ParmDefInt", "ParmDefSED", "ParmDefStr", "ParmGrpVal", "CalParm", "ParmGrpDef" }; + + // public static final String as1[] = { "Item", "Drawing" };"Part", "Design", + public static final String as2[] = { "EngChange", "PSSignal", "PSConnection", "Schedule", "ScheduleTask", "Architecture", "AllocationMap", "CAEItem", "CAEBCItem", "CAEConnItem", "CAELoadItem", "MEOP", "MEProcess", "MEWorkarea", "MEContext", "MEGenericBOP", "MEProductBOP", + "Vendor", "BidPackage", "SwDesignComp", "PhysicalPart", "ChangeItem", "ParmDef", "ParmDefBCD", "ParmDefBitDef", "ParmDefBool", "ParmDefDate", "ParmDefDbl", "ParmDefHex", "ParmDefInt", "ParmDefSED", "ParmDefStr", "ParmGrpVal", "CalParm", "ParmGrpDef" }; + + // public static final String startWithTypes[]={"SJ3_"}; +// public static final String startWithTypes[] = {}; + +} diff --git a/src/cn/com/origin/autocodemanager/common/AutoCodeManagerImageKey.java b/src/cn/com/origin/autocodemanager/common/AutoCodeManagerImageKey.java new file mode 100644 index 0000000..f1fc696 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/AutoCodeManagerImageKey.java @@ -0,0 +1,43 @@ +package cn.com.origin.autocodemanager.common; + +public interface AutoCodeManagerImageKey { + public static final String ICONSPATH = "icons/"; + public static final String HOME_IMAGE = ICONSPATH + "home_data.png"; + + public static final String CODE_IMAGE = ICONSPATH + "code_16.png"; + public static final String CODEGROUP_IMAGE = ICONSPATH + "folder_16.png"; + + public static final String NODEVALUE_IMAGE = ICONSPATH + "nodevalue_16.png"; + public static final String CODENODE_IMAGE = ICONSPATH + "codenode_16.png"; + + public static final String TREE_IMAGE = ICONSPATH + "tree_16.png"; + public static final String TREENODE_IMAGE = ICONSPATH + "treenode_16.png"; + + public static final String LIST_IMAGE = ICONSPATH + "list_16.png"; + public static final String LISTNODE_IMAGE = ICONSPATH + "listproperty_16.png"; + public static final String LISTVALUE_IMAGE = ICONSPATH + "listvalue_16.png"; + + public static final String OK_IMAGE = ICONSPATH + "ok_16.png"; + public static final String CLOSE_IMAGE = ICONSPATH + "close_16.png"; + + public static final String IMPORT_IMAGE = ICONSPATH + "import_16.png"; + public static final String EXPORT_IMAGE = ICONSPATH + "export_16.png"; + + public static final String ORGANIZATION_IMAGE = ICONSPATH + "organization_16.png"; + public static final String GROUP_IMAGE = ICONSPATH + "group_16.png"; + public static final String ROLE_IMAGE = ICONSPATH + "role_16.png"; + public static final String PERSON_IMAGE = ICONSPATH + "person_16.png"; + + public static final String ITEM_IMAGE = ICONSPATH + "item_16.png"; + + public static final String LOCK_IMAGE = ICONSPATH + "lock_16.png"; + public static final String UNLOCK_IMAGE = ICONSPATH + "unlock_16.png"; + + public static final String EDIT_IMAGE = ICONSPATH + "edit_16.png"; + public static final String REMOVE_IMAGE = ICONSPATH + "remove_16.png"; + public static final String DELETE_IMAGE = ICONSPATH + "delete_16.png"; + + public static final String SEQ_IMAGE = ICONSPATH + "seq_16.png"; + public static final String ADD_IMAGE = ICONSPATH + "add.png"; + +} diff --git a/src/cn/com/origin/autocodemanager/common/AutoCodeManagerPropertyName.java b/src/cn/com/origin/autocodemanager/common/AutoCodeManagerPropertyName.java new file mode 100644 index 0000000..3e9529c --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/AutoCodeManagerPropertyName.java @@ -0,0 +1,151 @@ +package cn.com.origin.autocodemanager.common; + +public interface AutoCodeManagerPropertyName { + // Cd9_TreeAndListCodeNode + public final static String TreeAndListCodeNode_isContainsChildren = "isContainsChildren" ;// Ƿӽڵ + public final static String TreeAndListCodeNode_uid = "uid" ;// uid + public final static String TreeAndListCodeNode_node_index = "cd9_node_index"; // Integer ڵ + public final static String TreeAndListCodeNode_node_type = "cd9_node_type";// String ڵ + public final static String TreeAndListCodeNode_node_name = "cd9_node_name";// String ڵ + public final static String TreeAndListCodeNode_node_value = "cd9_node_value"; // String ڵֵ + public final static String TreeAndListCodeNode_node_desc = "cd9_node_desc"; // String ڵ + public final static String TreeAndListCodeNode_code_style = "cd9_code_style"; // String ʽ + public final static String TreeAndListCodeNode_code_length = "cd9_code_length"; // int 볤 + public final static String TreeAndListCodeNode_is_root = "cd9_is_root";// boolean ǷǸڵ + public final static String TreeAndListCodeNode_rule_node = "cd9_rule_node";// boolean ǷǸڵ + public final static String TreeAndListCodeNode_reference_nodes = "cd9_reference_nodes"; // õĽڵ + + public final static String TreeAndListCodeNode_is_lock = "cd9_is_lock";// boolean Ƿ + public final static String TreeAndListCodeNode_create_date = "cd9_create_date";// Date + public final static String TreeAndListCodeNode_last_revise_date = "cd9_last_revise_date";// Date ޸ + public final static String TreeAndListCodeNode_create_user = "cd9_create_user";// TypeReference + public final static String TreeAndListCodeNode_last_revise_user = "cd9_last_revise_user";// TypeReference ޸ + + public final static String TreeAndListCodeNode_seq_begin_value = "cd9_seq_begin_value"; // Integer ˮʼֵ + public final static String TreeAndListCodeNode_seq_max_value = "cd9_seq_max_value"; // Integer ˮֵ + public final static String TreeAndListCodeNode_seq_length = "cd9_seq_length"; // Integer ˮ볤 + public final static String TreeAndListCodeNode_isDefaultSelected = "cd9_isDefaultSelected"; // boolean ǷΪĬѡУб + + String[] searchTreeAndListCodeNodePropNames = { + AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, + AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, + AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, + AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, + AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, + AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, + + AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, + AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, + AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, + + AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, + AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, + + AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, + AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, + AutoCodeManagerPropertyName.TreeAndListCodeNode_isContainsChildren + }; + + String[] searchSegmentPropNames = { + AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, + AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, + AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, + AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, + AutoCodeManagerPropertyName.TreeAndListCodeNode_isContainsChildren + }; + + // Cd9_CodeRelation + public final static String CodeRelation_parent_node = "cd9_parent_nodes"; // TypeReference ڵ + public final static String CodeRelation_current_node = "cd9_current_node"; // TypeReference ǰڵ + public final static String CodeRelation_children_nodes = "cd9_children_nodes"; // TypeReference ӽڵ + + public final static String CodeRelation_create_date = "cd9_create_date";// Date + public final static String CodeRelation_create_user = "cd9_create_user";// TypeReference + + // Cd9_ClassificationCodeNode + public final static String ClassificationCodeNode_node_index = "cd9_node_index"; // Integer ڵ + public final static String ClassificationCodeNode_node_name = "cd9_node_name";// String ڵ + public final static String ClassificationCodeNode_segment = "cd9_segment";// String + public final static String ClassificationCodeNode_create_date = "cd9_create_date";// Date + public final static String ClassificationCodeNode_last_revise_date = "cd9_last_revise_date";// Date ޸ + public final static String ClassificationCodeNode_create_user = "cd9_create_user";// TypeReference + public final static String ClassificationCodeNode_last_revise_user = "cd9_last_revise_user";// TypeReference ޸ + public final static String ClassificationCodeNode_grant_users = "cd9_grant_users";// TypeReference Ȩû + public final static String ClassificationCodeNode_grant_roles = "cd9_grant_roles";// TypeReference Ȩɫ + public final static String ClassificationCodeNode_grant_groups = "cd9_grant_groups";// TypeReference Ȩ + + // type + public final static String ItemName = "item"; + public final static String RootNodeName = "root"; + public final static String TreeName = "tree"; + public final static String ListName = "list"; + public final static String CodeGroupName = "codeGroup"; + public final static String TreeNodeName = "treeNode"; + public final static String ListPropertyNodeName = "listPropertyNode"; + public final static String ListPropertyValueNodeName = "listPropertyValueNode"; + + public final static String ComponentName = "component"; + public final static String OrganizationName = "organization"; + public final static String SegmentName = "segment"; + public final static String GroupName = "group"; + public final static String RoleName = "role"; + public final static String UserName = "user"; + public final static String LockName = "lock"; + public final static String AddChildrenTreeNodeName = "AddChildrenTreeNode"; + public final static String AddTreeNodeName = "AddTreeNode"; + public final static String AddRuleRootNodeName = "AddRuleRootNode"; + public final static String AddRuleGroupNodeName = "AddRuleGroupNode"; + + // Item + public final static String Item_Desc = "object_desc"; + public final static String Item_generateID = "cd9_generateID"; + public final static String Item_codeDesc = "cd9_codeDesc"; + public final static String Item_isLock = "cd9_isLock"; + public final static String Item_codePattern = "cd9_codePattern"; + public final static String Item_codeRuleName = "cd9_codeRuleName"; + public final static String Item_codeID = "cd9_codeID"; + public final static String Item_codeStyle = "cd9_codeStyle"; + public final static String Item_uom_tag = "uom_tag"; + + + + // Item Revision + public final static String ItemRevision_isLock = "cd9_isLock"; + + // codeStyle + public final static String Code_seq = "[L]"; + public final static String Code_pattern = "[T]"; + public final static String Code_year2 = "[YY]"; + public final static String Code_year4 = "[YYYY]"; + public final static String Code_mouth2 = "[MM]"; + public final static String Code_mouth1 = "[M]"; + public final static String Code_date2 = "[DD]"; + public final static String Code_date1 = "[D]"; + + // Cd9_CodeCounter + public final static String CodeCounter_index = "cd9_index"; + public final static String CodeCounter_name = "cd9_name"; + public final static String CodeCounter_recycleID = "cd9_recycleID"; + public final static String CodeCounter_isUsed = "cd9_isUsed"; + public final static String CodeCounter_createDate = "cd9_createDate"; + public final static String CodeCounter_createUser = "cd9_createUser"; + public final static String CodeCounter_last_revise_date = "cd9_last_revise_date";// Date ޸ + public final static String CodeCounter_last_revise_user = "cd9_last_revise_user"; + + // Cd9_CodeNextID + public final static String Counter_name = "cd9_name"; + public final static String Counter_nextID = "cd9_nextID"; + + // йص뵼 + public final static String CodeClassfication = "CodeClassfication"; + public final static String CodeTree = "CodeTree"; + public final static String CodeListName = "CodeListName"; + public final static String CodeListValue = "CodeListValue"; + +// public final static String[] TreeAndListCodeNode_Titles = { "", "", "", "ֵ", "ע", "ʽ", "볤", "ˮʼֵ", "ˮֵ", "ǷΪڵ", "Ƿ", "", "޸", "", "޸" }; + + public final static String[] TreeAndListCodeNode_Titles = { "", "", "", "ֵ", "ע", "ǷΪĬֵ", "ʽ", "볤", "ˮʼֵ", "ˮֵ", "ǷΪڵ", "Ƿ", "", "޸", "", "޸" }; + public final static String[] ClassificationCodeNode_Titles = { "", "", "", "ֵ", "ע", "ʽ", "ǷΪڵ", "Ƿ", "", "޸", "", "޸" }; + public final static String[] CodeSequence_Titles = { "", "", "ʼֵ", "ֵ", "", "", "", "Ƿ", "", "޸", "", "޸" }; + +} diff --git a/src/cn/com/origin/autocodemanager/common/AutoCodeManangerConstants.java b/src/cn/com/origin/autocodemanager/common/AutoCodeManangerConstants.java new file mode 100644 index 0000000..b8ca404 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/AutoCodeManangerConstants.java @@ -0,0 +1,34 @@ +package cn.com.origin.autocodemanager.common; + +/** + * @author river + * + */ +public interface AutoCodeManangerConstants { + // autocodemannager + public static final String AutoCodeMananger_APPLICATION_ID = "cn.com.origin.autocodemanager"; + public static final String AutoCodeManagerView_ID = "cn.com.origin.autocodemanager.views.AutoCodeSegmentView"; + public static final String AutoCodeManagerView_Name = ""; + public static final String AutoCodeManagerTreeCodeView_ID = "cn.com.origin.autocodemanager.views.AutoCodeTreeCodeView"; + public static final String AutoCodeManagerTreeCodeView_Name = ""; + public static final String AutoCodeManagerListCodeView_ID = "cn.com.origin.autocodemanager.views.AutoCodeListCodeView"; + public static final String AutoCodeManagerListCodeView_Name = "б"; + +// public static final String AutoCodeTreeCodeView_ID = "cn.com.origin.autocodemanager.views.AutoCodeTreeCodeView"; +// public static final String AutoCodeTreeCodeView_Name = ""; + +// public static final String AutoCodeListCodeView_ID = "cn.com.origin.autocodemanager.views.AutoCodeListCodeView"; +// public static final String AutoCodeListCodeView_Name = "б"; + + + public static final String AutoCodeManangerShowNoneView_Name = ""; + public static final String AutoCodeManangerShowNoneView_ID = "cn.com.origin.autocodemanager.views.ShowNoneView"; + + public static final String AutoCodeStyleView_ID = "cn.com.origin.autocodemanager.views.AutoCodeStyleView"; + public static final String AutoCodeStyleView_Name = "ʽ"; + + public static final String AutoCodeManagerGroupView_ID = "cn.com.origin.autocodemanager.views.AutoCodeGroupView"; + public static final String AutoCodeTestView_ID = "cn.com.origin.autocodemanager.views.AutoCodeTestView"; + public static final String AutoCodeTestView_Name = "֤"; + +} \ No newline at end of file diff --git a/src/cn/com/origin/autocodemanager/common/BusinessType.java b/src/cn/com/origin/autocodemanager/common/BusinessType.java new file mode 100644 index 0000000..7a531b1 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/BusinessType.java @@ -0,0 +1,218 @@ +package cn.com.origin.autocodemanager.common; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import javax.swing.ImageIcon; +import com.teamcenter.rac.common.TCUtilities; +import com.teamcenter.rac.common.create.DisplayTypeInfo; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCComponentGroup; +import com.teamcenter.rac.kernel.TCComponentGroupMember; +import com.teamcenter.rac.kernel.TCComponentGroupMemberType; +import com.teamcenter.rac.kernel.TCComponentGroupType; +import com.teamcenter.rac.kernel.TCComponentRole; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCPreferenceService; +import com.teamcenter.rac.kernel.TCSession; + +public class BusinessType { + private TCSession session; + protected Map typeToIcon; + private String origin_codeNeedLoadItemStartWords = "origin_codeNeedLoadItemStartWords"; + private String origin_codeNeedLoadItemTypes = "origin_codeNeedLoadItemTypes"; + + public BusinessType(TCSession session) { + this.session = session; + } + + public void getItemTypes(String rootType) { + com.teamcenter.services.rac.core._2007_06.DataManagement.BaseClassInput abaseclassinput[] = new com.teamcenter.services.rac.core._2007_06.DataManagement.BaseClassInput[1]; + abaseclassinput[0] = new com.teamcenter.services.rac.core._2007_06.DataManagement.BaseClassInput(); + abaseclassinput[0].baseClass = rootType; + try { + HashMap hashmap = (HashMap) TCUtilities.getDisplayableTypeNamesWithDisplayInfo(session, abaseclassinput); + } catch (TCException e) { + e.printStackTrace(); + } + } + + public Map getTypes(String rootType, String exclusionTypes[]) { + HashMap hashmap = new HashMap(); + com.teamcenter.services.rac.core._2007_06.DataManagement.BaseClassInput abaseclassinput[] = new com.teamcenter.services.rac.core._2007_06.DataManagement.BaseClassInput[1]; + abaseclassinput[0] = new com.teamcenter.services.rac.core._2007_06.DataManagement.BaseClassInput(); + abaseclassinput[0].baseClass = rootType; + // abaseclassinput[0].exclusionTypes = exclusionTypes; + // TCUtilities.getDisplayTypeInfoFromTypeNames(tcsession, as) + try { + hashmap = (HashMap) TCUtilities.getDisplayableTypeNamesWithDisplayInfo(session, abaseclassinput); + + Set key = hashmap.keySet(); + Iterator it = key.iterator(); + Set value = hashmap.entrySet(); + Iterator it2 = value.iterator(); + } catch (TCException e) { + e.printStackTrace(); + } + return hashmap; + } + + /** + * + * ȡϵͳû + * + * @return + * @throws TCException + */ + public TCComponent[] getGroup() throws TCException { + return ((TCComponentGroupType) session.getTypeComponent("Group")).extent(); + } + + /** + * ȡṹ + * + * @return + * @throws TCException + */ + public TCComponent[] getRootGroups() throws TCException { + return ((TCComponentGroupType) session.getTypeComponent("Group")).getRootGroups(); + } + + /** + * ȡϵͳԱ + * + * @return + * @throws TCException + */ + public TCComponent[] getGroupaArrayList() throws TCException { + + TCComponent[] tccomponentGroups = null; + TCComponentGroupMemberType groupMember = (TCComponentGroupMemberType) session.getTypeComponent("GroupMember"); + tccomponentGroups = groupMember.extent(); + if (tccomponentGroups != null && tccomponentGroups.length > 0) { + for (int i = 0; i < tccomponentGroups.length; i++) { + TCComponentGroupMember tccomponentGroupMembers = (TCComponentGroupMember) tccomponentGroups[i]; + TCComponentGroup group = tccomponentGroupMembers.getGroup(); + } + } + return tccomponentGroups; + } + + public TCComponent[] getGroupRoles(TCComponentGroup componentGroup) { + if (componentGroup == null) { + return null; + } + TCComponent[] components = null; + try { + components = componentGroup.getRolesAndGroups(); + } catch (TCException e) { + e.printStackTrace(); + } + return components; + } + + public TCComponent[] getRoleUsers(TCComponentGroup componentGroup, TCComponentRole role) { + if ((componentGroup == null) || (role == null)) { + return null; + } + + TCComponent[] components = null; + try { + components = role.getUsers(componentGroup); + } catch (TCException e) { + e.printStackTrace(); + } + return components; + } + + public ImageIcon getSelectedTypeIcon(String s) { + ImageIcon imageicon = null; + if (typeToIcon == null) + typeToIcon = new HashMap(0); + imageicon = (ImageIcon) typeToIcon.get(s); + return imageicon; + } + + public Map loadTypes(String s1[], String s2[]) { + Map map = buildInput(s1, s2); + Map newHashMap = new HashMap(); + long time11 = System.nanoTime(); + //Map hashMap = TCUtilities.loadSubClassesTypesAndIcons(session, map); +// 20130913 mod + Map hashMap = TCUtilities.loadSubTypesAndIcons(session, map); + long time12 = System.nanoTime(); + System.out.println("ʱ(ms) " + (time12 - time11) / 1000000); + if (hashMap != null && hashMap.size() > 0) { + Set entry = hashMap.entrySet(); + Object entryValue[] = entry.toArray(); + Set key = hashMap.keySet(); + Object keyValue[] = key.toArray(); + for (int m = 0; m < keyValue.length; m++) { + DisplayTypeInfo displaytypeinfo = (DisplayTypeInfo) keyValue[m]; + String typeName = displaytypeinfo.getTypeName(); + // String[] startWithTypes = AutoCodeConstants.startWithTypes; + String[] needLoadItemTypes = TCPreferenceUitl.getPreference(session, TCPreferenceService.TC_preference_site, origin_codeNeedLoadItemTypes); + String[] startWithTypes = TCPreferenceUitl.getPreference(session, TCPreferenceService.TC_preference_site, origin_codeNeedLoadItemStartWords); + if (needLoadItemTypes.length > 0) { + for (int i = 0; i < needLoadItemTypes.length; i++) { + if (typeName.equals(needLoadItemTypes[i].trim())) { + if (!newHashMap.containsKey(keyValue[m])) { + newHashMap.put(keyValue[m], hashMap.get(keyValue[m])); + } + } else { + continue; + } + } + } else { + if (startWithTypes.length > 0) { + for (int i = 0; i < startWithTypes.length; i++) { + // System.out.println("startWithTypes[i].trim()=================" + startWithTypes[i].trim()); + if (startWithTypes[i].trim().length() > 0) { + if (typeName.startsWith(startWithTypes[i].trim())) { + if (!newHashMap.containsKey(keyValue[m])) { + newHashMap.put(keyValue[m], hashMap.get(keyValue[m])); + } + } else { + continue; + } + } + } + } else { + newHashMap.put(keyValue[m], hashMap.get(keyValue[m])); + } + } + } + } + return newHashMap; + } + + private Map buildInput(String s[], String ss[]) { + HashMap hashmap = null; + String as[] = s; + if (as != null && as.length > 0) { + hashmap = new HashMap(as.length); + String as1[] = as; + int i = as1.length; + for (int j = 0; j < i; j++) { + String s1 = as1[j]; + if (s1 == null || s1.trim().length() <= 0) + continue; + String as2[] = ss; + ArrayList arraylist = new ArrayList(0); + if (as2 != null && as2.length > 0) { + String as3[] = as2; + int k = as3.length; + for (int l = 0; l < k; l++) { + String s3 = as3[l]; + if (s3 != null && s3.trim().length() > 0) + arraylist.add(s3.trim()); + } + } + hashmap.put(s1, arraylist); + } + } + return hashmap; + } +} diff --git a/src/cn/com/origin/autocodemanager/common/CacheImage.java b/src/cn/com/origin/autocodemanager/common/CacheImage.java new file mode 100644 index 0000000..637dc0d --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/CacheImage.java @@ -0,0 +1,120 @@ +package cn.com.origin.autocodemanager.common; + +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.awt.image.DirectColorModel; +import java.awt.image.ImageObserver; +import java.awt.image.WritableRaster; +import java.net.URL; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.swing.ImageIcon; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +public class CacheImage { + private final Map imageMap = new HashMap(); + + private static CacheImage INSTANCE; + + private CacheImage() { + } + + // ģʽCacheImageʵ + public static CacheImage getINSTANCE() { + if (INSTANCE == null) + INSTANCE = new CacheImage(); + return INSTANCE; + } + + // ͼ + public Image getImage(String applicationID,String imageName) { + if (imageName == null) + return null; + Image image = (Image) imageMap.get(imageName); + if (image == null) { + image =AbstractUIPlugin.imageDescriptorFromPlugin( + applicationID,imageName).createImage(); + imageMap.put(imageName, image); + } + + return image; + } + + // ͼ + public Image getImageIco(URL url,String imageName) { + if (imageName == null) + return null; + Image image = (Image) imageMap.get(imageName); + if (image == null) { + ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(url); + image =imageDescriptor.createImage(); + imageMap.put(imageName, image); + } + + return image; + } + + // ͷͼԴ + public void dispose() { + Iterator iterator = imageMap.values().iterator(); + while (iterator.hasNext()) + ((Image) iterator.next()).dispose(); + imageMap.clear(); + } + + /** + * change ImageIcon to BufferedImage + * @param icon + * @return + */ + public static BufferedImage getBufferedImage(ImageIcon icon){ + int width = icon.getIconWidth(); + int height = icon.getIconHeight(); + ImageObserver observer = icon.getImageObserver(); + BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + Graphics gc = bufferedImage.createGraphics(); + gc.drawImage(icon.getImage(), 0, 0, observer); + return bufferedImage; + } + + /** + * change BufferedImage to ImageData + * @param bufferedImage + * @return + */ + public static ImageData getImageData(BufferedImage bufferedImage){ + DirectColorModel colorModel = (DirectColorModel) bufferedImage.getColorModel(); + PaletteData palette = new PaletteData(colorModel.getRedMask(), colorModel.getGreenMask(), colorModel + .getBlueMask()); + ImageData data = new ImageData(bufferedImage.getWidth(), bufferedImage.getHeight(), colorModel + .getPixelSize(), palette); + WritableRaster raster = bufferedImage.getRaster(); + int[] pixelArray = new int[3]; + for (int y = 0; y < data.height; y++) { + for (int x = 0; x < data.width; x++) { + raster.getPixel(x, y, pixelArray); + int pixel = palette.getPixel(new RGB(pixelArray[0], pixelArray[1], pixelArray[2])); + data.setPixel(x, y, pixel); + } + } + return data; + } + + + public void testSwingToSwtImage() + { + ImageIcon icon = new ImageIcon("C:\\temp\\freshwind.jpg"); + BufferedImage bufferedImage = getBufferedImage(icon); + ImageData data = getImageData(bufferedImage); + Image image = new Image(null, data); + + } +} \ No newline at end of file diff --git a/src/cn/com/origin/autocodemanager/common/CreateCompositeUtil.java b/src/cn/com/origin/autocodemanager/common/CreateCompositeUtil.java new file mode 100644 index 0000000..9da21f2 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/CreateCompositeUtil.java @@ -0,0 +1,277 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.common; + +import java.util.Date; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.DateTime; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.Text; + +public class CreateCompositeUtil { + + public static Group createCompositeGroup(Composite parent, String title) { + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 1; + GridData gridData = new GridData(); + gridData.verticalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = true; + gridData.verticalSpan = 1; + gridData.horizontalAlignment = GridData.FILL; + Group codeTreeGroup = new Group(parent, SWT.NONE); + codeTreeGroup.setText(title); + codeTreeGroup.setLayout(gridLayout); + codeTreeGroup.setLayoutData(gridData); + return codeTreeGroup; + } + + public static Label createLabel(Composite composite, String text, + int heightLength, int widthLength) { + Label newLabel = new Label(composite, SWT.NONE); + // Label newLabel = toolkit.createLabel(composite, text); + newLabel.setText(text); + GridData gridData = new GridData(); + gridData.heightHint = heightLength; + gridData.widthHint = widthLength; + newLabel.setLayoutData(gridData); + newLabel.setVisible(true); + return newLabel; + } + + public static Label createSeparator(Composite composite, String text, + int heightLength, int widthLength) { + // Label separator = toolkit.createLabel(composite, ""); + Label separator = new Label(composite, SWT.NONE); + separator.setText(""); + GridData gridData1 = new GridData(); + gridData1.heightHint = heightLength; + gridData1.widthHint = widthLength; + separator.setLayoutData(gridData1); + separator.setVisible(true); + return separator; + } + + public static Combo createNotFillNewCombo(Composite parent, String[] items) { + Combo newCombo = new Combo(parent, SWT.BORDER); + newCombo.setLayoutData(getNotFillNewGridData()); + newCombo.setItems(items); + return newCombo; + } + + // public static Combo createNotFillNewCombo(Table parent, String[] items) { + // Combo newCombo = new Combo(parent, SWT.BORDER); + // newCombo.setLayoutData(getNotFillNewGridData()); + // newCombo.setItems(items); + // return newCombo; + // } + + public static GridData getNotFillNewGridData() { + GridData gridData = new GridData(); + gridData.verticalAlignment = GridData.FILL; + return gridData; + } + + public static Text createText(Composite composite, String text, + int heightLength, int widthLength) { + // Text newText = toolkit.createText(composite, ""); + Text newText = new Text(composite, SWT.BORDER); + newText.setText(text); + + GridData gridData1 = new GridData(); + gridData1.heightHint = heightLength; + gridData1.widthHint = widthLength; + newText.setLayoutData(gridData1); + newText.setVisible(true); + return newText; + } + + public static Combo createCombo(Composite composite, String[] items, + int heightLength, int widthLength) { + Combo newCombo = new Combo(composite, 8); + GridData gridData = new GridData(); + gridData.heightHint = heightLength; + gridData.widthHint = widthLength; + newCombo.setLayoutData(gridData); + if ((items != null) && (items.length > 0)) { + newCombo.setItems(items); + } + newCombo.setVisible(true); + return newCombo; + } + + public static Combo createNewCombo(Composite composite, int heightLength, + int widthLength) { + Combo newCombo = new Combo(composite, 8); + GridData gridData = new GridData(); + gridData.heightHint = heightLength; + gridData.widthHint = widthLength; + newCombo.setLayoutData(gridData); + newCombo.setVisible(true); + return newCombo; + } + + public static Button createButton(Composite composite, String text, + int heightLength, int widthLength) { + // Button newButton = toolkit.createButton(composite, text, 8); + Button newButton = new Button(composite, SWT.NONE); + GridData gridData1 = new GridData(); + gridData1.heightHint = heightLength; + gridData1.widthHint = widthLength; + newButton.setLayoutData(gridData1); + newButton.setVisible(true); + return newButton; + } + + public static Text createTextArea(Composite composite, String text, + int heightLength, int widthLength) { + Text newTextArea = new Text(composite, SWT.MULTI | SWT.WRAP + | SWT.V_SCROLL | SWT.BORDER); + GridData gridData1 = new GridData(); + gridData1.heightHint = heightLength; + gridData1.widthHint = widthLength; + newTextArea.setLayoutData(gridData1); + newTextArea.setVisible(true); + return newTextArea; + } + + public static Text createNewTextArea(Composite parent, String initValue) { + Text newText = new Text(parent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL + | SWT.BORDER); + newText.setLayoutData(getNewGridData()); + newText.setText(initValue); + return newText; + } + + public static DateTime createDateButton(Composite composite, Date date, + int heightLength, int widthLength) { + DateTime newCombo = new DateTime(composite, SWT.MULTI | SWT.WRAP + | SWT.V_SCROLL | SWT.BORDER); + GridData gridData = new GridData(); + gridData.heightHint = heightLength; + gridData.widthHint = widthLength; + newCombo.setLayoutData(gridData); + if (date != null) { + newCombo.setData(date); + } + newCombo.setVisible(true); + return newCombo; + } + + public static GridData getNewGridData() { + GridData gridData = new GridData(); + gridData.horizontalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = false; + gridData.verticalAlignment = GridData.FILL; + return gridData; + } + + + + public static Text createNewText(Composite parent, String initValue) { + Text newText = new Text(parent, SWT.BORDER); + newText.setLayoutData(getNewGridData()); + newText.setText(initValue); + return newText; + } + + + + public static Button createNewCheckBox(Composite parent, String title) { + Button newButton = new Button(parent, SWT.CHECK); + newButton.setLayoutData(getNewGridData()); + newButton.setText(title); + return newButton; + } + + public static Combo createNewCombo(Composite parent, String[] items) { + Combo newCombo = new Combo(parent, SWT.BORDER); + newCombo.setLayoutData(getNewGridData()); + newCombo.setItems(items); + return newCombo; + } + + public static Combo createNewCombo(Composite parent) { + Combo newCombo = new Combo(parent, SWT.BORDER); + newCombo.setLayoutData(getNewGridData()); + return newCombo; + } + + public static Button createNewButton(Composite composite, String text) { + // Button newButton = toolkit.createButton(composite, text, 8); + Button newButton = new Button(composite, SWT.BUTTON1 | SWT.BORDER + | SWT.COLOR_BLUE); + GridData gridData1 = new GridData(); + gridData1.heightHint = 40; + gridData1.widthHint = 100; + newButton.setLayoutData(gridData1); + newButton.setText(text); + newButton.setVisible(true); + return newButton; + } + + public static Label createNewLabel(Composite parent, String title) { + Label label = new Label(parent, SWT.NONE); + label.setText(title + ""); + return label; + } + + public static Label createNewWhiteLabel(Composite parent, String title) { + Label label = new Label(parent, SWT.NONE); + label.setText(title + ""); + label.setBackground(Display.getCurrent() + .getSystemColor(SWT.COLOR_WHITE)); + return label; + } + + /*** + * ̷Ҫչ + * + * @param composite + * @param text + * @param heightLength + * @param widthLength + * @return + */ + public static Table createNewTable(Composite composite, String text, + int heightLength, int widthLength) { + final Table table = new Table(composite, SWT.MULTI | SWT.FULL_SELECTION); + + // Text newTextArea = new Text(composite, SWT.MULTI | SWT.WRAP | + // SWT.V_SCROLL | SWT.BORDER); + GridData gridData1 = new GridData(); + // gridData1.heightHint = heightLength; + // gridData1.widthHint = widthLength; + // gridData1.horizontalAlignment = SWT.FILL; + // gridData1.grabExcessHorizontalSpace = true; + gridData1.grabExcessVerticalSpace = true; + gridData1.verticalAlignment = SWT.FILL; + table.addListener(SWT.MeasureItem, new Listener() { // һSWT.MeasureItemÿҪԪݵĴСʱͻᱻá + public void handleEvent(Event event) { + event.width = table.getGridLineWidth(); // ÿ + event.height = (int) Math.floor(event.gc + .getFontMetrics().getHeight() * 2); // ø߶Ϊ߶ȵ1.5 + } + }); + table.setLayoutData(gridData1); + table.setLinesVisible(true); + table.setVisible(true); + return table; + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/GetChoosePath.java b/src/cn/com/origin/autocodemanager/common/GetChoosePath.java new file mode 100644 index 0000000..c2ec942 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/GetChoosePath.java @@ -0,0 +1,106 @@ +/* +#============================================================================= +# +# copyright (c) 2009 Origin Enterprise Solution LTD. +# +#============================================================================= +# File name: GetChoosePath.java +# File description: +#============================================================================= +# Date Name Action Description of Change +# 2009-11-23 tyl õûѡ· +#============================================================================= + */ + +package cn.com.origin.autocodemanager.common; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; + +import javax.swing.JFileChooser; + +public class GetChoosePath { + private String title; + + public GetChoosePath(String title) { + this.title = title; + } + + /** + * getChoosePath:õûѡ· + * @param @return 趨ļ + * @return String + * @throws + * @since CodingExampleVer 1.1 + */ + public File getChooseFile() { +// List choosePath = new ArrayList(); + String tempPath = System.getProperty("java.io.tmpdir"); + File tempFile = new File(tempPath + "\\importjobshop.txt"); + JFileChooser jfc = null; + if (!tempFile.exists()) { + try { + tempFile.createNewFile(); + jfc = new JFileChooser(); + } catch (IOException e) { + e.printStackTrace(); + } + } else { + if (tempFile.exists()) { + BufferedReader in; + try { + in = new BufferedReader(new InputStreamReader(new FileInputStream(tempFile))); + String line; + try { + line = in.readLine(); + if ((line != null) && (line.length() > 0)) { + File file = new File(line); + if (file.exists()) { + jfc = new JFileChooser(file); + } else { + jfc = new JFileChooser(); + } + } else { + jfc = new JFileChooser(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } catch (FileNotFoundException e1) { + e1.printStackTrace(); + } + } + } + jfc.setFileSelectionMode(JFileChooser.CUSTOM_DIALOG); + jfc.setInheritsPopupMenu(true); + jfc.setDialogTitle(title); + jfc.setMultiSelectionEnabled(true); + + int openOrCancel = jfc.showSaveDialog(null); + File file = null; + if (openOrCancel == 0) { + try { + BufferedWriter output; + output = new BufferedWriter(new FileWriter(tempFile)); + output.write(jfc.getSelectedFile().getAbsolutePath()); + output.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + + // File[] files = jfc.getSelectedFiles(); + // for (int i = 0; i < files.length; i++) { + // choosePath.add(files[i].getAbsolutePath()); + // } + file = jfc.getSelectedFile(); + } + // return choosePath; + return file; + } +} diff --git a/src/cn/com/origin/autocodemanager/common/IsShowAutocodeManagerPerspective.java b/src/cn/com/origin/autocodemanager/common/IsShowAutocodeManagerPerspective.java new file mode 100644 index 0000000..9d79683 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/IsShowAutocodeManagerPerspective.java @@ -0,0 +1,61 @@ +package cn.com.origin.autocodemanager.common; + +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCPreferenceService; +import com.teamcenter.rac.kernel.TCSession; + +public class IsShowAutocodeManagerPerspective { + + //ֻڴѡõûȨ + private String showAutocodeManagerUserOptionName = "origin_showAutocodeManagerUsers"; + + public IsShowAutocodeManagerPerspective() { + + } + /** + * ͨ鵱ǰûǷȨ޲ + * @return + */ + public boolean getValue() { + boolean flag = false; + try { + TCSession session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + String userID = session.getUser().getUserId(); + flag = isExist(userID, showAutocodeManagerUserOptionName); + } catch (TCException e) { + e.printStackTrace(); + } + return flag; + } + /** + * ûǷѡƥ + * @param value + * @param optionName + * @return + */ + public boolean isExist(String value, String optionName) { + boolean flag = false; + try { + TCSession session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + TCPreferenceService preferenceService = session.getPreferenceService(); + String preferenceValues[] = preferenceService.getStringArray(TCPreferenceService.TC_preference_site, optionName); + if (preferenceValues != null && preferenceValues.length > 0) { + for (int i = 0; i < preferenceValues.length; i++) { + // System.out.println("preferenceValues===========" + + // preferenceValues[i]); + if (preferenceValues[i].trim().equalsIgnoreCase(value)) { + flag = true; + return flag; + } + } + } else { + flag = true; + return flag; + } + } catch (Exception e) { + e.printStackTrace(); + } + return flag; + } +} diff --git a/src/cn/com/origin/autocodemanager/common/PackCodeDescInfos.java b/src/cn/com/origin/autocodemanager/common/PackCodeDescInfos.java new file mode 100644 index 0000000..487a5c2 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/PackCodeDescInfos.java @@ -0,0 +1,125 @@ +package cn.com.origin.autocodemanager.common; + +import javax.swing.JTextField; + +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +import com.teamcenter.rac.util.iTextField; + +public class PackCodeDescInfos { + + private String generateID; + private String idDesc; + private String idjl; + private String codetz; + private AbstractTreeData selectedSegmentNode; + private String codeStyle; + + private iTextField idValueIText; + private iTextField revValueIText; + private iTextField nameValueIText; + + private JTextField idValueJText; + private JTextField revValueJText; + private JTextField nameValueJText; + + public PackCodeDescInfos() { + } + + public String getGenerateID() { + return generateID; + } + + public void setGenerateID(String generateID) { + this.generateID = generateID; + } + + public String getIdDesc() { + return idDesc; + } + + public void setIdDesc(String idDesc) { + this.idDesc = idDesc; + } + + public String getIdjl() { + return idjl; + } + + public void setIdjl(String idjl) { + this.idjl = idjl; + } + + public String getCodetz() { + return codetz; + } + + public void setCodetz(String codetz) { + this.codetz = codetz; + } + + public AbstractTreeData getSelectedSegmentNode() { + return selectedSegmentNode; + } + + public void setSelectedSegmentNode(AbstractTreeData selectedSegmentNode) { + this.selectedSegmentNode = selectedSegmentNode; + } + + public String getCodeStyle() { + return codeStyle; + } + + public void setCodeStyle(String codeStyle) { + this.codeStyle = codeStyle; + } + + public iTextField getIdValueIText() { + return idValueIText; + } + + public void setIdValueIText(iTextField idValueIText) { + this.idValueIText = idValueIText; + } + + public iTextField getRevValueIText() { + return revValueIText; + } + + public void setRevValueIText(iTextField revValueIText) { + this.revValueIText = revValueIText; + } + + public iTextField getNameValueIText() { + return nameValueIText; + } + + public void setNameValueIText(iTextField nameValueIText) { + this.nameValueIText = nameValueIText; + } + + public JTextField getIdValueJText() { + return idValueJText; + } + + public void setIdValueJText(JTextField idValueJText) { + this.idValueJText = idValueJText; + } + + public JTextField getRevValueJText() { + return revValueJText; + } + + public void setRevValueJText(JTextField revValueJText) { + this.revValueJText = revValueJText; + } + + public JTextField getNameValueJText() { + return nameValueJText; + } + + public void setNameValueJText(JTextField nameValueJText) { + this.nameValueJText = nameValueJText; + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/TCLOVUtil.java b/src/cn/com/origin/autocodemanager/common/TCLOVUtil.java new file mode 100644 index 0000000..9750c10 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/TCLOVUtil.java @@ -0,0 +1,26 @@ +package cn.com.origin.autocodemanager.common; + +import com.teamcenter.rac.kernel.TCComponentListOfValues; +import com.teamcenter.rac.kernel.TCComponentListOfValuesType; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; + +public class TCLOVUtil { + + + public static TCComponentListOfValues findLOVByName(TCSession tcsession, String s) { + TCComponentListOfValues tccomponentlistofvalues = null; + try { + TCComponentListOfValuesType tccomponentlistofvaluestype = (TCComponentListOfValuesType) tcsession.getTypeComponent("ListOfValues"); + TCComponentListOfValues atccomponentlistofvalues[] = tccomponentlistofvaluestype.find(s); + if (atccomponentlistofvalues != null && atccomponentlistofvalues.length > 0) + tccomponentlistofvalues = atccomponentlistofvalues[0]; + else + tccomponentlistofvalues = null; + } catch (TCException tcexception) { + tccomponentlistofvalues = null; + } + return tccomponentlistofvalues; + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/TCPreferenceUitl.java b/src/cn/com/origin/autocodemanager/common/TCPreferenceUitl.java new file mode 100644 index 0000000..e539570 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/TCPreferenceUitl.java @@ -0,0 +1,134 @@ +package cn.com.origin.autocodemanager.common; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Vector; + +import cn.com.origin.autocodemanager.common.encrypt.EncryptOperations; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; + +import com.teamcenter.rac.kernel.TCPreferenceService; +import com.teamcenter.rac.kernel.TCSession; + +public class TCPreferenceUitl { + + public String getEnv(String name) { + String str = ""; + Iterator it = System.getenv().entrySet().iterator(); + while (it.hasNext()) { + Map.Entry entry = (Map.Entry) it.next(); + // logger.info("entry-" + entry.getKey() + ":" + entry.getValue()); + if (entry.getKey().toString().equals(name)) { + str = entry.getValue() + ""; + if (!str.endsWith("\\")) { + str = str + "\\"; + } + break; + } + } + return str; + } + + /** + * @param tcsession + * @param preferenceName + * @param isSelectName + * @return + */ + public static boolean isSelectExsitToTCPreferenceValues(TCSession tcsession, String preferenceName, String isSelectName) { + boolean flag = false; + TCPreferenceService preferenceService = tcsession.getPreferenceService(); + String preferenceValues[] = preferenceService.getStringArray(TCPreferenceService.TC_preference_site, preferenceName); + if (preferenceValues == null) { + return false; + } + if (preferenceValues != null && preferenceValues.length > 0) { + for (int i = 0; i < preferenceValues.length; i++) { + // System.out.println(preferenceValues[i]); + if (preferenceValues[i].trim().equals(isSelectName)) { + flag = true; + return flag; + } + } + } + return flag; + } + + private static boolean isWriteExpire = false; + + public static synchronized boolean isWriteExpire() { + return isWriteExpire; + } + + public static synchronized void setWriteExpire(boolean isWriteExpire) { + TCPreferenceUitl.isWriteExpire = isWriteExpire; + } + + public static boolean isTrueTCPreferenceValue(TCSession tcsession, String preferenceName) { + boolean flag = false; + TCPreferenceService preferenceService = tcsession.getPreferenceService(); + String value = preferenceService.getString(TCPreferenceService.TC_preference_site, preferenceName); + if (value == null) { + return false; + } + if (value.equalsIgnoreCase("true")) { + flag = true; + } + return flag; + } + + public static String getTCPreferenceValue(TCSession tcsession, String preferenceName) { + TCPreferenceService preferenceService = tcsession.getPreferenceService(); + String value = preferenceService.getString(TCPreferenceService.TC_preference_all, preferenceName); + return value; + } + + public static String[] getListPreference(TCSession session, int scope, String pid) { + try { + String options[] = session.getPreferenceService().getStringArray(scope, pid); + return options; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public static HashMap getPreferenceHashMap(TCSession pSession, int pScope, String pid) { + HashMap hm = new HashMap(); + Vector preferencekeyNames = new Vector(); + try { + String options[] = getPreference(pSession, pScope, pid); + if (options == null) { + return hm; + } + if (options == null || options.length == 0) + return null; + String key = ""; + String value = ""; + for (int i = 0; i < options.length; i++) + if (options[i].indexOf("=") > 0) { + key = options[i].substring(0, options[i].indexOf("=")); + value = options[i].substring(options[i].indexOf("=") + 1); + hm.put(key, value); + preferencekeyNames.add(key); + } else { + hm.put((new StringBuilder()).append(i).toString(), options[i]); + } + } catch (Exception e) { + e.printStackTrace(); + return null; + } + return hm; + } + + public static String[] getPreference(TCSession session, int scope, String pid) { + try { + String options[] = session.getPreferenceService().getStringArray(scope, pid); + return options; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/src/cn/com/origin/autocodemanager/common/TCQueryUtil.java b/src/cn/com/origin/autocodemanager/common/TCQueryUtil.java new file mode 100644 index 0000000..aed0165 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/TCQueryUtil.java @@ -0,0 +1,50 @@ +package cn.com.origin.autocodemanager.common; + +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.kernel.TCComponentContextList; +import com.teamcenter.rac.kernel.TCComponentQuery; +import com.teamcenter.rac.kernel.TCComponentQueryType; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.kernel.TCTextService; + +public class TCQueryUtil { + + public static InterfaceAIFComponent[] searchComponentsCollection(TCSession session, String searchName, String[] keys, String[] values) { + // Ϣ + InterfaceAIFComponent[] result = new InterfaceAIFComponent[0]; + try { + TCTextService textService = session.getTextService(); + TCComponentQueryType querytype = (TCComponentQueryType) session.getTypeComponent("ImanQuery"); + TCComponentQuery query = (TCComponentQuery) querytype.find(searchName); + if (query == null) { + // MessageBox.post("뽨ѯ" + searchName + "!", "INFO", MessageBox.INFORMATION); + return result; + } + querytype.clearCache(); + String[] as = new String[keys.length]; + for (int i = 0; i < keys.length; i++) { + as[i] = textService.getTextValue(keys[i]); + } + + String[] as1 = new String[values.length]; + for (int i = 0; i < values.length; i++) { + as1[i] = textService.getTextValue(values[i]); + } + query.clearCache(); + TCComponentContextList list = query.getExecuteResultsList(as, as1); + if (list != null) { + int count = list.getListCount(); + result = new InterfaceAIFComponent[count]; + for (int i = 0; i < count; i++) { + result[i] = list.get(i).getComponent(); + } + } + } catch (TCException e) { + // MessageBox.post("ͨѯ" + searchName + "ѯ.", "INFO", MessageBox.ERROR); + e.printStackTrace(); + } + return result; + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/dialog/AbstractCodeDialog.java b/src/cn/com/origin/autocodemanager/common/dialog/AbstractCodeDialog.java new file mode 100644 index 0000000..6a32e4c --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/dialog/AbstractCodeDialog.java @@ -0,0 +1,380 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.common.dialog; + +import java.util.HashMap; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import cn.com.origin.autocodemanager.common.AutoCodeConstants; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.views.AutoCodeListCodeView; +import cn.com.origin.autocodemanager.views.AutoCodeSegmentView; +import cn.com.origin.autocodemanager.views.AutoCodeTreeCodeView; + +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class AbstractCodeDialog extends Dialog { + public AbstractCreateTreeView createView; + public AbstractTreeData selectedTreeData; + public TCComponent selectedComponent; + public String title; + public boolean isEdit; + public TreeAndListCodeOperation treeAndListCodeOperation; + public TreeViewOperation treeViewOperation; + public Text nodeDescriptionText; + public Text nodeNameText; + public Text nodeValueText; + public Text codeStyleText; + public Text codeLengthText; + public Combo typeCombo; + public TCSession session; + public AutoCodeListCodeView codeListView; + public AutoCodeSegmentView codeSegmentView; + public AutoCodeTreeCodeView codeTreeView; + public Text seqBeginText; + public Text seqMaxText; + public Text seqStepText; + public Text seqExcludeStrText; + + public AbstractCodeDialog(Shell parentShell, AbstractCreateTreeView createView, String title, boolean isEdit) { + //super(parentShell); + super(new Shell()); + this.setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE + | SWT.APPLICATION_MODAL); + this.createView = createView; + this.title = title; + this.isEdit = isEdit; + + + initParams(); + this.selectedTreeData = treeViewOperation.getSelectedTreeNode(createView.treeViewer); + if (selectedTreeData != null) { + this.selectedComponent = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + } + } + + public void initParams() { + this.treeAndListCodeOperation = new TreeAndListCodeOperation(); + session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + this.treeViewOperation = new TreeViewOperation(); + codeListView = (AutoCodeListCodeView) createView.viewPart.getSite().getPage().findView(AutoCodeManangerConstants.AutoCodeManagerListCodeView_ID); + codeSegmentView = (AutoCodeSegmentView) createView.viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + codeTreeView = (AutoCodeTreeCodeView) createView.viewPart.getSite().getPage().findView(AutoCodeManangerConstants.AutoCodeManagerTreeCodeView_ID); + } + + public AbstractCodeDialog(Shell parentShell, AbstractCreateTreeView createView, String title) { + super(parentShell); + this.title = title; + this.createView = createView; + this.treeAndListCodeOperation = new TreeAndListCodeOperation(); + session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + + return container; + } + + public void initNewCodeComposite(Composite composite) { + + } + + public String getSeqLength() { + String maxValue = getTextValue(seqMaxText); + if ((!maxValue.equalsIgnoreCase("0")) && (maxValue.trim().length() > 0)) { + return String.valueOf(maxValue.trim().length()); + } else { + return "0"; + } + } + + public void saveNewCodeNode(AbstractTreeData parentTreeData, TCComponent updateComponent, TreeViewer treeViewer, String type, boolean isRoot) { + HashMap hashMap = new HashMap(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + try { + if (isEdit) { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, getTextValue(nodeNameText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, getTextValue(nodeValueText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, getTextValue(codeStyleText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, getTextValue(codeLengthText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, getTextValue(nodeDescriptionText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, ""); + + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, getTextValue(seqBeginText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, getSeqLength()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value, getTextValue(seqMaxText)); + if (updateComponent != null) { + treeAndListCodeOperation.updateTreeORListNode(updateComponent, hashMap); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + treeViewer.refresh(selectedTreeData); + } + } else { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_index, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, getTextValue(nodeNameText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, getTextValue(nodeValueText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, type); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, getTextValue(codeStyleText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, getTextValue(codeLengthText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, ""); + + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, getTextValue(nodeDescriptionText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, String.valueOf(isRoot)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, "false"); + + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, getTextValue(seqBeginText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, getSeqLength()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value, getTextValue(seqMaxText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes, ""); + + TCComponent ruleComponent = null; + if (!isRoot) { + AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + if (segmentTreeData != null) { + ruleComponent = segmentTreeData.getPackCodeNodeInfo().getNodeComponent(); + } + } + TCComponent newComponent = new TreeAndListCodeOperation().createNewTreeORListNode(ruleComponent, parentTreeData, hashMap); + if (newComponent == null) { + return; + } + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(newComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + AbstractTreeData treeData = new AbstractTreeData(parentTreeData, packCodeNodeInfo); + treeViewOperation.addExistCodeNode(treeViewer, parentTreeData, treeData); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + } + + public String getTextValue(Text text) { + if (text != null) { + return text.getText().trim(); + } else { + return ""; + } + } + + public void createSeqComposite(Composite parent) { + Composite composite = new Composite(parent, 0); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + GridData gridData1 = new GridData(); + gridData1.horizontalAlignment = GridData.FILL; + gridData1.grabExcessHorizontalSpace = true; + gridData1.verticalSpan = 20; + gridData1.grabExcessVerticalSpace = true; + gridData1.verticalAlignment = GridData.FILL; + composite.setLayoutData(gridData1); + composite.setLayout(gridLayout1); + initSeqPropertyComposite(composite); + try { + if (selectedTreeData != null) { + TCComponent selectedComp = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + selectedComp.refresh(); + if (selectedComp != null) { + selectedComp.refresh(); + String seqProperty[] = { AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value }; + String[] seqValues = selectedComp.getProperties(seqProperty); + setTextValue(seqBeginText, seqValues[0]); + setTextValue(seqMaxText, seqValues[1]); + } + } + } catch (TCException e) { + e.printStackTrace(); + } + } + + public void initSeqPropertyComposite(Composite parent) { + Composite seqComposite = new Composite(parent, SWT.NONE); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + GridData gridData1 = new GridData(); + gridData1.horizontalAlignment = GridData.FILL; + gridData1.grabExcessHorizontalSpace = true; + gridData1.verticalSpan = 20; + gridData1.grabExcessVerticalSpace = true; + gridData1.verticalAlignment = GridData.FILL; + + seqComposite.setLayoutData(gridData1); + seqComposite.setLayout(gridLayout1); + createNewLabel(seqComposite, "ʼֵ"); + seqBeginText = createNewText(seqComposite, "1"); + createNewLabel(seqComposite, "ֵ"); + seqMaxText = createNewText(seqComposite, "9"); + } + + public void createNodeComposite(Composite parent) { + Composite composite = new Composite(parent, 0); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + GridData gridData1 = new GridData(); + gridData1.horizontalAlignment = GridData.FILL; + gridData1.grabExcessHorizontalSpace = true; + gridData1.verticalSpan = 20; + gridData1.grabExcessVerticalSpace = true; + gridData1.verticalAlignment = GridData.FILL; + composite.setLayoutData(gridData1); + composite.setLayout(gridLayout1); + initNewCodeComposite(composite); + try { + if (selectedTreeData != null) { + TCComponent selectedComp = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(selectedComp, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + if (selectedComp != null) { + selectedComp.refresh(); + String seqProperty[] = { AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value }; + + String[] seqValues = selectedComp.getProperties(seqProperty); + setTextValue(codeStyleText, packCodeNodeInfo.getCode_style()); + setTextValue(codeLengthText, seqValues[0]); + + setTextValue(nodeNameText, packCodeNodeInfo.getNode_name()); + setTextValue(nodeValueText, packCodeNodeInfo.getNode_value()); + setTextValue(nodeDescriptionText, packCodeNodeInfo.getNode_desc()); + + setTextValue(seqBeginText, seqValues[1]); + setTextValue(seqMaxText, seqValues[2]); + if (typeCombo != null) { + if (packCodeNodeInfo.getNode_type().equals(AutoCodeManagerPropertyName.ListName)) { + typeCombo.setText("б"); + } else { + typeCombo.setText(""); + } + if (isEdit) { + typeCombo.setEnabled(false); + } + } + } + } + } catch (TCException e) { + e.printStackTrace(); + } catch (ServiceException e) { + e.printStackTrace(); + } + } + + public void setTextValue(Text text, String value) { + if (text != null) { + text.setText(value); + } + } + + public GridData getNewGridData() { + GridData gridData = new GridData(); + gridData.horizontalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = false; + gridData.verticalAlignment = GridData.FILL; + return gridData; + } + + public Group createCompositeGroup(Composite parent, String title) { + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 1; + GridData gridData = new GridData(); + gridData.verticalAlignment = GridData.FILL; + gridData.grabExcessHorizontalSpace = true; + gridData.grabExcessVerticalSpace = true; + gridData.verticalSpan = 1; + gridData.horizontalAlignment = GridData.FILL; + Group codeTreeGroup = new Group(parent, SWT.NONE); + codeTreeGroup.setText(title); + codeTreeGroup.setLayout(gridLayout); + codeTreeGroup.setLayoutData(gridData); + return codeTreeGroup; + } + + public Text createNewText(Composite parent, String initValue) { + Text newText = new Text(parent, SWT.BORDER); + newText.setLayoutData(getNewGridData()); + newText.setText(initValue); + return newText; + } + + public Button createNewCheckBox(Composite parent, String title) { + Button newButton = new Button(parent, SWT.CHECK); + newButton.setLayoutData(getNewGridData()); + newButton.setText(title); + return newButton; + } + + public Combo createNewCombo(Composite parent, String[] items) { + Combo newCombo = new Combo(parent, SWT.BORDER); + newCombo.setLayoutData(getNewGridData()); + newCombo.setItems(items); + return newCombo; + } + + public Label createNewLabel(Composite parent, String title) { + Label label = new Label(parent, SWT.NONE); + label.setText(title + ""); + return label; + } + + public void postMesssageBox(String info) { + MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.OK); + mb.setText("INFO"); + mb.setMessage(info); + mb.open(); + } + + // Իť + @Override + protected void createButtonsForButtonBar(final Composite parent) { + createButton(parent, IDialogConstants.OK_ID, "ȷ", true); + createButton(parent, IDialogConstants.CANCEL_ID, "ر", false); + getButton(IDialogConstants.OK_ID).setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.OK_IMAGE)); + getButton(IDialogConstants.CANCEL_ID).setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.CLOSE_IMAGE)); + } + + @Override + public boolean close() { + return super.close(); + } + + @Override + protected Point getInitialSize() { + return new Point(230, 150); + } +} diff --git a/src/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog.java b/src/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog.java new file mode 100644 index 0000000..afa1789 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/dialog/AbstractCodeSegmentDialog.java @@ -0,0 +1,186 @@ +/** + * @author tyl + * @Action ini + * 2011-4-1 + */ +package cn.com.origin.autocodemanager.common.dialog; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TreeEvent; +import org.eclipse.swt.events.TreeListener; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Tree; +import cn.com.origin.autocodemanager.common.AutoCodeConstants; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.progress.ExpandProgressBar; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.ORTreeContentProvider; +import cn.com.origin.autocodemanager.common.tree.ORTreeLabelProvider; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.views.AutoCodeSegmentView; + +public class AbstractCodeSegmentDialog extends Dialog { + public TreeViewer treeViewer; + public Tree tree; + public AbstractCreateTreeView abstractTreeView; + public AbstractCreateTreeView createView; + public String title; + public TreeViewOperation treeViewOperation; + public int selected = 0; + public String action; + public AutoCodeSegmentView codeSegmentView; + public TreeAndListCodeOperation treeAndListCodeOperation; + + public AbstractCodeSegmentDialog(Shell parentShell, AbstractCreateTreeView createView, String title) { + super(parentShell); + this.createView = createView; + this.title = title; + initParams(); + codeSegmentView = (AutoCodeSegmentView) createView.viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + } + + public AbstractCodeSegmentDialog(Shell parentShell, AbstractCreateTreeView createView, String title, String action) { + super(parentShell); + this.createView = createView; + this.title = title; + initParams(); + this.action = action; + codeSegmentView = (AutoCodeSegmentView) createView.viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + } + + public AbstractCodeSegmentDialog(Shell parentShell, String title) { + super(parentShell); + this.title = title; + initParams(); + } + +private void initParams() +{ + this.setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE + | SWT.APPLICATION_MODAL); + this.treeViewOperation = new TreeViewOperation(); + this.treeAndListCodeOperation=new TreeAndListCodeOperation(); + +} + + public void createBottomComposite(Composite parent) { + } + + public void createTreeComposite(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + FillLayout gridLayout1 = new FillLayout(); + GridData gridData1 = new GridData(); + gridData1.horizontalAlignment = GridData.FILL; + gridData1.grabExcessHorizontalSpace = true; + gridData1.verticalSpan = 20; + gridData1.grabExcessVerticalSpace = true; + gridData1.verticalAlignment = GridData.FILL; + composite.setLayoutData(gridData1); + composite.setLayout(gridLayout1); + createTree(composite, ""); + } + + public void initTree(String rootName) { + treeViewer.setLabelProvider(new ORTreeLabelProvider()); + treeViewer.setContentProvider(new ORTreeContentProvider()); + AbstractTreeData treeData = new AbstractTreeData(null, null, rootName, AutoCodeManagerPropertyName.SegmentName, false); + treeViewer.setInput((new Object[] { treeData })); + addRightKeyAction(); + } + + public void createTree(Composite parent, String rootName) { + Composite composite = parent; + treeViewer = new TreeViewer(composite, SWT.BORDER); + tree = treeViewer.getTree(); + initTree(rootName); + + treeViewer.expandToLevel(1); + tree.addTreeListener(new TreeListener() { + public void treeCollapsed(TreeEvent treeEvent) { + } + public void treeExpanded(TreeEvent treeEvent) { + if (selected <= 1) { + selected++; + } + AbstractTreeData codeData = (AbstractTreeData) treeEvent.item.getData(); + if (codeData == null) { + return; + } + try { + expandNode(codeData); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + + tree.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + if (selected <= 1) { + selected++; + } + AbstractTreeData selectedData = (AbstractTreeData) e.item.getData(); + if (selectedData == null) { + return; + } + if (selectedData.getParentTreeData() == null) { + expandNode(selectedData); + } + } + }); + } + + /* + * (non-Javadoc) + * + * @see cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView#addRightKeyAction() + */ + public void addRightKeyAction() {} + public void expandNode(AbstractTreeData codeData) { + if (selected == 1) { + return; + } + AbstractTreeData[] codeDatas = new AbstractTreeData[] { codeData }; + if (codeData == null) { + return; + } + if (codeData.isChildrenLoader()) { + codeDatas = codeData.getChildrenDatas(); + } + ExpandProgressBar expandProgressBar = new ExpandProgressBar(Display.getDefault().getActiveShell(), "ڴ", this, codeDatas); + try { + expandProgressBar.expand(); + } catch (Exception e) { + e.printStackTrace(); + } + } + /* + * (non-Javadoc) + * + * @see cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView#createOrgAutoCodeNodeChildren(cn.com.origin.autocodemanager.common.tree.AbstractTreeData[]) + */ +// + public void createOrgAutoCodeNodeChildren(AbstractTreeData[] codeDatas) throws Exception {} + + // öԻ򴰿ڱͼ + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(title); + newShell.setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.CODENODE_IMAGE)); + } +} diff --git a/src/cn/com/origin/autocodemanager/common/encrypt/EncryptOperations.java b/src/cn/com/origin/autocodemanager/common/encrypt/EncryptOperations.java new file mode 100644 index 0000000..aea04f0 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/encrypt/EncryptOperations.java @@ -0,0 +1,18 @@ +package cn.com.origin.autocodemanager.common.encrypt; + +public class EncryptOperations { + + private static boolean isLicenseExpire = true; + + public static synchronized boolean isLicenseExpire() { + return isLicenseExpire; + } + + public static synchronized void setLicenseExpire(boolean isLicenseExpire) { + EncryptOperations.isLicenseExpire = isLicenseExpire; + } + + public EncryptOperations() { + // TCSession session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + } +} diff --git a/src/cn/com/origin/autocodemanager/common/operations/ExcelOperation.java b/src/cn/com/origin/autocodemanager/common/operations/ExcelOperation.java new file mode 100644 index 0000000..8913fd6 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/operations/ExcelOperation.java @@ -0,0 +1,145 @@ +package cn.com.origin.autocodemanager.common.operations; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.widgets.Display; +import jxl.Cell; +import jxl.Sheet; +import jxl.Workbook; +import jxl.format.Alignment; +import jxl.format.Colour; +import jxl.format.Pattern; +import jxl.format.UnderlineStyle; +import jxl.read.biff.BiffException; +import jxl.write.Label; +import jxl.write.WritableCellFormat; +import jxl.write.WritableFont; +import jxl.write.WritableSheet; +import jxl.write.WritableWorkbook; +import jxl.write.WriteException; + +/** + * @author wangjj Excelȡ + * + */ +public class ExcelOperation { + + public ExcelOperation() { + + } + + public static ArrayList> readExcel(File fileExcel, int startRow, String headTiles[]) throws BiffException, IOException { + ArrayList> arrayList = new ArrayList>(); + if (fileExcel != null) { + Workbook workBook = Workbook.getWorkbook(fileExcel); + Sheet sheet = workBook.getSheet(0); + if (headTiles != null && headTiles.length > 0) { + for (int i = startRow; i < sheet.getRows(); i++) { + HashMap hashMap = new HashMap(); + for (int k = 0; k < headTiles.length; k++) { +// System.out.println(headTiles + "[" + k + "]=" + headTiles[k]); + if (sheet.findCell(headTiles[k]) != null) { + Cell cell = sheet.getCell(sheet.findCell(headTiles[k]).getColumn(), i); +// System.out.println("cell================" + cell); + if (cell != null) { + hashMap.put(headTiles[k], cell.getContents()); + } + } + } + // System.out.println(hashMap); + arrayList.add(hashMap); + } + } + workBook.close(); + } else { + // System.out.println("EXCELļΪ"); + } + return arrayList; + } + + public static void writeExcel(String sheettile, File fileExcel, Object[] cloumnNames, ArrayList arrayList) throws IOException { + WritableWorkbook wbook = Workbook.createWorkbook(fileExcel); + wbook.createSheet(sheettile, 0); + WritableSheet writableSheet = wbook.getSheet(0); + Object[] titles = cloumnNames; + WritableFont font = new WritableFont(WritableFont.COURIER, 9, WritableFont.BOLD, false, UnderlineStyle.SINGLE_ACCOUNTING, jxl.format.Colour.BLUE); + WritableCellFormat wcfFC = new WritableCellFormat(font); // õԪʽ,ɫ. + try { + // wcfFC.setBackground(Colour.CORAL, Pattern.SOLID); // õԪɫ + wcfFC.setBackground(Colour.WHITE, Pattern.SOLID); // + wcfFC.setAlignment(Alignment.CENTRE); + for (int i = 0; i < titles.length; i++) { + Label l = new Label(i, 0, (String) titles[i]); + l.setCellFormat(wcfFC); // õԪʽ/ʽ + writableSheet.setColumnView(i, 12); + writableSheet.addCell(l); + } + if (arrayList != null && arrayList.size() > 0) { + for (int n = 0; n < arrayList.size(); n++) { + HashMap hashMap = (HashMap) arrayList.get(n); + if (cloumnNames != null && cloumnNames.length > 0) { + for (int k = 0; k < titles.length; k++) { + String str = (String) hashMap.get(titles[k]); + Label labelValue = new Label(k, n + 1, str); + writableSheet.addCell(labelValue); + } + } + } + } + wbook.write(); // дexcelļ. + wbook.close(); + } catch (WriteException e) { + e.printStackTrace(); + } + + if (fileExcel.exists()) { + openFile(fileExcel.getAbsolutePath()); + } + } + + public static void openFile(String targetFile) { + File file = new File(targetFile); + if (file.exists()) { + Boolean value = false; + value = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "INFO", "ļѾɣǷ򿪣"); + if (value) { + try { + Runtime runtime = Runtime.getRuntime(); + runtime.exec("cmd /c start exit &&\"" + targetFile + "\" "); + // String as1[] = { "cmd.exe", "/c", "start", targetFile }; + // runtime.exec(as1); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + public static boolean isInteger(String value) { + try { + Integer.parseInt(value); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + public static boolean isDouble(String value) { + try { + Double.parseDouble(value); + if (value.contains(".")) + return true; + return false; + } catch (NumberFormatException e) { + return false; + } + } + + public static boolean isNumber(String value) { + return isInteger(value) || isDouble(value); + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/operations/GetCodeNumber.java b/src/cn/com/origin/autocodemanager/common/operations/GetCodeNumber.java new file mode 100644 index 0000000..321617b --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/operations/GetCodeNumber.java @@ -0,0 +1,78 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.common.operations; + +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.kernel.TCUserService; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class GetCodeNumber { + + private TCUserService userService; + + public GetCodeNumber() { + try { + userService = (TCUserService) ((TCSession) AIFUtility.getCurrentApplication().getSession()).getUserService(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + + public void delete_recycleID(String itemID) { + // Object[] params = { counterName, itemID }; + if ((itemID == null) || (itemID.length() == 0)) { + return; + } + itemID = itemID.replace(" ", "").trim(); + Object[] params = { itemID }; + try { + userService.call("delete_recycleID", params); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * @param patternCode + * @param codeLength + * @param startIndex + * @param endIndex + * @param increaseStep + * @return + * @throws ServiceException + */ + public String getCodeNumber(String patternCode, int codeLength, int startIndex, int maxValue, int increaseStep, String excludeStr) throws ServiceException { + if (maxValue == startIndex) { + return String.valueOf(maxValue); + } + if (startIndex < 1) { + startIndex = 1; + } + if (maxValue < startIndex) { + return String.valueOf(startIndex); + } + codeLength = String.valueOf(maxValue).length(); + Object[] params = { patternCode.replace(" ", "").trim(), codeLength, startIndex, maxValue, increaseStep, excludeStr }; +// System.out.println("patternCode===========" + patternCode); +// System.out.println("codeLength===========" + codeLength); +// System.out.println("startIndex===========" + startIndex); +// System.out.println("endIndex===========" + maxValue); +// System.out.println("increaseStep===========" + increaseStep); +// System.out.println("excludeStr===========" + excludeStr); + try { + String str = ""; + str = (String) userService.call("queryPartNo", params); + return str; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/operations/PackCodeNodeInfo.java b/src/cn/com/origin/autocodemanager/common/operations/PackCodeNodeInfo.java new file mode 100644 index 0000000..251d663 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/operations/PackCodeNodeInfo.java @@ -0,0 +1,164 @@ +package cn.com.origin.autocodemanager.common.operations; + +import com.teamcenter.rac.kernel.TCComponent; + +public class PackCodeNodeInfo { + private TCComponent nodeComponent; + private String realTypeName; + + private String node_name = ""; + private String node_type = ""; + public String node_value = ""; + public String node_desc = ""; + public String code_style = ""; + public String rule_node = ""; + // boolean + public boolean is_root = false; + public boolean is_lock = false; + public boolean isDefaultSelected = false; + public boolean isContainsChildren = false; + // date + public String create_date = ""; + public String last_revise_date = ""; + // user + public String create_user = ""; + public String last_revise_user = ""; + + public TCComponent getNodeComponent() { + return nodeComponent; + } + + public void setNodeComponent(TCComponent nodeComponent) { + this.nodeComponent = nodeComponent; + } + + public String getRealTypeName() { + return realTypeName; + } + + public void setRealTypeName(String realTypeName) { + this.realTypeName = realTypeName; + } + + public String getNode_name() { + return node_name; + } + + public void setNode_name(String node_name) { + this.node_name = node_name; + } + + public String getNode_type() { + return node_type; + } + + public void setNode_type(String node_type) { + this.node_type = node_type; + } + + public String getNode_value() { + return node_value; + } + + public void setNode_value(String node_value) { + this.node_value = node_value; + } + + public String getNode_desc() { + return node_desc; + } + + public void setNode_desc(String node_desc) { + this.node_desc = node_desc; + } + + public String getCode_style() { + return code_style; + } + + public void setCode_style(String code_style) { + this.code_style = code_style; + } + + public String getRule_node() { + return rule_node; + } + + public void setRule_node(String rule_node) { + this.rule_node = rule_node; + } + + public boolean isIs_root() { + return is_root; + } + + public void setIs_root(boolean is_root) { + this.is_root = is_root; + } + + public boolean isIs_lock() { + return is_lock; + } + + public void setIs_lock(boolean is_lock) { + this.is_lock = is_lock; + } + + public boolean isDefaultSelected() { + return isDefaultSelected; + } + + public void setDefaultSelected(boolean isDefaultSelected) { + this.isDefaultSelected = isDefaultSelected; + } + + public boolean isContainsChildren() { + return isContainsChildren; + } + + public void setContainsChildren(boolean isContainsChildren) { + this.isContainsChildren = isContainsChildren; + } + + public String getCreate_date() { + return create_date; + } + + public void setCreate_date(String create_date) { + this.create_date = create_date; + } + + public String getLast_revise_date() { + return last_revise_date; + } + + public void setLast_revise_date(String last_revise_date) { + this.last_revise_date = last_revise_date; + } + + public String getCreate_user() { + return create_user; + } + + public void setCreate_user(String create_user) { + this.create_user = create_user; + } + + public String getLast_revise_user() { + return last_revise_user; + } + + public void setLast_revise_user(String last_revise_user) { + this.last_revise_user = last_revise_user; + } + + @Override + public String toString() { + return "PackCodeNodeInfo [nodeComponent=" + nodeComponent + ", realTypeName=" + realTypeName + ", node_name=" + node_name + ", node_type=" + + node_type + ", node_value=" + node_value + ", node_desc=" + node_desc + ", code_style=" + code_style + ", rule_node=" + rule_node + + ", is_root=" + is_root + ", is_lock=" + is_lock + ", isDefaultSelected=" + isDefaultSelected + ", isContainsChildren=" + + isContainsChildren + ", create_date=" + create_date + ", last_revise_date=" + last_revise_date + ", create_user=" + create_user + + ", last_revise_user=" + last_revise_user + "]"; + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/operations/PlmLocale.java b/src/cn/com/origin/autocodemanager/common/operations/PlmLocale.java new file mode 100644 index 0000000..61a3276 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/operations/PlmLocale.java @@ -0,0 +1,37 @@ +package cn.com.origin.autocodemanager.common.operations; + +import com.teamcenter.rac.util.Registry; + +public class PlmLocale { + + public static final Registry reg = Registry.getRegistry(PlmLocale.class); + public static boolean isCN = "cn".equals(PlmLocale.getString("language")); + + public static String getString(String title) { + if (isEmpty(title)) { + return ""; + } + String res = reg.getString(title); + return isEmpty(res) ? title : res; + } + + /** + * 获取当前语言的字符串,格式?英文内容@@中文内容? + * @param str + * @return + */ + public static String getStringByLanguage(String str) { + if (isEmpty(str)) { + return ""; + } + int ind = str.lastIndexOf("@@"); + if(ind<0) { + return str; + } + return isCN?str.substring(ind+2):str.substring(0,ind); + } + + private static boolean isEmpty(String title) { + return title == null || "".equals(title.trim()); + } +} diff --git a/src/cn/com/origin/autocodemanager/common/operations/TreeAndListCodeOperation.java b/src/cn/com/origin/autocodemanager/common/operations/TreeAndListCodeOperation.java new file mode 100644 index 0000000..fcc17c7 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/operations/TreeAndListCodeOperation.java @@ -0,0 +1,785 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.common.operations; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.kernel.TCUserService; +import com.teamcenter.rac.util.MessageBox; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + + +public class TreeAndListCodeOperation { + private TCUserService userService; + private TCSession session = null; + + public static void main(String[] args) { + + } + public TreeAndListCodeOperation() { + session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + try { + userService = (TCUserService) session.getUserService(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public int isDateExpire() { + int isDateExpire = 0; + Object[] params = {}; + // try { + // isDateExpire = (Integer) userService.call("isExpire", params); +// System.out.println("isDateExpire=-=========" + isDateExpire); +// } catch (TCException e) { +// e.printStackTrace(); +// } + return isDateExpire; + } + + public void addNodeReferenceComponents(TCComponent component, TCComponent referenceComponent) { + if ((component == null) || (referenceComponent == null)) { + return; + } + try { + TCComponent[] components = getNodeReferenceComponents(component); + if (components != null) { + for (int i = 0; i < components.length; i++) { + if (components[i].equals(referenceComponent)) { + return; + } + } + } + component.add(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes, referenceComponent); + } catch (TCException e) { + e.printStackTrace(); + } + } + + public void removeNodeReferenceComponents(TCComponent component, TCComponent referenceComponent) { + if ((component == null) || (referenceComponent == null)) { + return; + } + TCComponent[] components = getNodeReferenceComponents(component); + try { + if (components != null) { + for (int i = 0; i < components.length; i++) { + if (components[i].equals(referenceComponent)) { + component.remove(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes, referenceComponent); + } + } + } + } catch (TCException e) { + e.printStackTrace(); + } + } + + public TCComponent[] getNodeReferenceComponents(TCComponent component) { + if ((component == null)) { + return null; + } + TCComponent[] components = null; + try { + components = component.getTCProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes).getReferenceValueArray(); + } catch (TCException e) { + e.printStackTrace(); + } + return components; + } + + public TCComponent createNewTreeORListNode(TCComponent ruleNode, AbstractTreeData parentData, HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + System.out.println("i am in createNewTreeORListNode propNames[i]="+propNames[i]+" propValues[i]="+propValues[i]); + } + Object[] params = { propNames, propValues }; + try { + TCComponent newTCcomponent = (TCComponent) userService.call("createNewTreeOrListNode", params); + if (newTCcomponent == null) { + return null; + } + if (!newTCcomponent.getProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type).equals(AutoCodeManagerPropertyName.CodeGroupName)) { + if (ruleNode == null) { + newTCcomponent.setReferenceProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, newTCcomponent); + } else { + newTCcomponent.setReferenceProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, ruleNode); + newTCcomponent.getTCProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes).setReferenceValueArray(new TCComponent[] { ruleNode }); + } + } + return newTCcomponent; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + public TCComponent updateTreeORListNode(TCComponent component, HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + } + Object[] params = { component, propNames, propValues }; + try { + TCComponent updateTCcomponent = (TCComponent) userService.call("updateTreeORListNode", params); + return updateTCcomponent; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + + public boolean deleteTreeORListNode(AbstractTreeData segmentTreeData, AbstractTreeData deleteTreeData) throws ServiceException, TCException { + return deleteTreeRelations(segmentTreeData, deleteTreeData); + } + + public boolean deleteTreeRelations(AbstractTreeData segmentTreeData, AbstractTreeData deleteTreeData) { + TCComponent segmentComponent = null; + TCComponent deleteComponent = null; + boolean isContinueDelete = true; + if ((deleteTreeData != null) && (deleteTreeData.getPackCodeNodeInfo().getNodeComponent() != null)) { + deleteComponent = deleteTreeData.getPackCodeNodeInfo().getNodeComponent(); + } else { + isContinueDelete = false; + return isContinueDelete; + } + if ((segmentTreeData != null) && (segmentTreeData.getPackCodeNodeInfo().getNodeComponent() != null)) { + segmentComponent = segmentTreeData.getPackCodeNodeInfo().getNodeComponent(); + } + TCComponent[] referenceNode = getNodeReferenceComponents(deleteComponent); + if (referenceNode != null) { + if (referenceNode.length > 1) { + MessageBox.post(deleteTreeData.getPackCodeNodeInfo().getNode_name() + "Ѿʹòɾ", "INFO", MessageBox.WARNING); + isContinueDelete = false; + return isContinueDelete; + } + } + String parentStr = ""; + isContinueDelete = deleteChildrenRelations(getParentStr(deleteTreeData, parentStr), deleteTreeData.getPackCodeNodeInfo().getNodeComponent().getUid(), null, isContinueDelete); + if (isContinueDelete) { + if (segmentComponent != null) { + removeNodeReferenceComponents(deleteComponent, segmentComponent); + } + try { + TCComponent ruleComponent = deleteComponent.getReferenceProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node); + if ((deleteTreeData.getPackCodeNodeInfo().is_root) || (deleteTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.CodeGroupName))) { + updateClassificationAfterDeleteSegment(deleteComponent); + updateTreeRelationAfterDelete(deleteComponent); + deleteTreeData(deleteComponent); + } else { + if ((segmentComponent != null) && (ruleComponent != null) && (ruleComponent.equals(segmentComponent))) { + updateTreeRelationAfterDelete(deleteComponent); + deleteTreeData(deleteComponent); + } + } + } catch (TCException e) { + e.printStackTrace(); + } + } + if (isContinueDelete) { + MessageBox.post("ɾɹ", "INFO", MessageBox.WARNING); + } + return isContinueDelete; + } + + public void removeTreeORListNode(AbstractTreeData segmentTreeData, AbstractTreeData deleteTreeData) throws ServiceException, TCException { + removeTreeRelations(segmentTreeData, deleteTreeData); + updateTreeRelation(deleteTreeData); + removeNodeReferenceComponents(deleteTreeData.getPackCodeNodeInfo().getNodeComponent(), segmentTreeData.getPackCodeNodeInfo().getNodeComponent()); + } + + public void updateTreeRelation(AbstractTreeData deleteTreeData) { + if ((deleteTreeData != null) && (deleteTreeData.getPackCodeNodeInfo().getNodeComponent() != null)) { + String currentStr = ""; + String parentStr = ""; + parentStr = getParentStr(deleteTreeData.getParentTreeData(), parentStr); + String childrenStr = deleteTreeData.getPackCodeNodeInfo().getNodeComponent().getUid(); + if ((deleteTreeData.getParentTreeData() != null) && (deleteTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent() != null)) { + currentStr = deleteTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent().getUid(); + } else { + currentStr = ""; + } + Object[] params = { parentStr, currentStr, childrenStr }; + try { + userService.call("removeTreeRelation", params); + } catch (TCException e) { + e.printStackTrace(); + return; + } + } + } + + public void removeTreeRelations(AbstractTreeData segmentTreeData, AbstractTreeData deleteTreeData) { + String parentStr = ""; + removeChildrenRelations(getParentStr(deleteTreeData, parentStr), deleteTreeData.getPackCodeNodeInfo().getNodeComponent().getUid(), segmentTreeData.getPackCodeNodeInfo().getNodeComponent()); + } + + private void removeChildrenRelations(String parentStr, String currentStr, TCComponent segmentComponent) { + try { + TCComponent[] tccomponents = null; + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr.trim()); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, currentStr.trim()); + tccomponents = searchTreeORListNodes(hashMap); + if (tccomponents == null) { + return; + } + for (int i = 0; i < tccomponents.length; i++) { + String parentStr2 = parentStr + "," + currentStr; + if (parentStr2.trim().startsWith(",")) { + parentStr2 = parentStr2.substring(1); + } + if (isRuleRootNode(tccomponents[i])) { + segmentComponent = tccomponents[i]; + updateClassificationAfterDeleteSegment(segmentComponent); + } + removeChildrenRelations(parentStr2, tccomponents[i].getUid().trim(), segmentComponent); + deleteCodeRelations(hashMap); + removeNodeReferenceComponents(tccomponents[i], segmentComponent); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + } + + public void updateClassificationAfterDeleteSegment(TCComponent deleteComponent) { + if (deleteComponent != null) { + Object[] params = { deleteComponent.getUid() }; + try { + userService.call("updateClassificationAfterDeleteSegment", params); + } catch (TCException e) { + e.printStackTrace(); + return; + } + } + } + + public boolean isRuleRootNode(TCComponent component) { + if (component == null) { + return false; + } + try { + if ((component.getLogicalProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root))) { + return true; + } + } catch (TCException e) { + e.printStackTrace(); + } + return false; + } + + public void deleteTreeData(TCComponent deleteComponent) { + if (deleteComponent == null) { + return; + } + try { + deleteComponent.getTCProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes).setReferenceValueArray(null); + deleteComponent.getTCProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node).setReferenceValue(null); + deleteComponent.delete(); + } catch (TCException e) { + e.printStackTrace(); + } + } + + private boolean deleteChildrenRelations(String parentStr, String currentStr, TCComponent segmentComponent, boolean isContinueDelete) { + try { + if (!isContinueDelete) { + return false; + } + TCComponent[] tccomponents = null; + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr.trim()); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, currentStr.trim()); + tccomponents = searchTreeORListNodes(hashMap); + if (tccomponents == null) { + return false; + } + for (int i = 0; i < tccomponents.length; i++) { + TCComponent[] referenceNode = getNodeReferenceComponents(tccomponents[i]); + if (referenceNode != null) { + if (referenceNode.length > 1) { + tccomponents[i].refresh(); + MessageBox.post(tccomponents[i].getProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name) + "Ѿɾ", "INFO", MessageBox.WARNING); + return false; + } + } + } + for (int i = 0; i < tccomponents.length; i++) { + String parentStr2 = parentStr + "," + currentStr; + if (parentStr2.trim().startsWith(",")) { + parentStr2 = parentStr2.substring(1); + } + if (isRuleRootNode(tccomponents[i])) { + segmentComponent = tccomponents[i]; + } + isContinueDelete = deleteChildrenRelations(parentStr2, tccomponents[i].getUid().trim(), segmentComponent, isContinueDelete); + if (isContinueDelete) { + removeNodeReferenceComponents(tccomponents[i], segmentComponent); + try { + TCComponent ruleComponent = tccomponents[i].getReferenceProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node); + tccomponents[i].refresh(); + if ((isRuleRootNode(tccomponents[i])) || (tccomponents[i].getProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type).equals(AutoCodeManagerPropertyName.CodeGroupName))) { + updateClassificationAfterDeleteSegment(tccomponents[i]); + updateTreeRelationAfterDelete(tccomponents[i]); + deleteTreeData(tccomponents[i]); + } else { + if ((segmentComponent != null) && (ruleComponent != null) && (ruleComponent.equals(segmentComponent))) { + updateTreeRelationAfterDelete(tccomponents[i]); + deleteTreeData(tccomponents[i]); + } + } + } catch (TCException e) { + e.printStackTrace(); + } + } + } + if (isContinueDelete) { + deleteCodeRelations(hashMap); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + return isContinueDelete; + } + + private void updateTreeRelationAfterDelete(TCComponent deleteComponent) { + Object[] params = { deleteComponent.getUid() }; + try { + System.out.println("removeTreeRelationAfterDelete hashMap=== "+deleteComponent); + userService.call("removeTreeRelationAfterDelete", params); + } catch (TCException e) { + e.printStackTrace(); + return; + } + } + + public void deleteCodeRelations(HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + System.out.println("deleteCodeRelations hashMap=== "+hashMap); + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + } + Object[] params = { propNames, propValues }; + try { + userService.call("deleteCodeRelations", params); + return; + } catch (TCException e) { + e.printStackTrace(); + return; + } + } + + public TCComponent[] searchParentTreeOrListNodes(HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + } + Object[] params = { propNames, propValues }; + try { + TCComponent[] searchTCcomponents = (TCComponent[]) userService.call("searchParentTreeOrListNodes", params); + return searchTCcomponents; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + + public boolean isContainsChildrenNodes(HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + } + Object[] params = { propNames, propValues }; + try { + String value = (String) userService.call("isContainsChildrenNodes", params); + if (value.trim().equals("true")) { + return true; + } + } catch (TCException e) { + e.printStackTrace(); + return false; + } + return false; + } + + public TCComponent updateCodeRelation(TCComponent component, HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + } + Object[] params = { component, propNames, propValues }; + try { + TCComponent updateTCcomponent = (TCComponent) userService.call("updateCodeRelation", params); + return updateTCcomponent; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + + public TCComponent updateChildrenCodeRelation(String parentStr, String currentStr, String childrenStr) { + try { + String[] propNames1 = new String[] { AutoCodeManagerPropertyName.CodeRelation_parent_node, AutoCodeManagerPropertyName.CodeRelation_current_node }; + String[] propValues1 = new String[] { parentStr, currentStr }; + Object[] params1 = { propNames1, propValues1 }; + + TCComponent[] existComponent = (TCComponent[]) userService.call("searchCodeRelation", params1); + if (existComponent.length > 0) { + for (int i = 0; i < existComponent.length; i++) { + try { + String[] propNames2 = new String[] { AutoCodeManagerPropertyName.CodeRelation_parent_node, AutoCodeManagerPropertyName.CodeRelation_current_node, AutoCodeManagerPropertyName.CodeRelation_children_nodes, AutoCodeManagerPropertyName.CodeRelation_create_date, + AutoCodeManagerPropertyName.CodeRelation_create_user }; + String[] propValues2 = new String[] { parentStr, currentStr, childrenStr, "", "" }; + + Object[] params2 = { existComponent[i], propNames2, propValues2 }; + TCComponent updateTCcomponent = (TCComponent) userService.call("updateCodeRelation", params2); + return updateTCcomponent; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + } + } catch (TCException e) { + e.printStackTrace(); + return null; + } + return null; + } + + public TCComponent createNewCodeRelation(AbstractTreeData currentData, TCComponent childrenComponent) { + try { + String currentDatas = ""; + String childrenDatas = ""; + childrenDatas = getChildrenData(currentData, childrenDatas, childrenComponent); + String parentStr = ""; + parentStr = getParentStr(currentData, parentStr); + if (currentData != null) { + if (currentData.getPackCodeNodeInfo().getNodeComponent() != null) { + currentDatas = currentData.getPackCodeNodeInfo().getNodeComponent().getUid(); + } else { + currentDatas = ""; + } + } else { + currentDatas = ""; + } + System.out.println("createNewCodeRelation::existComponent::parentStr===="+parentStr); + System.out.println("createNewCodeRelation::existComponent::currentDatas===="+currentDatas); + + String[] propNames1 = new String[] { AutoCodeManagerPropertyName.CodeRelation_parent_node, AutoCodeManagerPropertyName.CodeRelation_current_node }; + String[] propValues1 = new String[] { parentStr, currentDatas }; + Object[] params1 = { propNames1, propValues1 }; + TCComponent[] existComponent = (TCComponent[]) userService.call("searchCodeRelation", params1); + System.out.println("createNewCodeRelation::::existComponent===="+existComponent); + if (existComponent.length > 0) { + for (int i = 0; i < existComponent.length; i++) { + try { + System.out.println("createNewCodeRelation::::existComponent.length===="+existComponent.length); + + String[] propNames2 = new String[] { AutoCodeManagerPropertyName.CodeRelation_parent_node, AutoCodeManagerPropertyName.CodeRelation_current_node, AutoCodeManagerPropertyName.CodeRelation_children_nodes, AutoCodeManagerPropertyName.CodeRelation_create_date, + AutoCodeManagerPropertyName.CodeRelation_create_user }; + String[] propValues2 = new String[] { parentStr, currentDatas, childrenDatas, "", "" }; + Object[] params2 = { existComponent[i], propNames2, propValues2 }; + + TCComponent updateTCcomponent = (TCComponent) userService.call("updateCodeRelation", params2); + return updateTCcomponent; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + } else { + System.out.println("createNewCodeRelation::::createNewCodeRelation===="); + String[] propNames3 = new String[] { AutoCodeManagerPropertyName.CodeRelation_parent_node, AutoCodeManagerPropertyName.CodeRelation_current_node, AutoCodeManagerPropertyName.CodeRelation_children_nodes, AutoCodeManagerPropertyName.CodeRelation_create_date, + AutoCodeManagerPropertyName.CodeRelation_create_user }; + String[] propValues3 = new String[] { parentStr, currentDatas, childrenDatas, "", "" }; + Object[] params3 = { propNames3, propValues3 }; + TCComponent newTCcomponent = (TCComponent) userService.call("createNewCodeRelation", params3); + return newTCcomponent; + } + } catch (TCException e) { + e.printStackTrace(); + return null; + } + return null; + } + + public String getParentStr(AbstractTreeData treeData, String parentStr) { + System.out.println("i am in getParentStr == "+parentStr); + + if (treeData != null) { + AbstractTreeData parentData = treeData.getParentTreeData(); + if ((parentData != null) && ((parentData.getPackCodeNodeInfo().getNodeComponent() != null))) { + System.out.println("parentData.getPackCodeNodeInfo() "+parentData.getPackCodeNodeInfo().getNode_name()); + if(parentData.getPackCodeNodeInfo().getNodeComponent()!=null){ + System.out.println("i am not null"); + } + if (parentStr.length() > 0) { + parentStr = parentData.getPackCodeNodeInfo().getNodeComponent().getUid() + "," + parentStr; + } else { + parentStr = parentData.getPackCodeNodeInfo().getNodeComponent().getUid(); + } + parentStr = getParentStr(parentData, parentStr); + System.out.println("parentStr AAA === "+parentStr); + } + }else{ + System.out.println(" treeDtae =null"); + } + if (parentStr.toString().endsWith(",")) { + parentStr = parentStr.substring(0, parentStr.length() - 1).toString(); + } + return parentStr; + } + + private String getChildrenData(AbstractTreeData treeData, String str, TCComponent childrenComponent) { + boolean isLoader = false; + if (treeData != null) { + AbstractTreeData[] childrenData = treeData.getChildrenDatas(); + if ((childrenData != null) && (childrenData.length > 0)) { + for (int i = 0; i < childrenData.length; i++) { + if (childrenData[i].getPackCodeNodeInfo().getNodeComponent() != null) { + if (childrenComponent.equals(childrenData[i].getPackCodeNodeInfo().getNodeComponent())) { + isLoader = true; + } + str = str + childrenData[i].getPackCodeNodeInfo().getNodeComponent().getUid(); + str = str + ","; + } + } + } + } + if (!isLoader) { + if (childrenComponent != null) { + str = str + childrenComponent.getUid(); + } + } + if (str.endsWith(",")) { + str = str.substring(0, str.length() - 1).toString(); + } + return str; + } + + public TCComponent[] searchTreeORListNodes(HashMap hashMap) throws ServiceException, TCException { + String[] propNames = new String[hashMap.size()]; + String[] propValues = new String[hashMap.size()]; + Set set = hashMap.keySet(); + Iterator it = set.iterator(); + for (int i = 0; i < hashMap.size(); i++) { + propNames[i] = (String) it.next(); + propValues[i] = (String) hashMap.get(propNames[i]); + } + Object[] params = { propNames, propValues }; + try { + TCComponent[] searchTCcomponents = (TCComponent[]) userService.call("searchTreeORListNodes", params); + // System.out.println("��ѯ���Ϊ�? + searchTCcomponents.length + "��"); + return searchTCcomponents; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + public PackCodeNodeInfo getTreeAndListStringValue(TCComponent component, String[] returnPropertyNames) throws ServiceException, TCException { + PackCodeNodeInfo packCodeNodeInfo = new PackCodeNodeInfo(); + try { + Object[] params = { component, returnPropertyNames }; +// System.out.println("=================="); + String returnValues = (String) userService.call("getTreeAndListStringValue", params); +// System.out.println("1111111111111111111111111"); + String[] values = returnValues.split("&&"); + if ((values != null) && (values.length > 0)) { + if (returnPropertyNames.equals(AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames)) { + packCodeNodeInfo.setNodeComponent(component); + System.out.println("node_name======"+PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_name(PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_type(getStringValue(values[1])); + packCodeNodeInfo.setNode_value(getStringValue(values[2])); + packCodeNodeInfo.setNode_desc(getStringValue(values[3])); + packCodeNodeInfo.setCode_style(getStringValue(values[4])); + packCodeNodeInfo.setRule_node(getStringValue(values[5])); + if (values[6].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_root(true); + } + if (values[7].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_lock(true); + } + if (values[8].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setDefaultSelected(true); + } + packCodeNodeInfo.setCreate_date(getStringValue(values[9])); + packCodeNodeInfo.setLast_revise_date(getStringValue(values[10])); + packCodeNodeInfo.setCreate_user(getStringValue(values[11])); + packCodeNodeInfo.setLast_revise_user(getStringValue(values[12])); + if (values[13].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setContainsChildren(true); + } + } else { + packCodeNodeInfo.setNodeComponent(component); + System.out.println("node_name======"+PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_name(PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_type(getStringValue(values[1])); + if (values[2].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_root(true); + } + if (values[3].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_lock(true); + } + if (values[4].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setContainsChildren(true); + } + } + } + } catch (TCException e) { + e.printStackTrace(); + } + return packCodeNodeInfo; + } + + private List getTreeORListNodeInfos(TCComponent[] searchTCcomponents, String parentString, String[] returnPropertyNames) { + List packCodeNodeInfos = new ArrayList(); + try { + if (searchTCcomponents != null && searchTCcomponents.length > 0) { + String[] stringValues = getTreeAndListStringValues(searchTCcomponents, returnPropertyNames, parentString); + System.out.println("stringPropNames====1111=========== "+stringValues); +// System.out.println("stringPropNames====1111=========== "+stringValues.length); + + if (stringValues == null) { + return null; + } + for (int i = 0; i < stringValues.length; i++) { + String[] values = stringValues[i].split("&&"); + PackCodeNodeInfo packCodeNodeInfo = new PackCodeNodeInfo(); + if ((values != null) && (values.length > 0)) { + if (returnPropertyNames.equals(AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames)) { + packCodeNodeInfo.setNodeComponent(searchTCcomponents[i]); + System.out.println("node_name======"+PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_name(PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_type(getStringValue(values[1])); + packCodeNodeInfo.setNode_value(getStringValue(values[2])); + packCodeNodeInfo.setNode_desc(getStringValue(values[3])); + packCodeNodeInfo.setCode_style(getStringValue(values[4])); + packCodeNodeInfo.setRule_node(getStringValue(values[5])); + if (values[6].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_root(true); + } + if (values[7].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_lock(true); + } + if (values[8].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setDefaultSelected(true); + } + packCodeNodeInfo.setCreate_date(getStringValue(values[9])); + packCodeNodeInfo.setLast_revise_date(getStringValue(values[10])); + packCodeNodeInfo.setCreate_user(getStringValue(values[11])); + packCodeNodeInfo.setLast_revise_user(getStringValue(values[12])); + if (values[13].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setContainsChildren(true); + } + } else { + packCodeNodeInfo.setNodeComponent(searchTCcomponents[i]); + System.out.println("node_name======"+PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_name(PlmLocale.getString(getStringValue(values[0]))); + packCodeNodeInfo.setNode_type(getStringValue(values[1])); + if (values[2].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_root(true); + } + if (values[3].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setIs_lock(true); + } + if (values[4].equalsIgnoreCase("yes")) { + packCodeNodeInfo.setContainsChildren(true); + } + } + packCodeNodeInfos.add(packCodeNodeInfo); + } + } + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + return packCodeNodeInfos; + } + + public List searchTreeORListNodeInfos(HashMap hashMap, String parentString, String[] returnPropertyNames) throws ServiceException, TCException { + List packCodeNodeInfos = new ArrayList(); + try { + TCComponent[] searchTCcomponents = searchTreeORListNodes(hashMap); + System.out.println("parentString ========================>"+parentString); + packCodeNodeInfos = getTreeORListNodeInfos(searchTCcomponents, parentString, returnPropertyNames); + return packCodeNodeInfos; + } catch (TCException e) { + e.printStackTrace(); + return null; + } + } + + private String getStringValue(String value) { + if ((value == null) || (value.equalsIgnoreCase("null"))) { + return ""; + } else { + return value; + } + } + + public String[] getTreeAndListStringValues(TCComponent[] components, String[] stringPropNames, String parentString) throws ServiceException, TCException { + Object[] params = { components, stringPropNames, parentString }; + try { +// for(int i=0;i(); + if (childrenAutoCodeNodeData != null && childrenAutoCodeNodeData.length > 0) { + for (int i = 0; i < childrenAutoCodeNodeData.length; i++) { + // vectorChildren.add(childrenAutoCodeNodeData[i]); + } + } + } + + public void addChildrenNode(AbstractTreeData childrenNode) { + if (childrenNode == null) { + return; + } + AbstractTreeData[] childrenNodes = this.childrenTreeData; + int childrenLength = 1; + if (childrenNodes != null) { + childrenLength = childrenLength + childrenNodes.length; + } + AbstractTreeData[] childrenNodes2 = new AbstractTreeData[childrenLength]; + for (int i = 0; i < childrenLength - 1; i++) { + childrenNodes2[i] = childrenNodes[i]; + } + childrenNodes2[childrenLength - 1] = childrenNode; + this.setTreeAutoCodeNodeChildren(childrenNodes2); + } + + public Image getImage() { + return image; + } + + /** + * @return the childrenDatas + */ + public AbstractTreeData[] getChildrenDatas() { + return childrenDatas; + } + + /** + * @param childrenDatas + * the childrenDatas to set + */ + public void setChildrenDatas(AbstractTreeData[] childrenDatas) { + this.childrenDatas = childrenDatas; + } + + /** + * @return the childrenTreeData + */ + public AbstractTreeData[] getChildrenTreeData() { + return childrenTreeData; + } + + /** + * @param image + * the image to set + */ + public void setImage(Image image) { + this.image = image; + } + + /** + * @return the parentTreeData + */ + public AbstractTreeData getParentTreeData() { + return parentTreeData; + } + + /** + * @param parentTreeData + * the parentTreeData to set + */ + public void setParentTreeData(AbstractTreeData parentTreeData) { + this.parentTreeData = parentTreeData; + } + + /** + * @return the isChildrenLoader + */ + public boolean isChildrenLoader() { + return isChildrenLoader; + } + + /** + * @param isChildrenLoader + * the isChildrenLoader to set + */ + public void setChildrenLoader(boolean isChildrenLoader) { + this.isChildrenLoader = isChildrenLoader; + } + + public PackCodeNodeInfo getPackCodeNodeInfo() { + return packCodeNodeInfo; + } + + public void setPackCodeNodeInfo(PackCodeNodeInfo packCodeNodeInfo) { + this.packCodeNodeInfo = packCodeNodeInfo; + if (packCodeNodeInfo.is_lock) { + this.image = getImageByType(AutoCodeManagerPropertyName.LockName); + } else { + this.image = getImageByType(packCodeNodeInfo.getNode_type()); + } + } + + public void setChildrenTreeData(AbstractTreeData[] childrenTreeData) { + this.childrenTreeData = childrenTreeData; + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction.java b/src/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction.java new file mode 100644 index 0000000..668ae15 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/tree/AbstractTreeViewRightKeyAction.java @@ -0,0 +1,352 @@ +/** + * @author tyl + * @Action ini + * 2011-3-16 + */ +package cn.com.origin.autocodemanager.common.tree; + +import java.util.HashMap; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.actions.ActionGroup; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import cn.com.origin.autocodemanager.common.AutoCodeConstants; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.views.AutoCodeListCodeView; +import cn.com.origin.autocodemanager.views.AutoCodeSegmentView; +import cn.com.origin.autocodemanager.views.AutoCodeTreeCodeView; +import cn.com.origin.autocodemanager.views.codeview.CodeSegmentDialog; +import cn.com.origin.autocodemanager.views.codeview.CopyCodeNodeDialog; +import cn.com.origin.autocodemanager.views.codeview.NewCodeNodeDialog; +import cn.com.origin.autocodemanager.views.listcodeview.CreateListCodeView; +import cn.com.origin.autocodemanager.views.listcodeview.NewListPropertyNodeDialog; +import cn.com.origin.autocodemanager.views.listcodeview.NewListPropertyValueNodeDialog; +import cn.com.origin.autocodemanager.views.treecodeview.CreateTreeCodeView; +import cn.com.origin.autocodemanager.views.treecodeview.NewTreeCodeNodeDialog; + +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class AbstractTreeViewRightKeyAction extends ActionGroup { + public TreeViewer treeViewer; + public MenuManager menuManager; + public AbstractCreateTreeView createView; + public AbstractTreeData selectedTreeData; + public TCSession session; + public AutoCodeListCodeView codeListView; + public AutoCodeSegmentView codeSegmentView; + public AutoCodeTreeCodeView codeTreeView; + public TreeAndListCodeOperation treeAndListCodeOperation; + public TreeViewOperation treeViewOperation; + + public AbstractTreeViewRightKeyAction(AbstractCreateTreeView createTreeView) { + this.createView = createTreeView; + this.treeViewer = createTreeView.treeViewer; + initParams(); + this.selectedTreeData = treeViewOperation.getSelectedTreeNode(createTreeView.treeViewer); + } + + public void initParams() { + this.treeAndListCodeOperation = new TreeAndListCodeOperation(); + this.treeViewOperation = new TreeViewOperation(); + session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + if (createView == null) { + return; + } + if (createView.viewPart == null) { + return; + } + codeListView = (AutoCodeListCodeView) createView.viewPart.getSite().getPage().findView(AutoCodeManangerConstants.AutoCodeManagerListCodeView_ID); + codeSegmentView = (AutoCodeSegmentView) createView.viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + codeTreeView = (AutoCodeTreeCodeView) createView.viewPart.getSite().getPage().findView(AutoCodeManangerConstants.AutoCodeManagerTreeCodeView_ID); + } + + public void fillContextMenu() { + if (menuManager == null) { + // һεø÷ʱ + menuManager = new MenuManager(); + menuManager.add(new LockCodeNodeAction()); + menuManager.add(new UnLockCodeNodeAction()); + menuManager.add(new RemoveCodeNodeAction()); + } + Tree tree = treeViewer.getTree(); + Menu menu = menuManager.createContextMenu(tree); + tree.setMenu(menu); + } + + public class EidtCodeNodeAction extends Action { + public EidtCodeNodeAction() { + setText("༭"); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.EDIT_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + try { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪ޸Ľڵ!", "INFO", MessageBox.WARNING); + return; + } + AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + TCComponent segmentComponent = segmentTreeData.getPackCodeNodeInfo().getNodeComponent(); + TCComponent selectedComponent = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + if (selectedComponent != null) { + TCComponent[] components = treeAndListCodeOperation.getNodeReferenceComponents(selectedComponent); + String segmentNames = ""; + if (components != null) { + for (int i = 0; i < components.length; i++) { + if (!components[i].equals(segmentComponent)) { + components[i].refresh(); + segmentNames = segmentNames + components[i].getProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name); + segmentNames = segmentNames + "\n"; + } + } + if (segmentNames.trim().length() > 0) { + Boolean value = false; + value = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "INFO", "õ˽ڵ㣺\n" + segmentNames + "ȷ޸ģ"); + if (!value) { + return; + } + } + } + } + Image nodeImage = selectedTreeData.getImage(); + HashMap hashMap = new HashMap(); + if (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() != null) { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "true"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, session.getUser().getUid()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, session.getUser().getUid()); + try { + TCComponent updateComponent = new TreeAndListCodeOperation().updateTreeORListNode(selectedComponent, hashMap); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + } catch (ServiceException e) { + e.printStackTrace(); + } + } + selectedTreeData.setImage(new AbstractTreeData().getImageByType(AutoCodeManagerPropertyName.LockName)); + treeViewer.refresh(selectedTreeData); + + if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyNodeName)) { + new NewListPropertyNodeDialog(treeViewer.getControl().getShell(), (CreateListCodeView) createView, "༭б", true).open(); + } else { + if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyValueNodeName)) { + new NewListPropertyValueNodeDialog(treeViewer.getControl().getShell(), (CreateListCodeView) createView, "༭б", true).open(); + } else if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.TreeNodeName)) { + new NewTreeCodeNodeDialog(treeViewer.getControl().getShell(), (CreateTreeCodeView) createView, "༭ڵ", true, true).open(); + } else { + if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.CodeGroupName)) { + NewCodeNodeDialog codeNodeDialog = new NewCodeNodeDialog(null, createView, AutoCodeManagerPropertyName.AddRuleGroupNodeName, "༭", true); + codeNodeDialog.open(); + } else { + NewCodeNodeDialog codeNodeDialog = new NewCodeNodeDialog(null, createView, AutoCodeManagerPropertyName.AddRuleRootNodeName, "༭", true); + codeNodeDialog.open(); + } + } + } + HashMap hashMap2 = new HashMap(); + if (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() != null) { + hashMap2.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "false"); + hashMap2.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + hashMap2.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap2.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, session.getUser().getUid()); + hashMap2.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, session.getUser().getUid()); + TCComponent updateComponent = new TreeAndListCodeOperation().updateTreeORListNode(selectedComponent, hashMap2); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + } + selectedTreeData.setImage(nodeImage); + treeViewer.refresh(selectedTreeData); + } catch (TCException e) { + e.printStackTrace(); + } catch (ServiceException e) { + e.printStackTrace(); + } + } + } + + public class AddChildrenNodeAction extends Action { + String text = ""; + String type = ""; + + public AddChildrenNodeAction(String text, String type) { + setText(text); + this.text = text; + this.type = type; + ImageDescriptor imageDesc = new AbstractTreeData().getImageDescriptorByType(type); + this.setImageDescriptor(imageDesc); + } + + public void run() { + try { + AbstractTreeData rootNode = treeViewOperation.getSelectedTreeNode(codeSegmentView.getCreateView().treeViewer); + if (!treeViewOperation.isRuleRootNode(rootNode)) { + MessageBox.post("ѡҪ޸Ĺ!", "INFO", MessageBox.WARNING); + return; + } + new CodeSegmentDialog(treeViewer.getControl().getShell(), createView, text, type).open(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public class LockCodeNodeAction extends Action { + public LockCodeNodeAction() { + setText(""); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.LOCK_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + try { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪڵ!", "INFO", MessageBox.WARNING); + return; + } + + AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + TCComponent segmentComponent = segmentTreeData.getPackCodeNodeInfo().getNodeComponent(); + TCComponent selectedComponent = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + if (selectedComponent != null) { + TCComponent[] components = treeAndListCodeOperation.getNodeReferenceComponents(selectedComponent); + String segmentNames = ""; + if (components != null) { + for (int i = 0; i < components.length; i++) { + if (!components[i].equals(segmentComponent)) { + components[i].refresh(); + segmentNames = segmentNames + components[i].getProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name); + segmentNames = segmentNames + "\n"; + } + } + if (segmentNames.trim().length() > 0) { + Boolean value = false; + value = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "INFO", "õ˽ڵ㣺\n" + segmentNames + "ȷ"); + if (!value) { + return; + } + } + } + } + HashMap hashMap = new HashMap(); + if (selectedComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "true"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, session.getUser().getUid()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, session.getUser().getUid()); + TCComponent updateComponent = new TreeAndListCodeOperation().updateTreeORListNode(selectedComponent, hashMap); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + createView.treeViewer.refresh(selectedTreeData); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public class UnLockCodeNodeAction extends Action { + public UnLockCodeNodeAction() { + setText(""); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.UNLOCK_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + try { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪڵ!", "INFO", MessageBox.WARNING); + return; + } + TCComponent selectedComponent = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + HashMap hashMap = new HashMap(); + if (selectedComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, session.getUser().getUid()); + TCComponent updateComponent = new TreeAndListCodeOperation().updateTreeORListNode(selectedComponent, hashMap); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + createView.treeViewer.refresh(selectedTreeData); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public class CopyCodeNodeAction extends Action { + public CopyCodeNodeAction() { + setText(""); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.EDIT_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪƽڵ!", "INFO", MessageBox.WARNING); + return; + } + + try { + if (treeViewOperation.isRuleRootNode(selectedTreeData)) { + CopyCodeNodeDialog codeNodeDialog = new CopyCodeNodeDialog(null, createView, "ƹ", true, AutoCodeManagerPropertyName.AddRuleRootNodeName); + codeNodeDialog.open(); + } else { + CopyCodeNodeDialog codeNodeDialog = new CopyCodeNodeDialog(null, createView, "", true, AutoCodeManagerPropertyName.AddRuleGroupNodeName); + codeNodeDialog.open(); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + } + } + + public class RemoveCodeNodeAction extends Action { + public RemoveCodeNodeAction() { + setText("Ƴ"); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.REMOVE_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪƳڵ!", "INFO", MessageBox.WARNING); + return; + } + try { + boolean value = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "INFO", "ȷƳ"); + AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + if (value) { + treeViewOperation.removeTreeNode(createView.treeViewer, selectedTreeData); + treeAndListCodeOperation.removeTreeORListNode(segmentTreeData, selectedTreeData); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + } + } +} diff --git a/src/cn/com/origin/autocodemanager/common/tree/ORTreeContentProvider.java b/src/cn/com/origin/autocodemanager/common/tree/ORTreeContentProvider.java new file mode 100644 index 0000000..060b449 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/tree/ORTreeContentProvider.java @@ -0,0 +1,41 @@ +package cn.com.origin.autocodemanager.common.tree; + +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; + +public class ORTreeContentProvider implements ITreeContentProvider { + + public Object[] getChildren(Object parentObj) { + return ((AbstractTreeData) parentObj).getChildrenTreeData(); + + } + + public Object getParent(Object element) { + return ((AbstractTreeData) element).getParentTreeData(); + + } + + public boolean hasChildren(Object element) { + boolean flag = false; + if (((AbstractTreeData) element) != null && ((AbstractTreeData) element).getChildrenTreeData() != null && ((AbstractTreeData) element).getChildrenTreeData().length > 0) { + flag = true; + } + return flag; + } + + public Object[] getElements(Object inputElement) { + // TODO Auto-generated method stub + return (Object[]) inputElement; + } + + public void dispose() { + // TODO Auto-generated method stub + + } + + public void inputChanged(Viewer arg0, Object obj1, Object obj2) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/tree/ORTreeLabelProvider.java b/src/cn/com/origin/autocodemanager/common/tree/ORTreeLabelProvider.java new file mode 100644 index 0000000..1bd7941 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/tree/ORTreeLabelProvider.java @@ -0,0 +1,48 @@ +package cn.com.origin.autocodemanager.common.tree; + +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.swt.graphics.Image; + +public class ORTreeLabelProvider implements ILabelProvider { + + public Image getImage(Object obj) { + if (obj instanceof AbstractTreeData) { + AbstractTreeData codeTreeData = (AbstractTreeData) obj; + return codeTreeData.getImage(); + } else { + return null; + } + } + + public String getText(Object obj) { + String nodeName = ""; + if (obj instanceof AbstractTreeData) { + AbstractTreeData treeData = ((AbstractTreeData) obj); + if (treeData.getPackCodeNodeInfo() != null) { + nodeName = treeData.getPackCodeNodeInfo().getNode_name(); + } + } + return nodeName; + } + + public void addListener(ILabelProviderListener listener) { + + } + + public void dispose() { + // TODO Auto-generated method stub + + } + + public boolean isLabelProperty(Object obj, String s) { + // TODO Auto-generated method stub + return false; + } + + public void removeListener(ILabelProviderListener label) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/tree/TreeViewOperation.java b/src/cn/com/origin/autocodemanager/common/tree/TreeViewOperation.java new file mode 100644 index 0000000..9b39768 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/tree/TreeViewOperation.java @@ -0,0 +1,339 @@ +/** + * @author tyl + * @Action ini + * 2011-3-29 + */ +package cn.com.origin.autocodemanager.common.tree; + +import java.util.ArrayList; +import java.util.List; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.widgets.TreeItem; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.views.AutoCodeListCodeView; +import cn.com.origin.autocodemanager.views.AutoCodeSegmentView; +import cn.com.origin.autocodemanager.views.AutoCodeTreeCodeView; +import com.teamcenter.rac.util.MessageBox; + +public class TreeViewOperation { + public TreeAndListCodeOperation treeAndListCodeOperation; + public AutoCodeListCodeView codeListView; + public AutoCodeSegmentView codeSegmentView; + public AutoCodeTreeCodeView codeTreeView; + + public TreeViewOperation() { + this.treeAndListCodeOperation = new TreeAndListCodeOperation(); + } + + public void addChildrenTreeNodeRelations(TreeViewer treeViewer, AbstractTreeData parentNode, AbstractTreeData[] childrenNodes) { + for (int i = 0; i < childrenNodes.length; i++) { + AbstractTreeData childrenNode = childrenNodes[i]; + if (childrenNode.getPackCodeNodeInfo().getNodeComponent() != null) { + treeAndListCodeOperation.createNewCodeRelation(parentNode, childrenNode.getPackCodeNodeInfo().getNodeComponent()); + addChildrenTreeNodeRelations(treeViewer, childrenNode, childrenNode.getChildrenDatas()); + } + } + } + + public boolean isRuleRootNode(AbstractTreeData treeData) { + if (treeData == null) { + return false; + } + if(treeData.getPackCodeNodeInfo() ==null){ + return false; + } + if (treeData.getPackCodeNodeInfo().getNodeComponent() == null) { + return false; + } + if (treeData.getPackCodeNodeInfo().is_root) { + return true; + } + return false; + } + + public void addExistCodeNode(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + try { + if (isRuleRootNode(parentData)) { + addNewTreeOrListInput(treeViewer, parentData, childrenData); + } else { + addChildrenData(treeViewer, parentData, childrenData); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void appendChildrenNode(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + AbstractTreeData[] childrenDatas = parentData.getChildrenDatas(); + int childrenLength = 1; + + if (childrenDatas != null) { + childrenLength = childrenLength + childrenDatas.length; + } + AbstractTreeData[] treeDatas = new AbstractTreeData[childrenLength]; + boolean isContain = true; + for (int i = 0; i < childrenLength - 1; i++) { + if ((childrenData.getPackCodeNodeInfo().getNodeComponent()).equals(childrenDatas[i].getPackCodeNodeInfo().getNodeComponent())) { + isContain = false; + break; + } + treeDatas[i] = childrenDatas[i]; + } + if (!isContain) { + return; + } else { + treeDatas[childrenLength - 1] = childrenData; + parentData.setTreeAutoCodeNodeChildren(treeDatas); + childrenData.setParentTreeData(parentData); + parentData.setChildrenLoader(true); + treeViewer.refresh(parentData); + } + } + + public void addChildrenRelations(AbstractTreeData parentData, AbstractTreeData childrenData) { + treeAndListCodeOperation.createNewCodeRelation(parentData, childrenData.getPackCodeNodeInfo().getNodeComponent()); + AbstractTreeData[] childrenDatas = parentData.getChildrenDatas(); + int childrenLength = 1; + + if (childrenDatas != null) { + childrenLength = childrenLength + childrenDatas.length; + } + AbstractTreeData[] treeDatas = new AbstractTreeData[childrenLength]; + for (int i = 0; i < childrenLength - 1; i++) { + treeDatas[i] = childrenDatas[i]; + } + treeDatas[childrenLength - 1] = childrenData; + + if (isRuleRootNode(parentData)) { + parentData.setChildrenDatas(treeDatas); + } else { + parentData.setTreeAutoCodeNodeChildren(treeDatas); + } + childrenData.setParentTreeData(parentData); + parentData.setChildrenLoader(true); + } + + public void addTreeNodes(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + treeAndListCodeOperation.createNewCodeRelation(parentData, childrenData.getPackCodeNodeInfo().getNodeComponent()); + AbstractTreeData[] childrenDatas = parentData.getChildrenDatas(); + int childrenLength = 1; + + if (childrenDatas != null) { + childrenLength = childrenLength + childrenDatas.length; + } + AbstractTreeData[] treeDatas = new AbstractTreeData[childrenLength]; + for (int i = 0; i < childrenLength - 1; i++) { + treeDatas[i] = childrenDatas[i]; + } + treeDatas[childrenLength - 1] = childrenData; + + parentData.setTreeAutoCodeNodeChildren(treeDatas); + childrenData.setParentTreeData(parentData); + parentData.setChildrenLoader(true); + treeViewer.refresh(parentData); + } + + public void addChildrenData(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + if (parentData == null) { + return; + } + if (childrenData == null) { + return; + } + treeAndListCodeOperation.createNewCodeRelation(parentData, childrenData.getPackCodeNodeInfo().getNodeComponent()); + AbstractTreeData[] childrenDatas = parentData.getChildrenDatas(); + int childrenLength = 1; + + if (childrenDatas != null) { + childrenLength = childrenLength + childrenDatas.length; + } + AbstractTreeData[] treeDatas = new AbstractTreeData[childrenLength]; + for (int i = 0; i < childrenLength - 1; i++) { + treeDatas[i] = childrenDatas[i]; + } + treeDatas[childrenLength - 1] = childrenData; + + if (isRuleRootNode(parentData)) { + parentData.setChildrenDatas(treeDatas); + } else { + parentData.setTreeAutoCodeNodeChildren(treeDatas); + } + childrenData.setParentTreeData(parentData); + parentData.setChildrenLoader(true); + treeViewer.refresh(parentData); + } + + public boolean appendChildrenData(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + AbstractTreeData[] childrenDatas = parentData.getChildrenDatas(); + int childrenLength = 1; + + if (childrenDatas != null) { + childrenLength = childrenLength + childrenDatas.length; + } + AbstractTreeData[] treeDatas = new AbstractTreeData[childrenLength]; + boolean isContain = false; + for (int i = 0; i < childrenLength - 1; i++) { + if ((childrenData.getPackCodeNodeInfo().getNodeComponent()).equals(childrenDatas[i].getPackCodeNodeInfo().getNodeComponent())) { + isContain = true; + break; + } + treeDatas[i] = childrenDatas[i]; + } + if (isContain) { + MessageBox.post("ӡ" + childrenData.getPackCodeNodeInfo().getNode_name() + "!", "INFO", MessageBox.WARNING); + } else { + treeDatas[childrenLength - 1] = childrenData; + parentData.setTreeAutoCodeNodeChildren(treeDatas); + childrenData.setParentTreeData(parentData); + if(childrenData.packCodeNodeInfo.getNodeComponent()!=null){ + String cNodeNameString = childrenData.packCodeNodeInfo.getNodeComponent().toDisplayString(); + if(cNodeNameString !=null && cNodeNameString.replace(" ", "").length() >0){ + childrenData.packCodeNodeInfo.setNode_name(cNodeNameString); + } + } + parentData.setChildrenLoader(true); + treeViewer.refresh(parentData); + } + return isContain; + } + + public void addNewTreeOrListInput(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + // treeAndListCodeOperation.createNewCodeRelation(parentData, childrenData.getPackCodeNodeInfo().getNodeComponent()); + int length = 1; + if (treeViewer.getInput() != null) { + Object[] existDatas = (Object[]) treeViewer.getInput(); + if (existDatas != null) { + length = length + existDatas.length; + } + AbstractTreeData[] childrenDatas = new AbstractTreeData[length]; + if (existDatas != null) { + for (int i = 0; i < existDatas.length; i++) { + childrenDatas[i] = (AbstractTreeData) existDatas[i]; + } + } + childrenData.setParentTreeData(parentData); + childrenDatas[length - 1] = childrenData; + treeViewer.setInput(childrenDatas); + parentData.setChildrenDatas(childrenDatas); + } else { + treeViewer.setInput(new AbstractTreeData[] { childrenData }); + parentData.setChildrenDatas(new AbstractTreeData[] { childrenData }); + childrenData.setParentTreeData(parentData); + } + parentData.setChildrenLoader(true); + treeViewer.refresh(parentData); + treeAndListCodeOperation.createNewCodeRelation(parentData, childrenData.getPackCodeNodeInfo().getNodeComponent()); + } + + public AbstractTreeData getSelectedTreeNode(TreeViewer treeViewer) { + TreeItem[] treeItems = treeViewer.getTree().getSelection(); + if ((treeItems != null) && (treeItems.length > 0)) { + return (AbstractTreeData) treeItems[0].getData(); + } else { + return null; + } + } + + public void removeTreeNode(TreeViewer treeViewer, AbstractTreeData treeData) { + try { + AbstractTreeData parentTreeData = treeData.getParentTreeData(); + if (parentTreeData != null) { + if (isRuleRootNode(parentTreeData)) { + updateTreeOrListInput(treeViewer, parentTreeData, treeData); + } else { + List treeDatas = new ArrayList(); + AbstractTreeData[] parentChildrenData = parentTreeData.getChildrenDatas(); + if (parentChildrenData != null) { + for (int i = 0; i < parentChildrenData.length; i++) { + if (!treeData.equals(parentChildrenData[i])) { + treeDatas.add(parentChildrenData[i]); + } + } + if (treeDatas.size() > 0) { + AbstractTreeData[] treeDatas2 = new AbstractTreeData[treeDatas.size()]; + for (int i = 0; i < treeDatas.size(); i++) { + treeDatas2[i] = treeDatas.get(i); + } + parentTreeData.setTreeAutoCodeNodeChildren(treeDatas2); + } else { + parentTreeData.setTreeAutoCodeNodeChildren(null); + } + } + } + } else { + treeViewer.setInput(null); + } + treeViewer.remove(treeData); + } catch (Exception e) { + e.printStackTrace(); + } + // treeViewer.refresh(parentTreeData); + } + + public void removeNodeFromParent(AbstractTreeData parentTreeData, AbstractTreeData childrenData) { + if ((parentTreeData == null) || (childrenData == null)) { + return; + } + List treeDatas = new ArrayList(); + AbstractTreeData[] parentChildrenData = parentTreeData.getChildrenDatas(); + if (parentChildrenData != null) { + for (int i = 0; i < parentChildrenData.length; i++) { + if (!childrenData.equals(parentChildrenData[i])) { + treeDatas.add(parentChildrenData[i]); + } + } + if (treeDatas.size() > 0) { + AbstractTreeData[] treeDatas2 = new AbstractTreeData[treeDatas.size()]; + for (int i = 0; i < treeDatas.size(); i++) { + treeDatas2[i] = treeDatas.get(i); + } + parentTreeData.setTreeAutoCodeNodeChildren(treeDatas2); + } else { + parentTreeData.setTreeAutoCodeNodeChildren(null); + } + } + + } + + public void updateTreeOrListInput(TreeViewer treeViewer, AbstractTreeData parentData, AbstractTreeData childrenData) { + int length = -1; + if (treeViewer.getInput() != null) { + AbstractTreeData[] existDatas = (AbstractTreeData[]) treeViewer.getInput(); + if (existDatas != null) { + length = length + existDatas.length; + } + if (length >= 1) { + List treeDatas = new ArrayList(); + for (int i = 0; i < existDatas.length; i++) { + if (!childrenData.equals(existDatas[i])) { + treeDatas.add(existDatas[i]); + } + } + AbstractTreeData[] childrenDatas = new AbstractTreeData[treeDatas.size()]; + for (int i = 0; i < treeDatas.size(); i++) { + childrenDatas[i] = treeDatas.get(i); + } + treeViewer.setInput(childrenDatas); + parentData.setTreeAutoCodeNodeChildren(childrenDatas); + } else { + treeViewer.setInput(null); + parentData.setTreeAutoCodeNodeChildren(null); + } + } else { + treeViewer.setInput(null); + parentData.setTreeAutoCodeNodeChildren(null); + } + treeViewer.refresh(parentData); + } + + public void addExistSegmentRelation(TreeViewer treeViewer, AbstractTreeData parentTreeData, AbstractTreeData[] childrenTreeDatas) { + for (int i = 0; i < childrenTreeDatas.length; i++) { + AbstractTreeData childrenData = childrenTreeDatas[i]; + if (childrenData.getPackCodeNodeInfo().getNodeComponent() != null) { + treeAndListCodeOperation.createNewCodeRelation(parentTreeData, childrenData.getPackCodeNodeInfo().getNodeComponent()); + addExistSegmentRelation(treeViewer, childrenData, childrenData.getChildrenDatas()); + } + } + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/treetable/AbstractTreeTable.java b/src/cn/com/origin/autocodemanager/common/treetable/AbstractTreeTable.java new file mode 100644 index 0000000..51fcdad --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/treetable/AbstractTreeTable.java @@ -0,0 +1,157 @@ +/** + * @author tyl + * @Action ini + * 2011-3-16 + */ +package cn.com.origin.autocodemanager.common.treetable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.TreeColumn; +import org.eclipse.ui.part.ViewPart; + +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.views.listcodeview.NewItemListCodeView; +import cn.com.origin.autocodemanager.views.treecodeview.NewItemTreeCodeView; +import org.eclipse.swt.graphics.Color; +import com.teamcenter.rac.kernel.TCComponent; + +public class AbstractTreeTable extends AbstractCreateTreeView { + + public AbstractTreeTable(Composite composite, String rootName, ViewPart viewPart) { + super(composite, rootName, viewPart); + // createTree(composite); + } + + public AbstractTreeTable() { + + } + + public AbstractTreeTable(Composite composite, String rootName) { + super(composite, rootName); + + } + + public TreeColumn createColumn(Composite parent, String treeColumnName, int width) { + TreeColumn treeColumn = new TreeColumn(tree, SWT.LEFT); + treeColumn.setText(treeColumnName); + treeColumn.setWidth(width); + return treeColumn; + } + + public void initTree(String rootName) { + tree.setHeaderVisible(true); // ñͷɼ + tree.setLinesVisible(true); // ߿ɼ + + tree.setBackground(new Color(Display.getCurrent(),255,255,255)); + tree.setVisible(true); + tree.setFocus(); // ý + treeViewer.setLabelProvider(new ORTreeTableLabelProvider()); + treeViewer.setContentProvider(new ORTreeTableContentProvider()); + createTreeColumn(); + } + + public void createTreeColumn() { + createColumn(tree, "", 150); + createColumn(tree, "ֵ", 100); + createColumn(tree, "ע", 100); + createColumn(tree, "ǷΪĬֵ", 100); + createColumn(tree, "", 100); + createColumn(tree, "Ƿ", 100); + createColumn(tree, "", 100); + createColumn(tree, "", 100); + createColumn(tree, "޸", 100); + createColumn(tree, "޸", 100); + } + + @Override + public void addMouseAction() { + + } + + @Override + public void addRightKeyAction() { + } + + @Override + public void createOrgAutoCodeNodeChildren(AbstractTreeData[] codeDatas) throws Exception { + if (codeDatas != null && codeDatas.length > 0) { + for (int i = 0; i < codeDatas.length; i++) { + AbstractTreeData autoCodeData = (AbstractTreeData) codeDatas[i]; + if (autoCodeData == null) { + return; + } + List newItemViewNames = new ArrayList(); + newItemViewNames.add(NewItemTreeCodeView.class.getSimpleName()); + newItemViewNames.add(NewItemListCodeView.class.getSimpleName()); + + String thisClassName = this.getClass().getSimpleName(); + if (newItemViewNames.contains(thisClassName)) { + TCComponent component = autoCodeData.getPackCodeNodeInfo().getNodeComponent(); + if ((component != null) &&(autoCodeData.getPackCodeNodeInfo().is_lock)) { + autoCodeData.setTreeAutoCodeNodeChildren(null); + autoCodeData.setChildrenLoader(false); + return; + } + } + TCComponent autoCodeDataComponent = autoCodeData.getPackCodeNodeInfo().getNodeComponent(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + HashMap hashMap = new HashMap(); + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(autoCodeData, parentStr); + if (autoCodeDataComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, autoCodeDataComponent.getUid()); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr); + } else { + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, ""); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, ""); + } + String parentStr2 = ""; + if (autoCodeDataComponent != null) { + if (parentStr.trim().length() == 0) { + parentStr2 = autoCodeDataComponent.getUid(); + } else { + parentStr2 = parentStr + "," + autoCodeDataComponent.getUid(); + } + } else { + parentStr2 = parentStr; + } + + List packCodeNodeInfos = treeAndListCodeOperation.searchTreeORListNodeInfos(hashMap, parentStr2,AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + + if (packCodeNodeInfos != null && packCodeNodeInfos.size() > 0) { + AbstractTreeData autoCodeDataTCComs[] = new AbstractTreeData[packCodeNodeInfos.size()]; + for (int k = 0; k < packCodeNodeInfos.size(); k++) { + if (packCodeNodeInfos.get(k).getNodeComponent() == null) { + continue; + } + PackCodeNodeInfo packCodeNodeInfo = packCodeNodeInfos.get(k); + autoCodeDataTCComs[k] = new AbstractTreeData(autoCodeData, packCodeNodeInfo); + if (packCodeNodeInfo.isContainsChildren()) { + autoCodeDataTCComs[k].setTreeAutoCodeNodeChildren(new AbstractTreeData[] { new AbstractTreeData() }); + } + } + autoCodeData.setTreeAutoCodeNodeChildren(autoCodeDataTCComs); + autoCodeData.setChildrenLoader(true); + treeViewer.refresh(autoCodeData); + treeViewer.expandToLevel(autoCodeData, 1); + } else { + autoCodeData.setTreeAutoCodeNodeChildren(null); + autoCodeData.setChildrenLoader(true); + treeViewer.refresh(autoCodeData); + treeViewer.expandToLevel(autoCodeData, 1); + } + } + } + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/treetable/ORNewItemTreeTableLabelProvider.java b/src/cn/com/origin/autocodemanager/common/treetable/ORNewItemTreeTableLabelProvider.java new file mode 100644 index 0000000..ea3831e --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/treetable/ORNewItemTreeTableLabelProvider.java @@ -0,0 +1,67 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.common.treetable; + +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Image; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import com.teamcenter.rac.kernel.TCComponent; + +public class ORNewItemTreeTableLabelProvider implements ITableLabelProvider { + public Image getColumnImage(Object element, int columnIndex) { + if (element instanceof AbstractTreeData) { + AbstractTreeData codeTreeData = (AbstractTreeData) element; + if (columnIndex == 0) { + return codeTreeData.getImage(); + } + } + return null; + } + + public String getColumnText(Object element, int coumnIndex) { + if (element instanceof AbstractTreeData) { + AbstractTreeData codeTreeData = (AbstractTreeData) element; + if (codeTreeData == null) { + return ""; + } + if (codeTreeData.getPackCodeNodeInfo() == null) { + return ""; + } + + TCComponent component = codeTreeData.getPackCodeNodeInfo().getNodeComponent(); + if (component == null) { + return ""; + } + switch (coumnIndex) { + case 0: + return codeTreeData.getPackCodeNodeInfo().getNode_name(); + case 1: + return codeTreeData.getPackCodeNodeInfo().getNode_value(); + case 2: + return codeTreeData.getPackCodeNodeInfo().getNode_desc(); + } + } + return ""; + } + + public void addListener(ILabelProviderListener arg0) { + + } + + public void dispose() { + + } + + public boolean isLabelProperty(Object obj, String obj1) { + return false; + } + + public void removeListener(ILabelProviderListener arg0) { + + } + +} diff --git a/src/cn/com/origin/autocodemanager/common/treetable/ORTreeTableContentProvider.java b/src/cn/com/origin/autocodemanager/common/treetable/ORTreeTableContentProvider.java new file mode 100644 index 0000000..4c6d21e --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/treetable/ORTreeTableContentProvider.java @@ -0,0 +1,46 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.common.treetable; + +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; + +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +public class ORTreeTableContentProvider implements ITreeContentProvider { + + public Object[] getChildren(Object parentObj) { + // TODO Auto-generated method stub + return ((AbstractTreeData) parentObj).getChildrenTreeData(); + + } + + public Object getParent(Object element) { + // TODO Auto-generated method stub + return ((AbstractTreeData) element).getParentTreeData(); + + } + + public boolean hasChildren(Object element) { + boolean flag = false; + if (((AbstractTreeData) element) != null && ((AbstractTreeData) element).getChildrenTreeData() != null && ((AbstractTreeData) element).getChildrenTreeData().length > 0) { + flag = true; + } + return flag; + } + + public Object[] getElements(Object inputElement) { + return (Object[]) inputElement; + } + + public void dispose() { + + } + + public void inputChanged(Viewer arg0, Object obj1, Object obj2) { + + } +} diff --git a/src/cn/com/origin/autocodemanager/common/treetable/ORTreeTableLabelProvider.java b/src/cn/com/origin/autocodemanager/common/treetable/ORTreeTableLabelProvider.java new file mode 100644 index 0000000..3326588 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/common/treetable/ORTreeTableLabelProvider.java @@ -0,0 +1,84 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.common.treetable; + +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.swt.graphics.Image; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +public class ORTreeTableLabelProvider implements ITableLabelProvider { + public Image getColumnImage(Object element, int columnIndex) { + if (element instanceof AbstractTreeData) { + AbstractTreeData codeTreeData = (AbstractTreeData) element; + if (columnIndex == 0) { + return codeTreeData.getImage(); + } + } + return null; + } + + public String getColumnText(Object element, int coumnIndex) { + if (element instanceof AbstractTreeData) { + try { + AbstractTreeData codeTreeData = (AbstractTreeData) element; + if ((codeTreeData == null) || (codeTreeData.getPackCodeNodeInfo() == null)) { + return ""; + } + switch (coumnIndex) { + case 0: + return codeTreeData.getPackCodeNodeInfo().getNode_name(); + case 1: + return codeTreeData.getPackCodeNodeInfo().getNode_value(); + case 2: + return codeTreeData.getPackCodeNodeInfo().getNode_desc(); + case 3: + if (codeTreeData.getPackCodeNodeInfo().isDefaultSelected) { + return ""; + } else { + return ""; + } + case 4: + return codeTreeData.getPackCodeNodeInfo().getRule_node(); + case 5: + if (codeTreeData.getPackCodeNodeInfo().is_lock) { + return ""; + } else { + return ""; + } + case 6: + return codeTreeData.getPackCodeNodeInfo().getCreate_date(); + case 7: + return codeTreeData.getPackCodeNodeInfo().getCreate_user(); + case 8: + return codeTreeData.getPackCodeNodeInfo().getLast_revise_date(); + case 9: + return codeTreeData.getPackCodeNodeInfo().getLast_revise_user(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + return ""; + } + + public void addListener(ILabelProviderListener arg0) { + + } + + public void dispose() { + + } + + public boolean isLabelProperty(Object obj, String obj1) { + return false; + } + + public void removeListener(ILabelProviderListener arg0) { + + } + +} diff --git a/src/cn/com/origin/autocodemanager/export/ExportNodeOperation.java b/src/cn/com/origin/autocodemanager/export/ExportNodeOperation.java new file mode 100644 index 0000000..d69d108 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/export/ExportNodeOperation.java @@ -0,0 +1,127 @@ +/** + * @author tyl + * @Action ini + * 2011-3-22 + */ +package cn.com.origin.autocodemanager.export; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.operations.ExcelOperation; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class ExportNodeOperation { + private TreeAndListCodeOperation treeAndListCodeOperation; + // private TCSession session; + private AbstractTreeData treeData; + private String filePath; + + public ExportNodeOperation(AbstractTreeViewPart viewPart, AbstractTreeData treeData, String filePath) { + // this.viewPart = viewPart; + this.treeData = treeData; + this.filePath = filePath; + initParams(); + } + + public void exportNode() { + ArrayList> arrayList = new ArrayList>(); + File excelFile = new File(filePath); + String sheetTitle = treeData.getPackCodeNodeInfo().getNode_name(); + Object[] cloumnNames = AutoCodeManagerPropertyName.TreeAndListCodeNode_Titles; + + exportTreeNode(treeData.getPackCodeNodeInfo().getNodeComponent(), arrayList, 0); + String parentStr = ""; + exportTreeNodes(treeAndListCodeOperation.getParentStr(treeData, parentStr), treeData.getPackCodeNodeInfo().getNodeComponent().getUid(), arrayList, 0); + + try { + ExcelOperation.writeExcel(sheetTitle, excelFile, cloumnNames, arrayList); + } catch (IOException e) { + } + } + + public void initParams() { + this.treeAndListCodeOperation = new TreeAndListCodeOperation(); + // session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + } + + private void exportTreeNodes(String parentStr, String currentStr, ArrayList> arrayList, int level) { + try { + TCComponent[] tccomponents = null; + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, currentStr); + tccomponents = treeAndListCodeOperation.searchTreeORListNodes(hashMap); + if (tccomponents == null) { + return; + } + + level = level + 1; + for (int i = 0; i < tccomponents.length; i++) { + exportTreeNode(tccomponents[i], arrayList, level); + String parentStr2 = parentStr + "," + currentStr; + if (parentStr2.trim().startsWith(",")) { + parentStr2 = parentStr2.substring(1); + } + exportTreeNodes(parentStr2, tccomponents[i].getUid().trim(), arrayList, level); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + } + + public void exportTreeNode(TCComponent tccomponent, ArrayList> arrayList, int level) { + if (tccomponent == null) { + return; + } + HashMap hashMap = new HashMap(); + try { + tccomponent.refresh(); + String[] propertyNames = { AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, + AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value, + AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, + AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user }; + String[] propertyValues = tccomponent.getProperties(propertyNames); + hashMap.put("", Integer.toString(level)); + hashMap.put("", propertyValues[0]); + hashMap.put("", propertyValues[1]); + hashMap.put("ֵ", propertyValues[2]); + hashMap.put("ע", propertyValues[3]); + hashMap.put("ʽ", propertyValues[4]); + hashMap.put("볤", propertyValues[5]); + hashMap.put("ˮʼֵ", propertyValues[6]); + hashMap.put("ˮֵ", propertyValues[7]); + if (propertyValues[8].equalsIgnoreCase("Y")) { + hashMap.put("ǷΪڵ", "true"); + } else { + hashMap.put("ǷΪڵ", "false"); + } + if (propertyValues[9].equalsIgnoreCase("Y")) { + hashMap.put("ǷΪĬֵ", "true"); + } else { + hashMap.put("ǷΪĬֵ", "false"); + } + if (propertyValues[10].equalsIgnoreCase("Y")) { + hashMap.put("Ƿ", "true"); + } else { + hashMap.put("Ƿ", "false"); + } + hashMap.put("", propertyValues[11]); + hashMap.put("޸", propertyValues[12]); + hashMap.put("", propertyValues[13]); + hashMap.put("޸", propertyValues[14]); + } catch (TCException e) { + e.printStackTrace(); + } + arrayList.add(hashMap); + } +} diff --git a/src/cn/com/origin/autocodemanager/handlers/CodeCopyHandler.java b/src/cn/com/origin/autocodemanager/handlers/CodeCopyHandler.java new file mode 100644 index 0000000..afb8f15 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/CodeCopyHandler.java @@ -0,0 +1,47 @@ +package cn.com.origin.autocodemanager.handlers; + +import java.awt.Toolkit; +import java.awt.datatransfer.StringSelection; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import com.teamcenter.rac.aif.AbstractAIFUIApplication; +import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponentBOMLine; +import com.teamcenter.rac.kernel.TCComponentCfgAttachmentLine; + +public class CodeCopyHandler extends AbstractHandler { + + + public Object execute(ExecutionEvent execut){ + try { + AbstractAIFUIApplication abstractAIFUIApplication = AIFUtility.getCurrentApplication(); + String id=""; + InterfaceAIFComponent target=abstractAIFUIApplication.getTargetComponent(); + if(target.getClass().toString().indexOf("TCComponentItem")>=0){ + id=target.getProperty("item_id"); + }else if(target.getClass().toString().indexOf("TCComponentItemRevision")>=0){ + id=target.getProperty("item_id"); + }else if(target.getClass().toString().indexOf("TCComponentBOMLine")>=0){ + TCComponentBOMLine targetLine=(TCComponentBOMLine) target; + id=targetLine.getItem().getProperty("item_id"); + }else if(target.getClass().toString().indexOf("TCComponentCfgAttachmentLine")>=0){ + TCComponentCfgAttachmentLine cfgLine=(TCComponentCfgAttachmentLine) target; + id=cfgLine.getRelatedComponent("me_cl_source").getProperty("item_id"); + }else if(target.getClass().toString().indexOf("TCComponentMfgBvrProcess")>=0){ + id=target.getProperty("bl_item_item_id"); + } + if(!"".equals(id)){ + setClipboard(id); + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + public void setClipboard(String str) { + StringSelection ss = new StringSelection(str); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null); + } + +} diff --git a/src/cn/com/origin/autocodemanager/handlers/DeleteNodeHandler.java b/src/cn/com/origin/autocodemanager/handlers/DeleteNodeHandler.java new file mode 100644 index 0000000..da7af0c --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/DeleteNodeHandler.java @@ -0,0 +1,100 @@ +/** + * @author tyl + * @Action ini + * 2011-3-22 + */ +package cn.com.origin.autocodemanager.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.ISources; + +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeConstants; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.views.AutoCodeSegmentView; + +import com.teamcenter.rac.aif.AbstractAIFUIApplication; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; + +public class DeleteNodeHandler extends AbstractHandler { + + /** + * + */ + public DeleteNodeHandler() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + */ + public Object execute(ExecutionEvent e) throws ExecutionException { + Object obj = e.getApplicationContext(); +// AutoCodeListCodeView codeListView; +// AutoCodeTreeCodeView codeTreeView; + AutoCodeSegmentView codeSegmentView; + if (obj instanceof IEvaluationContext) { + AbstractAIFUIApplication abstractAIFUIApplication = AIFUtility.getCurrentApplication(); + TCSession session = (TCSession) abstractAIFUIApplication.getSession(); + IEvaluationContext appContext = (IEvaluationContext) obj; + Object view = appContext.getVariable(ISources.ACTIVE_PART_NAME); + if (view instanceof AbstractTreeViewPart) { + try { + session.setStatus("ɾ......"); + Boolean value = false; + AbstractTreeViewPart viewPart = (AbstractTreeViewPart) view; +// codeListView = (AutoCodeListCodeView) viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeListCodeView_ID); +// codeTreeView = (AutoCodeTreeCodeView) viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeTreeCodeView_ID); + codeSegmentView = (AutoCodeSegmentView) viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + + AbstractCreateTreeView autocodeView = viewPart.getCreateView(); + TreeViewOperation treeViewOperation = new TreeViewOperation(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + AbstractTreeData selectedTreeData = treeViewOperation.getSelectedTreeNode(autocodeView.treeViewer); + AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + + if ((selectedTreeData == null)) { + MessageBox.post("ѡҪɾڵ!", "INFO", MessageBox.WARNING); + return null; + } + if ((selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪɾڵ!", "INFO", MessageBox.WARNING); + return null; + } + if ((segmentTreeData == null)) { + MessageBox.post("ѡҪɾ!", "INFO", MessageBox.WARNING); + return null; + } + if ((segmentTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.CodeGroupName))) { + segmentTreeData = null; + } + if (!value) { + value = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "INFO", "ȷɾ"); + } + if (value) { + boolean isContinueDelete = treeAndListCodeOperation.deleteTreeORListNode(segmentTreeData, selectedTreeData); + if (isContinueDelete) { + treeViewOperation.removeTreeNode(autocodeView.treeViewer, selectedTreeData); + } + } + } catch (Exception e1) { + e1.printStackTrace(); + } + session.setReadyStatus(); + } + } + return null; + } +} diff --git a/src/cn/com/origin/autocodemanager/handlers/DownListNodeHandler.java b/src/cn/com/origin/autocodemanager/handlers/DownListNodeHandler.java new file mode 100644 index 0000000..1c7521a --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/DownListNodeHandler.java @@ -0,0 +1,108 @@ +/** + * @author tyl + * @Action ini + * 2011-5-6 + */ +package cn.com.origin.autocodemanager.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.ui.ISources; +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.views.AutoCodeListCodeView; + +import com.teamcenter.rac.kernel.TCComponent; + +public class DownListNodeHandler extends AbstractHandler { + public DownListNodeHandler() { + } + + public Object execute(ExecutionEvent e) throws ExecutionException { + Object obj = e.getApplicationContext(); + if (obj instanceof IEvaluationContext) { +// AbstractAIFUIApplication abstractAIFUIApplication = AIFUtility.getCurrentApplication(); +// TCSession session = (TCSession) abstractAIFUIApplication.getSession(); + IEvaluationContext appContext = (IEvaluationContext) obj; + Object view = appContext.getVariable(ISources.ACTIVE_PART_NAME); + if (view instanceof AbstractTreeViewPart) { + TreeViewOperation treeViewOperation = new TreeViewOperation(); + AbstractTreeViewPart viewPart = (AbstractTreeViewPart) view; + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + + AutoCodeListCodeView codeListView = (AutoCodeListCodeView) viewPart.getSite().getPage().findView(AutoCodeManangerConstants.AutoCodeManagerListCodeView_ID); +// AutoCodeSegmentView codeSegmentView = (AutoCodeSegmentView) viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + AbstractTreeData selectedTreeData = treeViewOperation.getSelectedTreeNode(codeListView.createView.treeViewer); +// AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + if (selectedTreeData == null) { + return null; + } + if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyNodeName)) { + AbstractTreeData[] listPropertyTreeDatas = (AbstractTreeData[]) codeListView.createView.treeViewer.getInput(); + for (int i = 0; i < listPropertyTreeDatas.length; i++) { + if (selectedTreeData.equals(listPropertyTreeDatas[i])) { + AbstractTreeData tempTreeData = listPropertyTreeDatas[i]; + if (i < listPropertyTreeDatas.length - 1) { + listPropertyTreeDatas[i] = listPropertyTreeDatas[i + 1]; + listPropertyTreeDatas[i + 1] = tempTreeData; + codeListView.createView.treeViewer.refresh(); + break; + } + } + } + + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(selectedTreeData.getParentTreeData(), parentStr); + String childrenStr = ""; + for (int i = 0; i < listPropertyTreeDatas.length; i++) { + TCComponent component = listPropertyTreeDatas[i].getPackCodeNodeInfo().getNodeComponent(); + if (component != null) { + childrenStr = childrenStr + component.getUid() + ","; + + } + } + if (childrenStr.toString().endsWith(",")) { + childrenStr = childrenStr.substring(0, childrenStr.length() - 1).toString(); + } + treeAndListCodeOperation.updateChildrenCodeRelation(parentStr, selectedTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent().getUid(), childrenStr); + } else { + AbstractTreeData listPropertyTreeNode = selectedTreeData.getParentTreeData(); + AbstractTreeData[] listPropertyValueTreeDatas = listPropertyTreeNode.getChildrenTreeData(); + for (int i = 0; i < listPropertyValueTreeDatas.length; i++) { + if (selectedTreeData.equals(listPropertyValueTreeDatas[i])) { + AbstractTreeData tempTreeData = listPropertyValueTreeDatas[i]; + if (i < listPropertyValueTreeDatas.length - 1) { + listPropertyValueTreeDatas[i] = listPropertyValueTreeDatas[i + 1]; + listPropertyValueTreeDatas[i + 1] = tempTreeData; + listPropertyTreeNode.setTreeAutoCodeNodeChildren(listPropertyValueTreeDatas); + codeListView.createView.treeViewer.refresh(listPropertyTreeNode); + break; + } + } + } + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(selectedTreeData.getParentTreeData(), parentStr); + String childrenStr = ""; + for (int i = 0; i < listPropertyValueTreeDatas.length; i++) { + TCComponent component = listPropertyValueTreeDatas[i].getPackCodeNodeInfo().getNodeComponent(); + if (component != null) { + childrenStr = childrenStr + component.getUid() + ","; + + } + } + if (childrenStr.toString().endsWith(",")) { + childrenStr = childrenStr.substring(0, childrenStr.length() - 1).toString(); + } + treeAndListCodeOperation.updateChildrenCodeRelation(parentStr, selectedTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent().getUid(), childrenStr); + } + } + } + return null; + } +} diff --git a/src/cn/com/origin/autocodemanager/handlers/ExportNodeHandler.java b/src/cn/com/origin/autocodemanager/handlers/ExportNodeHandler.java new file mode 100644 index 0000000..f57e81a --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/ExportNodeHandler.java @@ -0,0 +1,59 @@ +/** + * @author tyl + * @Action ini + * 2011-3-22 + */ +package cn.com.origin.autocodemanager.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.ISources; +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.export.ExportNodeOperation; + +import com.teamcenter.rac.aif.AbstractAIFUIApplication; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; + +public class ExportNodeHandler extends AbstractHandler { + public Object execute(ExecutionEvent e) throws ExecutionException { + AbstractAIFUIApplication abstractAIFUIApplication = AIFUtility.getCurrentApplication(); + TCSession session = (TCSession) abstractAIFUIApplication.getSession(); + Object obj = e.getApplicationContext(); + if (obj instanceof IEvaluationContext) { + IEvaluationContext appContext = (IEvaluationContext) obj; + Object view = appContext.getVariable(ISources.ACTIVE_PART_NAME); + if (view instanceof AbstractTreeViewPart) { + AbstractTreeViewPart treeViewPart = (AbstractTreeViewPart) view; + AbstractCreateTreeView treeView = treeViewPart.getCreateView(); + AbstractTreeData selectedNode = new TreeViewOperation().getSelectedTreeNode(treeView.treeViewer); + // TreeViewOperation treeViewOperation=new TreeViewOperation(); + DirectoryDialog directoryDialog = new DirectoryDialog(Display.getDefault().getActiveShell()); + directoryDialog.setText(""); + directoryDialog.setFilterPath("SystemRoot"); + String filePath = directoryDialog.open(); + //String filePath = directoryDialog.getFilterPath(); + System.out.println("ѡļ·:" + filePath); + if (filePath != null && !"".equals(filePath)) { + filePath = filePath + "\\" + selectedNode.getPackCodeNodeInfo().getNode_name() + ".xls"; + } else { + MessageBox.post("ѡ·", "INFO", MessageBox.WARNING); + return null; + } + session.setStatus("ڵ......"); + new ExportNodeOperation(treeViewPart, selectedNode, filePath).exportNode(); + session.setReadyStatus(); + } + } + return null; + } + +} diff --git a/src/cn/com/origin/autocodemanager/handlers/ImportCodeNextIdHandler.java b/src/cn/com/origin/autocodemanager/handlers/ImportCodeNextIdHandler.java new file mode 100644 index 0000000..a46e132 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/ImportCodeNextIdHandler.java @@ -0,0 +1,43 @@ +/** + * @author tyl + * @Action ini + * 2011-5-17 + */ +package cn.com.origin.autocodemanager.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.kernel.TCUserService; + +public class ImportCodeNextIdHandler extends AbstractHandler { + + private TCUserService userService; + private TCSession session = null; + + public ImportCodeNextIdHandler() { + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands. + * ExecutionEvent) + */ + public Object execute(ExecutionEvent e) throws ExecutionException { + try { + session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + userService = (TCUserService) session.getUserService(); + Object[] params = {}; + userService.call("importHistoryNextID", params); + } catch (TCException e1) { + e1.printStackTrace(); + } + return null; + } + +} diff --git a/src/cn/com/origin/autocodemanager/handlers/ImportNodeHandler.java b/src/cn/com/origin/autocodemanager/handlers/ImportNodeHandler.java new file mode 100644 index 0000000..1731081 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/ImportNodeHandler.java @@ -0,0 +1,60 @@ +/** + * @author tyl + * @Action ini + * 2011-3-22 + */ +package cn.com.origin.autocodemanager.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.ui.ISources; +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.imports.ImportNodeOperation; +import com.teamcenter.rac.aif.AbstractAIFUIApplication; +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.rac.util.MessageBox; + +public class ImportNodeHandler extends AbstractHandler { + + public Object execute(ExecutionEvent e) throws ExecutionException { + AbstractAIFUIApplication abstractAIFUIApplication = AIFUtility.getCurrentApplication(); + TCSession session = (TCSession) abstractAIFUIApplication.getSession(); + Object obj = e.getApplicationContext(); + if (obj instanceof IEvaluationContext) { + IEvaluationContext appContext = (IEvaluationContext) obj; + Object view = appContext.getVariable(ISources.ACTIVE_PART_NAME); + if (view instanceof AbstractTreeViewPart) { + AbstractTreeViewPart treeViewPart = (AbstractTreeViewPart) view; + AbstractCreateTreeView treeView = treeViewPart.getCreateView(); + AbstractTreeData selectedNode = new TreeViewOperation().getSelectedTreeNode(treeView.treeViewer); + FileDialog fileDialog = new FileDialog(Display.getDefault().getActiveShell()); + fileDialog.setText(""); + fileDialog.setFilterNames(new String[] { "*.xls" }); + fileDialog.setFilterExtensions(new String[] { "*.xls" }); + fileDialog.open(); + String filePath = fileDialog.getFilterPath(); + String fileName = fileDialog.getFileName(); + // System.out.println("ѡļ·:" + filePath); + if (filePath != null && !"".equals(filePath) && fileName != null && !"".equals(fileName)) { + filePath = filePath + "/" + fileName; + } else { + MessageBox.post("ѡļ", "INFO", MessageBox.WARNING); + return null; + } + session.setStatus("ڵ......"); + new ImportNodeOperation(treeViewPart, selectedNode, filePath).importNode(); + session.setReadyStatus(); + MessageBox.post("ɹ!", "INFO", MessageBox.WARNING); + } + } + return null; + } +} diff --git a/src/cn/com/origin/autocodemanager/handlers/UpListNodeHandler.java b/src/cn/com/origin/autocodemanager/handlers/UpListNodeHandler.java new file mode 100644 index 0000000..efb0fb4 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/handlers/UpListNodeHandler.java @@ -0,0 +1,107 @@ +/** + * @author tyl + * @Action ini + * 2011-5-6 + */ +package cn.com.origin.autocodemanager.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.ui.ISources; +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.views.AutoCodeListCodeView; +import com.teamcenter.rac.kernel.TCComponent; + +public class UpListNodeHandler extends AbstractHandler { + public UpListNodeHandler() { + } + + public Object execute(ExecutionEvent e) throws ExecutionException { + Object obj = e.getApplicationContext(); + if (obj instanceof IEvaluationContext) { +// AbstractAIFUIApplication abstractAIFUIApplication = AIFUtility.getCurrentApplication(); +// TCSession session = (TCSession) abstractAIFUIApplication.getSession(); + IEvaluationContext appContext = (IEvaluationContext) obj; + Object view = appContext.getVariable(ISources.ACTIVE_PART_NAME); + if (view instanceof AbstractTreeViewPart) { + TreeViewOperation treeViewOperation = new TreeViewOperation(); + AbstractTreeViewPart viewPart = (AbstractTreeViewPart) view; + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + + AutoCodeListCodeView codeListView = (AutoCodeListCodeView) viewPart.getSite().getPage().findView(AutoCodeManangerConstants.AutoCodeManagerListCodeView_ID); +// AutoCodeSegmentView codeSegmentView = (AutoCodeSegmentView) viewPart.getSite().getPage().findView(AutoCodeConstants.AutoCodeSegmentView_ID); + AbstractTreeData selectedTreeData = treeViewOperation.getSelectedTreeNode(codeListView.createView.treeViewer); +// AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + if (selectedTreeData == null) { + return null; + } + if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyNodeName)) { + AbstractTreeData[] listPropertyTreeDatas = (AbstractTreeData[]) codeListView.createView.treeViewer.getInput(); + for (int i = 0; i < listPropertyTreeDatas.length; i++) { + if (selectedTreeData.equals(listPropertyTreeDatas[i])) { + AbstractTreeData tempTreeData = listPropertyTreeDatas[i]; + if (i > 0) { + listPropertyTreeDatas[i] = listPropertyTreeDatas[i - 1]; + listPropertyTreeDatas[i -1] = tempTreeData; + codeListView.createView.treeViewer.refresh(); + break; + } + } + } + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(selectedTreeData.getParentTreeData(), parentStr); + String childrenStr = ""; + for (int i = 0; i < listPropertyTreeDatas.length; i++) { + TCComponent component = listPropertyTreeDatas[i].getPackCodeNodeInfo().getNodeComponent(); + if (component != null) { + childrenStr = childrenStr + component.getUid() + ","; + + } + } + if (childrenStr.toString().endsWith(",")) { + childrenStr = childrenStr.substring(0, childrenStr.length() - 1).toString(); + } + treeAndListCodeOperation.updateChildrenCodeRelation(parentStr, selectedTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent().getUid(), childrenStr); + } else { + AbstractTreeData listPropertyTreeNode = selectedTreeData.getParentTreeData(); + AbstractTreeData[] listPropertyValueTreeDatas = listPropertyTreeNode.getChildrenTreeData(); + for (int i = 0; i < listPropertyValueTreeDatas.length; i++) { + if (selectedTreeData.equals(listPropertyValueTreeDatas[i])) { + AbstractTreeData tempTreeData = listPropertyValueTreeDatas[i]; + if (i > 0) { + listPropertyValueTreeDatas[i] = listPropertyValueTreeDatas[i - 1]; + listPropertyValueTreeDatas[i - 1] = tempTreeData; + listPropertyTreeNode.setTreeAutoCodeNodeChildren(listPropertyValueTreeDatas); + codeListView.createView.treeViewer.refresh(listPropertyTreeNode); + break; + } + } + } + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(selectedTreeData.getParentTreeData(), parentStr); + String childrenStr = ""; + for (int i = 0; i < listPropertyValueTreeDatas.length; i++) { + TCComponent component = listPropertyValueTreeDatas[i].getPackCodeNodeInfo().getNodeComponent(); + if (component != null) { + childrenStr = childrenStr + component.getUid() + ","; + + } + } + if (childrenStr.toString().endsWith(",")) { + childrenStr = childrenStr.substring(0, childrenStr.length() - 1).toString(); + } + treeAndListCodeOperation.updateChildrenCodeRelation(parentStr, selectedTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent().getUid(), childrenStr); + } + } + } + return null; + } + +} diff --git a/src/cn/com/origin/autocodemanager/imports/ImportNodeOperation.java b/src/cn/com/origin/autocodemanager/imports/ImportNodeOperation.java new file mode 100644 index 0000000..37a629e --- /dev/null +++ b/src/cn/com/origin/autocodemanager/imports/ImportNodeOperation.java @@ -0,0 +1,159 @@ +/** + * @author tyl + * @Action ini + * 2011-3-22 + */ +package cn.com.origin.autocodemanager.imports; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import jxl.read.biff.BiffException; +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.operations.ExcelOperation; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.util.MessageBox; + +public class ImportNodeOperation { + + private TreeViewOperation treeViewOperation; + // private TCSession session; + private AbstractTreeViewPart viewPart; + private AbstractTreeData treeData; + private String filePath; + TCComponent ruleComponent = null; + + public ImportNodeOperation(AbstractTreeViewPart viewPart, AbstractTreeData treeData, String filePath) { + this.viewPart = viewPart; + this.treeData = treeData; + this.filePath = filePath; + initParams(); + } + + public void initParams() { + // this.treeAndListCodeOperation = new TreeAndListCodeOperation(); + this.treeViewOperation = new TreeViewOperation(); + // session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + } + + public void importNode() { + try { + importTreeNode(treeData, filePath); + } catch (BiffException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private ArrayList> getImportFromExcel(String filePath) throws BiffException, IOException { + return ExcelOperation.readExcel(new File(filePath), 1, AutoCodeManagerPropertyName.TreeAndListCodeNode_Titles); + } + + public void importTreeNode(AbstractTreeData parentTreeData, String filePath) throws TCException, BiffException, IOException { + HashMap levelMap = new HashMap(); + ArrayList> arrayList = getImportFromExcel(filePath); + // System.out.println("arrayList:" + arrayList); + if (arrayList != null && arrayList.size() > 0) { + HashMap hashMap = (HashMap) arrayList.get(0); + int levelIndex = 0; + String level = (String) hashMap.get(""); + String name = (String) hashMap.get(""); + try { + levelIndex = Integer.parseInt(level); + } catch (NumberFormatException e) { + MessageBox.post(name + "д!", "INFO", MessageBox.WARNING); + e.printStackTrace(); + return; + } + String parentLevel = String.valueOf(levelIndex - 1); + levelMap.put(parentLevel, parentTreeData); + + for (int i = 0; i < arrayList.size(); i++) { + hashMap = (HashMap) arrayList.get(i); + level = (String) hashMap.get(""); + name = (String) hashMap.get(""); + String type = (String) hashMap.get(""); + try { + levelIndex = Integer.parseInt(level); + } catch (NumberFormatException e) { + MessageBox.post(name + "д!", "INFO", MessageBox.WARNING); + e.printStackTrace(); + return; + } + parentLevel = String.valueOf(levelIndex - 1); + parentTreeData = (AbstractTreeData) levelMap.get(parentLevel); + if (parentTreeData == null) { + MessageBox.post("" + name + "дǷ!", "INFO", MessageBox.WARNING); + return; + } + HashMap newHashMap = new HashMap(); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_index, ""); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, name); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, (String) hashMap.get("ֵ")); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, type); + if ((type.equalsIgnoreCase("tree")) || (type.equalsIgnoreCase("list"))) { + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, "true"); + } else { + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, "false"); + } + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, (String) hashMap.get("ʽ")); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, (String) hashMap.get("볤")); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, ""); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes, ""); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, (String) hashMap.get("ע")); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, ""); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, ""); + String isDefault = (String) hashMap.get("ǷΪĬֵ"); + if ((isDefault != null) && ((isDefault.equalsIgnoreCase("false")) || (isDefault.equalsIgnoreCase("true")))) { + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, (String) hashMap.get("ǷΪĬֵ")); + } else { + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, "false"); + } + + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "false"); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, (String) hashMap.get("ˮʼֵ")); + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value, (String) hashMap.get("ˮֵ")); + String maxValue = (String) hashMap.get("ˮֵ"); + if ((maxValue != null) && (!maxValue.equalsIgnoreCase("0")) && (maxValue.trim().length() > 0)) { + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, String.valueOf(maxValue.trim().length())); + } else { + newHashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, "0"); + } + if (newHashMap.get(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root).equalsIgnoreCase("true")) { + ruleComponent = null; + } + if (newHashMap.get(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type).equalsIgnoreCase(AutoCodeManagerPropertyName.CodeGroupName)) { + ruleComponent = null; + } + + TCComponent newComponent = new TreeAndListCodeOperation().createNewTreeORListNode(ruleComponent, parentTreeData, newHashMap); + if (newComponent == null) { + return; + } + if ((newHashMap.get(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root) != null) && (newHashMap.get(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root)).equalsIgnoreCase("true")) { + ruleComponent = newComponent; + } + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(newComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + AbstractTreeData treeData = new AbstractTreeData(parentTreeData, packCodeNodeInfo); + + treeViewOperation.addChildrenRelations(parentTreeData, treeData); + viewPart.createView.treeViewer.refresh(parentTreeData); + levelMap.put(level, treeData); + } + } + } +} diff --git a/src/cn/com/origin/autocodemanager/views/AutoCodeListCodeView.java b/src/cn/com/origin/autocodemanager/views/AutoCodeListCodeView.java new file mode 100644 index 0000000..57c2669 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/AutoCodeListCodeView.java @@ -0,0 +1,33 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.views; + +import org.eclipse.swt.widgets.Composite; + +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.views.listcodeview.CreateListCodeView; + +public class AutoCodeListCodeView extends AbstractTreeViewPart { + + public AutoCodeListCodeView() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) + */ + @Override + public void createPartControl(Composite arg0) { + super.createPartControl(arg0); + createView = new CreateListCodeView(arg0, "б", this); + } + + @Override + public void setFocus() { + } + +} diff --git a/src/cn/com/origin/autocodemanager/views/AutoCodeSegmentView.java b/src/cn/com/origin/autocodemanager/views/AutoCodeSegmentView.java new file mode 100644 index 0000000..ac8153e --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/AutoCodeSegmentView.java @@ -0,0 +1,23 @@ +package cn.com.origin.autocodemanager.views; + +import org.eclipse.swt.widgets.Composite; + +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.views.codeview.CreateCodeSegmentView; + +public class AutoCodeSegmentView extends AbstractTreeViewPart { + public AutoCodeSegmentView() { + super(); + } + + @Override + public void createPartControl(Composite parent) { + super.createPartControl(parent); + createView=new CreateCodeSegmentView(parent,"",AutoCodeSegmentView.this); + } + + @Override + public void setFocus() { + + } +} diff --git a/src/cn/com/origin/autocodemanager/views/AutoCodeTestView.java b/src/cn/com/origin/autocodemanager/views/AutoCodeTestView.java new file mode 100644 index 0000000..e90b2ad --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/AutoCodeTestView.java @@ -0,0 +1,40 @@ +/** + * @author tyl + * @Action ini + * 2011-3-17 + */ +package cn.com.origin.autocodemanager.views; + +import org.eclipse.swt.widgets.Composite; + +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.views.testview.CreateCodeTestView; + +public class AutoCodeTestView extends AbstractTreeViewPart { + + public AutoCodeTestView() { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) + */ + @Override + public void createPartControl(Composite parentComposite) { + super.createPartControl(parentComposite); + new CreateCodeTestView(parentComposite, "", this); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + @Override + public void setFocus() { + + } + +} diff --git a/src/cn/com/origin/autocodemanager/views/AutoCodeTreeCodeView.java b/src/cn/com/origin/autocodemanager/views/AutoCodeTreeCodeView.java new file mode 100644 index 0000000..e1f6be4 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/AutoCodeTreeCodeView.java @@ -0,0 +1,44 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.views; + +import org.eclipse.swt.widgets.Composite; + +import cn.com.origin.autocodemanager.common.AbstractTreeViewPart; +import cn.com.origin.autocodemanager.views.treecodeview.CreateTreeCodeView; + +public class AutoCodeTreeCodeView extends AbstractTreeViewPart { + + /** + * + */ +// private CreateTreeCodeView createTreeCodeView; + + public AutoCodeTreeCodeView() { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) + */ + @Override + public void createPartControl(Composite arg0) { + super.createPartControl(arg0); + createView = new CreateTreeCodeView(arg0, "", this); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + @Override + public void setFocus() { + } + +} diff --git a/src/cn/com/origin/autocodemanager/views/codestyleview/CreateCodeStyleView.java b/src/cn/com/origin/autocodemanager/views/codestyleview/CreateCodeStyleView.java new file mode 100644 index 0000000..de68c8c --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codestyleview/CreateCodeStyleView.java @@ -0,0 +1,119 @@ +/** + * @author tyl + * @Action ini + * 2011-4-7 + */ +package cn.com.origin.autocodemanager.views.codestyleview; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.part.ViewPart; + +import cn.com.origin.autocodemanager.common.CreateCompositeUtil; + +public class CreateCodeStyleView { + public ViewPart viewPart; + public Text seqBeginText; + public Text seqMaxText; + public Text seqLengthtext; + public Text seqStepText; + public Text seqExcludeStrText; + public Text codeStyleText; + public Text patternMinLengthText; + public Text coverText; + + public CreateCodeStyleView(Composite composite, ViewPart viewPart) { + this.viewPart = viewPart; + createNewComposite(composite); + } + + public void createNewComposite(Composite parent) { + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 1; + parent.setLayout(gridLayout); + parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + Group nodeGroup = CreateCompositeUtil.createCompositeGroup(parent, "ˮ"); + nodeGroup.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + createSeqPropertyComposite(nodeGroup); + + Group coverGroup = CreateCompositeUtil.createCompositeGroup(parent, "λ"); + coverGroup.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + createCoverComposite(coverGroup); + + Group styleGroup = CreateCompositeUtil.createCompositeGroup(parent, "ʽ"); + styleGroup.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + createCodeStyleComposite(styleGroup); + + Group buttonGroup = CreateCompositeUtil.createCompositeGroup(parent, "dsdsds"); + buttonGroup.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + createButtonComposite(buttonGroup); + } + + + private void createCodeStyleComposite(Composite composite) { + Composite styleComposite = new Composite(composite, SWT.NONE); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + styleComposite.setLayoutData(CreateCompositeUtil.getNewGridData()); + styleComposite.setLayout(gridLayout1); + styleComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + CreateCompositeUtil.createNewWhiteLabel(styleComposite, "ʽ"); + codeStyleText = CreateCompositeUtil.createNewText(styleComposite, "@"); + } + + private void createButtonComposite(Composite composite) { + Composite buttonComposite = new Composite(composite, SWT.NONE); + buttonComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + Button button1 = CreateCompositeUtil.createNewButton(buttonComposite, ""); + button1.setVisible(true); + Button button2 = CreateCompositeUtil.createButton(buttonComposite, "", 30, 100); + button2.setVisible(true); + } + + private void createCoverComposite(Composite composite) { + Composite coverComposite = new Composite(composite, SWT.NONE); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + coverComposite.setLayoutData(CreateCompositeUtil.getNewGridData()); + coverComposite.setLayout(gridLayout1); + coverComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + + CreateCompositeUtil.createNewWhiteLabel(coverComposite, "С"); + patternMinLengthText = CreateCompositeUtil.createNewText(coverComposite, ""); + CreateCompositeUtil.createNewWhiteLabel(coverComposite, "λ"); + coverText = CreateCompositeUtil.createNewText(coverComposite, ""); + } + + /** + * This method initializes createSeqPropertyComposite + * + */ + public void createSeqPropertyComposite(Composite parent) { + Composite seqComposite = new Composite(parent, SWT.NONE); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + seqComposite.setLayoutData(CreateCompositeUtil.getNewGridData()); + seqComposite.setLayout(gridLayout1); + seqComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); + + CreateCompositeUtil.createNewWhiteLabel(seqComposite, "ʼֵ"); + seqBeginText = CreateCompositeUtil.createNewText(seqComposite, "0"); + + CreateCompositeUtil.createNewWhiteLabel(seqComposite, "ֵ"); + seqMaxText = CreateCompositeUtil.createNewText(seqComposite, "0"); + + CreateCompositeUtil.createNewWhiteLabel(seqComposite, ""); + seqLengthtext = CreateCompositeUtil.createNewText(seqComposite, "0"); + + CreateCompositeUtil.createNewWhiteLabel(seqComposite, ""); + seqStepText = CreateCompositeUtil.createNewText(seqComposite, "0"); + + CreateCompositeUtil.createNewWhiteLabel(seqComposite, ""); + seqExcludeStrText = CreateCompositeUtil.createNewText(seqComposite, ""); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog.java b/src/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog.java new file mode 100644 index 0000000..b5aa25d --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codeview/CodeSegmentDialog.java @@ -0,0 +1,230 @@ +/** + * @author tyl + * @Action ini + * 2011-3-23 + */ +package cn.com.origin.autocodemanager.views.codeview; + +import java.util.HashMap; +import java.util.List; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Tree; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.CreateCompositeUtil; +import cn.com.origin.autocodemanager.common.dialog.AbstractCodeSegmentDialog; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.util.MessageBox; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class CodeSegmentDialog extends AbstractCodeSegmentDialog { + + public CodeSegmentDialog(Shell parentShell, AbstractCreateTreeView createView, String title, String action) { + super(parentShell, createView, title, action); + } + + // Ի + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + Group nodeGroup = CreateCompositeUtil.createCompositeGroup(container, ""); + createTreeComposite(nodeGroup); + return container; + } + + /* + * (non-Javadoc) + * + * @see cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView#addRightKeyAction() + */ + public void addRightKeyAction() { + final Tree tree = treeViewer.getTree(); + tree.addMouseListener(new MouseAdapter() { + public void mouseDoubleClick(MouseEvent mouseevent) { + addChildrenDataToParent(); + } + }); + } + + private void addChildrenDataToParent() { + AbstractTreeData parentTreeData = null; + AbstractTreeData childrenTreeData = treeViewOperation.getSelectedTreeNode(treeViewer); + + AbstractTreeData segmentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + + if ((childrenTreeData == null) || (childrenTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪҪӽڵ!", "INFO", MessageBox.WARNING); + return; + } + if ((segmentTreeData == null) || (segmentTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡ޸ĵĹ!", "INFO", MessageBox.WARNING); + return; + } + + parentTreeData = treeViewOperation.getSelectedTreeNode(createView.treeViewer); + if (parentTreeData == null) { + parentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + } + if (action.equals(AutoCodeManagerPropertyName.ListPropertyNodeName)) { + if (!childrenTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyNodeName)) { + MessageBox.post("ѡҪҪӵԽڵ!", "INFO", MessageBox.WARNING); + return; + } + parentTreeData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + AbstractTreeData targetAddNode = addNewChildrenNode(codeSegmentView.createView.treeViewer, parentTreeData, childrenTreeData.getPackCodeNodeInfo().getNodeComponent(), segmentTreeData.getPackCodeNodeInfo().getNodeComponent()); + String parentStr = ""; + addNewChildrenNodes(createView.treeViewer, treeAndListCodeOperation.getParentStr(childrenTreeData, parentStr), childrenTreeData.getPackCodeNodeInfo().getNodeComponent().getUid(), targetAddNode, segmentTreeData.getPackCodeNodeInfo().getNodeComponent()); + treeViewOperation.addExistCodeNode(createView.treeViewer, parentTreeData, targetAddNode); + createView.treeViewer.refresh(); + } else if (action.equals(AutoCodeManagerPropertyName.TreeNodeName)) { + if ((!childrenTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.TreeNodeName))) { + MessageBox.post("ѡҪҪӵڵ!", "INFO", MessageBox.WARNING); + return; + } + AbstractTreeData targetAddNode = addNewChildrenNode(treeViewer, parentTreeData, childrenTreeData.getPackCodeNodeInfo().getNodeComponent(), segmentTreeData.getPackCodeNodeInfo().getNodeComponent()); + String parentStr = ""; + addNewChildrenNodes(createView.treeViewer, treeAndListCodeOperation.getParentStr(childrenTreeData, parentStr), childrenTreeData.getPackCodeNodeInfo().getNodeComponent().getUid(), targetAddNode, segmentTreeData.getPackCodeNodeInfo().getNodeComponent()); + treeViewOperation.appendChildrenNode(createView.treeViewer, parentTreeData, targetAddNode); + createView.treeViewer.refresh(); + } + } + + private AbstractTreeData addNewChildrenNode(TreeViewer treeView, AbstractTreeData parentNode, TCComponent component, TCComponent segmentComponent) { + AbstractTreeData treeNode = null; + try { + if (component == null) { + return null; + } + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(component, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + treeNode = new AbstractTreeData(parentNode, packCodeNodeInfo); + + treeViewOperation.addChildrenRelations(parentNode, treeNode); + treeAndListCodeOperation.addNodeReferenceComponents(component, segmentComponent); + treeView.refresh(parentNode); + } catch (TCException e) { + e.printStackTrace(); + } catch (ServiceException e) { + e.printStackTrace(); + } + return treeNode; + } + + private void addNewChildrenNodes(TreeViewer treeView, String parentStr, String currentStr, AbstractTreeData parentNode, TCComponent segmentComponent) { + try { + TCComponent[] tccomponents = null; + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, currentStr); + tccomponents = treeAndListCodeOperation.searchTreeORListNodes(hashMap); + for (int i = 0; i < tccomponents.length; i++) { + AbstractTreeData copyNode = addNewChildrenNode(treeView, parentNode, tccomponents[i], segmentComponent); + String parentStr2 = parentStr + "," + currentStr; + if (parentStr2.trim().startsWith(",")) { + parentStr2 = parentStr2.substring(1); + } + addNewChildrenNodes(treeView, parentStr2, tccomponents[i].getUid().trim(), copyNode, segmentComponent); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + + } + + /* + * (non-Javadoc) + * + * @see cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView#createOrgAutoCodeNodeChildren(cn.com.origin.autocodemanager.common.tree.AbstractTreeData[]) + */ + + public void createOrgAutoCodeNodeChildren(AbstractTreeData[] codeDatas) throws Exception { + if (codeDatas != null && codeDatas.length > 0) { + for (int i = 0; i < codeDatas.length; i++) { + AbstractTreeData autoCodeData = (AbstractTreeData) codeDatas[i]; + if (autoCodeData == null) { + continue; + } + TCComponent autoCodeDataComponent = autoCodeData.getPackCodeNodeInfo().getNodeComponent(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + HashMap hashMap = new HashMap(); + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(autoCodeData, parentStr); + + if (autoCodeDataComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, autoCodeDataComponent.getUid()); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr); + } else { + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, ""); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, ""); + } + String parentStr2 = ""; + if (autoCodeDataComponent != null) { + if (parentStr.trim().length() == 0) { + parentStr2 = autoCodeDataComponent.getUid(); + } else { + parentStr2 = parentStr + "," + autoCodeDataComponent.getUid(); + } + } else { + parentStr2 = parentStr; + } + + List packCodeNodeInfos = treeAndListCodeOperation.searchTreeORListNodeInfos(hashMap, parentStr2, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + if (packCodeNodeInfos != null && packCodeNodeInfos.size() > 0) { + AbstractTreeData autoCodeDataTCComs[] = new AbstractTreeData[packCodeNodeInfos.size()]; + for (int k = 0; k < packCodeNodeInfos.size(); k++) { + if (packCodeNodeInfos.get(k).getNodeComponent() == null) { + continue; + } + PackCodeNodeInfo packCodeNodeInfo = packCodeNodeInfos.get(k); + autoCodeDataTCComs[k] = new AbstractTreeData(autoCodeData, packCodeNodeInfo); + if (packCodeNodeInfo.isContainsChildren()) { + autoCodeDataTCComs[k].setTreeAutoCodeNodeChildren(new AbstractTreeData[] { new AbstractTreeData() }); + } + } + autoCodeData.setTreeAutoCodeNodeChildren(autoCodeDataTCComs); + autoCodeData.setChildrenLoader(true); + treeViewer.refresh(autoCodeData); + } + } + } + } + + // öԻʼС + @Override + protected Point getInitialSize() { + return new Point(370, 500); + } + + // Իť + @Override + protected void createButtonsForButtonBar(final Composite parent) { + createButton(parent, IDialogConstants.OK_ID, "", true); + createButton(parent, IDialogConstants.CANCEL_ID, "ر", false); + getButton(IDialogConstants.OK_ID).setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.OK_IMAGE)); + getButton(IDialogConstants.CANCEL_ID).setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.CLOSE_IMAGE)); + } + + // ڵǷΪ + @Override + protected void okPressed() { + addChildrenDataToParent(); + this.close(); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction.java b/src/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction.java new file mode 100644 index 0000000..c64fc34 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codeview/CodeSegmentViewRightKeyAction.java @@ -0,0 +1,79 @@ +/** + * @author tyl + * @Action ini + * 2011-3-17 + */ +package cn.com.origin.autocodemanager.views.codeview; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.teamcenter.rac.util.MessageBox; + +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeViewRightKeyAction; + +public class CodeSegmentViewRightKeyAction extends AbstractTreeViewRightKeyAction { + /** + * @param treeViewer + */ + public CodeSegmentViewRightKeyAction(AbstractCreateTreeView createCodeSegmentView) { + super(createCodeSegmentView); + } + + public void fillContextMenu() { + if (menuManager == null) { + // һεø÷ʱ + menuManager = new MenuManager(); + menuManager.add(new NewCodeNodeAction(AutoCodeManagerPropertyName.AddRuleGroupNodeName)); + menuManager.add(new NewCodeNodeAction(AutoCodeManagerPropertyName.AddRuleRootNodeName)); + menuManager.add(new CopyCodeNodeAction()); + menuManager.add(new EidtCodeNodeAction()); + menuManager.add(new LockCodeNodeAction()); + menuManager.add(new UnLockCodeNodeAction()); + } + Tree tree = treeViewer.getTree(); + Menu menu = menuManager.createContextMenu(tree); + tree.setMenu(menu); + } + + private class NewCodeNodeAction extends Action { + String actionType = ""; + String title = ""; + + public NewCodeNodeAction(String actionType) { + this.actionType = actionType; + if (actionType.equals(AutoCodeManagerPropertyName.AddRuleRootNodeName)) { + title = "½"; + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.CODE_IMAGE); + this.setImageDescriptor(imageDesc); + } else { + title = "½"; + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.CODEGROUP_IMAGE); + this.setImageDescriptor(imageDesc); + } + this.setText(title); + + } + + public void run() { + AbstractTreeData selectedTreeData= treeViewOperation.getSelectedTreeNode(createView.treeViewer); + if((treeViewOperation.isRuleRootNode(selectedTreeData))&&(actionType.equals(AutoCodeManagerPropertyName.AddRuleGroupNodeName))) + { + MessageBox.post("˽ڵ²ܽ!", "INFO", MessageBox.WARNING); + return; + } + NewCodeNodeDialog codeNodeDialog = new NewCodeNodeDialog(null, createView, actionType,title, false); + codeNodeDialog.open(); + } + } + +} diff --git a/src/cn/com/origin/autocodemanager/views/codeview/CopyCodeNodeDialog.java b/src/cn/com/origin/autocodemanager/views/codeview/CopyCodeNodeDialog.java new file mode 100644 index 0000000..96a27a9 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codeview/CopyCodeNodeDialog.java @@ -0,0 +1,167 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.views.codeview; + +import java.util.HashMap; + +import org.eclipse.swt.widgets.Shell; + +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class CopyCodeNodeDialog extends NewCodeNodeDialog { + + TCComponent ruleComponent = null; + + public CopyCodeNodeDialog(Shell parentShell, AbstractCreateTreeView codeTreeView, String title, boolean isEdit, String actionType) { + super(parentShell, codeTreeView, actionType, title, isEdit); + } + + // ڵǷΪ + @Override + protected void okPressed() { + String nodename = nodeNameText.getText().trim(); + if (nodename == null || nodename.trim().length() == 0) { + postMesssageBox("ƲΪգ"); + nodeNameText.setFocus(); + return; + } + AbstractTreeData targetCopyNode = saveNewCodeNode(selectedTreeData.getParentTreeData(), selectedTreeData); + String parentStr = ""; + copyCodeNodes(treeAndListCodeOperation.getParentStr(selectedTreeData, parentStr), selectedTreeData.getPackCodeNodeInfo().getNodeComponent().getUid(), targetCopyNode); + try { + codeSegmentView.createView.createOrgAutoCodeNodeChildren(new AbstractTreeData[] { targetCopyNode }); + } catch (Exception e) { + e.printStackTrace(); + } + close(); + } + + private AbstractTreeData saveNewCodeNode(AbstractTreeData parentTreeData, AbstractTreeData selectedTreeData) { + AbstractTreeData treeData = null; + try { + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_index, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, getTextValue(nodeNameText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, getTextValue(nodeValueText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, selectedTreeData.getPackCodeNodeInfo().getNode_type()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, getTextValue(nodeDescriptionText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, String.valueOf(selectedTreeData.getPackCodeNodeInfo().is_root)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, getTextValue(codeStyleText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, getTextValue(codeLengthText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, getTextValue(seqBeginText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, getSeqLength()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value, getTextValue(seqMaxText)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes, ""); + if (selectedTreeData.getParentTreeData().getPackCodeNodeInfo().getNodeComponent() == null) { + ruleComponent = null; + } + TCComponent newComponent = new TreeAndListCodeOperation().createNewTreeORListNode(ruleComponent, parentTreeData, hashMap); + if (newComponent == null) { + return null; + } + if (selectedTreeData.getPackCodeNodeInfo().is_root) { + ruleComponent = newComponent; + } + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(newComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + packCodeNodeInfo.setNodeComponent(newComponent); + treeData = new AbstractTreeData(parentTreeData, packCodeNodeInfo); + treeViewOperation.addExistCodeNode(createView.treeViewer, parentTreeData, treeData); + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + return treeData; + } + + private void copyCodeNodes(String parentStr, String currentStr, AbstractTreeData parentNode) { + try { + TCComponent[] tccomponents = null; + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, currentStr); + tccomponents = treeAndListCodeOperation.searchTreeORListNodes(hashMap); + if (tccomponents == null) { + return; + } + for (int i = 0; i < tccomponents.length; i++) { + AbstractTreeData copyNode = copyTreeData(parentNode, tccomponents[i]); + String parentStr2 = parentStr + "," + currentStr; + if (parentStr2.trim().startsWith(",")) { + parentStr2 = parentStr2.substring(1); + } + copyCodeNodes(parentStr2, tccomponents[i].getUid().trim(), copyNode); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + } + + private AbstractTreeData copyTreeData(AbstractTreeData parentTreeData, TCComponent sourceComponent) { + AbstractTreeData treeData = null; + + try { + sourceComponent.refresh(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(sourceComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + String[] propertyNames = { AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value }; + String[] propertyValues = sourceComponent.getProperties(propertyNames); + HashMap hashMap = new HashMap(); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_index, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_name, packCodeNodeInfo.getNode_name()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_value, packCodeNodeInfo.getNode_value()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_type, packCodeNodeInfo.getNode_type()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_node_desc, packCodeNodeInfo.getNode_desc()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_root, String.valueOf(packCodeNodeInfo.is_root)); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_create_user, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, packCodeNodeInfo.getCode_style()); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, propertyValues[0]); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, propertyValues[1]); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, propertyValues[2]); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value, propertyValues[3]); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_reference_nodes, ""); + if (packCodeNodeInfo.is_root) { + ruleComponent = null; + } + TCComponent newComponent = new TreeAndListCodeOperation().createNewTreeORListNode(ruleComponent, parentTreeData, hashMap); + if (packCodeNodeInfo.is_root) { + ruleComponent = newComponent; + } + packCodeNodeInfo.setNodeComponent(newComponent); + treeData = new AbstractTreeData(parentTreeData, packCodeNodeInfo); + treeViewOperation.addChildrenRelations(parentTreeData, treeData); + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + return treeData; + } +} diff --git a/src/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView.java b/src/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView.java new file mode 100644 index 0000000..40be0e4 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codeview/CreateCodeSegmentView.java @@ -0,0 +1,247 @@ +/** + * @author tyl + * @Action ini + * 2011-3-15 + */ +package cn.com.origin.autocodemanager.views.codeview; + +import java.util.HashMap; +import java.util.List; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TreeEvent; +import org.eclipse.swt.events.TreeListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.part.ViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.ORTreeContentProvider; +import cn.com.origin.autocodemanager.common.tree.ORTreeLabelProvider; +import cn.com.origin.autocodemanager.views.AutoCodeListCodeView; +import cn.com.origin.autocodemanager.views.AutoCodeTreeCodeView; +import com.teamcenter.rac.kernel.TCComponent; + +public class CreateCodeSegmentView extends AbstractCreateTreeView { + private boolean isSelectedAction = false; + + public CreateCodeSegmentView(Composite composite, String rootName, + ViewPart viewPart) { + super(composite, rootName, viewPart); + } + + public CreateCodeSegmentView(Composite composite, String rootName) { + super(composite, rootName); + } + + public void initTree(String rootName) { + tree.setFocus(); // ý + treeViewer.setLabelProvider(new ORTreeLabelProvider()); + treeViewer.setContentProvider(new ORTreeContentProvider()); + rootTreeData = new AbstractTreeData(null, null, rootName, + AutoCodeManagerPropertyName.SegmentName, false); + treeViewer.setInput((new Object[] { rootTreeData })); + if (viewPart != null) { + codeListView = (AutoCodeListCodeView) viewPart + .getSite() + .getPage() + .findView( + AutoCodeManangerConstants.AutoCodeManagerListCodeView_ID); + codeTreeView = (AutoCodeTreeCodeView) viewPart + .getSite() + .getPage() + .findView( + AutoCodeManangerConstants.AutoCodeManagerTreeCodeView_ID); + } + } + + public void addRightKeyAction() { + final Tree tree = treeViewer.getTree(); + tree.addMouseListener(new MouseAdapter() { + public void mouseDown(MouseEvent e) { + if (e.button == 3) { + CodeSegmentViewRightKeyAction rightAction = new CodeSegmentViewRightKeyAction( + CreateCodeSegmentView.this); + rightAction.fillContextMenu(); + } + } + }); + } + + public void createTree(Composite parent, String rootName) { + Composite composite = new Composite(parent, 0); + FillLayout fillLayout = new FillLayout(); + composite.setLayout(fillLayout); + + treeViewer = new TreeViewer(composite, SWT.BORDER); + tree = treeViewer.getTree(); + tree.setBackground(new Color(Display.getCurrent(), 255, 255, 255)); + initTree(rootName); + + treeViewer.expandToLevel(1); + tree.addTreeListener(new TreeListener() { + public void treeCollapsed(TreeEvent treeEvent) { + } + + public void treeExpanded(TreeEvent treeEvent) { + isSelectedAction = false; + AbstractTreeData codeData = (AbstractTreeData) treeEvent.item + .getData(); + if (codeData == null) { + return; + } + try { + expandNode(codeData); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + + tree.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AbstractTreeData selectedData = (AbstractTreeData) e.item + .getData(); + if (selectedData == null) { + return; + } + isSelectedAction = true; + if (selectedData.getParentTreeData() == null) { + if (!selectedData.isChildrenLoader()) { + expandNode(selectedData); + } + return; + } + if ((selectedData.getPackCodeNodeInfo().getNodeComponent() != null) + && (selectedData.getPackCodeNodeInfo().is_root)) { + expandNode(selectedData); + } else { + if ((codeListView != null) && ((codeTreeView != null))) { + codeListView.createView.treeViewer.setInput(null); + codeTreeView.createView.treeViewer.setInput(null); + } + } + } + }); + } + + public void createOrgAutoCodeNodeChildren(AbstractTreeData[] codeDatas) + throws Exception { + if ((codeListView != null) && ((codeTreeView != null))) { + codeListView.createView.treeViewer.setInput(null); + codeTreeView.createView.treeViewer.setInput(null); + } + if (codeDatas != null && codeDatas.length > 0) { + for (int i = 0; i < codeDatas.length; i++) { + AbstractTreeData autoCodeData = (AbstractTreeData) codeDatas[i]; + if (autoCodeData == null) { + continue; + } + TCComponent autoCodeDataComponent = autoCodeData + .getPackCodeNodeInfo().getNodeComponent(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + HashMap hashMap = new HashMap(); + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(autoCodeData, + parentStr); + + if (autoCodeDataComponent != null) { + hashMap + .put( + AutoCodeManagerPropertyName.CodeRelation_current_node, + autoCodeDataComponent.getUid()); + hashMap + .put( + AutoCodeManagerPropertyName.CodeRelation_parent_node, + parentStr); + } else { + hashMap + .put( + AutoCodeManagerPropertyName.CodeRelation_parent_node, + ""); + hashMap + .put( + AutoCodeManagerPropertyName.CodeRelation_current_node, + ""); + } + String parentStr2 = ""; + if (autoCodeDataComponent != null) { + if (parentStr.trim().length() == 0) { + parentStr2 = autoCodeDataComponent.getUid(); + } else { + parentStr2 = parentStr + "," + + autoCodeDataComponent.getUid(); + } + } else { + parentStr2 = parentStr; + } + String[] propertyNames = AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames; + if (isSelectedAction) { + propertyNames = AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames; + } + List packCodeNodeInfos = treeAndListCodeOperation + .searchTreeORListNodeInfos(hashMap, parentStr2, + propertyNames); + if (packCodeNodeInfos != null && packCodeNodeInfos.size() > 0) { + AbstractTreeData autoCodeDataTCComs[] = new AbstractTreeData[packCodeNodeInfos + .size()]; + for (int k = 0; k < packCodeNodeInfos.size(); k++) { + if (packCodeNodeInfos.get(k).getNodeComponent() == null) { + continue; + } + PackCodeNodeInfo packCodeNodeInfo = packCodeNodeInfos + .get(k); + autoCodeDataTCComs[k] = new AbstractTreeData( + autoCodeData, packCodeNodeInfo); + + if (!packCodeNodeInfo.is_root) { + if (packCodeNodeInfo.isContainsChildren()) { + autoCodeDataTCComs[k] + .setTreeAutoCodeNodeChildren(new AbstractTreeData[] { new AbstractTreeData() }); + } + } + } + if (autoCodeData.getPackCodeNodeInfo().is_root) { + String type = autoCodeData.getPackCodeNodeInfo() + .getNode_type(); + if ((codeListView != null) && ((codeTreeView != null))) { + if (type + .equals(AutoCodeManagerPropertyName.ListName)) { + codeListView.createView.treeViewer + .setInput(autoCodeDataTCComs); + } else if (type + .equals(AutoCodeManagerPropertyName.TreeName)) { + codeTreeView.createView.treeViewer + .setInput(autoCodeDataTCComs); + } + } + } else { + autoCodeData + .setTreeAutoCodeNodeChildren(autoCodeDataTCComs); + autoCodeData.setChildrenLoader(true); + treeViewer.refresh(autoCodeData); + treeViewer.expandToLevel(autoCodeData, 1); + } + } else { + autoCodeData.setTreeAutoCodeNodeChildren(null); + autoCodeData.setChildrenLoader(true); + treeViewer.refresh(autoCodeData); + treeViewer.expandToLevel(autoCodeData, 1); + continue; + } + } + } + } +} diff --git a/src/cn/com/origin/autocodemanager/views/codeview/NewCodeNodeDialog.java b/src/cn/com/origin/autocodemanager/views/codeview/NewCodeNodeDialog.java new file mode 100644 index 0000000..717ca1c --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codeview/NewCodeNodeDialog.java @@ -0,0 +1,146 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.views.codeview; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.dialog.AbstractCodeDialog; +import cn.com.origin.autocodemanager.common.tree.AbstractCreateTreeView; + +public class NewCodeNodeDialog extends AbstractCodeDialog { + + String actionType; + + public NewCodeNodeDialog(Shell parentShell, AbstractCreateTreeView codeTreeView, String actionType, String title, boolean isEdit) { + super(parentShell, codeTreeView, title, isEdit); + this.actionType = actionType; + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + if (actionType.equals(AutoCodeManagerPropertyName.AddRuleGroupNodeName)) { + Group nodeGroup = createCompositeGroup(container, ""); + createGroupComposite(nodeGroup); + } else { + Group nodeGroup = createCompositeGroup(container, ""); + createNodeComposite(nodeGroup); + Group seqGroup = createCompositeGroup(container, "ˮ"); + createSeqComposite(seqGroup); + } + return container; + } + + public void createGroupComposite(Composite parent) { + Composite composite = new Composite(parent, 0); + GridLayout gridLayout1 = new GridLayout(); + gridLayout1.numColumns = 2; + GridData gridData1 = new GridData(); + gridData1.horizontalAlignment = GridData.FILL; + gridData1.grabExcessHorizontalSpace = true; + gridData1.verticalSpan = 20; + gridData1.grabExcessVerticalSpace = true; + gridData1.verticalAlignment = GridData.FILL; + composite.setLayoutData(gridData1); + composite.setLayout(gridLayout1); + initNewGroupComposite(composite); + if (selectedTreeData != null) { + if (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() != null) { + setTextValue(nodeNameText, selectedTreeData.getPackCodeNodeInfo().getNode_name()); + setTextValue(nodeDescriptionText, selectedTreeData.getPackCodeNodeInfo().getNode_desc()); + } + } + } + + public void initNewGroupComposite(Composite composite) { + createNewLabel(composite, ""); + nodeNameText = createNewText(composite, ""); + createNewLabel(composite, "ע"); + nodeDescriptionText = createNewText(composite, ""); + } + + public void initNewCodeComposite(Composite composite) { + createNewLabel(composite, ""); + nodeNameText = createNewText(composite, ""); + + createNewLabel(composite, "λ"); + nodeValueText = createNewText(composite, ""); + + createNewLabel(composite, "ע"); + nodeDescriptionText = createNewText(composite, ""); + + createNewLabel(composite, "ʽ"); + codeStyleText = createNewText(composite, "[T][L]"); + + createNewLabel(composite, "볤"); + codeLengthText = createNewText(composite, "14"); + + createNewLabel(composite, ""); + String[] items = new String[] { "", "б" }; + typeCombo = createNewCombo(composite, items); + + } + + // ڵǷΪ + @Override + protected void okPressed() { + String nodename = nodeNameText.getText().trim(); + if (nodename == null || nodename.trim().length() == 0) { + postMesssageBox("ƲΪգ"); + nodeNameText.setFocus(); + return; + } + String type = ""; + if (typeCombo != null) { + if (typeCombo.getText().equals("")) { + type = AutoCodeManagerPropertyName.TreeName; + } else { + type = AutoCodeManagerPropertyName.ListName; + } + } + if (actionType.equals(AutoCodeManagerPropertyName.AddRuleGroupNodeName)) { + type = AutoCodeManagerPropertyName.CodeGroupName; + } + if (actionType.equals(AutoCodeManagerPropertyName.AddRuleGroupNodeName)) { + saveNewCodeNode(selectedTreeData, selectedComponent, createView.treeViewer, type, false); + } else { + if ((treeViewOperation.isRuleRootNode(selectedTreeData))) { + saveNewCodeNode(selectedTreeData.getParentTreeData(), selectedComponent, createView.treeViewer, type, true); + } else { + saveNewCodeNode(selectedTreeData, selectedComponent, createView.treeViewer, type, true); + } + } + close(); + } + + // öԻʼС + @Override + protected Point getInitialSize() { + if (actionType.equals(AutoCodeManagerPropertyName.AddRuleGroupNodeName)) { + return new Point(250, 200); + } else { + return new Point(270, 440); + } + + } + + // öԻ򴰿ڱͼ + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(title); + newShell.setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.CODENODE_IMAGE)); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/codeview/NewCodeTestView.java b/src/cn/com/origin/autocodemanager/views/codeview/NewCodeTestView.java new file mode 100644 index 0000000..6ff3fd2 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/codeview/NewCodeTestView.java @@ -0,0 +1,15 @@ +package cn.com.origin.autocodemanager.views.codeview; + +import org.eclipse.swt.widgets.Composite; + +public class NewCodeTestView extends CreateCodeSegmentView{ + + public NewCodeTestView(Composite composite, String rootName) { + super(composite, rootName); + } + public void addRightKeyAction() { + + } + + +} diff --git a/src/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction.java b/src/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction.java new file mode 100644 index 0000000..4dea4a8 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/listcodeview/CodeListViewRightKeyAction.java @@ -0,0 +1,160 @@ +/** + * @author tyl + * @Action ini + * 2011-3-17 + */ +package cn.com.origin.autocodemanager.views.listcodeview; + +import java.util.HashMap; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.plugin.AbstractUIPlugin; + +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.util.MessageBox; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeViewRightKeyAction; + +public class CodeListViewRightKeyAction extends AbstractTreeViewRightKeyAction { + public CodeListViewRightKeyAction(CreateListCodeView createListCodeView) { + super(createListCodeView); + } + + public void fillContextMenu() { + if (menuManager == null) { + // һεø÷ʱ + menuManager = new MenuManager(); + menuManager.add(new NewCodeNodeAction()); + menuManager.add(new NewCodeNodeValueAction()); + menuManager.add(new AddChildrenNodeAction("", AutoCodeManagerPropertyName.ListPropertyNodeName)); + menuManager.add(new SetDefaultSelectedAction()); + menuManager.add(new CancelDefaultSelectedAction()); + menuManager.add(new EidtCodeNodeAction()); + menuManager.add(new RemoveCodeNodeAction()); + menuManager.add(new LockCodeNodeAction()); + menuManager.add(new UnLockCodeNodeAction()); + } + Tree tree = treeViewer.getTree(); + Menu menu = menuManager.createContextMenu(tree); + tree.setMenu(menu); + } + + public class SetDefaultSelectedAction extends Action { + public SetDefaultSelectedAction() { + setText("Ĭֵ"); +// ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.UNLOCK_IMAGE); +// this.setImageDescriptor(imageDesc); + } + + public void run() { + try { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪýڵ!", "INFO", MessageBox.WARNING); + return; + } + + TCComponent selectedComponent = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + if (!selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyValueNodeName)) { + MessageBox.post("ѡбֵ!", "INFO", MessageBox.WARNING); + return; + } + HashMap hashMap = new HashMap(); + if (selectedComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, "true"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, session.getUser().getUid()); + TCComponent updateComponent = new TreeAndListCodeOperation().updateTreeORListNode(selectedComponent, hashMap); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + createView.treeViewer.refresh(selectedTreeData); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public class CancelDefaultSelectedAction extends Action { + public CancelDefaultSelectedAction() { + setText("ȡĬֵ"); +// ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.UNLOCK_IMAGE); +// this.setImageDescriptor(imageDesc); + } + + public void run() { + try { + if ((selectedTreeData == null) || (selectedTreeData.getPackCodeNodeInfo().getNodeComponent() == null)) { + MessageBox.post("ѡҪýڵ!", "INFO", MessageBox.WARNING); + return; + } + + TCComponent selectedComponent = selectedTreeData.getPackCodeNodeInfo().getNodeComponent(); + if (!selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyValueNodeName)) { + MessageBox.post("ѡбֵ!", "INFO", MessageBox.WARNING); + return; + } + + HashMap hashMap = new HashMap(); + if (selectedComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_isDefaultSelected, "false"); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_date, ""); + hashMap.put(AutoCodeManagerPropertyName.TreeAndListCodeNode_last_revise_user, session.getUser().getUid()); + TCComponent updateComponent = new TreeAndListCodeOperation().updateTreeORListNode(selectedComponent, hashMap); + PackCodeNodeInfo packCodeNodeInfo = treeAndListCodeOperation.getTreeAndListStringValue(updateComponent, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + selectedTreeData.setPackCodeNodeInfo(packCodeNodeInfo); + createView.treeViewer.refresh(selectedTreeData); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + private class NewCodeNodeAction extends Action { + public NewCodeNodeAction() { + setText("½"); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.LISTNODE_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + AbstractTreeData rootNode = treeViewOperation.getSelectedTreeNode(codeSegmentView.getCreateView().treeViewer); + if (rootNode == null) { + MessageBox.post("ѡҪ޸Ľڵ!", "INFO", MessageBox.WARNING); + return; + } + String type = rootNode.getPackCodeNodeInfo().getNode_type(); + if (!type.equals(AutoCodeManagerPropertyName.ListName)) { + MessageBox.post("ѡҪ޸бڵ!", "INFO", MessageBox.WARNING); + return; + } + new NewListPropertyNodeDialog(treeViewer.getControl().getShell(), (CreateListCodeView) createView, "½", false).open(); + } + } + + private class NewCodeNodeValueAction extends Action { + public NewCodeNodeValueAction() { + setText("½ֵ"); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.LISTVALUE_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + AbstractTreeData rootNode = treeViewOperation.getSelectedTreeNode(createView.treeViewer); + if (rootNode == null) { + MessageBox.post("ѡҪ޸Ľڵ!", "INFO", MessageBox.WARNING); + return; + } + new NewListPropertyValueNodeDialog(treeViewer.getControl().getShell(), (CreateListCodeView) createView, "½ֵ", false).open(); + } + } +} diff --git a/src/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView.java b/src/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView.java new file mode 100644 index 0000000..80b83cc --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/listcodeview/CreateListCodeView.java @@ -0,0 +1,82 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.views.listcodeview; + +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TreeEvent; +import org.eclipse.swt.events.TreeListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.part.ViewPart; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.treetable.AbstractTreeTable; + +public class CreateListCodeView extends AbstractTreeTable { + public CreateListCodeView(Composite composite, String rootName, ViewPart viewPart) { + super(composite, rootName, viewPart); + + } + + public CreateListCodeView() { + + } + + public void addRightKeyAction() { + tree.addMouseListener(new MouseAdapter() { + public void mouseDown(MouseEvent e) { + if (e.button == 3) { + CodeListViewRightKeyAction rightAction = new CodeListViewRightKeyAction(CreateListCodeView.this); + rightAction.fillContextMenu(); + } + } + }); + } + + public void createTree(Composite parent, String rootName) { + Composite composite = parent; + treeViewer = new TreeViewer(composite, SWT.BORDER); + tree = treeViewer.getTree(); + initTree(rootName); + + treeViewer.expandToLevel(1); + tree.addTreeListener(new TreeListener() { + public void treeCollapsed(TreeEvent treeEvent) { + } + public void treeExpanded(TreeEvent treeEvent) { + AbstractTreeData codeData = (AbstractTreeData) treeEvent.item.getData(); + if (codeData == null) { + return; + } + try { + expandNode(codeData); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + + tree.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AbstractTreeData selectedData = (AbstractTreeData) e.item.getData(); + if (selectedData == null) { + return; + } + if (selectedData.getParentTreeData() == null) { + expandNode(selectedData); + } + } + }); + } + + public void createOrgAutoCodeNodeChildren(AbstractTreeData[] codeDatas) throws Exception { + super.createOrgAutoCodeNodeChildren(codeDatas); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView.java b/src/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView.java new file mode 100644 index 0000000..d1e0848 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/listcodeview/NewItemListCodeView.java @@ -0,0 +1,556 @@ +/** + * @author tyl + * @Action ini + * 2011-4-13 + */ +package cn.com.origin.autocodemanager.views.listcodeview; + +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.eclipse.jface.fieldassist.ComboContentAdapter; +import org.eclipse.jface.fieldassist.ContentProposal; +import org.eclipse.jface.fieldassist.ContentProposalAdapter; +import org.eclipse.jface.fieldassist.IContentProposal; +import org.eclipse.jface.fieldassist.SimpleContentProposalProvider; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TreeEvent; +import org.eclipse.swt.events.TreeListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.part.ViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +import com.teamcenter.rac.aif.AIFDesktop; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.util.MessageBox; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class NewItemListCodeView extends CreateListCodeView { + + public Label[] propertyLabel; + public Combo[] propertyComb; + boolean isSetName = true; + private String icoName = ""; + public String codeName = ""; + public StringBuffer pattern = new StringBuffer(); + public StringBuffer codeDesc = new StringBuffer(); + private Map icoPropertyMap; + private String splitString = "<---->"; + // + private String productCode = ""; + + public NewItemListCodeView(Composite composite, String rootName, ViewPart viewPart) { + super(composite, rootName, viewPart); + } + + public void createTree(Composite parent, String rootName) { + Composite composite = parent; + treeViewer = new TreeViewer(composite, SWT.BORDER); + tree = treeViewer.getTree(); + initTree(rootName); + treeViewer.expandToLevel(1); + tree.addTreeListener(new TreeListener() { + public void treeCollapsed(TreeEvent treeEvent) { + } + + public void treeExpanded(TreeEvent treeEvent) { + AbstractTreeData codeData = (AbstractTreeData) treeEvent.item.getData(); + if (codeData == null) { + return; + } + if (codeData.getPackCodeNodeInfo().is_lock) { + codeData.setTreeAutoCodeNodeChildren(null); + return; + } + expandNode(codeData); + } + }); + + tree.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AbstractTreeData selectedData = (AbstractTreeData) e.item.getData(); + if (selectedData == null) { + return; + } + if (selectedData.getParentTreeData() == null) { + expandNode(selectedData); + } + } + }); + } + + public void getListPropertyValue(AbstractTreeData segmentNode) { + initPropertyValue(); + try { + if ((segmentNode != null) && (segmentNode.getPackCodeNodeInfo().getNodeComponent() != null)) { + String firstNodeName = segmentNode.getPackCodeNodeInfo().getNode_name(); + String firstNodeValue = segmentNode.getPackCodeNodeInfo().getNode_value(); + if (firstNodeValue.trim().length() > 0) { + codeDesc.append(firstNodeValue + "::" + firstNodeName); + codeDesc.append("\n"); + pattern.append(firstNodeValue); + pattern.append(" "); + } + } + if (propertyComb != null && propertyComb.length > 0) { + for (int i = 0; i < propertyComb.length; i++) { + if (propertyComb[i] == null) { + continue; + } + if (propertyComb[i].getText().length() == 0) { + return; + } + String codeListValue = propertyComb[i].getText(); + String name = propertyLabel[i].getText().trim(); + codeName = name.substring(0, name.length() - 1).toString(); + if (codeListValue != null && !"".equals(codeListValue)) { + if (codeListValue.contains(splitString)) { + String temp[] = codeListValue.split(splitString); + if (temp.length > 0) { + icoPropertyMap.put(codeName.trim(), temp[1].trim()); + codeDesc.append(replaceSpecialValue(temp[0].trim()) + "::" + temp[1].trim()); + codeDesc.append("\n"); + pattern.append(replaceSpecialValue(temp[0].trim())); + pattern.append(" "); + } + } else { + icoPropertyMap.put(codeName.trim(), codeListValue); + codeDesc.append(replaceSpecialValue(codeListValue) + "::" + "д"); + codeDesc.append("\n"); + pattern.append(replaceSpecialValue(codeListValue)); + pattern.append(" "); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public String replaceSpecialValue(String value) { + Date date = new Date(System.currentTimeMillis()); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + String dateStr = formatter.format(date); + // System.out.println("dateStr:::::" + dateStr); + String temps[] = dateStr.split("-"); + if (value.contains(AutoCodeManagerPropertyName.Code_year4)) { + value = value.replace(AutoCodeManagerPropertyName.Code_year4, temps[0]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_year2)) { + value = value.replace(AutoCodeManagerPropertyName.Code_year2, temps[0].substring(2)); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_mouth1)) { + value = value.replace(AutoCodeManagerPropertyName.Code_mouth1, temps[1]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_mouth2)) { + value = value.replace(AutoCodeManagerPropertyName.Code_mouth2, temps[1]); + value = value + " "; + } + + if (value.contains(AutoCodeManagerPropertyName.Code_date1)) { + value = value.replace(AutoCodeManagerPropertyName.Code_date1, temps[2]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_date2)) { + value = value.replace(AutoCodeManagerPropertyName.Code_date2, temps[2]); + value = value + " "; + } + return value; + } + + /** + * @return the icoPropertyMap + */ + public Map getIcoPropertyMap() { + return icoPropertyMap; + } + + /** + * @param icoPropertyMap + * the icoPropertyMap to set + */ + public void setIcoPropertyMap(Map icoPropertyMap) { + this.icoPropertyMap = icoPropertyMap; + } + + private void initPropertyValue() { + icoName = ""; + codeName = ""; + icoPropertyMap = new HashMap(); + pattern = new StringBuffer(); + codeDesc = new StringBuffer(); + } + + public String getFirstComboName() { + String value = ""; + if (isSetName) { + if (propertyComb != null && propertyComb.length > 0) { + for (int i = 0; i < propertyComb.length; i++) { + if (propertyComb[i] == null) { + continue; + } + String codeListValue = propertyComb[i].getText(); + if (codeListValue != null && !"".equals(codeListValue)) { + if (codeListValue.contains(splitString)) { + String temp[] = codeListValue.split(splitString); + if (temp.length > 0) { + // value = temp[0].trim(); + value = temp[1].trim(); + } + } else { + value = ""; + } + } + break; + } + } + } + return value; + } + + public List lp_packCodeNodeInfos; + + public void createCombox(Composite composite, AbstractTreeData segmentTreeData) { + try { + TCComponent segmentComponent = segmentTreeData.getPackCodeNodeInfo().getNodeComponent(); + composite.setLayout(new GridLayout(2, false)); + initPropertyValue(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + HashMap hashMap11 = new HashMap(); + String parentStr11 = ""; + parentStr11 = treeAndListCodeOperation.getParentStr(segmentTreeData, parentStr11); + if (segmentTreeData.getPackCodeNodeInfo().getNodeComponent() != null) { + hashMap11.put(AutoCodeManagerPropertyName.CodeRelation_current_node, segmentComponent.getUid()); + hashMap11.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr11); + } else { + hashMap11.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, ""); + hashMap11.put(AutoCodeManagerPropertyName.CodeRelation_current_node, ""); + } + String parentStr12 = ""; + if (segmentComponent != null) { + if (parentStr11.trim().length() == 0) { + parentStr12 = segmentComponent.getUid(); + } else { + parentStr12 = parentStr11 + "," + segmentComponent.getUid(); + } + } else { + parentStr12 = parentStr11; + } + List packCodeNodeInfos = treeAndListCodeOperation.searchTreeORListNodeInfos(hashMap11, parentStr12, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + if ((packCodeNodeInfos == null) || (packCodeNodeInfos.size() == 0)) { + return; + } + + propertyLabel = new Label[packCodeNodeInfos.size()]; + propertyComb = new Combo[packCodeNodeInfos.size()]; + for (int i = 0; i < packCodeNodeInfos.size(); i++) { + if (packCodeNodeInfos.get(i).getNodeComponent() == null) { + continue; + } + PackCodeNodeInfo packCodeNodeInfo = packCodeNodeInfos.get(i); + + GridData gridDataLabel = new GridData(); + gridDataLabel.horizontalSpan = 1; + GridData gridDataLabeCombo = new GridData(); + gridDataLabeCombo.horizontalSpan = 1; + + String labelText = packCodeNodeInfo.getNode_name(); + propertyLabel[i] = new Label(composite, SWT.NONE); + propertyLabel[i].setText(labelText + ":"); + propertyLabel[i].setLayoutData(gridDataLabel); + if (packCodeNodeInfo.is_lock) { + propertyComb[i].setItems(new String[] { "<---->" }); + continue; + } + HashMap hashMap21 = new HashMap(); + String parentStr21 = ""; + String parentStr22 = ""; + parentStr21 = treeAndListCodeOperation.getParentStr(segmentTreeData, parentStr21); + if (parentStr21.trim().length() > 0) { + parentStr21 = parentStr21 + "," + segmentComponent.getUid(); + } else { + parentStr21 = segmentComponent.getUid(); + } + hashMap21.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr21); + hashMap21.put(AutoCodeManagerPropertyName.CodeRelation_current_node, packCodeNodeInfo.getNodeComponent().getUid()); + + List packCodeNodeInfos2 = treeAndListCodeOperation.searchTreeORListNodeInfos(hashMap21, parentStr22, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + if ((packCodeNodeInfos2 != null) && (packCodeNodeInfos2.size() > 0)) { + +// System.out.println("20181019 labelText >>" + labelText); + if (labelText != null && labelText.equals("ļ")) { + lp_packCodeNodeInfos = packCodeNodeInfos2; + System.out.println("not READ_ONLY"); + propertyComb[i] = new Combo(composite, SWT.NONE); + } else { + propertyComb[i] = new Combo(composite, SWT.NONE | SWT.READ_ONLY); + } + + propertyComb[i].setLayoutData(gridDataLabeCombo); + String items[] = new String[packCodeNodeInfos2.size()]; + String selectValue = ""; + + for (int k = 0; k < packCodeNodeInfos2.size(); k++) { + PackCodeNodeInfo packCodeNodeInfo2 = packCodeNodeInfos2.get(k); + if (packCodeNodeInfo2.is_lock) { + items[k] = "<---->"; + continue; + } + String key = packCodeNodeInfo2.getNode_name(); + String value = packCodeNodeInfo2.getNode_value(); + items[k] = value + "<---->" + key; + boolean isSelected = packCodeNodeInfo2.isDefaultSelected; + if (isSelected) { + selectValue = items[k]; + } + } + propertyComb[i].setItems(items); + + if (selectValue.length() > 0) { + propertyComb[i].setText(selectValue); + } + int itemCount = propertyComb[i].getItemCount(); + if (itemCount < 15) { + propertyComb[i].setVisibleItemCount(itemCount); + } else { + propertyComb[i].setVisibleItemCount(15); + } + + if (labelText != null && labelText.equals("ļ")) { + System.out.println("not READ_ONLY 222"); + ComboContentAdapter comboContentAdapter = new ComboContentAdapter(); + // new AutoCompleteField(combo, comboContentAdapter,items); + MySimpleContentProposalProvider proposalProvider; + proposalProvider = new MySimpleContentProposalProvider(items); + proposalProvider.setFiltering(true); + ContentProposalAdapter adapter = new ContentProposalAdapter(propertyComb[i], comboContentAdapter, proposalProvider, null, null); + adapter.setPropagateKeys(true); + adapter.setProposalAcceptanceStyle(2); + + } + + } else { + if (isSetName) { + isSetName = false; + } + propertyComb[i] = new Combo(composite, SWT.NONE); + + // ===============20210628============ + if (productCode.trim().length() > 0) { + String s1 = propertyLabel[i].getText(); + if (s1.substring(0, s1.length() - 1).equals("Ʒ")) { + String codeInfo = productCode + "<---->Ʒ"; + propertyComb[i].setItems(new String[] { codeInfo }); + propertyComb[i].setText(codeInfo); + int itemCount = propertyComb[i].getItemCount(); + if (itemCount < 15) { + propertyComb[i].setVisibleItemCount(itemCount); + } else { + propertyComb[i].setVisibleItemCount(15); + } + } else if (s1.substring(0, s1.length() - 1).equals("ṹͼ")) { + String codeInfo = productCode + "<---->ṹͼ"; + propertyComb[i].setItems(new String[] { codeInfo }); + propertyComb[i].setText(codeInfo); + int itemCount = propertyComb[i].getItemCount(); + if (itemCount < 15) { + propertyComb[i].setVisibleItemCount(itemCount); + } else { + propertyComb[i].setVisibleItemCount(15); + } + } + } + // ===============20210628============ + propertyComb[i].setLayoutData(gridDataLabeCombo); + } + composite.redraw(); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } + composite.redraw(); + } + + /** + * @return the propertyLabel + */ + public Label[] getPropertyLabel() { + return propertyLabel; + } + + /** + * @param propertyLabel + * the propertyLabel to set + */ + public void setPropertyLabel(Label[] propertyLabel) { + this.propertyLabel = propertyLabel; + } + + /** + * @return the propertyComb + */ + public Combo[] getPropertyComb() { + return propertyComb; + } + + /** + * @param propertyComb + * the propertyComb to set + */ + public void setPropertyComb(Combo[] propertyComb) { + this.propertyComb = propertyComb; + } + + /** + * + */ + public NewItemListCodeView() { + } + + public NewItemListCodeView(String productCode) { + this.productCode = productCode; + } + + /** + * @return the newSeq + */ + // public String getNewSeq() { + // return newSeq; + // } + // + // /** + // * @param newSeq + // * the newSeq to set + // */ + // public void setNewSeq(String newSeq) { + // this.newSeq = newSeq; + // } + /** + * @return the icoName + */ + public String getIcoName() { + return icoName; + } + + /** + * @param icoName + * the icoName to set + */ + public void setIcoName(String icoName) { + this.icoName = icoName; + } + + /** + * @return the codeStyle + */ + // public String getCodeStyle() { + // return codeStyle; + // } + // + // /** + // * @param codeStyle + // * the codeStyle to set + // */ + // public void setCodeStyle(String codeStyle) { + // this.codeStyle = codeStyle; + // } + /** + * @return the pattern + */ + public StringBuffer getPattern() { + return pattern; + } + + /** + * @param pattern + * the pattern to set + */ + public void setPattern(StringBuffer pattern) { + this.pattern = pattern; + } + + /** + * @return the codeDesc + */ + public StringBuffer getCodeDesc() { + return codeDesc; + } + + /** + * @param codeDesc + * the codeDesc to set + */ + public void setCodeDesc(StringBuffer codeDesc) { + this.codeDesc = codeDesc; + } + + /** + * @return the codeName + */ + public String getCodeName() { + return codeName; + } + + /** + * @param codeName + * the codeName to set + */ + public void setCodeName(String codeName) { + this.codeName = codeName; + } + + private class MySimpleContentProposalProvider extends SimpleContentProposalProvider { + private String proposals[]; + private IContentProposal contentProposals[]; + private boolean filterProposals; + + public MySimpleContentProposalProvider(String[] proposals) { + super(proposals); + filterProposals = true; + this.proposals = proposals; + } + + public IContentProposal[] getProposals(String contents, int position) { + if (filterProposals) { + ArrayList list = new ArrayList(); + for (int i = 0; i < proposals.length; i++) { + if (proposals[i].length() >= contents.length() && proposals[i].toUpperCase().contains(contents.toUpperCase())) { + list.add(new ContentProposal(proposals[i])); + } + } + + return (IContentProposal[]) list.toArray(new IContentProposal[list.size()]); + } + if (contentProposals == null) { + contentProposals = new IContentProposal[proposals.length]; + for (int i = 0; i < proposals.length; i++) + contentProposals[i] = new ContentProposal(proposals[i]); + } + return contentProposals; + } + } +} diff --git a/src/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyNodeDialog.java b/src/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyNodeDialog.java new file mode 100644 index 0000000..e3ac9b1 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyNodeDialog.java @@ -0,0 +1,67 @@ +package cn.com.origin.autocodemanager.views.listcodeview; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; + +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.dialog.AbstractCodeDialog; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +public class NewListPropertyNodeDialog extends AbstractCodeDialog { + + public NewListPropertyNodeDialog(Shell parentShell, CreateListCodeView codeListViewTree, String title, boolean isEdit) { + super(parentShell, codeListViewTree, title, isEdit); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + Group nodeGroup = createCompositeGroup(container, "б"); + createNodeComposite(nodeGroup); + return container; + } + + public void initNewCodeComposite(Composite composite) { + createNewLabel(composite, ""); + nodeNameText = createNewText(composite, ""); + + createNewLabel(composite, "ע"); + nodeDescriptionText = createNewText(composite, ""); + + } + + // ڵǷΪF + @Override + protected void okPressed() { + String nodename = nodeNameText.getText().trim(); + if (nodename == null || nodename.trim().length() == 0) { + postMesssageBox("ƲΪգ"); + nodeNameText.setFocus(); + return; + } + AbstractTreeData rootData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + saveNewCodeNode(rootData, selectedComponent, createView.treeViewer, AutoCodeManagerPropertyName.ListPropertyNodeName, false); + close(); + } + + // öԻʼС + // @Override + protected Point getInitialSize() { + return new Point(400, 230); + } + + // öԻ򴰿ڱͼ + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(title); + newShell.setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.LISTNODE_IMAGE)); + } + +} diff --git a/src/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyValueNodeDialog.java b/src/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyValueNodeDialog.java new file mode 100644 index 0000000..3c097e1 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/listcodeview/NewListPropertyValueNodeDialog.java @@ -0,0 +1,79 @@ +package cn.com.origin.autocodemanager.views.listcodeview; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.dialog.AbstractCodeDialog; + +public class NewListPropertyValueNodeDialog extends AbstractCodeDialog { + + public NewListPropertyValueNodeDialog(Shell parentShell, CreateListCodeView codeListViewTree, String title, boolean isEdit) { + super(parentShell, codeListViewTree, title, isEdit); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + Group nodeGroup = createCompositeGroup(container, "бֵ"); + createNodeComposite(nodeGroup); + return container; + } + + public void initNewCodeComposite(Composite composite) { + createNewLabel(composite, ""); + nodeNameText = createNewText(composite, ""); + + createNewLabel(composite, "ֵ"); + nodeValueText = createNewText(composite, ""); + + createNewLabel(composite, "ע"); + nodeDescriptionText = createNewText(composite, ""); + } + + // ڵǷΪ + @Override + protected void okPressed() { + String nodename = nodeNameText.getText().trim(); + String nodevalue = nodeValueText.getText().trim(); + if (nodename == null || nodename.trim().length() == 0) { + postMesssageBox("ƲΪգ"); + nodeNameText.setFocus(); + return; + } + if (nodevalue == null || nodevalue.trim().length() == 0) { + postMesssageBox("ֵΪգ"); + nodeValueText.setFocus(); + return; + } + if (selectedTreeData == null) { + postMesssageBox("ѡԣ"); + } else { + if (selectedTreeData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListPropertyValueNodeName)) { + saveNewCodeNode(selectedTreeData.getParentTreeData(), selectedComponent, createView.treeViewer, AutoCodeManagerPropertyName.ListPropertyValueNodeName, false); + } else { + saveNewCodeNode(selectedTreeData, selectedComponent, createView.treeViewer, AutoCodeManagerPropertyName.ListPropertyValueNodeName, false); + } + } + close(); + } + + // öԻʼС + @Override + protected Point getInitialSize() { + return new Point(400, 230); + } + + // öԻ򴰿ڱͼ + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(title); + newShell.setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.LISTVALUE_IMAGE)); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView.java b/src/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView.java new file mode 100644 index 0000000..ae4b392 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/testview/CreateCodeTestView.java @@ -0,0 +1,704 @@ +/** + * @author tyl + * @Action ini + * 2011-3-17 + */ +package cn.com.origin.autocodemanager.views.testview; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.custom.CTabItem; +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.part.ViewPart; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.CreateCompositeUtil; +import cn.com.origin.autocodemanager.common.TCPreferenceUitl; +import cn.com.origin.autocodemanager.common.operations.PackCodeNodeInfo; +import cn.com.origin.autocodemanager.common.operations.TreeAndListCodeOperation; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.TreeViewOperation; +import cn.com.origin.autocodemanager.views.codeview.NewCodeTestView; +import cn.com.origin.autocodemanager.views.listcodeview.NewItemListCodeView; +import cn.com.origin.autocodemanager.views.treecodeview.NewItemTreeCodeView; + +import com.teamcenter.rac.aifrcp.AIFUtility; +import com.teamcenter.rac.kernel.TCComponent; +import com.teamcenter.rac.kernel.TCComponentItemType; +import com.teamcenter.rac.kernel.TCException; +import com.teamcenter.rac.kernel.TCSession; +import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException; + +public class CreateCodeTestView { + private SashForm sashFormCodeView; + private CTabItem codeTreeCTab; + private CTabItem codeListCTab; + private Composite compositCodeTree; + private Composite compositCodeList; + private CTabFolder ctabFolder; + private Text idLengthText; + private Text DescText; + private Text idText; + private Text revText; + private Text nameText; + private Combo unitCombo; + private NewCodeTestView classificationView; + private NewItemListCodeView listView; + private NewItemTreeCodeView treeView; + private TreeViewer classificationTreeViewer; + private TreeViewOperation treeViewOperation; + public TreeAndListCodeOperation treeAndListCodeOperation; + private TCSession session; + private TCComponentItemType tccomponentitemtype; + private AbstractTreeData selectedSegmentNode = null; + private TCComponent selectedSegmentTCComponent = null; + private String pattern = ""; + private String codeDesc = ""; + private String codeStyle = ""; + private String newSeq = ""; + private int codeLength; + private String firstListICOName = ""; + private Map segmentItemType; + private String origin_isCodePatternCanEditTypes = "origin_isCodePatternCanEditTypes"; + private String origin_showUnit_excludeTypes = "origin_showUnit_excludeTypes"; + private String origin_isItemNameTextDefaultNull = "origin_isItemNameTextDefaultNull"; + private SashForm itemInfoComposite; + private SashForm sashFormClassfication; + + public Text getIdLengthText() { + return idLengthText; + } + + public void setIdLengthText(Text idLengthText) { + this.idLengthText = idLengthText; + } + + public Combo getUnitCombo() { + return unitCombo; + } + + public void setUnitCombo(Combo unitCombo) { + this.unitCombo = unitCombo; + } + + public Text getDescText() { + return DescText; + } + + public void setDescText(Text descText) { + DescText = descText; + } + + public Text getIdText() { + return idText; + } + + public void setIdText(Text idText) { + this.idText = idText; + } + + public Text getRevText() { + return revText; + } + + public void setRevText(Text revText) { + this.revText = revText; + } + + public Text getNameText() { + return nameText; + } + + public void setNameText(Text nameText) { + this.nameText = nameText; + } + + public CreateCodeTestView(Composite composite, String rootName, ViewPart viewPart) { + treeViewOperation = new TreeViewOperation(); + treeAndListCodeOperation = new TreeAndListCodeOperation(); + session = (TCSession) AIFUtility.getCurrentApplication().getSession(); + try { + tccomponentitemtype = (TCComponentItemType) (session.getTypeComponent("Item")); + } catch (TCException e) { + e.printStackTrace(); + } + createDialogArea(composite); + } + + protected Control createDialogArea(Composite parent) { + Composite container = parent; + FillLayout fillLayout = new FillLayout(SWT.HORIZONTAL); + container.setLayout(fillLayout); + sashFormClassfication = new SashForm(container, SWT.NONE); + // SashForm sashFormClassfication = new SashForm(container, SWT.BORDER | SWT.H_SCROLL); + // sashFormClassfication.setOrientation(SWT.HORIZONTAL); + classificationView = new NewCodeTestView(sashFormClassfication, ""); + + classificationTreeViewer = classificationView.treeViewer; + addMouseAction(); + sashFormCodeView = new SashForm(container, SWT.NONE); + GridData gridData9 = new GridData(); + gridData9.heightHint = 70; + gridData9.horizontalAlignment = GridData.FILL; + gridData9.verticalAlignment = GridData.CENTER; + gridData9.grabExcessHorizontalSpace = true; + + ctabFolder = new CTabFolder(sashFormCodeView, SWT.BORDER); + ctabFolder.setBorderVisible(true); + ctabFolder.setSimple(false); + ctabFolder.setLayoutData(gridData9); + + codeTreeCTab = new CTabItem(ctabFolder, SWT.NONE); + codeTreeCTab.setText(""); + compositCodeTree = new Composite(ctabFolder, SWT.NONE); + compositCodeTree.setBackground(new Color(Display.getCurrent(), 255, 255, 255)); + + compositCodeTree.setLayout(new FillLayout()); + codeTreeCTab.setControl(compositCodeTree); + treeView = new NewItemTreeCodeView(compositCodeTree, "root"); + + codeListCTab = new CTabItem(ctabFolder, SWT.NONE); + codeListCTab.setText("б"); + ctabFolder.setSelection(0); + compositCodeList = new Composite(ctabFolder, SWT.NONE); + compositCodeList.setLayout(new FillLayout()); + codeListCTab.setControl(compositCodeList); + + listView = new NewItemListCodeView(); + ctabFolder.setSelection(1); + + itemInfoComposite = new SashForm(container, SWT.NONE); + createNewItemInfo(itemInfoComposite); + return container; + } + + private void createNewItemInfo(Composite parent) { + Composite composite = new Composite(parent, SWT.BORDER); + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 1; + composite.setLayout(gridLayout); + CreateCompositeUtil.createNewLabel(composite, ""); + idText = CreateCompositeUtil.createNewText(composite, ""); + + CreateCompositeUtil.createNewLabel(composite, "볤"); + idLengthText = CreateCompositeUtil.createNewText(composite, ""); + + CreateCompositeUtil.createNewLabel(composite, "ϰ汾"); + revText = CreateCompositeUtil.createNewText(composite, ""); + + CreateCompositeUtil.createNewLabel(composite, ""); + nameText = CreateCompositeUtil.createNewText(composite, ""); + CreateCompositeUtil.createNewLabel(composite, ""); + DescText = CreateCompositeUtil.createTextArea(composite, "", 90, 300); + idText.setEnabled(false); + idLengthText.setEnabled(false); + revText.setEnabled(false); + DescText.setEnabled(false); + } + + private TCComponent[] getParentGroupNode(AbstractTreeData segmentNode) { + TCComponent[] tccomponents = null; + classificationTreeViewer.refresh(); + if (segmentNode == null) { + return null; + } + if ((segmentNode.getPackCodeNodeInfo().getNodeComponent() != null) && (segmentNode.getPackCodeNodeInfo().is_root)) { + } else { + return null; + } + getRealItemType(segmentNode, segmentNode.getParentTreeData()); + return tccomponents; + } + + private void getRealItemType(AbstractTreeData segmentNode, AbstractTreeData parentNode) { + if ((parentNode != null) && (parentNode.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ItemName))) { + String realItemType = parentNode.getPackCodeNodeInfo().getRealTypeName().trim(); + if (!segmentItemType.containsKey(segmentNode)) { + segmentItemType.put(segmentNode, realItemType); + } + } else { + if (parentNode != null) { + parentNode = parentNode.getParentTreeData(); + getRealItemType(segmentNode, parentNode); + } + } + } + + public void setTreeNodes(AbstractTreeData segmentNode) { + try { + classificationTreeViewer.refresh(); + if (segmentNode == null) { + return; + } + getRealItemType(segmentNode, segmentNode.getParentTreeData()); + TCComponent autoCodeDataComponent = segmentNode.getPackCodeNodeInfo().getNodeComponent(); + TreeAndListCodeOperation treeAndListCodeOperation = new TreeAndListCodeOperation(); + HashMap hashMap = new HashMap(); + + String parentStr = ""; + parentStr = treeAndListCodeOperation.getParentStr(segmentNode, parentStr); + if (autoCodeDataComponent != null) { + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, autoCodeDataComponent.getUid()); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, parentStr); + } else { + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_parent_node, ""); + hashMap.put(AutoCodeManagerPropertyName.CodeRelation_current_node, ""); + } + String parentStr2 = ""; + if (autoCodeDataComponent != null) { + if (parentStr.trim().length() == 0) { + parentStr2 = autoCodeDataComponent.getUid(); + } else { + parentStr2 = parentStr + "," + autoCodeDataComponent.getUid(); + } + } else { + parentStr2 = parentStr; + } + List packCodeNodeInfos = treeAndListCodeOperation.searchTreeORListNodeInfos(hashMap, parentStr2, AutoCodeManagerPropertyName.searchTreeAndListCodeNodePropNames); + if (packCodeNodeInfos != null && packCodeNodeInfos.size() > 0) { + AbstractTreeData autoCodeDataTCComs[] = new AbstractTreeData[packCodeNodeInfos.size()]; + for (int k = 0; k < packCodeNodeInfos.size(); k++) { + if (packCodeNodeInfos.get(k).getNodeComponent() == null) { + continue; + } + PackCodeNodeInfo packCodeNodeInfo = packCodeNodeInfos.get(k); + autoCodeDataTCComs[k] = new AbstractTreeData(segmentNode, packCodeNodeInfo); + if (packCodeNodeInfo.isContainsChildren()) { + autoCodeDataTCComs[k].setTreeAutoCodeNodeChildren(new AbstractTreeData[] { new AbstractTreeData() }); + } + } + treeView.treeViewer.setInput(autoCodeDataTCComs); + treeView.treeViewer.refresh(); + } + } catch (ServiceException e) { + e.printStackTrace(); + } catch (TCException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void addMouseAction() { + classificationTreeViewer.getTree().addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + try { + initClassificationMouseClick(); + selectedSegmentNode = treeViewOperation.getSelectedTreeNode(classificationTreeViewer); + if (selectedSegmentNode == null) { + return; + } + selectedSegmentTCComponent = selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent(); + if (selectedSegmentTCComponent == null) { + return; + } + if (selectedSegmentTCComponent.getLogicalProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_is_lock)) { + ScrolledComposite scrolledComposite = new ScrolledComposite(ctabFolder, SWT.H_SCROLL | SWT.V_SCROLL); + codeListCTab.setControl(scrolledComposite); + treeView.treeViewer.setInput(null); + return; + } + if ((selectedSegmentNode.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.TreeName)) || (selectedSegmentNode.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListName))) { + String realType = selectedSegmentNode.getPackCodeNodeInfo().getRealTypeName(); + if (TCPreferenceUitl.isSelectExsitToTCPreferenceValues(session, origin_showUnit_excludeTypes, realType)) { + unitCombo.setEnabled(false); + } + } + if (selectedSegmentNode.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.TreeName)) { + classificationView.treeViewer.refresh(); + listView.setPropertyComb(null); + treeView.treeViewer.setInput(null); + Composite compositTemp = new Composite(ctabFolder, SWT.NONE); + codeListCTab.setControl(compositTemp); + setTreeNodes(treeViewOperation.getSelectedTreeNode(classificationView.treeViewer)); + ctabFolder.setSelection(0); + ctabFolder.redraw(); + + treeView.treeViewer.getTree().addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + initTreeOrListMouseClick(); + AbstractTreeData selectedData = treeViewOperation.getSelectedTreeNode(treeView.treeViewer); + if (selectedData == null) { + return; + } + if (selectedData.getPackCodeNodeInfo().getNodeComponent() == null) { + return; + } + if ((selectedData.getPackCodeNodeInfo().is_lock)) { + return; + } + String currentNodeDesc = ""; + String currentNodeValue = ""; + String name = ""; + // õϢ + getCodeInfo(selectedData); + name = selectedData.getPackCodeNodeInfo().getNode_name(); + currentNodeValue = replaceSpecialValue(selectedData.getPackCodeNodeInfo().node_value); + if (currentNodeValue.length() > 0) { + currentNodeDesc = currentNodeValue + "::" + selectedData.getPackCodeNodeInfo().getNode_name(); + } + if (currentNodeValue.trim().length() > 0) { + pattern = pattern + " " + currentNodeValue + " "; + } + if (currentNodeDesc.trim().length() > 0) { + codeDesc = codeDesc + currentNodeDesc; + } + if (!TCPreferenceUitl.isTrueTCPreferenceValue(session, origin_isItemNameTextDefaultNull)) { + nameText.setText(name); + } else { + nameText.setText(""); + } + getFinalPattern(selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent()); + getSequenceNo(pattern, selectedData.getPackCodeNodeInfo().getNodeComponent()); + idText.setText(getID(codeStyle)); + setIDPatternTextIsCanEdit(); + idLengthText.setText(String.valueOf(idText.getText().replace(" ", "").trim().length())); + DescText.setText(codeDesc); + } + }); + } else if (selectedSegmentNode.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ListName)) { + treeView.treeViewer.setInput(null); + ctabFolder.setLayout(new FillLayout()); + ScrolledComposite scrolledComposite = new ScrolledComposite(ctabFolder, SWT.H_SCROLL | SWT.V_SCROLL); + Composite compositTemp = new Composite(scrolledComposite, SWT.NONE); + compositTemp.setLayout(new FillLayout()); + scrolledComposite.setContent(compositTemp); + getParentGroupNode(selectedSegmentNode); + + listView.createCombox(compositTemp, selectedSegmentNode); + codeListCTab.setControl(scrolledComposite); + scrolledComposite.setExpandHorizontal(true); + scrolledComposite.setExpandVertical(true); + scrolledComposite.setMinWidth(250); + scrolledComposite.setMinHeight(1000); + ctabFolder.setSelection(1); + ctabFolder.redraw(); + + Combo[] coms = listView.getPropertyComb(); + if (coms == null) { + return; + } + for (int i = 0; i < coms.length; i++) { + if (coms[i] == null) { + continue; + } + int comboStyle = coms[i].getStyle(); + if (comboStyle == 33554692) { + coms[i].addFocusListener(new FocusListener() { + public void focusGained(FocusEvent event) { + } + + public void focusLost(FocusEvent event) { + initTreeOrListMouseClick(); + try { + firstListICOName = listView.getFirstComboName(); + listView.getListPropertyValue(selectedSegmentNode); + codeDesc = listView.getCodeDesc().toString(); + pattern = listView.getPattern().toString(); + revText.setText(tccomponentitemtype.getNewRev(null)); + + if (!TCPreferenceUitl.isTrueTCPreferenceValue(session, origin_isItemNameTextDefaultNull)) { + nameText.setText(firstListICOName); + } else { + nameText.setText(""); + } + getFinalPattern(selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent()); + getSequenceNo(pattern, selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent()); + idText.setText(getID(codeStyle)); + setIDPatternTextIsCanEdit(); + idLengthText.setText(String.valueOf(idText.getText().replace(" ", "").trim().length())); + DescText.setText(codeDesc); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + }); + } else { + coms[i].addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent selectionevent) { + initTreeOrListMouseClick(); + try { + firstListICOName = listView.getFirstComboName(); + listView.getListPropertyValue(selectedSegmentNode); + codeDesc = listView.getCodeDesc().toString(); + pattern = listView.getPattern().toString(); + revText.setText(tccomponentitemtype.getNewRev(null)); + + if (!TCPreferenceUitl.isTrueTCPreferenceValue(session, origin_isItemNameTextDefaultNull)) { + nameText.setText(firstListICOName); + } else { + nameText.setText(""); + } + getFinalPattern(selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent()); + getSequenceNo(pattern, selectedSegmentNode.getPackCodeNodeInfo().getNodeComponent()); + idText.setText(getID(codeStyle)); + setIDPatternTextIsCanEdit(); + idLengthText.setText(String.valueOf(idText.getText().replace(" ", "").trim().length())); + DescText.setText(codeDesc); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + }); + } + } + } + } catch (Exception e1) { + e1.printStackTrace(); + } + } + }); + } + + private void setIDPatternTextIsCanEdit() { + String realItemType = "Item"; + if (segmentItemType != null) { + realItemType = (String) segmentItemType.get(selectedSegmentNode); + } + if (TCPreferenceUitl.isSelectExsitToTCPreferenceValues(session, origin_isCodePatternCanEditTypes, realItemType)) { + idText.setEnabled(true); + } + } + + public String replaceSpecialValue(String value) { + Date date = new Date(System.currentTimeMillis()); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + String dateStr = formatter.format(date); + String temps[] = dateStr.split("-"); + if (value.contains(AutoCodeManagerPropertyName.Code_year4)) { + value = value.replace(AutoCodeManagerPropertyName.Code_year4, temps[0]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_year2)) { + value = value.replace(AutoCodeManagerPropertyName.Code_year2, temps[0].substring(2)); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_mouth1)) { + value = value.replace(AutoCodeManagerPropertyName.Code_mouth1, temps[1]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_mouth2)) { + value = value.replace(AutoCodeManagerPropertyName.Code_mouth2, temps[1]); + value = value + " "; + } + + if (value.contains(AutoCodeManagerPropertyName.Code_date1)) { + value = value.replace(AutoCodeManagerPropertyName.Code_date1, temps[2]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_date2)) { + value = value.replace(AutoCodeManagerPropertyName.Code_date2, temps[2]); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_seq)) { + value = value.replace(AutoCodeManagerPropertyName.Code_seq, newSeq); + value = value + " "; + } + if (value.contains(AutoCodeManagerPropertyName.Code_pattern)) { + value = value.replace(AutoCodeManagerPropertyName.Code_pattern, pattern); + value = value + " "; + } + return value; + } + + public void getCodeInfo(AbstractTreeData treeData) { + if (treeData != null) { + AbstractTreeData parentData = treeData.getParentTreeData(); + if ((parentData != null) && (parentData.getPackCodeNodeInfo().getNodeComponent() != null)) { + getCodeInfo(parentData); + String nodeValue = ""; + String nodeName = ""; + if (!parentData.getPackCodeNodeInfo().getNode_type().equals(AutoCodeManagerPropertyName.ItemName)) { + nodeValue = replaceSpecialValue(parentData.getPackCodeNodeInfo().getNode_value()); + nodeName = parentData.getPackCodeNodeInfo().getNode_name(); + } + if (nodeValue.trim().length() > 0) { + pattern = pattern + nodeValue; + pattern = pattern + " "; + codeDesc = codeDesc + nodeValue; + codeDesc = codeDesc + "::"; + codeDesc = codeDesc + nodeName; + codeDesc = codeDesc + "\n"; + } + } + } + } + + private void initTreeOrListMouseClick() { + try { + if (treeViewOperation.getSelectedTreeNode(classificationTreeViewer) == null) { + return; + } + pattern = ""; + codeDesc = ""; + newSeq = ""; + DescText.setText(""); + idText.setText(""); + if (unitCombo != null) { + unitCombo.setText(""); + } + idText.setEnabled(false); + revText.setText(tccomponentitemtype.getNewRev(null)); + idLengthText.setText(""); + nameText.setText(""); + } catch (TCException e) { + e.printStackTrace(); + } + } + + private void initClassificationMouseClick() { + try { + if (treeViewOperation.getSelectedTreeNode(classificationTreeViewer) == null) { + return; + } + pattern = ""; + codeDesc = ""; + pattern = ""; + newSeq = ""; + DescText.setText(""); + idText.setText(""); + if (unitCombo != null) { + unitCombo.setText(""); + } + idText.setEnabled(false); + idLengthText.setText(""); + revText.setText(tccomponentitemtype.getNewRev(null)); + nameText.setText(""); + } catch (TCException e) { + e.printStackTrace(); + } + } + + public String getParentCodeData(AbstractTreeData treeData, String str) { + if (treeData != null) { + AbstractTreeData parentData = treeData.getParentTreeData(); + if ((parentData != null) && (parentData.getPackCodeNodeInfo().getNodeComponent() != null)) { + str = getParentCodeData(parentData, str); + String nodeValue = parentData.getPackCodeNodeInfo().getNode_value(); + if (nodeValue.trim().length() > 0) { + str = str + nodeValue; + str = str + " "; + } + } + } + return str; + } + + public String getParentDescData(AbstractTreeData treeData, String str) { + if (treeData != null) { + AbstractTreeData parentData = treeData.getParentTreeData(); + if ((parentData != null) && (parentData.getPackCodeNodeInfo().getNodeComponent() != null)) { + str = getParentDescData(parentData, str); + String nodeValue = parentData.getPackCodeNodeInfo().getNode_value(); + String nodeDesc = parentData.getPackCodeNodeInfo().getNode_name(); + if (nodeValue.trim().length() > 0) { + str = str + nodeValue; + str = str + "::"; + str = str + nodeDesc; + str = str + "\n"; + } + } + } + return str; + } + + public String getID(String value) { + String id = replaceSpecialValue(value); +// return id.replace(" ", "").trim(); + return id; + } + + private String getFinalPattern(TCComponent seqComponent) { + newSeq = ""; + int codeSeqLength = 0; + try { + if (seqComponent != null) { + String[] propNames = { AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length }; + String[] propValues = seqComponent.getProperties(propNames); + codeStyle = propValues[0]; + codeLength = Integer.valueOf(propValues[1]); + codeSeqLength = Integer.valueOf(propValues[2]); + } + } catch (TCException e) { + e.printStackTrace(); + } + String finalPattern = replaceSpecialValue(codeStyle); + int coverNum = codeLength - finalPattern.replace(" ", "").trim().length() - codeSeqLength; + String coverStr = ""; + if (coverNum > 0) { + for (int i = 0; i < coverNum; i++) { + coverStr = coverStr + "0"; + } + if (coverStr.trim().length() > 0) { + pattern = pattern + coverStr + " "; + } + } + return pattern; + } + + private String getSequenceNo(String codeCounterName, TCComponent selectedComponent) { + try { + codeCounterName = codeCounterName.replace(" ", "").trim(); + TCComponent seqComponent = selectedComponent.getReferenceProperty(AutoCodeManagerPropertyName.TreeAndListCodeNode_rule_node); + if (seqComponent != null) { + String[] propNames = { AutoCodeManagerPropertyName.TreeAndListCodeNode_code_style, AutoCodeManagerPropertyName.TreeAndListCodeNode_code_length, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_begin_value, AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_length, + AutoCodeManagerPropertyName.TreeAndListCodeNode_seq_max_value }; + String[] propValues = seqComponent.getProperties(propNames); + codeStyle = propValues[0]; + codeLength = Integer.valueOf(propValues[1]); + int startValue = Integer.valueOf(propValues[2]); + int codeSeqLength = Integer.valueOf(propValues[3]); + int endValue = Integer.valueOf(propValues[4]); + int increaseStep = 1; + String excludeStr = ""; + int seqValue = startValue + increaseStep; + if (seqValue > endValue) { + seqValue = startValue; + } + String seqStr = String.valueOf(seqValue); + if (excludeStr.length() > 0) { + int exclude = Integer.valueOf(excludeStr); + + if (seqStr.contains(excludeStr)) { + seqStr.replace(excludeStr, String.valueOf(exclude++)); + } + } + int length1 = seqStr.length(); + if (codeSeqLength > 0) { + if (length1 > codeSeqLength) { + newSeq = seqStr.substring(0, codeSeqLength - 1); + } else { + newSeq = seqStr; + for (int i = 0; i < (codeSeqLength - length1); i++) { + newSeq = "0" + newSeq; + } + } + } + } + } catch (TCException e) { + e.printStackTrace(); + return newSeq; + } + return newSeq; + } +} diff --git a/src/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction.java b/src/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction.java new file mode 100644 index 0000000..517e1ab --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/treecodeview/CodeTreeViewRightKeyAction.java @@ -0,0 +1,87 @@ +/** + * @author tyl + * @Action ini + * 2011-3-17 + */ +package cn.com.origin.autocodemanager.views.treecodeview; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeViewRightKeyAction; +import com.teamcenter.rac.util.MessageBox; + +public class CodeTreeViewRightKeyAction extends AbstractTreeViewRightKeyAction { + + /** + * @param treeViewer + */ + public CodeTreeViewRightKeyAction(CreateTreeCodeView createTreeCodeView) { + super(createTreeCodeView); + } + + public void fillContextMenu() { + if (menuManager == null) { + // һεø÷ʱ + menuManager = new MenuManager(); + menuManager.add(new NewCodeNodeAction(AutoCodeManagerPropertyName.AddTreeNodeName)); + menuManager.add(new NewCodeNodeAction(AutoCodeManagerPropertyName.AddChildrenTreeNodeName)); + menuManager.add(new AddChildrenNodeAction("ӽڵ", AutoCodeManagerPropertyName.TreeNodeName)); + menuManager.add(new EidtCodeNodeAction()); + menuManager.add(new RemoveCodeNodeAction()); + menuManager.add(new LockCodeNodeAction()); + menuManager.add(new UnLockCodeNodeAction()); + } + Tree tree = treeViewer.getTree(); + Menu menu = menuManager.createContextMenu(tree); + tree.setMenu(menu); + } + + public class NewCodeNodeAction extends Action { + private String actionType; + private String title; + + public NewCodeNodeAction(String type) { + this.actionType = type; + if (type.equals(AutoCodeManagerPropertyName.AddChildrenTreeNodeName)) { + title = "½ڵ"; + } else { + title = "½ƽڵ"; + } + setText(title); + ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.TREENODE_IMAGE); + this.setImageDescriptor(imageDesc); + } + + public void run() { + AbstractTreeData rootNode = treeViewOperation.getSelectedTreeNode(codeSegmentView.getCreateView().treeViewer); + if (rootNode == null) { + MessageBox.post("ѡҪ޸Ĺ!", "INFO", MessageBox.WARNING); + return; + } + String type = rootNode.getPackCodeNodeInfo().getNode_type(); + if (!type.equals(AutoCodeManagerPropertyName.TreeName)) { + MessageBox.post("ѡҪ޸ ı!", "INFO", MessageBox.WARNING); + return; + } + if (type.equals(AutoCodeManagerPropertyName.AddChildrenTreeNodeName)) { + setText("½ڵ"); + } else { + setText("½ƽڵ"); + } + if (actionType.equals(AutoCodeManagerPropertyName.AddChildrenTreeNodeName)) { + new NewTreeCodeNodeDialog(treeViewer.getControl().getShell(), (CreateTreeCodeView) createView, title, false, true).open(); + } else { + new NewTreeCodeNodeDialog(treeViewer.getControl().getShell(), (CreateTreeCodeView) createView, title, false, false).open(); + } + } + } + +} diff --git a/src/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView.java b/src/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView.java new file mode 100644 index 0000000..60c2f07 --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/treecodeview/CreateTreeCodeView.java @@ -0,0 +1,38 @@ +/** + * @author tyl + * @Action ini + * 2011-3-21 + */ +package cn.com.origin.autocodemanager.views.treecodeview; + +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.part.ViewPart; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.treetable.AbstractTreeTable; + +public class CreateTreeCodeView extends AbstractTreeTable { + boolean isNewItem = false; + public CreateTreeCodeView(Composite composite, String rootName, ViewPart viewPart) { + super(composite, rootName, viewPart); + } + public CreateTreeCodeView(Composite composite, String rootName) { + super(composite, rootName); + isNewItem = true; + } + public void addRightKeyAction() { + tree.addMouseListener(new MouseAdapter() { + public void mouseDown(MouseEvent e) { + if (e.button == 3) { + CodeTreeViewRightKeyAction rightAction = new CodeTreeViewRightKeyAction(CreateTreeCodeView.this); + rightAction.fillContextMenu(); + } + } + }); + } + + public void createOrgAutoCodeNodeChildren(AbstractTreeData[] codeDatas) throws Exception { + super.createOrgAutoCodeNodeChildren(codeDatas); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView.java b/src/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView.java new file mode 100644 index 0000000..2b5287a --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/treecodeview/NewItemTreeCodeView.java @@ -0,0 +1,87 @@ +/** + * @author tyl + * @Action ini + * 2011-4-13 + */ +package cn.com.origin.autocodemanager.views.treecodeview; + +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TreeEvent; +import org.eclipse.swt.events.TreeListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.part.ViewPart; + +import cn.com.origin.autocodemanager.common.operations.PlmLocale; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; +import cn.com.origin.autocodemanager.common.treetable.ORNewItemTreeTableLabelProvider; +import cn.com.origin.autocodemanager.common.treetable.ORTreeTableContentProvider; +import com.teamcenter.rac.kernel.TCComponent; + +public class NewItemTreeCodeView extends CreateTreeCodeView { + + public NewItemTreeCodeView(Composite composite, String rootName, ViewPart viewPart) { + super(composite, rootName, viewPart); + } + + public NewItemTreeCodeView(Composite composite, String rootName) { + super(composite, rootName); + } + + public void initTree(String rootName) { + tree.setHeaderVisible(true); // ñͷɼ + tree.setLinesVisible(true); // ߿ɼ + tree.setFocus(); // ý + treeViewer.setLabelProvider(new ORNewItemTreeTableLabelProvider()); + treeViewer.setContentProvider(new ORTreeTableContentProvider()); + createTreeColumn(); + } + + public void createTreeColumn() { + createColumn(tree, PlmLocale.getString("CodeSegmentName"), 250); + createColumn(tree, PlmLocale.getString("CodeValue"), 100); + createColumn(tree, PlmLocale.getString("Remarks"), 50); + } + + public void createTree(Composite parent, String rootName) { + System.out.println("rootName==========="+rootName); + Composite composite = parent; + treeViewer = new TreeViewer(composite, SWT.BORDER); + tree = treeViewer.getTree(); + initTree(rootName); + treeViewer.expandToLevel(1); + tree.addTreeListener(new TreeListener() { + public void treeCollapsed(TreeEvent treeEvent) { + } + public void treeExpanded(TreeEvent treeEvent) { + AbstractTreeData codeData = (AbstractTreeData) treeEvent.item.getData(); + if (codeData == null) { + return; + } + TCComponent component = codeData.getPackCodeNodeInfo().getNodeComponent(); + if ((component != null) && (codeData.getPackCodeNodeInfo().is_lock)) { + codeData.setTreeAutoCodeNodeChildren(null); + codeData.setChildrenLoader(false); + return; + } else { + expandNode(codeData); + } + } + }); + + tree.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + AbstractTreeData selectedData = (AbstractTreeData) e.item.getData(); + if (selectedData == null) { + return; + } + if (selectedData.getParentTreeData() == null) { + expandNode(selectedData); + } + } + }); + } +} diff --git a/src/cn/com/origin/autocodemanager/views/treecodeview/NewTreeCodeNodeDialog.java b/src/cn/com/origin/autocodemanager/views/treecodeview/NewTreeCodeNodeDialog.java new file mode 100644 index 0000000..cc1c4de --- /dev/null +++ b/src/cn/com/origin/autocodemanager/views/treecodeview/NewTreeCodeNodeDialog.java @@ -0,0 +1,81 @@ +package cn.com.origin.autocodemanager.views.treecodeview; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import cn.com.origin.autocodemanager.common.AutoCodeManagerImageKey; +import cn.com.origin.autocodemanager.common.AutoCodeManagerPropertyName; +import cn.com.origin.autocodemanager.common.AutoCodeManangerConstants; +import cn.com.origin.autocodemanager.common.CacheImage; +import cn.com.origin.autocodemanager.common.dialog.AbstractCodeDialog; +import cn.com.origin.autocodemanager.common.tree.AbstractTreeData; + +public class NewTreeCodeNodeDialog extends AbstractCodeDialog { + boolean isNewChildren = false; + + public NewTreeCodeNodeDialog(Shell parentShell, CreateTreeCodeView codeTreeView, String title, boolean isEdit, boolean isNewChildren) { + super(parentShell, codeTreeView, title, isEdit); + this.isNewChildren = isNewChildren; + + + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite container = (Composite) super.createDialogArea(parent); + Group nodeGroup = createCompositeGroup(container, ""); + createNodeComposite(nodeGroup); + return container; + } + + public void initNewCodeComposite(Composite composite) { + createNewLabel(composite, "ڵ"); + nodeNameText = createNewText(composite, ""); + + createNewLabel(composite, "ֵ"); + nodeValueText = createNewText(composite, ""); + + createNewLabel(composite, "ע"); + nodeDescriptionText = createNewText(composite, ""); + } + + // ڵǷΪ + @Override + protected void okPressed() { + String nodename = nodeNameText.getText().trim(); + if (nodename == null || nodename.trim().length() == 0) { + postMesssageBox("ڵƲΪգ"); + nodeNameText.setFocus(); + return; + } + if (selectedTreeData == null) { + AbstractTreeData rootData = treeViewOperation.getSelectedTreeNode(codeSegmentView.createView.treeViewer); + saveNewCodeNode(rootData, selectedComponent, codeTreeView.createView.treeViewer, AutoCodeManagerPropertyName.TreeNodeName, false); + } else { + if (isNewChildren) { + saveNewCodeNode(selectedTreeData, selectedComponent, createView.treeViewer, AutoCodeManagerPropertyName.TreeNodeName, false); + } else { + saveNewCodeNode(selectedTreeData.getParentTreeData(), selectedComponent, createView.treeViewer, AutoCodeManagerPropertyName.TreeNodeName, false); + } + } + close(); + } + + // öԻʼС + @Override + protected Point getInitialSize() { + return new Point(400, 230); + } + + // öԻ򴰿ڱͼ + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(title); + newShell.setImage(CacheImage.getINSTANCE().getImage(AutoCodeManangerConstants.AutoCodeMananger_APPLICATION_ID, AutoCodeManagerImageKey.TREENODE_IMAGE)); + + } + +} diff --git a/src/icons/add.png b/src/icons/add.png new file mode 100644 index 0000000..bc58bd7 Binary files /dev/null and b/src/icons/add.png differ diff --git a/src/icons/addgroup_16.png b/src/icons/addgroup_16.png new file mode 100644 index 0000000..71b9d47 Binary files /dev/null and b/src/icons/addgroup_16.png differ diff --git a/src/icons/addnode_16.png b/src/icons/addnode_16.png new file mode 100644 index 0000000..d84fdfd Binary files /dev/null and b/src/icons/addnode_16.png differ diff --git a/src/icons/adduser_16.png b/src/icons/adduser_16.png new file mode 100644 index 0000000..b184734 Binary files /dev/null and b/src/icons/adduser_16.png differ diff --git a/src/icons/addvalue_16.png b/src/icons/addvalue_16.png new file mode 100644 index 0000000..3cf9bd3 Binary files /dev/null and b/src/icons/addvalue_16.png differ diff --git a/src/icons/autocode_16.png b/src/icons/autocode_16.png new file mode 100644 index 0000000..44938f5 Binary files /dev/null and b/src/icons/autocode_16.png differ diff --git a/src/icons/autocode_24.png b/src/icons/autocode_24.png new file mode 100644 index 0000000..2ac939f Binary files /dev/null and b/src/icons/autocode_24.png differ diff --git a/src/icons/autocode_32.png b/src/icons/autocode_32.png new file mode 100644 index 0000000..528106c Binary files /dev/null and b/src/icons/autocode_32.png differ diff --git a/src/icons/classficationcode_16.png b/src/icons/classficationcode_16.png new file mode 100644 index 0000000..d28e0f0 Binary files /dev/null and b/src/icons/classficationcode_16.png differ diff --git a/src/icons/close_16.png b/src/icons/close_16.png new file mode 100644 index 0000000..9935027 Binary files /dev/null and b/src/icons/close_16.png differ diff --git a/src/icons/code2_16.png b/src/icons/code2_16.png new file mode 100644 index 0000000..242a122 Binary files /dev/null and b/src/icons/code2_16.png differ diff --git a/src/icons/code_16.png b/src/icons/code_16.png new file mode 100644 index 0000000..c1757aa Binary files /dev/null and b/src/icons/code_16.png differ diff --git a/src/icons/codenode_16.png b/src/icons/codenode_16.png new file mode 100644 index 0000000..d28e0f0 Binary files /dev/null and b/src/icons/codenode_16.png differ diff --git a/src/icons/delete_16.png b/src/icons/delete_16.png new file mode 100644 index 0000000..dc602bc Binary files /dev/null and b/src/icons/delete_16.png differ diff --git a/src/icons/down_16.png b/src/icons/down_16.png new file mode 100644 index 0000000..35ef44f Binary files /dev/null and b/src/icons/down_16.png differ diff --git a/src/icons/edit_16.png b/src/icons/edit_16.png new file mode 100644 index 0000000..d133306 Binary files /dev/null and b/src/icons/edit_16.png differ diff --git a/src/icons/exceltemplate_16.png b/src/icons/exceltemplate_16.png new file mode 100644 index 0000000..d0f4a26 Binary files /dev/null and b/src/icons/exceltemplate_16.png differ diff --git a/src/icons/exceltemplate_32.png b/src/icons/exceltemplate_32.png new file mode 100644 index 0000000..f961043 Binary files /dev/null and b/src/icons/exceltemplate_32.png differ diff --git a/src/icons/export_16.png b/src/icons/export_16.png new file mode 100644 index 0000000..baa7c0f Binary files /dev/null and b/src/icons/export_16.png differ diff --git a/src/icons/exporttoexcel_16.png b/src/icons/exporttoexcel_16.png new file mode 100644 index 0000000..9cc4cd1 Binary files /dev/null and b/src/icons/exporttoexcel_16.png differ diff --git a/src/icons/exporttoexcel_24.png b/src/icons/exporttoexcel_24.png new file mode 100644 index 0000000..4ec0c15 Binary files /dev/null and b/src/icons/exporttoexcel_24.png differ diff --git a/src/icons/folder_16.png b/src/icons/folder_16.png new file mode 100644 index 0000000..e7499ce Binary files /dev/null and b/src/icons/folder_16.png differ diff --git a/src/icons/grant_16.png b/src/icons/grant_16.png new file mode 100644 index 0000000..f7a63ad Binary files /dev/null and b/src/icons/grant_16.png differ diff --git a/src/icons/group_16.png b/src/icons/group_16.png new file mode 100644 index 0000000..71a4bfb Binary files /dev/null and b/src/icons/group_16.png differ diff --git a/src/icons/home_data.png b/src/icons/home_data.png new file mode 100644 index 0000000..2e436a7 Binary files /dev/null and b/src/icons/home_data.png differ diff --git a/src/icons/import_16.png b/src/icons/import_16.png new file mode 100644 index 0000000..e3213a6 Binary files /dev/null and b/src/icons/import_16.png differ diff --git a/src/icons/importhistory_16.png b/src/icons/importhistory_16.png new file mode 100644 index 0000000..57a85f8 Binary files /dev/null and b/src/icons/importhistory_16.png differ diff --git a/src/icons/item_16.png b/src/icons/item_16.png new file mode 100644 index 0000000..6ff9793 Binary files /dev/null and b/src/icons/item_16.png differ diff --git a/src/icons/linkageNode_16.png b/src/icons/linkageNode_16.png new file mode 100644 index 0000000..2bf5ddd Binary files /dev/null and b/src/icons/linkageNode_16.png differ diff --git a/src/icons/linkage_16.png b/src/icons/linkage_16.png new file mode 100644 index 0000000..3d6c823 Binary files /dev/null and b/src/icons/linkage_16.png differ diff --git a/src/icons/list_16.png b/src/icons/list_16.png new file mode 100644 index 0000000..8c83db0 Binary files /dev/null and b/src/icons/list_16.png differ diff --git a/src/icons/listproperty_16.png b/src/icons/listproperty_16.png new file mode 100644 index 0000000..eccc1f1 Binary files /dev/null and b/src/icons/listproperty_16.png differ diff --git a/src/icons/listvalue_16.png b/src/icons/listvalue_16.png new file mode 100644 index 0000000..ead21d5 Binary files /dev/null and b/src/icons/listvalue_16.png differ diff --git a/src/icons/lock_16.png b/src/icons/lock_16.png new file mode 100644 index 0000000..197232e Binary files /dev/null and b/src/icons/lock_16.png differ diff --git a/src/icons/newclassfication_16.png b/src/icons/newclassfication_16.png new file mode 100644 index 0000000..3c91d1c Binary files /dev/null and b/src/icons/newclassfication_16.png differ diff --git a/src/icons/newcodetreenode_16.png b/src/icons/newcodetreenode_16.png new file mode 100644 index 0000000..92353fc Binary files /dev/null and b/src/icons/newcodetreenode_16.png differ diff --git a/src/icons/newlistproperty_16.png b/src/icons/newlistproperty_16.png new file mode 100644 index 0000000..8c83db0 Binary files /dev/null and b/src/icons/newlistproperty_16.png differ diff --git a/src/icons/newlistvalue_16.png b/src/icons/newlistvalue_16.png new file mode 100644 index 0000000..3cd33d0 Binary files /dev/null and b/src/icons/newlistvalue_16.png differ diff --git a/src/icons/ok_16.png b/src/icons/ok_16.png new file mode 100644 index 0000000..380ce66 Binary files /dev/null and b/src/icons/ok_16.png differ diff --git a/src/icons/organization_16.png b/src/icons/organization_16.png new file mode 100644 index 0000000..88d3093 Binary files /dev/null and b/src/icons/organization_16.png differ diff --git a/src/icons/person_16.png b/src/icons/person_16.png new file mode 100644 index 0000000..fa412c8 Binary files /dev/null and b/src/icons/person_16.png differ diff --git a/src/icons/remove_16.png b/src/icons/remove_16.png new file mode 100644 index 0000000..4ff8845 Binary files /dev/null and b/src/icons/remove_16.png differ diff --git a/src/icons/role_16.png b/src/icons/role_16.png new file mode 100644 index 0000000..78c754d Binary files /dev/null and b/src/icons/role_16.png differ diff --git a/src/icons/seq_16.png b/src/icons/seq_16.png new file mode 100644 index 0000000..fad4c83 Binary files /dev/null and b/src/icons/seq_16.png differ diff --git a/src/icons/tree_16.png b/src/icons/tree_16.png new file mode 100644 index 0000000..6d82492 Binary files /dev/null and b/src/icons/tree_16.png differ diff --git a/src/icons/treenode_16.png b/src/icons/treenode_16.png new file mode 100644 index 0000000..822f6d0 Binary files /dev/null and b/src/icons/treenode_16.png differ diff --git a/src/icons/unlock_16.png b/src/icons/unlock_16.png new file mode 100644 index 0000000..fbf2acc Binary files /dev/null and b/src/icons/unlock_16.png differ diff --git a/src/icons/up_16.png b/src/icons/up_16.png new file mode 100644 index 0000000..96d82de Binary files /dev/null and b/src/icons/up_16.png differ