diff options
author | Andrew M Finkbeiner | 2013-01-16 19:42:07 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2013-01-16 19:42:07 +0000 |
commit | 8a46cbffe0a4f6e1190a130c4bb4905d29d6300b (patch) | |
tree | c9480a7e1b0fc94d05ae43eefd20add0ac15f5c1 /plugins | |
parent | f730b8dbc09a4851552f34ac0cfb7160a71cba99 (diff) | |
download | org.eclipse.osee-8a46cbffe0a4f6e1190a130c4bb4905d29d6300b.tar.gz org.eclipse.osee-8a46cbffe0a4f6e1190a130c4bb4905d29d6300b.tar.xz org.eclipse.osee-8a46cbffe0a4f6e1190a130c4bb4905d29d6300b.zip |
feature[ats_PP77Z]: Delete the moved projects
Change-Id: Ib6d566f23c6423ad6c3fd2a6003a35791d1fc392
Diffstat (limited to 'plugins')
138 files changed, 0 insertions, 12879 deletions
diff --git a/plugins/org.eclipse.osee.ote.parent/pom.xml b/plugins/org.eclipse.osee.ote.parent/pom.xml index 0811cd6e5bd..fbc2ae01ce5 100644 --- a/plugins/org.eclipse.osee.ote.parent/pom.xml +++ b/plugins/org.eclipse.osee.ote.parent/pom.xml @@ -38,9 +38,6 @@ <module>../../plugins/org.eclipse.osee.ote.ui</module> <!-- <module>../../plugins/org.eclipse.osee.ote.ui.host.cmd</module> --> <module>../../plugins/org.eclipse.osee.ote.ui.markers</module> - <module>../../plugins/org.eclipse.osee.ote.ui.message</module> - <module>../../plugins/org.eclipse.osee.ote.ui.message.util</module> - <module>../../plugins/org.eclipse.osee.ote.ui.mux</module> <module>../../plugins/org.eclipse.osee.ote.version</module> <module>../../plugins/org.eclipse.osee.ote.version.git</module> diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/.classpath b/plugins/org.eclipse.osee.ote.ui.message.util/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/.pmd b/plugins/org.eclipse.osee.ote.ui.message.util/.pmd deleted file mode 100644 index c7b0a9fb3f5..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/.pmd +++ /dev/null @@ -1,925 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<pmd> - <useProjectRuleSet>false</useProjectRuleSet> - <ruleSetFile>.ruleset</ruleSetFile> - <rules> - <rule> - <name>LooseCoupling</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>CloneMethodMustImplementCloneable</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>UnusedImports</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>SignatureDeclareThrowsException</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>IfStmtsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>WhileLoopsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>IfElseStmtsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>ForLoopsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>UseSingleton</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanReturns</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanExpressions</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SwitchStmtsShouldHaveDefault</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidDeeplyNestedIfStmts</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidReassigningParameters</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SwitchDensity</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ConstructorCallsOverridableMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AccessorClassGeneration</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>FinalFieldCouldBeStatic</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>CloseResource</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonStaticInitializer</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>DefaultLabelNotLastInSwitchStmt</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonCaseLabelInSwitchStatement</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>OptimizableToArrayCall</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>BadComparison</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>EqualsNull</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ConfusingTernary</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>InstantiationToGetClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>IdempotentOperations</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimpleDateFormatNeedsLocale</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ImmutableField</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseLocaleWithCaseConversions</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidProtectedFieldInFinalClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AssignmentToNonFinalStatic</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>MissingStaticMethodInNonInstantiatableClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidSynchronizedAtMethodLevel</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>MissingBreakInSwitch</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseNotifyAllInsteadOfNotify</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidInstanceofChecksInCatchClause</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AbstractClassWithoutAbstractMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyConditional</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>CompareObjectsWithEquals</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>PositionLiteralsFirstInComparisons</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryLocalBeforeReturn</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonThreadSafeSingleton</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UncommentedEmptyMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UncommentedEmptyConstructor</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidConstantsInterface</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UnsynchronizedStaticDateFormatter</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>PreserveStackTrace</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseCollectionIsEmpty</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ClassWithOnlyPrivateConstructorsShouldBeFinal</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>EmptyMethodInAbstractClassShouldBeAbstract</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SingularField</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ReturnEmptyArrayRatherThanNull</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AbstractClassWithoutAnyMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>TooFewBranchesForASwitchStatement</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidCatchingThrowable</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>SignatureDeclareThrowsException</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>ExceptionAsFlowControl</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidCatchingNPE</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingRawExceptionTypes</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingNullPointerException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidRethrowingException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>DoNotExtendJavaLangError</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>DoNotThrowExceptionInFinally</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingNewInstanceOfSameException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>UnusedPrivateField</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedLocalVariable</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedPrivateMethod</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedFormalParameter</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>MoreThanOneLogger</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>LoggerIsNotStaticFinal</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>SystemPrintln</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>AvoidPrintStackTrace</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>AvoidDuplicateLiterals</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringInstantiation</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringToString</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InefficientStringBuffering</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryCaseChange</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseStringBufferLength</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>AppendCharacterWithChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>ConsecutiveLiteralAppends</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseIndexOfChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InefficientEmptyStringCheck</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InsufficientStringBufferDeclaration</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UselessStringValueOf</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringBufferInstantiationWithChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseEqualsToCompareStrings</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>AvoidStringBufferField</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>ReplaceVectorWithList</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ReplaceHashtableWithMap</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ReplaceEnumerationWithIterator</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>AvoidEnumAsIdentifier</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>AvoidAssertAsIdentifier</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>IntegerInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ByteInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ShortInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>LongInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseBeforeAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseAfterAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseTestAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4SuitesShouldUseSuiteAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnitUseExpected</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>UseProperClassLoader</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>MDBAndSessionBeanNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>RemoteSessionInterfaceNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>LocalInterfaceSessionNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>LocalHomeNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>RemoteInterfaceNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>DoNotCallSystemExit</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>StaticEJBFieldShouldBeFinal</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>DoNotUseThreads</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>AvoidInstantiatingObjectsInLoops</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseArrayListInsteadOfVector</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>SimplifyStartsWith</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseStringBufferForStringAppends</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseArraysAsList</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>AvoidArrayLoops</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryWrapperObjectCreation</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>AddEmptyString</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>EmptyCatchBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyIfStmt</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyWhileStmt</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyTryBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyFinallyBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptySwitchStatements</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>JumbledIncrementer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ForLoopShouldBeWhileLoop</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryConversionTemporary</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>OverrideBothEqualsAndHashcode</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>DoubleCheckedLocking</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ReturnFromFinallyBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptySynchronizedBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryReturn</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyStaticInitializer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnconditionalIfStatement</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyStatementNotInLoop</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BooleanInstantiation</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryFinalModifier</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>CollapsibleIfStatements</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UselessOverridingMethod</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ClassCastExceptionWithToArray</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidDecimalLiteralsInBigDecimalConstructor</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UselessOperationOnImmutable</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>MisplacedNullCheck</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnusedNullCheckInEquals</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidThreadGroup</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BrokenNullCheck</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BigIntegerInstantiation</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingOctalValues</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingHardCodedIP</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>CheckResultSet</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidMultipleUnaryOperators</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyInitializer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>MethodReturnsInternalArray</name> - <ruleset>Security Code Guidelines</ruleset> - </rule> - <rule> - <name>ArrayIsStoredDirectly</name> - <ruleset>Security Code Guidelines</ruleset> - </rule> - <rule> - <name>CouplingBetweenObjects</name> - <ruleset>Coupling Rules</ruleset> - </rule> - <rule> - <name>ExcessiveImports</name> - <ruleset>Coupling Rules</ruleset> - </rule> - <rule> - <name>LooseCoupling</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>DuplicateImports</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>DontImportJavaLang</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>UnusedImports</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>ImportFromSamePackage</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>TooManyStaticImports</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>JUnitStaticSuite</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitSpelling</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitAssertionsShouldIncludeMessage</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitTestsShouldIncludeAssert</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>TestClassWithoutTestCases</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryBooleanAssertion</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertEqualsInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertSameInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertNullInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanAssertion</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>NullAssignment</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>UnusedModifier</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AssignmentInOperand</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AtLeastOneConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DontImportSun</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>SuspiciousOctalEscape</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>CallSuperInConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryParentheses</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DefaultPackage</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>BooleanInversion</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DataflowAnomalyAnalysis</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidFinalLocalVariable</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingShortType</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingVolatile</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingNativeCode</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidAccessibilityAlteration</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DoNotCallGarbageCollectionExplicitly</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>MethodNamingConventions</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>ClassNamingConventions</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AbstractNaming</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidDollarSigns</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>MethodWithSameNameAsEnclosingClass</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousHashcodeMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousConstantFieldName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousEqualsMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidFieldNameMatchingTypeName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidFieldNameMatchingMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>NoPackage</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>PackageCase</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>MisleadingVariableName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>BooleanGetMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>NPathComplexity</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveMethodLength</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveParameterList</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveClassLength</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>CyclomaticComplexity</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessivePublicCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>TooManyFields</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssMethodCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssTypeCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssConstructorCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>TooManyMethods</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>EmptyFinalizer</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeOnlyCallsSuperFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeOverloaded</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeDoesNotCallSuperFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeShouldBeProtected</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>AvoidCallingFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>UseCorrectExceptionLogging</name> - <ruleset>Jakarta Commons Logging Rules</ruleset> - </rule> - <rule> - <name>ProperLogger</name> - <ruleset>Jakarta Commons Logging Rules</ruleset> - </rule> - <rule> - <name>MissingSerialVersionUID</name> - <ruleset>JavaBean Rules</ruleset> - </rule> - <rule> - <name>ProperCloneImplementation</name> - <ruleset>Clone Implementation Rules</ruleset> - </rule> - <rule> - <name>CloneThrowsCloneNotSupportedException</name> - <ruleset>Clone Implementation Rules</ruleset> - </rule> - <rule> - <name>CloneMethodMustImplementCloneable</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - </rules> - <includeDerivedFiles>false</includeDerivedFiles> - <violationsAsErrors>true</violationsAsErrors> -</pmd> diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/.project b/plugins/org.eclipse.osee.ote.ui.message.util/.project deleted file mode 100644 index 652125d8c6f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.osee.ote.ui.message.util</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.ui.message.util/META-INF/MANIFEST.MF deleted file mode 100644 index bb5149120db..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OSEE OTE Messaging Utils -Bundle-SymbolicName: org.eclipse.osee.ote.ui.message.util;singleton:=true -Bundle-Version: 0.11.0.qualifier -Bundle-Activator: org.eclipse.osee.ote.ui.message.util.internal.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.osee.framework.logging, - org.eclipse.osee.ote.client.msg, - org.eclipse.osee.ote.message, - org.eclipse.osee.ote.client, - org.eclipse.osee.ote.core -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.osee.ote.ui.message.util -Import-Package: org.eclipse.osee.framework.jdk.core.persistence, - org.eclipse.osee.framework.plugin.core.util -Bundle-Vendor: Eclipse Open System Engineering Environment diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/build.properties b/plugins/org.eclipse.osee.ote.ui.message.util/build.properties deleted file mode 100644 index 34d2e4d2dad..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/pom.xml b/plugins/org.eclipse.osee.ote.ui.message.util/pom.xml deleted file mode 100644 index 8d2d5f84146..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.eclipse.osee</groupId> - <artifactId>org.eclipse.osee.ote.parent</artifactId> - <version>0.11.0-SNAPSHOT</version> - <relativePath>../../plugins/org.eclipse.osee.ote.parent</relativePath> - </parent> - - <artifactId>org.eclipse.osee.ote.ui.message.util</artifactId> - <packaging>eclipse-plugin</packaging> - <name>OTE Ui Message Util (Incubation)</name> - - <build> - <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 --> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>tycho-source-plugin</artifactId> - </plugin> - </plugins> - </build> - -</project>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java deleted file mode 100644 index c3c4d1dab59..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ClientMessageServiceTracker.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.util; - -import java.util.logging.Level; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.ote.client.msg.IOteMessageService; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Ken J. Aguilar - */ -public class ClientMessageServiceTracker extends ServiceTracker { - - private final IOteMessageClientView viewer; - - public ClientMessageServiceTracker(BundleContext context, IOteMessageClientView viewer) { - super(context, IOteMessageService.class.getName(), null); - this.viewer = viewer; - } - - @Override - public synchronized Object addingService(ServiceReference reference) { - IOteMessageService service = (IOteMessageService) super.addingService(reference); - try { - viewer.oteMessageServiceAcquired(service); - } catch (RuntimeException e) { - OseeLog.log(ClientMessageServiceTracker.class, Level.SEVERE, "exception while notifying viewer of service", e); - } - return service; - } - - @Override - public synchronized void removedService(ServiceReference reference, Object service) { - try { - viewer.oteMessageServiceReleased(); - } catch (RuntimeException e) { - OseeLog.log(ClientMessageServiceTracker.class, Level.SEVERE, - "exception while notifying viewer of service stop", e); - } finally { - super.removedService(reference, service); - } - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java deleted file mode 100644 index ebe46290068..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/ElementFilter.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.util; - -import java.util.Arrays; -import java.util.HashSet; -import org.eclipse.osee.ote.message.elements.Element; - -/** - * @author Ken J. Aguilar - */ -public class ElementFilter { - private final HashSet<Class<? extends Element>> classes = new HashSet<Class<? extends Element>>(); - private boolean headerElementsAllowed = true; - - /** - * @param allowHeaderElements the allowHeaderElements to set - */ - public void setHeaderElementsAllowed(boolean headerElementsAllowed) { - this.headerElementsAllowed = headerElementsAllowed; - } - - public void addAllowableClass(Class<? extends Element> elementClass) { - classes.add(elementClass); - } - - public void addAllowableClass(Class<? extends Element>... elementClasses) { - classes.addAll(Arrays.asList(elementClasses)); - } - - public boolean accept(Element e) { - return classes.contains(e.getClass()); - } - - /** - * @return the headerElementsAllowed - */ - public boolean isHeaderElementsAllowed() { - return headerElementsAllowed; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java deleted file mode 100644 index e3ef31ad5dc..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/IOteMessageClientView.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.util; - -import org.eclipse.osee.ote.client.msg.IOteMessageService; -import org.eclipse.ui.IViewPart; - -/** - * @author Ken J. Aguilar - */ -public interface IOteMessageClientView extends IViewPart { - void oteMessageServiceAcquired(IOteMessageService service); - - void oteMessageServiceReleased(); -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java deleted file mode 100644 index 6010c6e2b24..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageElementSelectionDialog.java +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.util; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.osee.framework.plugin.core.util.ExportClassLoader; -import org.eclipse.osee.ote.message.ElementPath; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.elements.RecordElement; -import org.eclipse.osee.ote.message.elements.RecordMap; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import org.osgi.framework.FrameworkUtil; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Ken J. Aguilar - */ -public class MessageElementSelectionDialog extends ElementListSelectionDialog { - - public MessageElementSelectionDialog(Shell parent, Message<?, ?, ?> msg) { - this(parent, msg, null); - } - - public MessageElementSelectionDialog(Shell parent, String msg, ElementFilter filter) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalStateException { - this(parent, getMessage(msg), filter); - } - - public MessageElementSelectionDialog(Shell parent, Message<?, ?, ?> msg, ElementFilter filter) { - super(parent, new LabelProvider()); - LinkedList<Element> topLevelElements = new LinkedList<Element>(); - LinkedList<Element> filterElements = new LinkedList<Element>(); - msg.getAllElements(topLevelElements); - - process(filter, topLevelElements, filterElements); - setElements(filterElements.toArray()); - setMessage("Select a message element. Use * as the wild card character"); - setTitle("Message Element Selection"); - } - - private static Message<?, ?, ?> getMessage(String msg) throws ClassNotFoundException, InstantiationException, IllegalAccessException { - ServiceTracker tracker = - new ServiceTracker(FrameworkUtil.getBundle(MessageElementSelectionDialog.class).getBundleContext(), MessageDefinitionProvider.class.getName(), - null); - tracker.open(true); - try { - Object[] dictionary = tracker.getServices(); - if (dictionary.length == 0) { - throw new IllegalStateException("no dictionary loaded"); - } - return ExportClassLoader.getInstance().loadClass(msg).asSubclass(Message.class).newInstance(); - } finally { - tracker.close(); - } - } - - private static final class LabelProvider implements ILabelProvider { - - @Override - public Image getImage(Object element) { - return null; - } - - @Override - public String getText(Object element) { - Element msgElement = (Element) element; - return new ElementPath(msgElement.getElementPath()).toString(); - } - - @Override - public void addListener(ILabelProviderListener listener) { - } - - @Override - public void dispose() { - } - - @Override - public boolean isLabelProperty(Object element, String property) { - return false; - } - - @Override - public void removeListener(ILabelProviderListener listener) { - } - - }; - - private void process(ElementFilter filter, List<Element> list, List<Element> destinationList) { - for (Element element : list) { - processElement(filter, element, destinationList); - } - } - - private void processElement(ElementFilter filter, Element element, List<Element> destinationList) { - if (element instanceof RecordMap<?>) { - processRecordMap(filter, (RecordMap<?>) element, destinationList); - } else if (element instanceof RecordElement) { - processRecordElement(filter, (RecordElement) element, destinationList); - } else { - if (filter == null || filter.accept(element)) { - destinationList.add(element); - } - } - } - - private void processRecordMap(ElementFilter filter, RecordMap<?> map, List<Element> destinationList) { - for (int i = 0; i < map.length(); i++) { - processRecordElement(filter, map.get(i), destinationList); - } - - } - - private void processRecordElement(ElementFilter filter, RecordElement element, List<Element> destinationList) { - if (element instanceof RecordMap<?>) { - processRecordMap(filter, (RecordMap<?>) element, destinationList); - } else { - for (Element childElement : element.getElementMap().values()) { - processElement(filter, childElement, destinationList); - } - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java deleted file mode 100644 index 78772b062c4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/MessageSelectionDialog.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.util; - -import java.util.ArrayList; -import java.util.logging.Level; - -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.eclipse.osee.ote.message.MessageSink; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import org.osgi.framework.FrameworkUtil; -import org.osgi.util.tracker.ServiceTracker; - -/** - * @author Ken J. Aguilar - */ -public class MessageSelectionDialog extends ElementListSelectionDialog { - - public MessageSelectionDialog(Shell parent) { - super(parent, new ILabelProvider() { - - @Override - public Image getImage(Object element) { - return null; - } - - @Override - public String getText(Object element) { - String msgName = (String) element; - String packageName = msgName.substring(0, msgName.lastIndexOf('.')); - String type = packageName.substring(packageName.lastIndexOf('.') + 1); - - return String.format("%s [%s]", msgName.substring(msgName.lastIndexOf('.') + 1), type); - } - - @Override - public void addListener(ILabelProviderListener listener) { - } - - @Override - public void dispose() { - } - - @Override - public boolean isLabelProperty(Object element, String property) { - return false; - } - - @Override - public void removeListener(ILabelProviderListener listener) { - } - - }); - - ServiceTracker tracker = - new ServiceTracker(FrameworkUtil.getBundle(getClass()).getBundleContext(), MessageDefinitionProvider.class.getName(), null); - tracker.open(true); - try { - Object[] dictionaries = tracker.getServices(); - final ArrayList<String> messages = new ArrayList<String>(4096); - for(Object dictionary:dictionaries){ - ((MessageDefinitionProvider)dictionary).generateMessageIndex(new MessageSink() { - @Override - public void absorbElement(String elementName) { - } - @Override - public void absorbMessage(String messageName) { - messages.add(messageName); - } - @Override - public void absorbProvider(String providerName) { - } - }); - } - setElements(messages.toArray()); - } catch (Exception e) { - OseeLog.log(MessageSelectionDialog.class, Level.SEVERE, "failed to generate message listing", e); - } finally { - tracker.close(); - } - setMessage("Select a message. Use * as the wild card character"); - setTitle("Message Selection"); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java b/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java deleted file mode 100644 index 12496864658..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message.util/src/org/eclipse/osee/ote/ui/message/util/internal/Activator.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.util.internal; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - * - * @author Ken J. Aguilar - */ -public class Activator extends AbstractUIPlugin { - public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.message.util"; - private static Activator plugin; - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - @Override - 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; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/.classpath b/plugins/org.eclipse.osee.ote.ui.message/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.osee.ote.ui.message/.pmd b/plugins/org.eclipse.osee.ote.ui.message/.pmd deleted file mode 100644 index c7b0a9fb3f5..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/.pmd +++ /dev/null @@ -1,925 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<pmd> - <useProjectRuleSet>false</useProjectRuleSet> - <ruleSetFile>.ruleset</ruleSetFile> - <rules> - <rule> - <name>LooseCoupling</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>CloneMethodMustImplementCloneable</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>UnusedImports</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>SignatureDeclareThrowsException</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>IfStmtsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>WhileLoopsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>IfElseStmtsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>ForLoopsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>UseSingleton</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanReturns</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanExpressions</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SwitchStmtsShouldHaveDefault</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidDeeplyNestedIfStmts</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidReassigningParameters</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SwitchDensity</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ConstructorCallsOverridableMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AccessorClassGeneration</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>FinalFieldCouldBeStatic</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>CloseResource</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonStaticInitializer</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>DefaultLabelNotLastInSwitchStmt</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonCaseLabelInSwitchStatement</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>OptimizableToArrayCall</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>BadComparison</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>EqualsNull</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ConfusingTernary</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>InstantiationToGetClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>IdempotentOperations</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimpleDateFormatNeedsLocale</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ImmutableField</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseLocaleWithCaseConversions</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidProtectedFieldInFinalClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AssignmentToNonFinalStatic</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>MissingStaticMethodInNonInstantiatableClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidSynchronizedAtMethodLevel</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>MissingBreakInSwitch</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseNotifyAllInsteadOfNotify</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidInstanceofChecksInCatchClause</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AbstractClassWithoutAbstractMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyConditional</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>CompareObjectsWithEquals</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>PositionLiteralsFirstInComparisons</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryLocalBeforeReturn</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonThreadSafeSingleton</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UncommentedEmptyMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UncommentedEmptyConstructor</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidConstantsInterface</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UnsynchronizedStaticDateFormatter</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>PreserveStackTrace</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseCollectionIsEmpty</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ClassWithOnlyPrivateConstructorsShouldBeFinal</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>EmptyMethodInAbstractClassShouldBeAbstract</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SingularField</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ReturnEmptyArrayRatherThanNull</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AbstractClassWithoutAnyMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>TooFewBranchesForASwitchStatement</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidCatchingThrowable</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>SignatureDeclareThrowsException</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>ExceptionAsFlowControl</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidCatchingNPE</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingRawExceptionTypes</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingNullPointerException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidRethrowingException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>DoNotExtendJavaLangError</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>DoNotThrowExceptionInFinally</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingNewInstanceOfSameException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>UnusedPrivateField</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedLocalVariable</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedPrivateMethod</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedFormalParameter</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>MoreThanOneLogger</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>LoggerIsNotStaticFinal</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>SystemPrintln</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>AvoidPrintStackTrace</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>AvoidDuplicateLiterals</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringInstantiation</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringToString</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InefficientStringBuffering</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryCaseChange</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseStringBufferLength</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>AppendCharacterWithChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>ConsecutiveLiteralAppends</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseIndexOfChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InefficientEmptyStringCheck</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InsufficientStringBufferDeclaration</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UselessStringValueOf</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringBufferInstantiationWithChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseEqualsToCompareStrings</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>AvoidStringBufferField</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>ReplaceVectorWithList</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ReplaceHashtableWithMap</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ReplaceEnumerationWithIterator</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>AvoidEnumAsIdentifier</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>AvoidAssertAsIdentifier</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>IntegerInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ByteInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ShortInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>LongInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseBeforeAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseAfterAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseTestAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4SuitesShouldUseSuiteAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnitUseExpected</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>UseProperClassLoader</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>MDBAndSessionBeanNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>RemoteSessionInterfaceNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>LocalInterfaceSessionNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>LocalHomeNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>RemoteInterfaceNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>DoNotCallSystemExit</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>StaticEJBFieldShouldBeFinal</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>DoNotUseThreads</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>AvoidInstantiatingObjectsInLoops</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseArrayListInsteadOfVector</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>SimplifyStartsWith</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseStringBufferForStringAppends</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseArraysAsList</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>AvoidArrayLoops</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryWrapperObjectCreation</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>AddEmptyString</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>EmptyCatchBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyIfStmt</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyWhileStmt</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyTryBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyFinallyBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptySwitchStatements</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>JumbledIncrementer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ForLoopShouldBeWhileLoop</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryConversionTemporary</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>OverrideBothEqualsAndHashcode</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>DoubleCheckedLocking</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ReturnFromFinallyBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptySynchronizedBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryReturn</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyStaticInitializer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnconditionalIfStatement</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyStatementNotInLoop</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BooleanInstantiation</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryFinalModifier</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>CollapsibleIfStatements</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UselessOverridingMethod</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ClassCastExceptionWithToArray</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidDecimalLiteralsInBigDecimalConstructor</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UselessOperationOnImmutable</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>MisplacedNullCheck</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnusedNullCheckInEquals</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidThreadGroup</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BrokenNullCheck</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BigIntegerInstantiation</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingOctalValues</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingHardCodedIP</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>CheckResultSet</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidMultipleUnaryOperators</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyInitializer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>MethodReturnsInternalArray</name> - <ruleset>Security Code Guidelines</ruleset> - </rule> - <rule> - <name>ArrayIsStoredDirectly</name> - <ruleset>Security Code Guidelines</ruleset> - </rule> - <rule> - <name>CouplingBetweenObjects</name> - <ruleset>Coupling Rules</ruleset> - </rule> - <rule> - <name>ExcessiveImports</name> - <ruleset>Coupling Rules</ruleset> - </rule> - <rule> - <name>LooseCoupling</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>DuplicateImports</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>DontImportJavaLang</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>UnusedImports</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>ImportFromSamePackage</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>TooManyStaticImports</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>JUnitStaticSuite</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitSpelling</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitAssertionsShouldIncludeMessage</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitTestsShouldIncludeAssert</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>TestClassWithoutTestCases</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryBooleanAssertion</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertEqualsInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertSameInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertNullInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanAssertion</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>NullAssignment</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>UnusedModifier</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AssignmentInOperand</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AtLeastOneConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DontImportSun</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>SuspiciousOctalEscape</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>CallSuperInConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryParentheses</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DefaultPackage</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>BooleanInversion</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DataflowAnomalyAnalysis</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidFinalLocalVariable</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingShortType</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingVolatile</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingNativeCode</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidAccessibilityAlteration</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DoNotCallGarbageCollectionExplicitly</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>MethodNamingConventions</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>ClassNamingConventions</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AbstractNaming</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidDollarSigns</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>MethodWithSameNameAsEnclosingClass</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousHashcodeMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousConstantFieldName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousEqualsMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidFieldNameMatchingTypeName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidFieldNameMatchingMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>NoPackage</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>PackageCase</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>MisleadingVariableName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>BooleanGetMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>NPathComplexity</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveMethodLength</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveParameterList</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveClassLength</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>CyclomaticComplexity</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessivePublicCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>TooManyFields</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssMethodCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssTypeCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssConstructorCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>TooManyMethods</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>EmptyFinalizer</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeOnlyCallsSuperFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeOverloaded</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeDoesNotCallSuperFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeShouldBeProtected</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>AvoidCallingFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>UseCorrectExceptionLogging</name> - <ruleset>Jakarta Commons Logging Rules</ruleset> - </rule> - <rule> - <name>ProperLogger</name> - <ruleset>Jakarta Commons Logging Rules</ruleset> - </rule> - <rule> - <name>MissingSerialVersionUID</name> - <ruleset>JavaBean Rules</ruleset> - </rule> - <rule> - <name>ProperCloneImplementation</name> - <ruleset>Clone Implementation Rules</ruleset> - </rule> - <rule> - <name>CloneThrowsCloneNotSupportedException</name> - <ruleset>Clone Implementation Rules</ruleset> - </rule> - <rule> - <name>CloneMethodMustImplementCloneable</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - </rules> - <includeDerivedFiles>false</includeDerivedFiles> - <violationsAsErrors>true</violationsAsErrors> -</pmd> diff --git a/plugins/org.eclipse.osee.ote.ui.message/.project b/plugins/org.eclipse.osee.ote.ui.message/.project deleted file mode 100644 index 78a9516b9eb..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/.project +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.osee.ote.ui.message</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ds.core.builder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.osee.ote.ui.message/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.ui.message/META-INF/MANIFEST.MF deleted file mode 100644 index ce2b10e1fbe..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: OSEE MessageTool Plug-in (Incubation) -Bundle-SymbolicName: org.eclipse.osee.ote.ui.message;singleton:=true -Bundle-Version: 0.11.0.qualifier -Bundle-Activator: org.eclipse.osee.ote.ui.message.internal.Activator -Bundle-Vendor: Eclipse Open System Engineering Environment -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.osee.framework.jdk.core, - org.eclipse.core.resources, - org.eclipse.osee.framework.plugin.core, - org.eclipse.osee.ote.core, - org.eclipse.osee.ote.message;visibility:=reexport, - org.eclipse.osee.framework.ui.plugin, - org.eclipse.osee.framework.ui.swt, - org.eclipse.osee.ote.messaging.dds, - org.eclipse.osee.ote.connection.service, - org.eclipse.osee.ote.client, - org.eclipse.osee.framework.logging, - org.eclipse.nebula.widgets.xviewer, - org.eclipse.osee.ote.client.msg;visibility:=reexport, - org.eclipse.osee.ote.ui.message.util -Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.osee.ote.ui.message, - org.eclipse.osee.ote.ui.message.internal, - org.eclipse.osee.ote.ui.message.tree, - org.eclipse.osee.ote.ui.message.view, - org.eclipse.osee.ote.ui.message.watch -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Import-Package: org.eclipse.osee.framework.core.exception, - org.eclipse.osee.framework.core.operation diff --git a/plugins/org.eclipse.osee.ote.ui.message/build.properties b/plugins/org.eclipse.osee.ote.ui.message/build.properties deleted file mode 100644 index 0594ab9073e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - images/,\ - plugin.xml,\ - schema/,\ - . -source.. = src/ diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/binary.gif b/plugins/org.eclipse.osee.ote.ui.message/images/binary.gif Binary files differdeleted file mode 100644 index a298937f8cc..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/binary.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/binoculars.gif b/plugins/org.eclipse.osee.ote.ui.message/images/binoculars.gif Binary files differdeleted file mode 100644 index b04deb3c266..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/binoculars.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/bug.gif b/plugins/org.eclipse.osee.ote.ui.message/images/bug.gif Binary files differdeleted file mode 100644 index 9a738e55054..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/bug.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/collapse_state.gif b/plugins/org.eclipse.osee.ote.ui.message/images/collapse_state.gif Binary files differdeleted file mode 100644 index e38d016fb46..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/collapse_state.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/config.gif b/plugins/org.eclipse.osee.ote.ui.message/images/config.gif Binary files differdeleted file mode 100644 index 9ac596da3a4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/config.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/database.png b/plugins/org.eclipse.osee.ote.ui.message/images/database.png Binary files differdeleted file mode 100644 index 20263739740..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/database.png +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/delete.gif b/plugins/org.eclipse.osee.ote.ui.message/images/delete.gif Binary files differdeleted file mode 100644 index 2cd9c544436..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/delete.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/deleteAll.gif b/plugins/org.eclipse.osee.ote.ui.message/images/deleteAll.gif Binary files differdeleted file mode 100644 index 28a3785aaca..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/deleteAll.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/element.gif b/plugins/org.eclipse.osee.ote.ui.message/images/element.gif Binary files differdeleted file mode 100644 index c5153bf9583..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/element.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/errorSm.gif b/plugins/org.eclipse.osee.ote.ui.message/images/errorSm.gif Binary files differdeleted file mode 100644 index 8612eaff599..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/errorSm.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/expand_state.gif b/plugins/org.eclipse.osee.ote.ui.message/images/expand_state.gif Binary files differdeleted file mode 100644 index 41ab5707b8d..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/expand_state.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/gear.png b/plugins/org.eclipse.osee.ote.ui.message/images/gear.png Binary files differdeleted file mode 100644 index 8e146b468c7..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/gear.png +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/glasses.gif b/plugins/org.eclipse.osee.ote.ui.message/images/glasses.gif Binary files differdeleted file mode 100644 index 9bdbc128f49..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/glasses.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/hex.gif b/plugins/org.eclipse.osee.ote.ui.message/images/hex.gif Binary files differdeleted file mode 100644 index 7b406f3984d..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/hex.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/message_old.gif b/plugins/org.eclipse.osee.ote.ui.message/images/message_old.gif Binary files differdeleted file mode 100644 index f15a1f68d29..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/message_old.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/msgReadImg.gif b/plugins/org.eclipse.osee.ote.ui.message/images/msgReadImg.gif Binary files differdeleted file mode 100644 index d6cbc9338c8..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/msgReadImg.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/msgWriteImg.gif b/plugins/org.eclipse.osee.ote.ui.message/images/msgWriteImg.gif Binary files differdeleted file mode 100644 index a0d9dd18213..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/msgWriteImg.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/open.gif b/plugins/org.eclipse.osee.ote.ui.message/images/open.gif Binary files differdeleted file mode 100644 index 51e703b1b9c..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/open.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/pipe.png b/plugins/org.eclipse.osee.ote.ui.message/images/pipe.png Binary files differdeleted file mode 100644 index a210381cddb..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/pipe.png +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/refresh.gif b/plugins/org.eclipse.osee.ote.ui.message/images/refresh.gif Binary files differdeleted file mode 100644 index a063c230aca..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/refresh.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/remove.gif b/plugins/org.eclipse.osee.ote.ui.message/images/remove.gif Binary files differdeleted file mode 100644 index 6f647666d32..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/remove.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/save.gif b/plugins/org.eclipse.osee.ote.ui.message/images/save.gif Binary files differdeleted file mode 100644 index 499dd0ca602..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/save.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/showNames.gif b/plugins/org.eclipse.osee.ote.ui.message/images/showNames.gif Binary files differdeleted file mode 100644 index 1b50ff8d67b..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/showNames.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/watchlist_view.gif b/plugins/org.eclipse.osee.ote.ui.message/images/watchlist_view.gif Binary files differdeleted file mode 100644 index 99783a247f0..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/watchlist_view.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/images/wire_aiu.gif b/plugins/org.eclipse.osee.ote.ui.message/images/wire_aiu.gif Binary files differdeleted file mode 100644 index 8dc12dafd0a..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/images/wire_aiu.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.message/plugin.xml b/plugins/org.eclipse.osee.ote.ui.message/plugin.xml deleted file mode 100644 index d5c53f65fd2..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/plugin.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin> -<extension-point id="ToolbarItem" name="ToolbarItem" schema="schema/ToolbarItem.exsd"/> -<extension-point id="detailsProvider" name="Message Details Provider" schema="schema/RenderTabProvider.exsd"/> - <extension - id="osee.test.message" - name="Message" - point="org.eclipse.ui.views"> - <category - name="OSEE Test" - id="osee.test.category"/> - <view - class="org.eclipse.osee.ote.ui.message.view.MessageView" - icon="images/glasses.gif" - category="osee.test.category" - name="MessageView" - id="org.eclipse.osee.ote.ui.message.view.MessageView"/> - <view - class="org.eclipse.osee.ote.ui.message.watch.WatchView" - icon="images/binoculars.gif" - category="osee.test.category" - name="MessageWatch" - id="org.eclipse.osee.ote.ui.message.watch.WatchView"/> - </extension> - <extension - id="CsvRunner" - name="CsvRunner" - point="org.eclipse.core.runtime.applications"> - <application> - <run class="org.eclipse.osee.ote.ui.message.watch.recording.xform.RunCSVConversion"/> - </application> - </extension> - <extension - point="org.eclipse.osee.framework.ui.plugin.XNavigateItem"> - <XNavigateItem - classname="org.eclipse.osee.ote.ui.message.navigate.MessageNavigateViewItems" - category="Messaging" - viewId="org.eclipse.osee.ote.ui.navigate.OteNavigateView"> - </XNavigateItem> - </extension> -<extension - point="org.eclipse.ui.perspectiveExtensions"> - <perspectiveExtension - targetID="org.eclipse.osee.ote.ui.TestPerspective"> - <view - relationship="stack" - id="org.eclipse.osee.ote.ui.message.watch.WatchView" - relative="org.eclipse.jdt.ui.PackageExplorer"> - </view> - <viewShortcut - id="org.eclipse.osee.ote.ui.message.watch.WatchView"> - </viewShortcut> - </perspectiveExtension> - </extension> -<extension - point="org.eclipse.ui.perspectiveExtensions"> - <perspectiveExtension - targetID="org.eclipse.osee.ote.ui.TestPerspective"> - <view - relationship="stack" - id="org.eclipse.osee.ote.ui.message.view.MessageView" - relative="org.eclipse.pde.runtime.LogView"> - </view> - <viewShortcut - id="org.eclipse.osee.ote.ui.message.view.MessageView"> - </viewShortcut> - </perspectiveExtension> - </extension> - <extension - id="CsvTransform" - name="CsvTransform" - point="org.eclipse.osee.ote.ui.message.ToolbarItem"> - <ToolbarItem - Action="org.eclipse.osee.ote.ui.message.watch.recording.xform.CsvTransform" - Label="Csv Transform" - Tooltip="Transform the base CSV format."/> - </extension> -</plugin> diff --git a/plugins/org.eclipse.osee.ote.ui.message/pom.xml b/plugins/org.eclipse.osee.ote.ui.message/pom.xml deleted file mode 100644 index 145ab167b78..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.eclipse.osee</groupId> - <artifactId>org.eclipse.osee.ote.parent</artifactId> - <version>0.11.0-SNAPSHOT</version> - <relativePath>../../plugins/org.eclipse.osee.ote.parent</relativePath> - </parent> - - <artifactId>org.eclipse.osee.ote.ui.message</artifactId> - <packaging>eclipse-plugin</packaging> - <name>OTE Ui Message (Incubation)</name> - - <build> - <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 --> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>tycho-source-plugin</artifactId> - </plugin> - </plugins> - </build> - -</project>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/schema/RenderTabProvider.exsd b/plugins/org.eclipse.osee.ote.ui.message/schema/RenderTabProvider.exsd deleted file mode 100644 index cae0157cb50..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/schema/RenderTabProvider.exsd +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.osee.ote.ui.message" xmlns="http://www.w3.org/2001/XMLSchema"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.osee.ote.ui.message" id="org.eclipse.osee.ote.ui.message.detailsProvider" name="Message Details Provider"/> - </appInfo> - <documentation> - [Enter description of this extension point.] - </documentation> - </annotation> - - <element name="extension"> - <annotation> - <appInfo> - <meta.element /> - </appInfo> - </annotation> - <complexType> - <sequence> - <element ref="TabProvider"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string" use="required"> - <annotation> - <documentation> - a unique id identifying the contribution - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="TabProvider"> - <complexType> - <attribute name="className" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn="org.eclipse.osee.ote.ui.message.watch.DetailsProvider:"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - [Enter the first release in which this extension point appears.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - [Enter extension point usage example here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiinfo"/> - </appInfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - -</schema> diff --git a/plugins/org.eclipse.osee.ote.ui.message/schema/ToolbarItem.exsd b/plugins/org.eclipse.osee.ote.ui.message/schema/ToolbarItem.exsd deleted file mode 100644 index 4e491c65f73..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/schema/ToolbarItem.exsd +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- Schema file written by PDE --> -<schema targetNamespace="org.eclipse.osee.ote.ui.message"> -<annotation> - <appInfo> - <meta.schema plugin="org.eclipse.osee.ote.ui.message" id="ToolbarItem" name="ToolbarItem"/> - </appInfo> - <documentation> - [Enter description of this extension point.] - </documentation> - </annotation> - - <element name="extension"> - <complexType> - <sequence minOccurs="1" maxOccurs="unbounded"> - <element ref="ToolbarItem"/> - </sequence> - <attribute name="point" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="id" type="string"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="name" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute translatable="true"/> - </appInfo> - </annotation> - </attribute> - </complexType> - </element> - - <element name="ToolbarItem"> - <complexType> - <attribute name="Action" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute kind="java" basedOn="org.eclipse.jface.action.Action"/> - </appInfo> - </annotation> - </attribute> - <attribute name="Icon" type="string"> - <annotation> - <documentation> - - </documentation> - <appInfo> - <meta.attribute kind="resource"/> - </appInfo> - </annotation> - </attribute> - <attribute name="Label" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - <attribute name="Tooltip" type="string" use="required"> - <annotation> - <documentation> - - </documentation> - </annotation> - </attribute> - </complexType> - </element> - - <annotation> - <appInfo> - <meta.section type="since"/> - </appInfo> - <documentation> - [Enter the first release in which this extension point appears.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="examples"/> - </appInfo> - <documentation> - [Enter extension point usage example here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="apiInfo"/> - </appInfo> - <documentation> - [Enter API information here.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="implementation"/> - </appInfo> - <documentation> - [Enter information about supplied implementation of this extension point.] - </documentation> - </annotation> - - <annotation> - <appInfo> - <meta.section type="copyright"/> - </appInfo> - <documentation> - - </documentation> - </annotation> - -</schema> diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/OteMessageImage.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/OteMessageImage.java deleted file mode 100644 index 14c3af760f3..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/OteMessageImage.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.KeyedImage; -import org.eclipse.osee.ote.ui.message.internal.Activator; - -/** - * @author Andrew M. Finkbeiner - */ -public enum OteMessageImage implements KeyedImage { - BINARY("binary.gif"), - BINOCULARS("binoculars.gif"), - BUG("bug.gif"), - COLLAPSE_STATE("collapse_state.gif"), - CONFIG("config.gif"), - DATABASE("database.png"), - DELETE("delete.gif"), - DELETE_ALL("deleteAll.gif"), - ELEMENT("element.gif"), - ERROR_SM("errorSm.gif"), - EXPAND_STATE("expand_state.gif"), - GEAR("gear.png"), - GLASSES("glasses.gif"), - HEX("hex.gif"), - MESSAGE_OLD("message_old.gif"), - MSG_READ_IMG("msgReadImg.gif"), - MSG_WRITE_IMG("msgWriteImg.gif"), - OPEN("open.gif"), - PIPE("pipe.png"), - REFRESH("refresh.gif"), - REMOVE("remove.gif"), - SAVE("save.gif"), - SHOW_NAMES("showNames.gif"), - WATCHLIST_VIEW("watchlist_view.gif"), - WIRE_AIU("wire_aiu.gif"); - - private final String fileName; - - private OteMessageImage(String fileName) { - this.fileName = fileName; - } - - @Override - public ImageDescriptor createImageDescriptor() { - return ImageManager.createImageDescriptor(Activator.PLUGIN_ID, "images", fileName); - } - - @Override - public String getImageKey() { - return Activator.PLUGIN_ID + ".images." + fileName; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/internal/Activator.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/internal/Activator.java deleted file mode 100644 index 663b88dd97f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/internal/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.internal; - -import org.eclipse.osee.framework.ui.plugin.OseeUiActivator; -import org.eclipse.osee.ote.service.IOteClientService; -import org.osgi.framework.BundleContext; -import org.osgi.util.tracker.ServiceTracker; - -public class Activator extends OseeUiActivator { - - private static Activator pluginInstance; - public static final String PLUGIN_ID = "org.eclipse.osee.ote.ui.message"; - private ServiceTracker oteClientServiceTracker; - - public Activator() { - super(PLUGIN_ID); - } - - public static Activator getDefault() { - return pluginInstance; - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - oteClientServiceTracker = new ServiceTracker(context, IOteClientService.class.getName(), null); - oteClientServiceTracker.open(); - pluginInstance = this; - } - - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - oteClientServiceTracker.close(); - pluginInstance = null; - } - - public IOteClientService getOteClientService() { - return (IOteClientService) oteClientServiceTracker.getService(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/IAddPopupMenuItems.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/IAddPopupMenuItems.java deleted file mode 100644 index 1c74f4645c7..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/IAddPopupMenuItems.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.messageXViewer; - -import org.eclipse.swt.widgets.Menu; - -/** - * @author Andrew M. Finkbeiner - */ -public interface IAddPopupMenuItems { - void addPopupItems(Menu menu); -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/MessageXViewer.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/MessageXViewer.java deleted file mode 100644 index 976c56c0c3f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/MessageXViewer.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.messageXViewer; - -import org.eclipse.nebula.widgets.xviewer.XViewer; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; - -/** - * @author Andrew M. Finkbeiner - */ -public class MessageXViewer extends XViewer { - - public MessageXViewer(Composite parent, int style) { - super(parent, style, new MessageXViewerFactory()); - } - - public Menu getPopupMenu() { - return this.getMenuManager().getMenu(); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/MessageXViewerFactory.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/MessageXViewerFactory.java deleted file mode 100644 index 2b29394100e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/messageXViewer/MessageXViewerFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.messageXViewer; - -import java.io.File; -import java.util.logging.Level; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn.SortDataType; -import org.eclipse.nebula.widgets.xviewer.XViewerFactory; -import org.eclipse.nebula.widgets.xviewer.customize.FileStoreCustomizations; -import org.eclipse.nebula.widgets.xviewer.customize.IXViewerCustomizations; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.plugin.core.util.OseeData; -import org.eclipse.swt.SWT; - -/** - * @author Andrew M. Finkbeiner - */ -public class MessageXViewerFactory extends XViewerFactory { - - private static String VIEWER_NAMESPACE = "org.eclipse.osee.ote.message.MessageXViewer"; - public static XViewerColumn name = new XViewerColumn("osee.message.name", "Name", 200, SWT.LEFT, true, - SortDataType.String, false, null); - public static XViewerColumn psUpdateCount = new XViewerColumn("osee.message.udpates", "Updates", 60, SWT.LEFT, true, - SortDataType.Integer, false, null); - public static XViewerColumn value = new XViewerColumn("osee.message.value", "Value", 100, SWT.LEFT, true, - SortDataType.String, false, null); - public static XViewerColumn byteOffset = new XViewerColumn("osee.message.offset", "Offset", 50, SWT.LEFT, true, - SortDataType.Integer, false, null); - public static XViewerColumn msb = new XViewerColumn("osee.message.msb", "MSB", 50, SWT.LEFT, true, - SortDataType.Integer, false, null); - public static XViewerColumn lsb = new XViewerColumn("osee.message.lsb", "LSB", 50, SWT.LEFT, true, - SortDataType.Integer, false, null); - public static XViewerColumn bitSize = new XViewerColumn("osee.message.bitSize", "Bit Size", 60, SWT.LEFT, true, - SortDataType.Integer, false, null); - public static XViewerColumn elementType = new XViewerColumn("osee.message.type", "Type", 100, SWT.LEFT, true, - SortDataType.String, false, null); - - private final FileStoreCustomizations propertyStoreCustomizations; - - private static final String defaultCustomDataXml = - "<XTreeProperties name=\"default\" namespace=\"org.eclipse.osee.ote.message.MessageXViewer\" guid=\"61ksp8mbrj8501466lgqc8\"><xSorter><id>osee.message.offset</id><id>osee.message.msb</id></xSorter><xFilter></xFilter><xCol><id>osee.message.name</id><name>Name</name><wdth>225</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.udpates</id><name>Updates</name><wdth>60</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.value</id><name>Value</name><wdth>100</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.offset</id><name>Offset</name><wdth>50</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.msb</id><name>MSB</name><wdth>50</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.lsb</id><name>LSB</name><wdth>50</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.bitSize</id><name>Bit Size</name><wdth>58</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol><xCol><id>osee.message.type</id><name>Type</name><wdth>68</wdth><algn>left</algn><srtFwd>true</srtFwd><show>true</show></xCol></XTreeProperties>"; - - public MessageXViewerFactory() { - super(VIEWER_NAMESPACE); - - File folder; - try { - folder = OseeData.getFolder("OteMessageWatch").getLocation().toFile(); - } catch (Exception ex) { - OseeLog.log(MessageXViewerFactory.class, Level.SEVERE, ex); - folder = new File(System.getProperty("java.io.tmpdir")); - } - propertyStoreCustomizations = - new FileStoreCustomizations(folder, "OteMessageWatch", ".xml", "DefaultMessageWatch.xml", defaultCustomDataXml); - registerColumns(name, psUpdateCount, value, /* hex, */byteOffset, msb, lsb, bitSize, elementType); - } - - @Override - public IXViewerCustomizations getXViewerCustomizations() { - return propertyStoreCustomizations; - } - - @Override - public boolean isAdmin() { - return true; - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/navigate/MessageNavigateViewItems.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/navigate/MessageNavigateViewItems.java deleted file mode 100644 index 35562595eaa..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/navigate/MessageNavigateViewItems.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.navigate; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.osee.framework.ui.plugin.xnavigate.IXNavigateContainer; -import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem; -import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.view.MessageViewAction; -import org.eclipse.osee.ote.ui.message.watch.MessageWatchAction; - -/** - * @author Donald G. Dunne - */ -public class MessageNavigateViewItems implements IXNavigateContainer { - - @Override - public List<XNavigateItem> getNavigateItems() { - List<XNavigateItem> items = new ArrayList<XNavigateItem>(); - items.add(new XNavigateItemAction(null, new MessageViewAction(), OteMessageImage.GLASSES, false)); - items.add(new XNavigateItemAction(null, new MessageWatchAction(), OteMessageImage.BINOCULARS, false)); - return items; - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/AbstractTreeNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/AbstractTreeNode.java deleted file mode 100644 index 6bf50f8a5c9..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/AbstractTreeNode.java +++ /dev/null @@ -1,208 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.Collection; -import java.util.Collections; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.swt.graphics.Image; - -public abstract class AbstractTreeNode { - private String treeViewName = "treeViewName"; - private AbstractTreeNode parent; - private Image image; - private int level; - private boolean enabled = true; - private volatile boolean isSelected = false; - private volatile boolean isDisposed = false; - private boolean hasMappingToCurrentMemType = true; - private String disabledReason = ""; - - private boolean isChecked = false; - - public AbstractTreeNode(final String treeViewName) { - this(treeViewName, null); - } - - /** - * constructs the node and adds this node to the parent - */ - public AbstractTreeNode(final String treeViewName, final Image image) { - this.treeViewName = treeViewName; - this.image = image; - } - - protected void setParent(AbstractTreeNode parent) { - this.parent = parent; - } - - protected void setImage(Image image) { - this.image = image; - } - - /** - * sets the level or depth of this node. Usually the root is level 0. The level policy is up to the implementation - */ - protected void setLevel(final int level) { - this.level = level; - } - - /** - * @return Returns the isDisposed. - */ - public boolean isDisposed() { - return isDisposed; - } - - /** - * destroys the node. Must be called by the parent that wants to remove the child - * - * @param isDisposed The isDisposed to set. - */ - protected void dispose() { - removeAll(); - this.isDisposed = true; - } - - /** - * gets the name of this node as it would appear in a tree view - * - * @return Returns tree view name string. - */ - public String getName() { - return treeViewName; - } - - abstract String getLabel(); - - /** - * Returns the parent name and this node's name seperated by a dot. If the parent of this node is null then it will - * return exactly the same as {@link #treeViewName}. - * - * @return Returns qualified name string. exactly the same as {@link #getName()}. - */ - public String getQualifiedName() { - if (parent != null) { - return parent.treeViewName + '.' + treeViewName; - } else { - return treeViewName; - } - } - - /** - * gets the level of this node. Level represents the number of descendants this node has. Root has a level of zero - * - * @return Returns level value. - */ - public int getLevel() { - return level; - } - - /** - * Gets the parent node of this node - * - * @return the parent node or null if no parent exist for this node - */ - public AbstractTreeNode getParent() { - return parent; - } - - /** - * returns an image that can be displayed - * - * @return Returns image object reference. - */ - public Image getImage(XViewerColumn columns) { - return image; - } - - abstract public void deleteChildren(Collection<AbstractTreeNode> children); - - abstract public void removeAll(); - - abstract public boolean hasChildren(); - - abstract public Collection<? extends AbstractTreeNode> getChildren(); - - public void delete() { - if (getParent() != null) { - getParent().deleteChildren(Collections.singleton(this)); - } - } - - public abstract boolean canSetValue(); - - /** - * Sets the flag determining whether the node can be edited or displays anything in the right-click pop-up menu. For - * right now this will only apply to non-mapping elements which exist solely in pub/sub and not in other physical - * types. - * - * @param hasAMapping true if node should be able to be edited. - */ - public void setHasMappingToCurrentMemType(boolean hasAMapping) { - this.hasMappingToCurrentMemType = hasAMapping; - } - - public boolean hasMappingToCurrentMemType() { - return this.hasMappingToCurrentMemType; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public boolean isEnabled() { - return enabled; - } - - public boolean isSelected() { - return isSelected; - } - - public void setSelected(final boolean selected) { - isSelected = selected; - } - - public abstract <T> T visit(INodeVisitor<T> visitor); - - // public List<Object> getElementPath() { - // return elementPath; - // } - - // public void addToPath(Object obj) { - // elementPath.add(obj); - // } - - public String getLabel(XViewerColumn columns) { - return ""; - } - - public Image getImage() { - return image; - } - - public String getDisabledReason() { - return disabledReason; - } - - public void setDisabledReason(String disabledReason) { - this.disabledReason = disabledReason; - } - - public boolean isChecked() { - return isChecked; - } - - public void setChecked(boolean checked) { - this.isChecked = checked; - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/ElementNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/ElementNode.java deleted file mode 100644 index 0ea2c49f8f2..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/ElementNode.java +++ /dev/null @@ -1,244 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.OverlayImage; -import org.eclipse.osee.framework.ui.swt.OverlayImage.Location; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.messageXViewer.MessageXViewerFactory; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.osee.ote.ui.message.watch.recording.IElementPath; -import org.eclipse.swt.graphics.Image; - -/** - * Represents an {@link org.eclipse.osee.ote.message.elements.Element} of a {@link org.eclipse.osee.ote.message.Message} - * in a tree view - * - * @author Ken J. Aguilar - */ -public class ElementNode extends AbstractTreeNode implements IElementPath { - - private final ElementPath messageElementPath; - - private final Map<String, ElementNode> pathToElementNode = new HashMap<String, ElementNode>(); - - private static final Image normalImg = ImageManager.getImage(OteMessageImage.PIPE); - private static final Image errorImg = - new OverlayImage(normalImg, ImageDescriptor.createFromImage(ImageManager.getImage(OteMessageImage.ERROR_SM)), - Location.BOT_RIGHT).createImage(); - private MessageNode messageNode; - - /** - * Convience Constructor - */ - public ElementNode(final ElementPath elementName) { - super(elementName.get(elementName.size() - 1).toString(), normalImg); - this.messageElementPath = elementName; - } - - public void addChild(ElementNode node) { - if (getParent() == null) { - throw new IllegalStateException("parent not set"); - } - ElementNode elementNode = node; - pathToElementNode.put(elementNode.getElementPath().asString(), elementNode); - node.setParent(this); - } - - protected void setParent(MessageNode node) { - messageNode = node; - super.setParent(node); - } - - protected void setParent(ElementNode node) { - messageNode = node.messageNode; - super.setParent(node); - } - - public void collectDescendants(Collection<? super ElementNode> descendants) { - for (ElementNode node : pathToElementNode.values()) { - descendants.add(node); - node.collectDescendants(descendants); - } - } - - public String getMessageName() { - return getElementPath().getMessageName(); - } - - public boolean hasDescendant(ElementPath element) { - if (pathToElementNode.containsKey(element.asString())) { - return true; - } - String path = element.asString(); - for (Map.Entry<String, ElementNode> entry : pathToElementNode.entrySet()) { - if (entry.getKey().startsWith(path)) { - if (entry.getValue().hasDescendant(element)) { - return true; - } - } - } - return false; - } - - public ElementNode findDescendant(ElementPath element) { - ElementNode node = pathToElementNode.get(element.asString()); - if (node == null) { - String path = element.asString(); - for (Map.Entry<String, ElementNode> entry : pathToElementNode.entrySet()) { - if (path.startsWith(entry.getKey())) { - node = entry.getValue().findDescendant(element); - if (node != null) { - return node; - } - } - } - } - return node; - } - - /** - * gets the name of the element that this tree node represents - * - * @return Returns element name string. - */ - public String getElementName() { - return getElementPath().getElementName(); - } - - @Override - public String getName() { - return getElementName(); - } - - public MessageNode getMessageNode() { - return messageNode; - } - - @Override - public boolean canSetValue() { - return true; - } - - @Override - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - setImage(enabled ? normalImg : errorImg); - } - - @Override - public void setHasMappingToCurrentMemType(boolean isEditable) { - super.setHasMappingToCurrentMemType(isEditable); - setImage(isEditable ? normalImg : errorImg); - } - - @Override - public String getLabel() { - return getName(); - } - - @Override - public <T> T visit(INodeVisitor<T> visitor) { - return visitor.elementNode(this); - } - - @Override - public Image getImage(XViewerColumn column) { - if (column == null) { - return null; - } - if (column.equals(MessageXViewerFactory.name)) { - return getImage(); - } - return null; - } - - @Override - public Image getImage() { - if (hasMappingToCurrentMemType() && isEnabled()) { - return ElementNode.normalImg; - } else { - return ElementNode.errorImg; - } - } - - @Override - public String getLabel(XViewerColumn columns) { - if (columns == null) { - return ""; - } - if (columns.equals(MessageXViewerFactory.name)) { - return getElementName(); - } - if (columns.equals(MessageXViewerFactory.value)) { - return ""; - } - // Object obj = get(columns); - return ""; // obj == null ? "" : get(columns).toString(); - } - - @Override - public ElementPath getElementPath() { - return messageElementPath; - } - - public List<ElementNode> getAllChildren() { - List<ElementNode> allChildren = new ArrayList<ElementNode>(); - for (AbstractTreeNode node : getChildren()) { - getChildren(node, allChildren); - } - return allChildren; - } - - private void getChildren(AbstractTreeNode node, List<ElementNode> children) { - if (node instanceof ElementNode) { - children.add((ElementNode) node); - } - for (AbstractTreeNode child : node.getChildren()) { - getChildren(child, children); - } - } - - @Override - public Collection<ElementNode> getChildren() { - return pathToElementNode.values(); - } - - @Override - public boolean hasChildren() { - return !pathToElementNode.isEmpty(); - } - - @Override - public void removeAll() { - for (AbstractTreeNode child : pathToElementNode.values()) { - child.dispose(); - } - pathToElementNode.clear(); - } - - @Override - public void deleteChildren(Collection<AbstractTreeNode> children) { - for (AbstractTreeNode child : children) { - pathToElementNode.remove(((ElementNode) child).getElementPath().asString()); - child.dispose(); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/HeaderElementNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/HeaderElementNode.java deleted file mode 100644 index 553c0f8fc60..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/HeaderElementNode.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; - -/** - * @author Ken J. Aguilar - */ -public class HeaderElementNode extends ElementNode { - - private final Element headerElement; - - public HeaderElementNode(Element headerElement) { - super(new ElementPath(true, headerElement.getElementPath())); - this.headerElement = headerElement; - } - - public int getByteOffset() { - return headerElement.getByteOffset(); - } - - public int getMsb() { - return headerElement.getMsb(); - } - - public int getLsb() { - return headerElement.getLsb(); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/INodeVisitor.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/INodeVisitor.java deleted file mode 100644 index 935662410cf..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/INodeVisitor.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -public interface INodeVisitor<T> { - - T messageNode(MessageNode node); - - T elementNode(ElementNode node); - - T rootNode(RootNode node); -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageContentProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageContentProvider.java deleted file mode 100644 index 4ba245fd9b5..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageContentProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; - -public class MessageContentProvider implements ITreeContentProvider { - private Viewer viewer; - private RootNode rootInput = null; - - @Override - public Object[] getChildren(Object parentElement) { - assert parentElement instanceof AbstractTreeNode; - return ((AbstractTreeNode) parentElement).getChildren().toArray(); - } - - @Override - public Object getParent(Object element) { - assert element instanceof AbstractTreeNode; - return ((AbstractTreeNode) element).getParent(); - } - - @Override - public boolean hasChildren(Object element) { - assert element instanceof AbstractTreeNode; - return ((AbstractTreeNode) element).hasChildren(); - } - - @Override - public Object[] getElements(Object inputElement) { - if (inputElement == null) { - return new Object[0]; - } - return getChildren(inputElement); - } - - @Override - public void dispose() { - // required to implement by IContentProvider - } - - public void clear() { - if (rootInput != null) { - rootInput.removeAll(); - if (viewer != null) { - viewer.refresh(); - } - } - } - - public void refresh() { - viewer.refresh(); - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.viewer = viewer; - if (oldInput != null) { - ((RootNode) oldInput).removeAll(); - } - rootInput = (RootNode) newInput; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageNode.java deleted file mode 100644 index 44d4c8b9b8f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageNode.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.OverlayImage; -import org.eclipse.osee.framework.ui.swt.OverlayImage.Location; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.messageXViewer.MessageXViewerFactory; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.swt.graphics.Image; - -/** - * Defines a node in a {@link org.eclipse.swt.widgets.Tree} that maintains detials on - * {@link org.eclipse.osee.ote.message.Message} for display - * - * @author Ken J. Aguilar - */ -public class MessageNode extends AbstractTreeNode { - - private final Map<String, ElementNode> pathToElementNode = new HashMap<String, ElementNode>(); - - protected static final Image normalImg = ImageManager.getImage(OteMessageImage.GEAR); - @SuppressWarnings("unused") - private static final Image wireAIUImg = ImageManager.getImage(OteMessageImage.WIRE_AIU); - protected static final Image errorImg = - new OverlayImage(normalImg, ImageDescriptor.createFromImage(ImageManager.getImage(OteMessageImage.ERROR_SM)), - Location.BOT_RIGHT).createImage(); - private final String shortenedMessageName; - private final String packageName; - private final String type; - - public MessageNode(String msgClassName, Image image) { - super(msgClassName, image); - shortenedMessageName = msgClassName.substring(msgClassName.lastIndexOf('.') + 1); - packageName = msgClassName.substring(0, msgClassName.lastIndexOf('.')); - type = packageName.substring(packageName.lastIndexOf('.') + 1); - } - - public MessageNode(String msgClassName) { - this(msgClassName, normalImg); - } - - public String getType() { - return type; - } - - public String getPackageName() { - return packageName; - } - - @Override - public boolean canSetValue() { - return false; - } - - @Override - public void setEnabled(boolean enabled) { - super.setEnabled(enabled); - if (!enabled) { - setImage(errorImg); - } - } - - @Override - String getLabel() { - return getName(); - } - - @Override - public <T> T visit(INodeVisitor<T> visitor) { - return visitor.messageNode(this); - } - - @Override - public Image getImage(XViewerColumn columns) { - if (columns == null) { - return null; - } - if (columns.equals(MessageXViewerFactory.name)) { - return getImage(); - } - return null; - } - - @Override - public String getLabel(XViewerColumn columns) { - if (columns == null) { - return ""; - } - if (columns.equals(MessageXViewerFactory.name)) { - return getName(); - } - return ""; - } - - public ElementNode findChildElement(ElementPath element) { - return pathToElementNode.get(element.asString()); - } - - public boolean hasDescendant(ElementPath element) { - if (pathToElementNode.containsKey(element.asString())) { - return true; - } - String path = element.asString(); - for (Map.Entry<String, ElementNode> entry : pathToElementNode.entrySet()) { - if (entry.getKey().startsWith(path)) { - if (entry.getValue().hasDescendant(element)) { - return true; - } - } - } - return false; - } - - public ElementNode findDescendant(ElementPath element) { - String path = element.asString(); - ElementNode node = pathToElementNode.get(path); - if (node == null) { - for (Map.Entry<String, ElementNode> entry : pathToElementNode.entrySet()) { - if (path.startsWith(entry.getKey())) { - node = entry.getValue().findDescendant(element); - if (node != null) { - return node; - } - } - } - } - return node; - } - - @Override - public String getName() { - return shortenedMessageName; - } - - public String getMessageClassName() { - return super.getName(); - } - - public void addChild(ElementNode node) { - pathToElementNode.put(node.getElementPath().asString(), node); - node.setParent(this); - } - - @Override - public Collection<ElementNode> getChildren() { - return pathToElementNode.values(); - } - - @Override - public boolean hasChildren() { - return !pathToElementNode.isEmpty(); - } - - @Override - public void removeAll() { - for (AbstractTreeNode child : pathToElementNode.values()) { - child.dispose(); - } - pathToElementNode.clear(); - } - - @Override - public void deleteChildren(Collection<AbstractTreeNode> children) { - for (AbstractTreeNode child : children) { - pathToElementNode.remove(((ElementNode) child).getElementPath().asString()); - child.dispose(); - } - } - - public void collectDescendants(Collection<? super ElementNode> descendants) { - for (ElementNode node : pathToElementNode.values()) { - descendants.add(node); - node.collectDescendants(descendants); - } - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java deleted file mode 100644 index 43935b5ea71..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.eclipse.osee.ote.message.MessageSink; - -/** - * Builds a simple tree out of messages. All nodes under the root are messages. Each node under each message is a - * message element - * - * @author Ken J. Aguilar - */ -public class MessageTreeBuilder implements MessageSink { - - private ArrayList<String> lastAddedMsgNode; - private int numElements = 0; - private int numMessages = 0; - private HashMap<String, ArrayList<String>> currentMsgs; - private Collection<Map.Entry<String, ArrayList<String>>> allMessages = new ArrayList<Map.Entry<String, ArrayList<String>>>(200000); - private final HashMap<MessageDefinitionProvider, HashMap<String, ArrayList<String>>> msgs = new HashMap<MessageDefinitionProvider, HashMap<String, ArrayList<String>>>(); - - public void clear() { - numMessages = numElements = 0; - msgs.clear(); - lastAddedMsgNode = null; - } - - @Override - public void absorbElement(final String elementName) { - if (lastAddedMsgNode == null) { - throw new IllegalStateException("no message exists for " + elementName); - } - lastAddedMsgNode.add(elementName); - numElements++; - } - - @Override - public void absorbMessage(String messageName) { - lastAddedMsgNode = new ArrayList<String>(64); - currentMsgs.put(messageName, lastAddedMsgNode); - numMessages++; - } - - @Override - public void absorbProvider(String providerName) { - // We don't care about absorbing this yet - // In the future it would be nice to have this - // information stored and related to the messages - // that are from this provider for display - // to the users - } - - public int getNumElements() { - return numElements; - } - - public int getNumMessages() { - return numMessages; - } - - public Collection<Map.Entry<String, ArrayList<String>>> getMessages() { - return allMessages; - } - - private void buildAllMsgs(){ - allMessages.clear(); - for(HashMap<String, ArrayList<String>> val:msgs.values()){ - allMessages.addAll(val.entrySet()); - } - } - - public void startProcessing(MessageDefinitionProvider provider) { - currentMsgs = new HashMap<String, ArrayList<String>>(200000); - msgs.put(provider, currentMsgs); - } - - public void stopProcessing(MessageDefinitionProvider provider) { - buildAllMsgs(); - currentMsgs = null; - } - - public void removeProvider(MessageDefinitionProvider service) { - if(msgs.remove(service) == null){ - System.out.println("didn't remove anything"); - } - buildAllMsgs(); - } - - public int getNumProviders() { - return msgs.size(); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeSorter.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeSorter.java deleted file mode 100644 index da4cf3c02c6..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageTreeSorter.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import org.eclipse.jface.viewers.ViewerSorter; - -public class MessageTreeSorter extends ViewerSorter { - - @Override - public int category(Object element) { - // TODO: we should categorize by message type (Mux, PUB SUB, WIRE, etc) - return 1; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageUpdateListener.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageUpdateListener.java deleted file mode 100644 index 343941d5875..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageUpdateListener.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.LinkedList; - -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.client.msg.core.AbstractMessageListener; -import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; -import org.eclipse.osee.ote.message.MessageSystemException; -import org.eclipse.osee.ote.message.data.MessageData; -import org.eclipse.osee.ote.message.enums.DataType; - -/** - * @author Ken J. Aguilar - */ -public class MessageUpdateListener extends AbstractMessageListener { - - private final WatchedMessageNode node; - private final TreeViewer viewer; - - private final class NodeUpdate implements Runnable { - - private final AbstractTreeNode[] nodes; - - NodeUpdate(AbstractTreeNode[] nodes) { - this.nodes = nodes; - } - - @Override - public void run() { - for (AbstractTreeNode node : nodes) { - viewer.refresh(node, true); - } - } - - }; - - public MessageUpdateListener(TreeViewer viewer, WatchedMessageNode node) { - super(node.getSubscription()); - this.viewer = viewer; - this.node = node; - } - - @Override - public void onDataAvailable(MessageData data, DataType type) throws MessageSystemException { - if (type == getSubscription().getMemType()) { - node.incrementCounter(); - } - } - - @Override - public void subscriptionActivated(IMessageSubscription subscription) { - update(node); - } - - @Override - public void subscriptionInvalidated(IMessageSubscription subscription) { - String reason = subscription.getMessageClassName() + " does not exist"; - LinkedList<AbstractTreeNode> list = new LinkedList<AbstractTreeNode>(); - list.add(node); - node.collectDescendants(list); - - for (AbstractTreeNode child : list) { - child.setEnabled(false); - child.setDisabledReason(reason); - } - update(list.toArray(new AbstractTreeNode[list.size()])); - - } - - @Override - public void subscriptionNotSupported(IMessageSubscription subscription) { - update(node); - } - - @Override - public void subscriptionResolved(IMessageSubscription subscription) { - super.subscriptionResolved(subscription); - node.setResolved(true); - node.setEnabled(true); - node.setDisabledReason(""); - update(node); - } - - @Override - public void subscriptionUnresolved(IMessageSubscription subscription) { - super.subscriptionUnresolved(subscription); - node.setResolved(false); - update(node); - subscriptionInvalidated(subscription); - } - - private void update(AbstractTreeNode[] nodes) { - Displays.ensureInDisplayThread(new NodeUpdate(nodes)); - } - - private void update(AbstractTreeNode node) { - Displays.ensureInDisplayThread(new NodeUpdate(new AbstractTreeNode[] {node})); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageViewLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageViewLabelProvider.java deleted file mode 100644 index 03e78edf46f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageViewLabelProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; - -public class MessageViewLabelProvider extends LabelProvider { - - private final INodeVisitor<String> nodeVisitor = new INodeVisitor<String>() { - - @Override - public String elementNode(ElementNode node) { - return node.getElementName(); - } - - @Override - public String messageNode(MessageNode node) { - String type = node.getPackageName(); - type = type.substring(type.lastIndexOf('.') + 1); - return String.format("%s [%s]", node.getName(), type); - } - - @Override - public String rootNode(RootNode node) { - return node.getName(); - } - - }; - - @Override - public Image getImage(Object element) { - assert element instanceof AbstractTreeNode; - final AbstractTreeNode node = (AbstractTreeNode) element; - return node.getImage(); - } - - @Override - public String getText(Object element) { - assert element instanceof AbstractTreeNode; - return ((AbstractTreeNode) element).visit(nodeVisitor); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageWatchLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageWatchLabelProvider.java deleted file mode 100644 index f759376c9b7..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/MessageWatchLabelProvider.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.nebula.widgets.xviewer.XViewerLabelProvider; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.ui.message.messageXViewer.MessageXViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; - -public class MessageWatchLabelProvider extends XViewerLabelProvider { - - public MessageWatchLabelProvider(MessageXViewer viewer) { - super(viewer); - } - - @Override - public Image getColumnImage(Object element, XViewerColumn col, int columnIndex) { - assert element instanceof AbstractTreeNode; - return ((AbstractTreeNode) element).getImage(col); - } - - @Override - public void addListener(ILabelProviderListener listener) { - } - - @Override - public void dispose() { - - } - - @Override - public boolean isLabelProperty(Object element, String property) { - return false; - } - - @Override - public void removeListener(ILabelProviderListener listener) { - } - - @Override - public String getColumnText(Object element, XViewerColumn col, int columnIndex) throws Exception { - return ((AbstractTreeNode) element).getLabel(col); - } - - @Override - public Color getForeground(Object element, XViewerColumn col, int columnIndex) { - AbstractTreeNode node = (AbstractTreeNode) element; - return node.isEnabled() ? null : Displays.getSystemColor(SWT.COLOR_RED); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/RootNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/RootNode.java deleted file mode 100644 index 78d4f6df782..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/RootNode.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.Collection; -import java.util.HashMap; - -public final class RootNode extends AbstractTreeNode { - private final HashMap<String, MessageNode> childMessages = new HashMap<String, MessageNode>(); - - public RootNode(final String name) { - this(name, 3000); - } - - public RootNode(final String name, final int defaultChildrenNum) { - super(name, null); - setLevel(0); - } - - @Override - public boolean canSetValue() { - return false; - } - - @Override - String getLabel() { - return "root"; - } - - @Override - public <T> T visit(INodeVisitor<T> visitor) { - return visitor.rootNode(this); - } - - public MessageNode getMessageByName(String message) { - return childMessages.get(message); - } - - public void addChild(MessageNode node) { - childMessages.put(node.getMessageClassName(), node); - node.setParent(this); - } - - @Override - public Collection<MessageNode> getChildren() { - return childMessages.values(); - } - - @Override - public boolean hasChildren() { - return !childMessages.isEmpty(); - } - - @Override - public void removeAll() { - for (AbstractTreeNode child : childMessages.values()) { - child.dispose(); - } - childMessages.clear(); - - } - - @Override - public void deleteChildren(Collection<AbstractTreeNode> children) { - for (AbstractTreeNode child : children) { - childMessages.remove(((MessageNode) child).getMessageClassName()); - child.dispose(); - } - } - - public static void main(String[] args) { - RootNode root = new RootNode("test root"); - String msgName1 = "osee.test.a.msg1"; - String msgName2 = "osee.test.a.msg2"; - String msgName3 = "osee.test.b.msg3"; - MessageNode msg1 = new MessageNode(msgName1); - MessageNode msg2 = new MessageNode(msgName2); - MessageNode msg3 = new MessageNode(msgName3); - root.addChild(msg1); - root.addChild(msg2); - root.addChild(msg3); - assert root.getMessageByName(msgName1) != null; - assert root.getMessageByName(msgName2) != null; - assert root.getMessageByName(msgName3) != null; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchList.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchList.java deleted file mode 100644 index 56f458ce270..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchList.java +++ /dev/null @@ -1,271 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.osee.ote.client.msg.IOteMessageService; -import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.osee.ote.ui.message.watch.ViewRefresher; -import org.eclipse.osee.ote.ui.message.watch.WatchView; - -public class WatchList implements ITreeContentProvider { - - private TreeViewer viewer; - private RootNode rootNode = null; - private IOteMessageService service = null; - private final ViewRefresher viewRefresher; - - public WatchList(WatchView view) { - viewRefresher = new ViewRefresher(this, view, 200); - } - - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof IOteMessageService) { - return getChildren(rootNode); - } - return ((AbstractTreeNode) parentElement).getChildren().toArray(); - } - - @Override - public Object getParent(Object element) { - assert element instanceof AbstractTreeNode; - return ((AbstractTreeNode) element).getParent(); - } - - @Override - public boolean hasChildren(Object element) { - assert element instanceof AbstractTreeNode; - return ((AbstractTreeNode) element).hasChildren(); - } - - @Override - public Object[] getElements(Object inputElement) { - if (inputElement == null) { - return new Object[0]; - } - return getChildren(rootNode); - } - - @Override - public void dispose() { - if (rootNode != null) { - deleteAll(); - } - rootNode = null; - viewRefresher.dispose(); - } - - public void clear() { - if (rootNode != null) { - rootNode.removeAll(); - if (viewer != null) { - viewer.refresh(); - } - } - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.viewer = (TreeViewer) viewer; - - if (newInput != null) { - rootNode = new RootNode("root"); - service = (IOteMessageService) newInput; - viewRefresher.start(); - } else { -// deleteAll(); -// rootNode = null; - service = null; - viewRefresher.stop(); - } - } - - public MessageNode createElements(String message, Collection<ElementPath> elements) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception { - boolean needToRegisterListener = false; - WatchedMessageNode messageNode = (WatchedMessageNode) rootNode.getMessageByName(message); - if (messageNode == null) { - messageNode = createMessageNode(message); - needToRegisterListener = true; - } - for (ElementPath elementPath : elements) { - if (elementPath.isValidElement() && messageNode.findChildElement(elementPath) == null) { - addChildElementPath(message, elementPath, messageNode); - } - } - if (needToRegisterListener) { - // need to register listener only after children are created. - messageNode.getSubscription().addSubscriptionListener(new MessageUpdateListener(viewer, messageNode)); - - } - return messageNode; - } - - private MessageNode addChildElementPath(String message, ElementPath elementPath, WatchedMessageNode messageNode) { - - // messageNode.addUpdateListener(nodeUpdateHandler); - if (messageNode.findChildElement(elementPath) == null) { - if (elementPath.size() > 2) {// then it's some sort of nested item - // who's parent is not the MessageNode - ElementNode parentNode = findParent(messageNode, elementPath); - if (parentNode == null) { - parentNode = createDescendants(messageNode, elementPath); - } - createElement(parentNode, elementPath); - } else { - createElement(messageNode, elementPath); - } - } else { - System.out.println("tried to add twice"); - } - return messageNode; - } - - public void deleteAll() { - if (rootNode != null) { - viewer.getTree().setRedraw(false); - rootNode.removeAll(); - viewer.getTree().setRedraw(true); - viewer.refresh(); - } - } - - public void clearUpdateCounters(IStructuredSelection selection) { - Iterator<?> iter = selection.iterator(); - while (iter.hasNext()) { - Object item = iter.next(); - if (item instanceof WatchedMessageNode) { - WatchedMessageNode node = (WatchedMessageNode) item; - node.clearUpdateCounter(); - viewer.update(node, null); - } - } - } - - public void clearAllUpdateCounters() { - if (rootNode != null && !rootNode.isDisposed()) { - for (MessageNode node : rootNode.getChildren()) { - if (node instanceof WatchedMessageNode) { - WatchedMessageNode msgNode = (WatchedMessageNode) node; - msgNode.clearUpdateCounter(); - viewer.update(msgNode, null); - } - } - } - } - - public void deleteSelection(IStructuredSelection selection) { - final HashSet<MessageNode> msgNodesToDelete = new HashSet<MessageNode>(64); - final HashSet<ElementNode> elemNodesToDelete = new HashSet<ElementNode>(64); - final INodeVisitor<Boolean> visitor = new INodeVisitor<Boolean>() { - - @Override - public Boolean elementNode(ElementNode node) { - if (!msgNodesToDelete.contains(node.getParent())) { - return elemNodesToDelete.add(node); - } - return null; - } - - @Override - public Boolean messageNode(MessageNode node) { - return msgNodesToDelete.add(node); - } - - @Override - public Boolean rootNode(RootNode node) { - return null; - } - - }; - for (Object node : selection.toArray()) { - ((AbstractTreeNode) node).visit(visitor); - } - viewer.getTree().setRedraw(false); - for (AbstractTreeNode node : msgNodesToDelete) { - node.delete(); - } - for (AbstractTreeNode node : elemNodesToDelete) { - node.delete(); - } - viewer.getTree().setRedraw(true); - viewer.refresh(); - } - - private WatchedMessageNode createMessageNode(String message) throws Exception { - IMessageSubscription subscription = service.subscribe(message); - WatchedMessageNode node = new WatchedMessageNode(subscription); - rootNode.addChild(node); - return node; - } - - private ElementNode createElement(MessageNode messageNode, ElementPath elementPath) { - return createElementCommon(messageNode, elementPath); - } - - private ElementNode createElementCommon(MessageNode messageNode, ElementPath elementPath) { - WatchedElementNode child = new WatchedElementNode(elementPath); - messageNode.addChild(child); - return child; - } - - private ElementNode createElementCommon(ElementNode parentNode, ElementPath elementPath) { - WatchedElementNode child = new WatchedElementNode(elementPath); - parentNode.addChild(child); - return child; - } - - private ElementNode findParent(MessageNode messageNode, ElementPath elementPath) { - return messageNode.findDescendant(elementPath.subElementPath(elementPath.size() - 2)); - } - - private ElementNode createDescendants(MessageNode messageNode, ElementPath elementPath) { - ElementPath subElementPath = elementPath.subElementPath(1); - ElementNode elementNode = messageNode.findDescendant(subElementPath); - if (elementNode == null) { - elementNode = createElementCommon(messageNode, subElementPath); - } - ElementNode parentNode = elementNode; - for (int i = 2; i < elementPath.size() - 1; i++) { - subElementPath = elementPath.subElementPath(i); - elementNode = messageNode.findDescendant(subElementPath); - if (elementNode == null) { - elementNode = createElementCommon(parentNode, subElementPath); - } - parentNode = elementNode; - } - return elementNode; - } - - private ElementNode createElement(ElementNode parentNode, ElementPath elementPath) { - return createElementCommon(parentNode, elementPath); - } - - public WatchedMessageNode getMessageNode(String msgClassName) { - return (WatchedMessageNode) rootNode.getMessageByName(msgClassName); - } - - public Collection<MessageNode> getMessages() { - if (rootNode == null || rootNode.isDisposed()) { - return Collections.emptyList(); - } - return rootNode.getChildren(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchedElementNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchedElementNode.java deleted file mode 100644 index 6ab6e02f4ac..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchedElementNode.java +++ /dev/null @@ -1,173 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.util.Collection; -import java.util.HashMap; - -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.data.MessageData; -import org.eclipse.osee.ote.message.elements.DiscreteElement; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.elements.NumericElement; -import org.eclipse.osee.ote.message.elements.RecordMap; -import org.eclipse.osee.ote.ui.message.messageXViewer.MessageXViewerFactory; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; - -/** - * @author Ken J. Aguilar - */ -public class WatchedElementNode extends ElementNode { - - private Object value = "???"; - - private final HashMap<XViewerColumn, Object> columnValues = new HashMap<XViewerColumn, Object>(); - private Element element; - - public WatchedElementNode(ElementPath elementName) { - super(elementName); - } - - @Override - public String getLabel(XViewerColumn columns) { - if (columns == null) { - return ""; - } - if (columns.equals(MessageXViewerFactory.name)) { - return getElementName(); - } - if (columns.equals(MessageXViewerFactory.value)) { - return value.toString(); - } - Object obj = columnValues.get(columns); - return obj == null ? "" : obj.toString(); - } - - public String getHex() { - if (element != null && element instanceof NumericElement<?>) { - NumericElement<?> e = (NumericElement<?>) element; - return String.format("%08X", e.getNumericBitValue()); - } - return "--"; - } - - public IMessageSubscription getSubscription() { - return ((WatchedMessageNode) getMessageNode()).getSubscription(); - } - - public Integer getByteOffset() { - Object obj = columnValues.get(MessageXViewerFactory.byteOffset); - if (obj != null) { - return (Integer) obj; - } - return null; - } - - public Integer getMsb() { - Object obj = columnValues.get(MessageXViewerFactory.msb); - if (obj != null) { - return (Integer) obj; - } - return null; - } - - public Integer getLsb() { - Object obj = columnValues.get(MessageXViewerFactory.lsb); - if (obj != null) { - return (Integer) obj; - } - return null; - } - - public void setResolved(boolean isResolved) { - if (isResolved) { - Message<?, ?, ?> message = getSubscription().getMessage(); - element = message.getElement(getElementPath().getElementPath(), getSubscription().getMemType()); - setEnabled(true); - setDisabledReason(""); - if (element == null) { - columnValues.clear(); - value = "???"; - setEnabled(false); - setDisabledReason("could not find the element " + getElementPath().getElementName()); - return; - } - if (element.isNonMappingElement()) { - columnValues.clear(); - value = "???"; - setEnabled(false); - setDisabledReason("this element does not map in " + getSubscription().getMemType()); - return; - } - columnValues.put(MessageXViewerFactory.lsb, Integer.valueOf(element.getLsb())); - columnValues.put(MessageXViewerFactory.msb, Integer.valueOf(element.getMsb())); - columnValues.put(MessageXViewerFactory.bitSize, Integer.valueOf(element.getBitLength())); - if (element instanceof DiscreteElement<?>) { - value = ((DiscreteElement<?>) element).getValue(); - columnValues.put(MessageXViewerFactory.byteOffset, Integer.valueOf(element.getByteOffset())); - } else if (element instanceof RecordMap<?>) { - value = ""; - columnValues.put(MessageXViewerFactory.byteOffset, - Integer.valueOf(((RecordMap<?>) element).get(0).getByteOffset())); - } else { - value = ""; - columnValues.put(MessageXViewerFactory.byteOffset, Integer.valueOf(element.getByteOffset())); - } - } else { - columnValues.clear(); - value = "???"; - element = null; - } - for (ElementNode child : getChildren()) { - ((WatchedElementNode) child).setResolved(isResolved); - } - } - - public void determineDeltas(Collection<AbstractTreeNode> deltas) { - if (!isEnabled() || element == null) { - return; - } - - if (element instanceof DiscreteElement<?>) { - MessageData data = element.getMessage().getActiveDataSource(); - int headerSize = data.getMsgHeader() == null ? 0 : data.getMsgHeader().getHeaderSize(); - if (element.getByteOffset() >= data.getCurrentLength() - headerSize) { - value = "???"; - deltas.add(this); - } else { - DiscreteElement<?> discrete = (DiscreteElement<?>) element; - Object newValue = discrete.getValue(); - if (!newValue.equals(value)) { - value = newValue; - deltas.add(this); - } - } - } - for (ElementNode node : getChildren()) { - ((WatchedElementNode) node).determineDeltas(deltas); - } - } - - @Override - protected void setParent(MessageNode node) { - super.setParent(node); - setResolved(getSubscription().isResolved()); - } - - @Override - protected void setParent(ElementNode node) { - super.setParent(node); - setResolved(getSubscription().isResolved()); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchedMessageNode.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchedMessageNode.java deleted file mode 100644 index 4e759fb43a3..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/tree/WatchedMessageNode.java +++ /dev/null @@ -1,196 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.tree; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.atomic.AtomicLong; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.nebula.widgets.xviewer.XViewerColumn; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.OverlayImage; -import org.eclipse.osee.framework.ui.swt.OverlayImage.Location; -import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.message.enums.DataType; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.messageXViewer.MessageXViewerFactory; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.swt.graphics.Image; - -/** - * @author Ken J. Aguilar - */ -public class WatchedMessageNode extends MessageNode { - - private static final Image readerImg = - new OverlayImage(MessageNode.normalImg, - ImageDescriptor.createFromImage(ImageManager.getImage(OteMessageImage.MSG_READ_IMG)), Location.BOT_RIGHT).createImage(); - private static final Image writerImg = - new OverlayImage(MessageNode.normalImg, - ImageDescriptor.createFromImage(ImageManager.getImage(OteMessageImage.MSG_WRITE_IMG)), Location.BOT_RIGHT).createImage(); - private final RecordingState recordingState = new RecordingState(); - private final IMessageSubscription subscription; - private final AtomicLong numUpdates = new AtomicLong(0); - private long lastUpdateNumber = 0; - - public WatchedMessageNode(IMessageSubscription subscription) { - super(subscription.getMessageClassName()); - this.subscription = subscription; - } - - public IMessageSubscription getSubscription() { - return subscription; - } - - public RecordingState getRecordingState() { - return this.recordingState; - } - - public MessageRecordDetails createRecordingDetails() { - return null; - } - - public DataType getMemType() { - return subscription.getMemType(); - } - - public void determineDeltas(Collection<AbstractTreeNode> deltas) { - if (!isEnabled()) { - return; - } - long currentUpdate = numUpdates.get(); - if (currentUpdate != lastUpdateNumber) { - deltas.add(this); - for (ElementNode node : getChildren()) { - ((WatchedElementNode) node).determineDeltas(deltas); - } - lastUpdateNumber = currentUpdate; - } - } - - public void incrementCounter() { - numUpdates.incrementAndGet(); - } - - public void clearUpdateCounter() { - numUpdates.set(0); - } - - public void setResolved(boolean isResolved) { - for (ElementNode child : getChildren()) { - WatchedElementNode elementNode = (WatchedElementNode) child; - elementNode.setResolved(isResolved); - } - } - - @Override - public String getLabel(XViewerColumn columns) { - if (columns == null) { - return ""; - } - if (columns.equals(MessageXViewerFactory.name)) { - return getName(); - } - if (columns.equals(MessageXViewerFactory.psUpdateCount)) { - return numUpdates.toString(); - } - return ""; - } - - public class RecordingState { - private final List<ElementPath> headerElements = new ArrayList<ElementPath>(); - private final List<ElementPath> bodyElements = new ArrayList<ElementPath>(); - private boolean headerDump = false; - private boolean bodyDump = false; - - public void reset() { - headerElements.clear(); - bodyElements.clear(); - headerDump = false; - bodyDump = false; - } - - public void setHeaderDump(boolean header) { - headerDump = header; - } - - public void setBodyDump(boolean body) { - bodyDump = body; - } - - public void addHeader(ElementPath path) { - headerElements.add(path); - } - - public void addBody(ElementPath path) { - bodyElements.add(path); - } - - public boolean getBodyDump() { - return bodyDump; - } - - public boolean getHeaderDump() { - return headerDump; - } - - public List<ElementPath> getHeaderElements() { - return headerElements; - } - - public List<ElementPath> getBodyElements() { - return bodyElements; - } - - public void write(OutputStreamWriter writer) throws IOException { - if (bodyDump) { - writer.write(String.format("#rec#,%s,bodyHex,true", getMessageClassName())); - writer.write("\n"); - } - if (headerDump) { - writer.write(String.format("#rec#,%s,headerHex,true", getMessageClassName())); - writer.write("\n"); - } - for (ElementPath path : headerElements) { - writer.write(String.format("#rec#,%s,header,%s", getMessageClassName(), path.asString())); - writer.write("\n"); - } - for (ElementPath path : bodyElements) { - writer.write(String.format("#rec#,%s,body,%s", getMessageClassName(), path.asString())); - writer.write("\n"); - } - } - } - - @Override - protected void dispose() { - subscription.cancel(); - super.dispose(); - } - - @Override - public Image getImage() { - if (!isEnabled()) { - return MessageNode.errorImg; - } - switch (getSubscription().getMessageMode()) { - case READER: - return readerImg; - case WRITER: - return writerImg; - } - return MessageNode.normalImg; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageDefinitionProviderTracker.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageDefinitionProviderTracker.java deleted file mode 100644 index 0252abc86d3..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageDefinitionProviderTracker.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.osee.ote.ui.message.view; - -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -class MessageDefinitionProviderTracker extends ServiceTracker<MessageDefinitionProvider, MessageDefinitionProvider> { - - private final MessageView view; - - public MessageDefinitionProviderTracker(BundleContext context, MessageView view){ - super(context, MessageDefinitionProvider.class.getName(), null); - this.view = view; - } - - @Override - public MessageDefinitionProvider addingService(ServiceReference<MessageDefinitionProvider> reference) { - MessageDefinitionProvider provider = super.addingService(reference); - view.addMessageDefinitionProvider(provider); - return provider; - } - - @Override - public void removedService(ServiceReference<MessageDefinitionProvider> reference, MessageDefinitionProvider service) { - view.removeMessageDefinitionProvider(service); - super.removedService(reference, service); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java deleted file mode 100644 index 471c6a2c276..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageView.java +++ /dev/null @@ -1,588 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.view; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.Map; -import java.util.logging.Level; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.plugin.util.HelpUtil; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.Widgets; -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.eclipse.osee.ote.message.MessageProviderVersion; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.osee.ote.ui.message.tree.AbstractTreeNode; -import org.eclipse.osee.ote.ui.message.tree.ElementNode; -import org.eclipse.osee.ote.ui.message.tree.MessageContentProvider; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.MessageTreeBuilder; -import org.eclipse.osee.ote.ui.message.tree.MessageTreeSorter; -import org.eclipse.osee.ote.ui.message.tree.MessageViewLabelProvider; -import org.eclipse.osee.ote.ui.message.tree.RootNode; -import org.eclipse.osee.ote.ui.message.watch.AddWatchParameter; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.osee.ote.ui.message.watch.WatchView; -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.SelectionListener; -import org.eclipse.swt.events.TraverseEvent; -import org.eclipse.swt.events.TraverseListener; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.events.VerifyListener; -import org.eclipse.swt.graphics.Color; -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.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.ViewPart; -import org.osgi.framework.FrameworkUtil; - -public class MessageView extends ViewPart { - protected TreeViewer treeViewer; - protected Text searchText; - protected MessageViewLabelProvider labelProvider; - - protected Action expandAction, collapseAction, refreshAction, filterByName, bugAction; - protected ViewerSorter nameSorter; - public static final String VIEW_ID = "org.eclipse.osee.ote.ui.message.view.MessageView"; - private Label startLabel; - private Composite parentComposite; - private Button searchButton; - private int numMessages = 0; - private int numElements = 0; - private MessageTreeBuilder treeBuilder; - - private MessageDefinitionProviderTracker tracker; - private MessageProviderVersion messageProviderVersion; - - - public MessageView() { - super(); - messageProviderVersion = new MessageProviderVersion(); - } - - @Override - public void createPartControl(Composite parent) { - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.verticalSpacing = 0; - layout.marginWidth = 0; - layout.marginHeight = 0; - parent.setLayout(layout); - parentComposite = new Composite(parent, SWT.NONE); - GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); - parentComposite.setLayoutData(layoutData); - Widgets.setFormLayout(parentComposite, 5, 5); - - startLabel = new Label(parentComposite, SWT.LEFT); - Widgets.attachToParent(startLabel, SWT.TOP, 0, 0); - Widgets.attachToParent(startLabel, SWT.LEFT, 0, 0); - Widgets.attachToParent(startLabel, SWT.RIGHT, 50, 0); - - // Create the tree treeViewer as a child of the composite parent - treeViewer = new TreeViewer(parentComposite); - treeViewer.setContentProvider(new MessageContentProvider()); - labelProvider = new MessageViewLabelProvider(); - treeViewer.setLabelProvider(labelProvider); - final Tree tree = treeViewer.getTree(); - Widgets.attachToControl(tree, startLabel, SWT.TOP, SWT.BOTTOM, 5); - Widgets.attachToParent(tree, SWT.BOTTOM, 100, -50); - Widgets.attachToParent(tree, SWT.LEFT, 0, 0); - Widgets.attachToParent(tree, SWT.RIGHT, 100, 0); - treeViewer.setUseHashlookup(true); - // tree.setMenu(getPopupMenu(parent)); - tree.addMouseListener(new MouseAdapter() { - - @Override - public void mouseDown(MouseEvent e) { - if (e.button == 3) { - Point p = new Point(e.x, e.y); - final Menu contextMenu = getPopupMenu(tree.getParent()); - if (contextMenu != null) { - p = tree.toDisplay(p); - contextMenu.setLocation(p); - contextMenu.setVisible(true); - - // TODO: Change to use OteHelpContext - HelpUtil.setHelp(contextMenu, "message_view_watch", "org.eclipse.osee.ote.help.ui"); - } - } - } - - }); - treeBuilder = new MessageTreeBuilder(); - /* - * Create a text field to be used for filtering the elements displayed by the tree treeViewer - */ - Group grp = new Group(parentComposite, SWT.NONE); - Widgets.attachToControl(grp, tree, SWT.TOP, SWT.BOTTOM, 5); - Widgets.attachToParent(grp, SWT.LEFT, 0, 0); - Widgets.attachToParent(grp, SWT.RIGHT, 100, 0); - layout = new GridLayout(); - layout.numColumns = 3; - grp.setLayout(layout); - Label l = new Label(grp, SWT.NULL); - l.setText("Search:"); - l.setToolTipText("Enter a regular expression filter.\nEnter space to see all."); - - searchText = new Text(grp, SWT.SINGLE | SWT.BORDER); - searchText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - searchText.addTraverseListener(new TraverseListener() { - - @Override - public void keyTraversed(TraverseEvent event) { - if (event.detail == SWT.TRAVERSE_RETURN) { - search(searchText.getText()); - } - } - - }); - - searchText.addVerifyListener(new VerifyListener() { - @Override - public void verifyText(VerifyEvent e) { - e.text = e.text.toUpperCase(); - } - }); - - searchButton = new Button(grp, SWT.PUSH); - searchButton.setText("Go"); - searchButton.addSelectionListener(new SelectionListener() { - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - @Override - public void widgetSelected(SelectionEvent e) { - search(searchText.getText()); - } - }); - - // Create menu, toolbars, filters, sorters. - createFiltersAndSorters(); - createActions(); - createMenus(); - createToolbar(); - - treeViewer.setSorter(nameSorter); - treeViewer.expandToLevel(0); - - RootNode root = new RootNode("empty"); - /* - * instantiate dummy nodes since the first time these classes are instantiated must be from a UI thread. - */ - MessageNode msgNode = new MessageNode("osee.test.msg.pubsub.DUMMY_MSG", null); - ElementPath obj = new ElementPath(); - obj.add("DUMMY"); - ElementNode node = new ElementNode(obj); - msgNode.addChild(node); - treeViewer.setInput(root); - setHelpContexts(); - setLibraryUnloadedState(); - tracker = new MessageDefinitionProviderTracker(FrameworkUtil.getBundle(getClass()).getBundleContext(), this); - tracker.open(true); - } - - private void setHelpContexts() { - // TODO: Change to use OteHelpContext - HelpUtil.setHelp(parentComposite.getParent(), "message_view", "org.eclipse.osee.ote.help.ui"); - HelpUtil.setHelp(searchButton, "message_view_search", "org.eclipse.osee.ote.help.ui"); - HelpUtil.setHelp(searchText, "message_view_search", "org.eclipse.osee.ote.help.ui"); - } - - /** - * sets the filter for searches - */ - private void search(final String searchPattern) { - final Color bgColor = treeViewer.getTree().getBackground(); - treeViewer.getTree().setBackground(Displays.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); - searchText.setEnabled(false); - searchButton.setEnabled(false); - final Job searchJob = new Job("Searching Message.jar") { - - @Override - public IStatus run(IProgressMonitor monitor) { - monitor.beginTask("searching jar", numElements); - try { - String searchTxt = searchPattern; - if (searchPattern.equals("")) { - searchTxt = ".*"; - } - try { - final Pattern pattern = Pattern.compile(searchTxt); - final Collection<Map.Entry<String, ArrayList<String>>> map = treeBuilder.getMessages(); - if (map.size() > 0) { - final RootNode root = new RootNode("root"); - for (Map.Entry<String, ArrayList<String>> entry : map) { - final String name = entry.getKey().substring(entry.getKey().lastIndexOf('.') + 1); - final Matcher matcher = pattern.matcher(name); - - if (matcher.matches()) { - MessageNode msgNode = new MessageNode(entry.getKey()); - root.addChild(msgNode); - for (String elementName : entry.getValue()) { - ElementPath obj = new ElementPath(msgNode.getMessageClassName(), elementName); - ElementNode node = new ElementNode(obj); - msgNode.addChild(node); - } - } else { - LinkedList<String> matches = new LinkedList<String>(); - for (String elementName : entry.getValue()) { - if (pattern.matcher(elementName).matches()) { - matches.add(elementName); - } - } - if (!matches.isEmpty()) { - MessageNode msgNode = new MessageNode(entry.getKey()); - root.addChild(msgNode); - for (String elementName : matches) { - ElementPath obj = new ElementPath(msgNode.getMessageClassName(), elementName); - ElementNode node = new ElementNode(obj); - msgNode.addChild(node); - } - } - } - monitor.worked(entry.getValue().size()); - } - - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - - treeViewer.setInput(root); - if (!root.hasChildren()) { - MessageDialog.openError(Displays.getActiveShell(), "Search", - "No matches found for pattern " + searchPattern); - } - } - - }); - } else { - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - MessageDialog.openError(Displays.getActiveShell(), "Search", - "There are no messages available for searching"); - } - }); - } - } catch (final PatternSyntaxException e) { - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - MessageDialog.openError(Displays.getActiveShell(), "Search Error", e.getMessage()); - - } - }); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "", null); - } - return new Status(IStatus.OK, Activator.PLUGIN_ID, IStatus.OK, "", null); - } catch (Throwable t) { - OseeLog.log(Activator.class, Level.SEVERE, "exception during search operation", t); - return new Status(IStatus.CANCEL, Activator.PLUGIN_ID, IStatus.CANCEL, "", t); - } finally { - monitor.done(); - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - treeViewer.getTree().setBackground(bgColor); - searchText.setEnabled(true); - searchButton.setEnabled(true); - } - }); - } - } - - }; - searchJob.setUser(true); - searchJob.schedule(); - } - - private Menu getPopupMenu(final Composite composite) { - final IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection(); - final AbstractTreeNode node = (AbstractTreeNode) selection.getFirstElement(); - final Menu previewMenu = new Menu(composite); - - // if there's nothing selected in the tree, no need to display a menu. - if (node == null) { - return null; - } - - MenuItem item = new MenuItem(previewMenu, SWT.CASCADE); - item.setText("Watch"); - item.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - try { - final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - WatchView watchView = (WatchView) page.findView(WatchView.VIEW_ID); - if (watchView == null) { - watchView = launchMessageWatch(page); - } - if (watchView != null) { - final Iterator<?> iter = selection.iterator(); - AddWatchParameter addWatchParam = new AddWatchParameter(); - while (iter.hasNext()) { - final AbstractTreeNode node = (AbstractTreeNode) iter.next(); - if (node instanceof MessageNode) { - addWatchParam.addMessage(((MessageNode) node).getMessageClassName()); - } else if (node instanceof ElementNode) { - addWatchParam.addMessage(((ElementNode) node).getElementPath().getMessageName(), - ((ElementNode) node).getElementPath()); - } - } - watchView.addWatchMessage(addWatchParam); - watchView.refresh(); - } - } catch (RuntimeException ex) { - OseeLog.log(Activator.class, Level.SEVERE, "exception during attempt to watch", ex); - } - } - }); - - if (node instanceof MessageNode) { - item = new MenuItem(previewMenu, SWT.CASCADE); - item.setText("Watch All"); - item.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - try { - final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - WatchView watchView = (WatchView) page.findView(WatchView.VIEW_ID); - if (watchView == null) { - watchView = launchMessageWatch(page); - } - if (watchView != null) { - final Iterator<?> iter = selection.iterator(); - final RootNode root = (RootNode) treeViewer.getInput(); - AddWatchParameter parameter = new AddWatchParameter(); - while (iter.hasNext()) { - final AbstractTreeNode node = (AbstractTreeNode) iter.next(); - if (node.getParent() == root) { - if (node instanceof MessageNode) { - parameter.addMessage(((MessageNode) node).getMessageClassName()); - for (AbstractTreeNode child : node.getChildren()) { - ElementPath obj = - new ElementPath(((MessageNode) node).getMessageClassName(), child.getName()); - parameter.addMessage(((MessageNode) node).getMessageClassName(), obj); - } - } - } else { - MessageNode parent = (MessageNode) node.getParent(); - if (!parameter.containsMessage(parent.getName())) { - for (int index = 0; index < parent.getChildren().size(); index++) { - ElementPath obj = new ElementPath(parent.getMessageClassName(), node.getName()); - parameter.addMessage(parent.getMessageClassName(), obj); - } - } - } - } - - watchView.addWatchMessage(parameter); - watchView.refresh(); - } - } catch (RuntimeException ex) { - OseeLog.log(Activator.class, Level.SEVERE, "Exception during attempt to watch all", ex); - } - } - }); - } - - return previewMenu; - } - - private WatchView launchMessageWatch(IWorkbenchPage page) { - WatchView watchView = null; - try { - watchView = (WatchView) page.showView(WatchView.VIEW_ID); - } catch (PartInitException e1) { - MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Launch Error", - "Couldn't Launch MsgWatch " + e1.getMessage()); - return null; - } - return watchView; - } - - protected void createFiltersAndSorters() { - nameSorter = new MessageTreeSorter(); - } - - protected void createActions() { - final TreeViewer ftv = treeViewer; - expandAction = new Action("Expand All") { - - @Override - public void run() { - treeViewer.getTree().setRedraw(false); - ftv.expandAll(); - treeViewer.getTree().setRedraw(true); - } - }; - expandAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.EXPAND_STATE)); - expandAction.setToolTipText("Expand All"); - - collapseAction = new Action("Collapse All") { - - @Override - public void run() { - treeViewer.getTree().setRedraw(false); - ftv.collapseAll(); - treeViewer.getTree().setRedraw(true); - } - }; - collapseAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.COLLAPSE_STATE)); - collapseAction.setToolTipText("Collapse All"); - - refreshAction = new Action("Reload Messages from JAR") { - - @Override - public void run() { - search(".*"); - } - }; - refreshAction.setToolTipText("Reload Messages from JAR"); - refreshAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.REFRESH)); - - } - - protected void createMenus() { - IMenuManager rootMenuManager = getViewSite().getActionBars().getMenuManager(); - rootMenuManager.setRemoveAllWhenShown(true); - rootMenuManager.addMenuListener(new IMenuListener() { - - @Override - public void menuAboutToShow(IMenuManager mgr) { - fillMenu(mgr); - } - }); - fillMenu(rootMenuManager); - } - - protected void fillMenu(IMenuManager rootMenuManager) { - rootMenuManager.add(refreshAction); - rootMenuManager.add(expandAction); - rootMenuManager.add(collapseAction); - } - - protected void createToolbar() { - IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager(); - toolbarManager.add(refreshAction); - toolbarManager.add(expandAction); - toolbarManager.add(collapseAction); - // toolbarManager.add(bugAction); - } - - /* - * @see IWorkbenchPart#setFocus() - */ - @Override - public void setFocus() { - parentComposite.setFocus(); - } - - private void setLibraryUnloadedState() { - if (treeViewer.getTree().isDisposed() || startLabel.isDisposed() || searchText.isDisposed()) { - return; - } - treeViewer.getTree().setToolTipText(""); - treeViewer.getTree().setBackground(Displays.getSystemColor(SWT.COLOR_GRAY)); - startLabel.setText("message library not detected"); - treeViewer.setInput(null); - searchText.setEnabled(false); - } - - @Override - public void dispose() { - tracker.close(); - super.dispose(); - } - - public void addMessageDefinitionProvider(final MessageDefinitionProvider provider) { - messageProviderVersion.add(provider); - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - try { - startLabel.setText("processing library..."); - treeViewer.getTree().setBackground(Displays.getSystemColor(SWT.COLOR_WHITE)); - treeBuilder.startProcessing(provider); - provider.generateMessageIndex(treeBuilder); - treeBuilder.stopProcessing(provider); - treeViewer.getTree().setToolTipText( - String.format("Providers:\n%s", messageProviderVersion.getVersion())); - searchText.setEnabled(true); - startLabel.setText("Ready for query"); - } catch (Exception e) { - OseeLog.log(Activator.class, Level.SEVERE, "Problem during message jar processing", e); - } - } - }); - } - - public void removeMessageDefinitionProvider(final MessageDefinitionProvider service) { - messageProviderVersion.remove(service); - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - try { - treeBuilder.removeProvider(service); - if(!treeViewer.getTree().isDisposed()){ - if(treeBuilder.getNumProviders() == 0){ - setLibraryUnloadedState(); - } else { - treeViewer.getTree().setToolTipText(String.format("Providers:\n%s", messageProviderVersion.getVersion())); - } - } - } catch (Exception e) { - OseeLog.log(Activator.class, Level.SEVERE, "Problem during message jar processing", e); - } - } - }); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageViewAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageViewAction.java deleted file mode 100644 index 6da658ca9e2..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/view/MessageViewAction.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.view; - -import org.eclipse.jface.action.Action; -import org.eclipse.osee.framework.ui.plugin.util.ViewPartUtil; - -/** - * @author Donald G. Dunne - */ -public class MessageViewAction extends Action { - - public MessageViewAction() { - super("Open Message View"); - } - - @Override - public void run() { - ViewPartUtil.openOrShowView(MessageView.VIEW_ID); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ActionButton.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ActionButton.java deleted file mode 100644 index b95b02af869..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ActionButton.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.action.Action; -import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable; -import org.eclipse.osee.framework.plugin.core.util.Jobs; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -/** - * @author Andrew M. Finkbeiner - */ -public class ActionButton extends SelectionAdapter implements IExceptionableRunnable { - - private final Action action; - private final String label; - private final String pluginId; - private final Button button; - - public ActionButton(Composite parent, int style, Action action, String label, String pluginId) { - this.action = action; - this.label = label; - this.pluginId = pluginId; - button = new Button(parent, style); - button.addSelectionListener(this); - button.setText(label); - } - - @Override - public void widgetSelected(SelectionEvent e) { - Jobs.runInJob(label, this, Activator.class, pluginId); - } - - @Override - public IStatus run(IProgressMonitor monitor) throws Exception { - action.run(); - return Status.OK_STATUS; - } - - public void setToolTipText(String tooltip) { - button.setToolTipText(tooltip); - } - - public void setImage(Image img) { - button.setImage(img); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/AddWatchParameter.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/AddWatchParameter.java deleted file mode 100644 index c6aaea38df8..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/AddWatchParameter.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Ken J. Aguilar - */ -public class AddWatchParameter { - private final HashMap<String, ArrayList<ElementPath>> watchMap = new HashMap<String, ArrayList<ElementPath>>(64); - - public AddWatchParameter() { - super(); - } - - public AddWatchParameter(String message) { - addMessage(message); - } - - public AddWatchParameter(String message, ElementPath element) { - addMessage(message, element); - } - - public AddWatchParameter(Map<String, ArrayList<ElementPath>> map) { - watchMap.putAll(map); - } - - public void addMessage(String name, Collection<ElementPath> elements) { - ArrayList<ElementPath> list = watchMap.get(name); - if (list == null) { - list = new ArrayList<ElementPath>(elements.size()); - watchMap.put(name, list); - } - list.addAll(elements); - } - - public void addMessageWithAllElements(String name) { - watchMap.put(name, null); - } - - public void addMessage(String name, ElementPath... elements) { - ArrayList<ElementPath> list = watchMap.get(name); - if (list == null) { - list = new ArrayList<ElementPath>(elements.length); - watchMap.put(name, list); - } - for (ElementPath element : elements) { - list.add(element); - } - } - - public void addMessage(String name) { - ArrayList<ElementPath> list = watchMap.get(name); - if (list == null) { - list = new ArrayList<ElementPath>(); - watchMap.put(name, list); - } - } - - public void addMessage(String name, ElementPath element) { - ArrayList<ElementPath> list = watchMap.get(name); - if (list == null) { - list = new ArrayList<ElementPath>(1024); - watchMap.put(name, list); - } - list.add(element); - } - - public Collection<String> getMessages() { - return watchMap.keySet(); - } - - public Collection<ElementPath> getMessageElements(String messageNmae) { - return watchMap.get(messageNmae); - } - - public boolean containsMessage(String name) { - return watchMap.containsKey(name); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildElementNodeContentProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildElementNodeContentProvider.java deleted file mode 100644 index 14260a4860e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildElementNodeContentProvider.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.elements.RecordElement; -import org.eclipse.osee.ote.message.elements.RecordMap; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class ChildElementNodeContentProvider implements ITreeContentProvider { - private WatchedMessageNode input; - - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof RecordMap<?>) { - RecordMap<?> recordMap = (RecordMap<?>) parentElement; - List<Element> list = new ArrayList<Element>(); - for (int i = 0; i < recordMap.length(); i++) { - RecordElement element = recordMap.get(i); - if (recordHasChildrenNotListening(element)) { - list.add(element); - } - } - return list.toArray(); - } else if (parentElement instanceof RecordElement) { - RecordElement recordElement = (RecordElement) parentElement; - List<Element> list = new ArrayList<Element>(); - for (final Element element : recordElement.getElementMap().values()) { - if (!(element instanceof RecordElement)) { - if (!input.hasDescendant(new ElementPath(element.getElementPath()))) { - list.add(element); - } - } else { - if (recordHasChildrenNotListening((RecordElement) element)) { - list.add(element); - } - } - } - return list.toArray(); - } else if (parentElement instanceof Element) { - return new Object[0]; - } - return new Object[0]; - } - - private boolean recordHasChildrenNotListening(RecordElement element) { - if (element instanceof RecordMap<?>) { - RecordMap<?> recordMap = (RecordMap<?>) element; - for (int i = 0; i < recordMap.length(); i++) { - RecordElement recelement = recordMap.get(i); - if (recordHasChildrenNotListening(recelement)) { - return true; - } - } - - } else { - for (Element recelement : element.getElementMap().values()) { - if (!(recelement instanceof RecordElement)) { - if (!input.hasDescendant(new ElementPath(recelement.getElementPath()))) { - return true; - } - } else { - if (recordHasChildrenNotListening((RecordElement) recelement)) { - return true; - } - } - - } - } - return false; - } - - @Override - public Object getParent(Object element) { - return null; - } - - @Override - public boolean hasChildren(Object element) { - if (element instanceof RecordElement) { - return getChildren(element).length > 0; - } else { - return false; - } - } - - @Override - public Object[] getElements(Object inputElement) { - WatchedMessageNode data = (WatchedMessageNode) inputElement; - List<Element> list = new ArrayList<Element>(); - - Message<?, ?, ?> message = data.getSubscription().getMessage(); - for (final Element element : message.getElements()) { - if (!(element instanceof RecordElement)) { - if (data.findChildElement(new ElementPath(element.getElementPath())) == null) { - list.add(element); - } - } else { - list.add(element); - } - } - return list.toArray(); - } - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - input = (WatchedMessageNode) newInput; - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildElementNodeLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildElementNodeLabelProvider.java deleted file mode 100644 index 4f262d85d1d..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildElementNodeLabelProvider.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.elements.RecordElement; -import org.eclipse.osee.ote.message.elements.RecordMap; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.swt.graphics.Image; - -/** - * @author Andrew M. Finkbeiner - */ -public class ChildElementNodeLabelProvider extends LabelProvider { - private static final Image recordImg = ImageManager.getImage(OteMessageImage.DATABASE); - private static final Image elementImg = ImageManager.getImage(OteMessageImage.PIPE); - - @Override - public Image getImage(Object element) { - if (element instanceof RecordElement) { - return recordImg; - } else if (element instanceof Element) { - return elementImg; - } - return null; - } - - @Override - public String getText(Object element) { - if (element instanceof Element) { - if (element instanceof RecordMap<?>) { - return ((Element) element).getDescriptiveName(); - } else { - return String.format("%s: byte=%d, msb=%d, lsb=%d", ((Element) element).getDescriptiveName(), - ((Element) element).getByteOffset(), ((Element) element).getMsb(), ((Element) element).getLsb()); - } - } - return "<UNKNOWN>"; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildSelectCheckedTreeSelectionDialog.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildSelectCheckedTreeSelectionDialog.java deleted file mode 100644 index 130484af92f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ChildSelectCheckedTreeSelectionDialog.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog; - -/** - * @author Andrew M. Finkbeiner - */ -public class ChildSelectCheckedTreeSelectionDialog extends CheckedTreeSelectionDialog { - - @Override - public Object[] getResult() { - Object[] objs = super.getResult(); - return objs; - } - - private CheckboxTreeViewer viewer; - - public ChildSelectCheckedTreeSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider) { - super(parent, labelProvider, contentProvider); - } - - @Override - protected CheckboxTreeViewer createTreeViewer(Composite parent) { - viewer = super.createTreeViewer(parent); - viewer.addCheckStateListener(new ICheckStateListener() { - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - viewer.expandToLevel(event.getElement(), 1); - viewer.setSubtreeChecked(event.getElement(), event.getChecked()); - } - }); - return viewer; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java deleted file mode 100644 index aa308c76aa4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java +++ /dev/null @@ -1,382 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.lang.reflect.Constructor; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.logging.Level; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.IRegistryEventListener; -import org.eclipse.core.runtime.Platform; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.data.MessageData; -import org.eclipse.osee.ote.message.elements.ArrayElement; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.tree.AbstractTreeNode; -import org.eclipse.osee.ote.ui.message.tree.ElementNode; -import org.eclipse.osee.ote.ui.message.tree.INodeVisitor; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.RootNode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyleRange; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; -import org.osgi.framework.Bundle; - -/** - * @author Ken J. Aguilar - */ -public class DetailsBox implements IRegistryEventListener { - private static final String EXTENSION_POINT_ID = "org.eclipse.osee.ote.ui.message.detailsProvider"; - private static final String ELEMENT = "TabProvider"; - private static final String PAYLOAD_TXT = "\npayload:\n 0: "; - private static final String HEADER_TXT = "header:\n 0: "; - private static int HEX_DUMP_BYTES_PER_ROW = 16; - private static int HEX_DUMP_CHARS_PER_BYTE = 3; - - /** - * number of characters that lead each row in the hex dump, these characters represent the byte offset indicator for - * each hex row - */ - private static int HEX_DUMP_PREFIX_CHARS = 8; - private static int HEX_DUMP_NON_PREFIX_CHAR = HEX_DUMP_BYTES_PER_ROW * HEX_DUMP_CHARS_PER_BYTE; - /** - * total number of characters per hex dump row including the newline character - */ - private static int HEX_DUMP_LINE_WIDTH = HEX_DUMP_PREFIX_CHARS + HEX_DUMP_NON_PREFIX_CHAR + 1; - - private final TabFolder infoFolder; - private final TabItem hexDumpTab; - private final StyledText hexDumpTxt; - private final Font courier; - private final Image hexImg; - private final StringBuilder strBuilder = new StringBuilder(8500); - private TabItem selectedTab; - private final HashMap<String, TabItem> detailsProviderMap = new HashMap<String, TabItem>(); - - private static final String[] hexTbl = new String[256]; - - static { - for (int i = 0; i < 256; i++) { - hexTbl[i] = String.format("%02X ", i); - } - } - - public DetailsBox(Composite parent) { - hexImg = ImageManager.getImage(OteMessageImage.HEX); - courier = new Font(parent.getDisplay(), "Courier", 10, SWT.NORMAL); - /* Create Text box to display values of selected messages */ - infoFolder = new TabFolder(parent, SWT.BORDER); - - hexDumpTab = new TabItem(infoFolder, SWT.NONE); - hexDumpTab.setText("Hex Dump"); - hexDumpTab.setImage(hexImg); - hexDumpTab.setToolTipText("displays hex dump of currently selected message"); - hexDumpTxt = - new StyledText(infoFolder, SWT.DOUBLE_BUFFERED | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY); - hexDumpTxt.setFont(courier); - hexDumpTab.setControl(hexDumpTxt); - - installExtensionRegistryListener(); - - infoFolder.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - selectedTab = (TabItem) e.item; - } - }); - selectedTab = infoFolder.getItem(infoFolder.getSelectionIndex()); - } - - /** - * display details about specified node - * - * @param node node whose details will be displayed in the detail window of the GUI - */ - public void setDetailText(final AbstractTreeNode node) { - if (selectedTab == null) { - return; - } - if (selectedTab == hexDumpTab) { - renderHex(node); - } else { - DetailsProvider provider = (DetailsProvider) selectedTab.getControl(); - provider.render(node); - } - - } - - public void dispose() { - courier.dispose(); - } - - private void renderHex(AbstractTreeNode node) { - if (!node.isEnabled()) { - hexDumpTxt.setText(node.getName() + "\nDISABLED: " + node.getDisabledReason()); - return; - } - final INodeVisitor<Object> visitor = new INodeVisitor<Object>() { - @Override - public Object elementNode(final ElementNode node) { - hexDumpTxt.setStyleRange(null); - WatchedMessageNode msgNode = (WatchedMessageNode) node.getMessageNode(); - if (!msgNode.getSubscription().isResolved()) { - hexDumpTxt.setText(node.getName() + " not found in library"); - return null; - } - final Message<?, ?, ?> msg = msgNode.getSubscription().getMessage(); - if (msg.isDestroyed()) { - return null; - } - hexDumpTxt.setRedraw(false); - int payloadStart = printByteDump(msg); - - Element e = msg.getElement(node.getElementPath().getElementPath()); - if (e != null) { - if (!e.isNonMappingElement()) { - MessageData data = msg.getActiveDataSource(); - int headerSize = data.getMsgHeader() == null ? 0 : data.getMsgHeader().getHeaderSize(); - if (e.getByteOffset() >= data.getCurrentLength() - headerSize) { - hexDumpTxt.setText("element outside of current message size"); - hexDumpTxt.setRedraw(true); - return null; - } - StyleRange range = new StyleRange(); - range.background = Displays.getSystemColor(SWT.COLOR_GRAY); - range.foreground = Displays.getSystemColor(SWT.COLOR_BLACK); - int offset = e.getByteOffset() + e.getMsb() / 8; - range.length = (e.getLsb() - e.getMsb() + 8) / 8 * HEX_DUMP_CHARS_PER_BYTE - 1; - - int line = offset / HEX_DUMP_BYTES_PER_ROW * HEX_DUMP_LINE_WIDTH; - int lineIndent = offset % HEX_DUMP_BYTES_PER_ROW * HEX_DUMP_CHARS_PER_BYTE; - range.start = line + lineIndent + payloadStart; - - if(!(e instanceof ArrayElement)){ - - if (HEX_DUMP_PREFIX_CHARS + lineIndent + range.length >= HEX_DUMP_LINE_WIDTH) { - int remaing = range.length - (HEX_DUMP_LINE_WIDTH - lineIndent - 9); - StyleRange[] ranges = new StyleRange[remaing / HEX_DUMP_NON_PREFIX_CHAR + 2]; - ranges[0] = range; - range.length -= remaing; - int c = 1; - while (remaing > 0) { - StyleRange newRange = new StyleRange(); - ranges[c] = newRange; - newRange.background = range.background; - newRange.foreground = range.foreground; - newRange.start = line + c * HEX_DUMP_LINE_WIDTH + payloadStart; - newRange.length = remaing < HEX_DUMP_NON_PREFIX_CHAR ? remaing : HEX_DUMP_NON_PREFIX_CHAR; - remaing -= newRange.length; - c++; - } - try{ - hexDumpTxt.setStyleRanges(ranges); - } catch (Throwable th){ - th.printStackTrace(); - } - } else { - try{ - hexDumpTxt.setStyleRange(range); - } catch (Throwable th){ - th.printStackTrace(); - } - } - } - hexDumpTxt.setTopIndex(msg.getHeaderSize() / HEX_DUMP_BYTES_PER_ROW + offset / HEX_DUMP_BYTES_PER_ROW + 2); - hexDumpTxt.setRedraw(true); - } - } - - return node; - } - - @Override - public Object messageNode(final MessageNode node) { - WatchedMessageNode msgNode = (WatchedMessageNode) node; - final Message<?, ?, ?> msg = msgNode.getSubscription().getMessage(); - if (msg != null && !msg.isDestroyed()) { - hexDumpTxt.setRedraw(false); - printByteDump(msg); - hexDumpTxt.setStyleRange(null); - hexDumpTxt.setRedraw(true); - } - return node; - } - - @Override - public Object rootNode(RootNode node) { - return node; - } - - }; - node.visit(visitor); - } - - /** - * writes message data to a buffer in hex format - */ - private int printByteDump(Message<?, ?, ?> msg) { - strBuilder.setLength(0); - int ypos = hexDumpTxt.getTopIndex(); - int xpos = hexDumpTxt.getHorizontalIndex(); - int cursorPos = hexDumpTxt.getCaretOffset(); - final byte[] data = msg.getData(); - int columnCount = 0; - strBuilder.append(HEADER_TXT); - for (int i = 0; i < msg.getHeaderSize(); i++) { - if (columnCount == HEX_DUMP_BYTES_PER_ROW) { - strBuilder.append('\n').append(String.format("%5d: ", i)); - columnCount = 0; - } - strBuilder.append(hexTbl[data[i] & 0xFF]); - columnCount++; - } - strBuilder.append(PAYLOAD_TXT); - int payloadStart = strBuilder.length(); - columnCount = 0; - for (int i = msg.getHeaderSize(); i < msg.getHeaderSize() + msg.getPayloadSize(); i++) { - if (columnCount == HEX_DUMP_BYTES_PER_ROW) { - strBuilder.append('\n').append(String.format("%5d: ", i - msg.getHeaderSize())); - columnCount = 0; - } - strBuilder.append(hexTbl[data[i] & 0xFF]); - columnCount++; - } - strBuilder.append('\n'); - hexDumpTxt.setText(strBuilder.toString()); - hexDumpTxt.setTopIndex(ypos); - hexDumpTxt.setHorizontalIndex(xpos); - hexDumpTxt.setCaretOffset(cursorPos); - return payloadStart; - } - - private void installExtensionRegistryListener() { - IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry(); - if (extensionRegistry == null) { - throw new IllegalStateException("The extension registry is unavailable"); - } - - IExtensionPoint point = extensionRegistry.getExtensionPoint(EXTENSION_POINT_ID); - if (point == null) { - return; - } - added(point.getExtensions()); - extensionRegistry.addListener(this, EXTENSION_POINT_ID); - } - - @Override - public void added(IExtension[] extensions) { - final List<IConfigurationElement> newElements = new LinkedList<IConfigurationElement>(); - for (IExtension extension : extensions) { - for (IConfigurationElement element : extension.getConfigurationElements()) { - if (element.getName().equals(ELEMENT)) { - newElements.add(element); - } - } - } - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - for (IConfigurationElement element : newElements) { - String className = element.getAttribute("className"); - String bundleName = element.getContributor().getName(); - Bundle bundle = Platform.getBundle(bundleName); - if (bundle == null) { - OseeLog.logf(DetailsBox.class, Level.SEVERE, - "no bundle found for name %s while handling extension element %s", bundleName, element.getName()); - return; - } - try { - Class<?> clazz = bundle.loadClass(className); - Class<? extends DetailsProvider> detailsClazz = clazz.asSubclass(DetailsProvider.class); - Constructor<? extends DetailsProvider> constructor = - detailsClazz.getConstructor(Composite.class, int.class); - try { - DetailsProvider provider = constructor.newInstance(infoFolder, SWT.NONE); - TabItem newTab = new TabItem(infoFolder, SWT.NONE); - newTab.setText(provider.getTabText()); - newTab.setToolTipText(provider.getTabToolTipText()); - newTab.setControl(provider); - detailsProviderMap.put(element.getDeclaringExtension().getUniqueIdentifier(), newTab); - } catch (Exception ex) { - OseeLog.logf(DetailsBox.class, Level.SEVERE, "failed to install details provider"); - } - } catch (ClassCastException ex) { - OseeLog.logf( - DetailsBox.class, - Level.SEVERE, - "the class named %s is not a subclass of %s", className, - DetailsProvider.class.getName()); - } catch (ClassNotFoundException ex) { - OseeLog.logf(DetailsBox.class, Level.SEVERE, - "no class found named %s in bundle %s", className, bundleName); - } catch (NoSuchMethodException ex) { - OseeLog.logf(DetailsBox.class, Level.SEVERE, - "can't find appropriate constructor for %s", className); - } - } - } - }); - - } - - @Override - public void added(IExtensionPoint[] points) { - - } - - @Override - public void removed(IExtension[] extensions) { - final List<TabItem> removedElements = new LinkedList<TabItem>(); - for (IExtension extension : extensions) { - TabItem item = detailsProviderMap.get(extension.getUniqueIdentifier()); - if (item != null) { - removedElements.add(item); - } - } - - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - - for (TabItem item : removedElements) { - if (selectedTab == item) { - selectedTab = null; - infoFolder.setSelection(hexDumpTab); - } - item.dispose(); - } - } - }); - } - - @Override - public void removed(IExtensionPoint[] arg0) { - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsProvider.java deleted file mode 100644 index f47eb06e424..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import org.eclipse.osee.ote.ui.message.tree.AbstractTreeNode; -import org.eclipse.swt.widgets.Composite; - -/** - * @author Ken J. Aguilar - */ -public abstract class DetailsProvider extends Composite { - - public DetailsProvider(Composite parent, int style) { - super(parent, style); - } - - public abstract void render(AbstractTreeNode node); - - public abstract String getTabText(); - - public abstract String getTabToolTipText(); -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ElementPath.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ElementPath.java deleted file mode 100644 index b74614075f4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ElementPath.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Andrew M. Finkbeiner - */ -public class ElementPath { - private static final String UNKNOWN = "UNKNOWN"; - private final List<Object> elementPath; - private String asString = ""; - private String messageName = UNKNOWN; - private String elementName = UNKNOWN; - private boolean modified; - private boolean isHeader = false; - - public ElementPath(Object... objs) { - this.elementPath = new ArrayList<Object>(); - if (objs.length == 1 && objs[0] instanceof String && ((String) objs[0]).contains("+")) {//then we have an asString to parse - String[] items = ((String) objs[0]).split("\\+"); - for (String item : items) { - try { - int index = Integer.parseInt(item); - elementPath.add(index); - } catch (Exception ex) { - elementPath.add(item); - } - } - } else { - add(objs); - } - modified = true; - recomputeStrings(); - } - - public ElementPath(boolean isHeader, List<Object> elementPath) { - this.elementPath = elementPath; - modified = true; - this.isHeader = isHeader; - recomputeStrings(); - } - - public ElementPath(List<Object> elementPath) { - this(false, elementPath); - } - - public ElementPath() { - this.elementPath = new ArrayList<Object>(); - modified = true; - recomputeStrings(); - } - - private void recomputeStrings() { - if (modified) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < elementPath.size(); i++) { - sb.append(elementPath.get(i).toString()); - if (i + 1 < elementPath.size()) { - sb.append("+"); - } - } - asString = sb.toString(); - - if (elementPath.size() > 0) { - Object obj = elementPath.get(0); - if (obj instanceof String) { - messageName = (String) obj; - } - } - - if (elementPath.size() > 1) { - Object obj = elementPath.get(elementPath.size() - 1); - if (obj instanceof Integer) { - elementName = (String) elementPath.get(elementPath.size() - 2) + "[" + ((Integer) obj).intValue() + "]"; - } else if (obj instanceof String) { - elementName = (String) obj; - } - } - - modified = false; - } - } - - public void add(Object... objs) { - modified = true; - for (Object obj : objs) { - elementPath.add(obj); - } - } - - public List<Object> getElementPath() { - recomputeStrings(); - return elementPath; - } - - public String asString() { - recomputeStrings(); - return asString; - } - - public Object get(int i) { - recomputeStrings(); - return elementPath.get(i); - } - - public int size() { - return elementPath.size(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof ElementPath) { - return asString().equals(((ElementPath) obj).asString()); - } else { - return false; - } - } - - @Override - public int hashCode() { - recomputeStrings(); - return asString().hashCode(); - } - - public ElementPath subElementPath(int range) { - recomputeStrings(); - ElementPath newElementPath = new ElementPath(); - for (int i = 0; i <= range; i++) { - newElementPath.add(elementPath.get(i)); - } - newElementPath.recomputeStrings(); - return newElementPath; - } - - public String getMessageName() { - recomputeStrings(); - return messageName; - } - - public String getElementName() { - recomputeStrings(); - return elementName; - } - - public boolean isValidElement() { - return elementName != UNKNOWN; - } - - public boolean isHeader() { - return isHeader; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/MessageWatchAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/MessageWatchAction.java deleted file mode 100644 index 7564958331f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/MessageWatchAction.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import org.eclipse.jface.action.Action; -import org.eclipse.osee.framework.ui.plugin.util.ViewPartUtil; - -/** - * @author Donald G. Dunne - */ -public class MessageWatchAction extends Action { - - public MessageWatchAction() { - super("Open Message Watch"); - } - - @Override - public void run() { - ViewPartUtil.openOrShowView(WatchView.VIEW_ID); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/SignalStripper.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/SignalStripper.java deleted file mode 100644 index 41f3bf2b60e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/SignalStripper.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.osee.framework.jdk.core.type.HashCollection; -import org.eclipse.osee.framework.jdk.core.util.Lib; - -/** - * @author Michael P. Masterson - */ -public class SignalStripper { - - /** - * - * @param args Requires one argument - * @throws IOException - */ - public static void main(String[] args) throws IOException { - if( args.length != 1 ) - { - throw new IllegalArgumentException("Usage: SignalStripper <Path to folder containing java scripts>"); - } - File folderToStartAt = new File(args[0]); - new SignalStripper().buildMwiForEachScript(folderToStartAt); - } - - private void buildMwiForEachScript(File folderToStartAt) throws FileNotFoundException { - File[] scriptFiles = findFiles(folderToStartAt); - System.out.println("Updating " + scriptFiles.length + " projects..."); - - for( File project : scriptFiles ){ - generateMwi(project); - } - System.out.println("Done."); - - } - - /** - * @param folderToStartAt - * @return - * @throws FileNotFoundException - */ - private File[] findFiles(File folderToStartAt) throws FileNotFoundException { - if( !folderToStartAt.exists() || !folderToStartAt.isDirectory() ) - throw new FileNotFoundException("Workspace root not found:" + folderToStartAt.getAbsolutePath()); - - File[] scriptProjects = folderToStartAt.listFiles(new FilenameFilter() { - - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".java"); - } - }); - return scriptProjects; - } - - private void generateMwi(File scriptFile) { - try { - System.out.println("-----------------------------------------------------------------"); - System.out.println("Looking at script " + scriptFile.getName()); - - String fileAsString = Lib.fileToString(scriptFile); - String mwiAsString = generateStringToWrite(fileAsString); - if( mwiAsString != null ) - writeMwi(scriptFile, mwiAsString); - else { - System.err.println("No messages found for " + scriptFile); - System.err.flush(); - } - - } - catch (IOException ex) { - System.err.println("Problem writing mwi files."); - ex.printStackTrace(); - } - } - - /** - * - * @param fileAsString - * @return String to use when writing an mwi file or null if something went wrong - * @throws IOException - */ - public String generateStringToWrite(String fileAsString) { - HashCollection<String, String> fullyQualifiedMessageNameToElementListMap = getMessageClassToElementsNamesMap(fileAsString); - String mwiAsString = generateMwiAsString(fullyQualifiedMessageNameToElementListMap); - return mwiAsString; - } - - private String generateMwiAsString(HashCollection<String, String> fullyQualifiedMessageNameToElementListMap) { - StringBuilder builder = new StringBuilder(); - for( String className : fullyQualifiedMessageNameToElementListMap.keySet()) - { - Collection<String> elements = fullyQualifiedMessageNameToElementListMap.getValues(className); - for(String element : elements) - { - builder.append(className).append("+").append(element).append("\n"); - } - - } - - if( builder.length() == 0) - return null; - else - return "version=2.0\n" + builder.toString(); - } - - private void writeMwi(File scriptFile, String mwiAsString) throws IOException { - String absolutePath = scriptFile.getAbsolutePath(); - String fileNameWithoutExtension = absolutePath.substring(0, absolutePath.length()-5); - - File outputFile = new File(fileNameWithoutExtension + ".mwi"); - - BufferedWriter outputStream = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8")); - System.out.println("Writing " + outputFile.getName()); - outputStream.write(mwiAsString); - outputStream.flush(); - outputStream.close(); - - } - - private HashCollection<String, String> getMessageClassToElementsNamesMap(String fileAsString) { - List<String> importedMessages = extractMessageImports(fileAsString); - Map<String, String> variableNameToMessageClassNameMap = findVariablesAndCreateVariableToClassMap(importedMessages,fileAsString); - HashCollection<String, String> messageClassToElementNamesMap = findElementsUsed(variableNameToMessageClassNameMap,fileAsString); - return messageClassToElementNamesMap; - } - - private List<String> extractMessageImports(String fileAsString) { - List<String> retVal = new ArrayList<String>(); - Pattern pattern = Pattern.compile("import ((\\w|\\.)+?\\.[A-Z0-9_]+);"); - Matcher matcher = pattern.matcher(fileAsString); - while( matcher.find()){ - String fullyQualifiesMessageClass = matcher.group(1); - if( fullyQualifiesMessageClass.contains("enum")) - continue; - - retVal.add(fullyQualifiesMessageClass); - } - return retVal; - } - - private Map<String, String> findVariablesAndCreateVariableToClassMap(List<String> importedMessages, String fileAsString) { - Map<String, String> retVal = new HashMap<String, String>(); - for( String fullyQualifiedMessage : importedMessages) - { - - String[] split = fullyQualifiedMessage.split("\\."); - String className = split[split.length-1]; - String variableName = findVariableNameFor(className, fileAsString); - - retVal.put(variableName, fullyQualifiedMessage); - } - return retVal; - } - - private String findVariableNameFor(String className, String fileAsString) { - Pattern pattern = Pattern.compile("\\s" + className + "\\s+(\\w+)\\s*(\\=|;)"); - Matcher matcher = pattern.matcher(fileAsString); - if( matcher.find()) - { - return matcher.group(1); - } - return null; - } - - private HashCollection<String, String> findElementsUsed(Map<String, String> variableNameToMessageClassNameMap, String fileAsString) { - HashCollection<String, String> retVal = new HashCollection<String, String>(false,HashSet.class); - Pattern pattern = Pattern.compile("\\W(\\w+)\\.([A-Z0-9_]+)\\."); - Matcher matcher = pattern.matcher(fileAsString); - while( matcher.find()) { - String variable = matcher.group(1); - String className = variableNameToMessageClassNameMap.get(variable); - String elementName = matcher.group(2); - - if( className != null) // it's possible someone forgot to instantiate something - retVal.put(className, elementName); - else { - retVal.size(); - } - } - - return retVal; - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ViewRefresher.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ViewRefresher.java deleted file mode 100644 index 4ab62f93e30..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/ViewRefresher.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.util.ArrayList; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.osee.framework.jdk.core.util.benchmark.Benchmark; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.ui.message.tree.AbstractTreeNode; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.WatchList; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class ViewRefresher implements Runnable { - private final ArrayList<AbstractTreeNode> deltas = new ArrayList<AbstractTreeNode>(256); - private final Benchmark benchMark = new Benchmark("Message Watch Update Time"); - private final WatchView view; - private volatile AbstractTreeNode selectedNode; - private final int period; - private ScheduledFuture<?> handle = null; - private final WatchList list; - - public ViewRefresher(WatchList list, final WatchView view, int period) { - this.period = period; - this.view = view; - this.list = list; - view.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - final IStructuredSelection selection = (IStructuredSelection) view.getTreeViewer().getSelection(); - selectedNode = (AbstractTreeNode) selection.getFirstElement(); - } - }); - } - - private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); - - private final Runnable task = new Runnable() { - - @Override - public void run() { - if (view != null && !view.getTreeViewer().getTree().isDisposed()) { - if (selectedNode != null) { - view.setDetailText(selectedNode); - } - for (AbstractTreeNode node : deltas) { - view.getTreeViewer().update(node, null); - } - } - } - - }; - - public void start() { - handle = scheduler.scheduleWithFixedDelay(this, period, period, TimeUnit.MILLISECONDS); - } - - public void stop() { - if (handle != null) { - handle.cancel(false); - handle = null; - } - } - - public void dispose() { - scheduler.shutdown(); - } - - @Override - public void run() { - try { - benchMark.startSample(); - deltas.clear(); - for (MessageNode node : list.getMessages()) { - ((WatchedMessageNode) node).determineDeltas(deltas); - } - Displays.pendInDisplayThread(task); - benchMark.endSample(); - - } catch (Throwable th) { - th.printStackTrace(); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java deleted file mode 100644 index 963238a9c45..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java +++ /dev/null @@ -1,1074 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.nebula.widgets.xviewer.XViewer; -import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.framework.core.exception.OseeArgumentException; -import org.eclipse.osee.framework.jdk.core.util.Lib; -import org.eclipse.osee.framework.jdk.core.util.benchmark.Benchmark; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.plugin.core.util.Jobs; -import org.eclipse.osee.framework.plugin.core.util.OseeData; -import org.eclipse.osee.framework.ui.plugin.util.HelpUtil; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.Widgets; -import org.eclipse.osee.ote.client.msg.IOteMessageService; -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.eclipse.osee.ote.message.MessageProviderVersion; -import org.eclipse.osee.ote.message.interfaces.ITestEnvironmentMessageSystem; -import org.eclipse.osee.ote.message.tool.IUdpTransferListener; -import org.eclipse.osee.ote.message.tool.TransferConfig; -import org.eclipse.osee.ote.service.ConnectionEvent; -import org.eclipse.osee.ote.service.IOteClientService; -import org.eclipse.osee.ote.service.ITestConnectionListener; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.osee.ote.ui.message.messageXViewer.MessageXViewer; -import org.eclipse.osee.ote.ui.message.tree.AbstractTreeNode; -import org.eclipse.osee.ote.ui.message.tree.ElementNode; -import org.eclipse.osee.ote.ui.message.tree.INodeVisitor; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.MessageWatchLabelProvider; -import org.eclipse.osee.ote.ui.message.tree.RootNode; -import org.eclipse.osee.ote.ui.message.tree.WatchList; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; -import org.eclipse.osee.ote.ui.message.util.ClientMessageServiceTracker; -import org.eclipse.osee.ote.ui.message.util.IOteMessageClientView; -import org.eclipse.osee.ote.ui.message.watch.action.ClearUpdatesAction; -import org.eclipse.osee.ote.ui.message.watch.action.DeleteSelectionAction; -import org.eclipse.osee.ote.ui.message.watch.action.SendMessageAction; -import org.eclipse.osee.ote.ui.message.watch.action.SetDataSourceMenu; -import org.eclipse.osee.ote.ui.message.watch.action.SetMessageModeMenu; -import org.eclipse.osee.ote.ui.message.watch.action.SetValueAction; -import org.eclipse.osee.ote.ui.message.watch.action.WatchElementAction; -import org.eclipse.osee.ote.ui.message.watch.action.ZeroizeElementAction; -import org.eclipse.osee.ote.ui.message.watch.action.ZeroizeMessageAction; -import org.eclipse.osee.ote.ui.message.watch.recording.RecordingWizard; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.ViewPart; -import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; - -/** - * A view that allows the monitoring of messages and their associated elements - * - * @author Ken J. Aguilar - */ -public final class WatchView extends ViewPart implements ITestConnectionListener, IOteMessageClientView { - private MessageXViewer treeViewer; - - private final ClientMessageServiceTracker msgServiceTracker; - private Label statusTxt; - private Clipboard cb; - private final File watchFile; - private Button recordButton; - private final Benchmark benchMark = new Benchmark("Message Watch Update Time"); - - private static final Pattern elmPattern = Pattern.compile("^(osee\\.test\\.core\\.message\\.[^.]+\\..+)\\.(.+)$"); - private static final Pattern msgPattern = Pattern.compile("^(osee\\.test\\.core\\.message\\.[^.]+\\..+)$"); - - public static final String VIEW_ID = "org.eclipse.osee.ote.ui.message.watch.WatchView"; - - private DetailsBox detailsBox; - final IUdpTransferListener recBtnListener = new IUdpTransferListener() { - - @Override - public void onTransferComplete(final TransferConfig config) { - OseeLog.log(Activator.class, Level.INFO, "file transfer complete"); - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - openInfo("Message Recorder", - "Message recording file " + config.getFileName() + " is now ready for opening"); - } - }); - } - - @Override - public void onTransferException(final TransferConfig config, final Throwable t) { - OseeLog.log(Activator.class, Level.SEVERE, "problems writing to recorder output file " + config.getFileName(), - t); - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - recordButton.setSelection(false); - openInfo("Message Recorder", - "An exception occurred while writing to recorder output file " + config.getFileName()); - } - }); - } - }; - - private IOteMessageService messageService = null; - - private final SelectionListener recBtnHandler = new SelectionListener() { - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - widgetSelected(e); - } - - @Override - public void widgetSelected(SelectionEvent e) { - if (recordButton.getSelection()) { - - RecordingWizard recordingWizard = new RecordingWizard(watchList); - final WizardDialog recdialog = new WizardDialog(Displays.getActiveShell(), recordingWizard); - int recResult = recdialog.open(); - if (Window.OK == recResult) { - try { - saveWatchFile(); - messageService.startRecording(recordingWizard.getFileName(), - recordingWizard.getFilteredMessageRecordDetails()).addListener(recBtnListener); - } catch (FileNotFoundException ex) { - MessageDialog.openError(Displays.getActiveShell(), "Recording Error", - "Failed to open file for writing. " + "Make sure its not being used by another application"); - recordButton.setSelection(false); - } catch (Throwable ex) { - OseeLog.log(Activator.class, Level.SEVERE, "Failed to start message recording", ex); - MessageDialog.openError(Displays.getActiveShell(), "Recording Error", - "Exception ocurred while recording. see error log"); - recordButton.setSelection(false); - } - } else { - recordButton.setSelection(false); - } - } else { - try { - messageService.stopRecording(); - } catch (IOException ioe) { - OseeLog.log(Activator.class, Level.WARNING, "problem when attempting to stop recording", ioe); - } catch (Throwable t) { - OseeLog.log(Activator.class, Level.SEVERE, "problem when attempting to stop recording", t); - } - } - } - }; - - private static enum Status { - /** - * no active test manager - */ - NO_TEST_MANAGER("No test manager running"), - /** - * active test manager but not connected to a host - */ - NOT_CONNECTED("%s: Not connected to a host"), - /** - * active test manager and connected to a host - */ - CONNECTED("Connected to %s (%s)"); - - private final String txt; - - Status(final String txt) { - this.txt = txt; - } - - public String asString(Object... args) { - return String.format(txt, args); - } - - } - - private Composite parentComposite; - private WatchList watchList; - -private WatchViewMessageDefinitionProviderTracker watchViewMessageDefinitionProviderTracker; - -private MessageProviderVersion messageProviderVersion; - - public WatchView() { - watchFile = OseeData.getFile("msgWatch.txt"); - msgServiceTracker = new ClientMessageServiceTracker(Activator.getDefault().getBundle().getBundleContext(), this); - messageProviderVersion = new MessageProviderVersion(); - } - - @SuppressWarnings("unchecked") - @Override - public void createPartControl(Composite parent) { - final int numColumns = 4; - - parentComposite = parent; - - GridLayout layout = new GridLayout(); - layout.numColumns = numColumns; - layout.verticalSpacing = 0; - layout.marginWidth = 5; - layout.marginHeight = 5; - parent.setLayout(layout); - - Label label = new Label(parent, SWT.RIGHT); - label.setText("Status:"); - Widgets.positionGridItem(label, false, false, SWT.END, SWT.CENTER, 1); - - statusTxt = new Label(parent, SWT.READ_ONLY); - statusTxt.setText(Status.NO_TEST_MANAGER.asString()); - Widgets.positionGridItem(statusTxt, false, false, SWT.FILL, SWT.BEGINNING, 3); - - Composite buttons = new Composite(parent, SWT.NONE); - buttons.setLayout(new RowLayout(SWT.HORIZONTAL)); - - recordButton = new Button(buttons, SWT.TOGGLE); - recordButton.setText("REC"); - recordButton.setToolTipText("Record the messages and elements currently shown in Message Watch."); - recordButton.addSelectionListener(recBtnHandler); - recordButton.setEnabled(false); - - IExtension[] extensions = - Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ote.ui.message.ToolbarItem").getExtensions(); - for (IExtension ext : extensions) { - for (IConfigurationElement el : ext.getConfigurationElements()) { - if (el.getName().equals("ToolbarItem")) { - String actionClass = el.getAttribute("Action"); - String icon = el.getAttribute("Icon"); - String btnLabel = el.getAttribute("Label"); - String tooltip = el.getAttribute("Tooltip"); - - Class<? extends Action> clazz; - try { - Bundle bundle = Platform.getBundle(el.getContributor().getName()); - clazz = bundle.loadClass(actionClass).asSubclass(Action.class); - - Action action = clazz.newInstance(); - ActionButton btn = - new ActionButton(buttons, SWT.PUSH, action, btnLabel, el.getContributor().getName()); - btn.setToolTipText(tooltip); - - if (icon != null) { - URL url = bundle.getEntry(icon); - if (url == null) { - throw new OseeArgumentException("Invalid icon path [{%s}/%s]", el.getContributor().getName(), - icon); - } else { - ImageDescriptor desc = ImageDescriptor.createFromURL(url); - Image img = desc.createImage(); - if (img == null) { - throw new OseeArgumentException("Unable to create Image from [{%s}/%s]", - el.getContributor().getName(), icon); - } else { - btn.setImage(img); - } - } - } - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - } - } - } - - final SashForm sashForm = new SashForm(parent, SWT.VERTICAL); - // sashForm.SASH_WIDTH = 1; - Widgets.positionGridItem(sashForm, true, true, SWT.FILL, SWT.FILL, numColumns); - - Composite comp = new Composite(sashForm, SWT.NONE); - comp.setLayout(new GridLayout(1, false)); - GridData gd = new GridData(GridData.FILL_BOTH); - comp.setLayoutData(gd); - - // Create the tree treeViewer as a child of the composite parent - treeViewer = - new MessageXViewer(comp, - SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.DOUBLE_BUFFERED); - GridData layoutData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); - layoutData.horizontalSpan = numColumns; - treeViewer.getControl().setLayoutData(layoutData); - watchList = new WatchList(this); - treeViewer.setContentProvider(watchList); - treeViewer.setLabelProvider(new MessageWatchLabelProvider(treeViewer)); - treeViewer.setUseHashlookup(true); - - treeViewer.getTree().setHeaderVisible(true); - treeViewer.getTree().setLinesVisible(true); - - detailsBox = new DetailsBox(sashForm); - - sashForm.setWeights(new int[] {75, 25}); - // Add Listeners to the Tree - treeViewer.addSelectionChangedListener(new ISelectionChangedListener() { - private AbstractTreeNode lastNodeSelected = null; - - @Override - public void selectionChanged(SelectionChangedEvent event) { - final IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection(); - - final AbstractTreeNode node = (AbstractTreeNode) selection.getFirstElement(); - if (node != null && node != lastNodeSelected) { - if (lastNodeSelected != null) { - lastNodeSelected.setSelected(false); - } - node.setSelected(true); - try { - setDetailText(node); - } catch (ArrayIndexOutOfBoundsException t) { - // throw if there is an error in the message jar - // (usually... ) - final String msg = - String.format("Problems occurred when trying to display details for %s: (See Error Log)", - node.getName()); - OseeLog.log(Activator.class, Level.SEVERE, "Error while displaying details for " + node.getName(), t); - openInfo("Possible Message JAR Error", msg); - } - lastNodeSelected = node; - } - } - }); - treeViewer.getTree().addMouseListener(new MouseAdapter() { - - @Override - public void mouseDown(MouseEvent e) { - if (e.button == 3) { - showContextMenu(new Point(e.x, e.y)); - } - } - }); - - // Create menu, toolbars, filters, sorters. - createToolBar(); - - getSite().setSelectionProvider(treeViewer); - - treeViewer.addCustomizeToViewToolbar(this); - createMenuActions(); - - setHelpContexts(); - setNoLibraryStatus(); - IOteClientService clientService = Activator.getDefault().getOteClientService(); - if (clientService == null) { - throw new IllegalStateException("cannot acquire ote client service"); - } - msgServiceTracker.open(true); - clientService.addConnectionListener(this); - loadWatchFile(); - - cb = new Clipboard(Display.getCurrent()); - - treeViewer.getControl().addKeyListener(new KeyListener() { - - @Override - public void keyPressed(KeyEvent e) { - if (e.stateMask == SWT.CTRL && e.keyCode == 'v') { - TextTransfer transfer = TextTransfer.getInstance(); - String data = (String) cb.getContents(transfer); - if (data != null) { - SignalStripper signalStripper = new SignalStripper(); - String mwi = signalStripper.generateStringToWrite(data); - loadWatchFile(mwi); - } - } - } - - @Override - public void keyReleased(KeyEvent e) { - } - }); - - int ops = DND.DROP_COPY | DND.DROP_MOVE; - Transfer[] transfers = new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance()}; - treeViewer.addDropSupport(ops, transfers, new WatchViewDropAdapter(this)); - - watchViewMessageDefinitionProviderTracker = new WatchViewMessageDefinitionProviderTracker(FrameworkUtil.getBundle(getClass()).getBundleContext(), this); - watchViewMessageDefinitionProviderTracker.open(true); - } - - @Override - public void dispose() { - watchViewMessageDefinitionProviderTracker.close(); - if (detailsBox != null) { - detailsBox.dispose(); - } - msgServiceTracker.close(); - Activator.getDefault().getOteClientService().removeConnectionListener(WatchView.this); - super.dispose(); - } - - public void createToolBar() { - Action expandAction = new Action("Expand All") { - - @Override - public void run() { - treeViewer.getTree().setRedraw(false); - treeViewer.expandAll(); - treeViewer.getTree().setRedraw(true); - } - }; - expandAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.EXPAND_STATE)); - expandAction.setToolTipText("Expand All"); - - Action showNameAction = new Action("Show Names", SWT.TOGGLE) { - - @Override - public void run() { - treeViewer.refresh(); - } - }; - showNameAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.SHOW_NAMES)); - showNameAction.setToolTipText("Show Message Names"); - - Action collapseAction = new Action("Collapse All") { - - @Override - public void run() { - treeViewer.getTree().setRedraw(false); - treeViewer.collapseAll(); - treeViewer.getTree().setRedraw(true); - } - }; - collapseAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.COLLAPSE_STATE)); - collapseAction.setToolTipText("Collapse All"); - - Action deleteAction = new Action("Delete") { - @Override - public void run() { - final IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection(); - watchList.deleteSelection(selection); - } - }; - - deleteAction.setToolTipText("Delete"); - - deleteAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.DELETE)); - - Action deleteAllAction = new Action("Delete All") { - - @Override - public void run() { - if (MessageDialog.openConfirm(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), - "Delete All", "Delete All Watch Items?")) { - watchList.deleteAll(); - saveWatchFile(); - } - } - }; - deleteAllAction.setToolTipText("Delete All"); - deleteAllAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.DELETE_ALL)); - - Action refreshAction = new Action("Refresh") { - @Override - public void run() { - treeViewer.refresh(); - } - }; - refreshAction.setToolTipText("refresh"); - refreshAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.REFRESH)); - - Action saveAction = new Action("Save Items") { - private String saveFilePath = null; - private String lastSaveFileName = null; - - @Override - public void run() { - final FileDialog dialog = new FileDialog(treeViewer.getTree().getShell(), SWT.SAVE); - dialog.setFilterExtensions(new String[] {"*.mwi"}); - if (saveFilePath == null) { - saveFilePath = OseeData.getPath().toOSString(); - } - if (lastSaveFileName == null) { - lastSaveFileName = "msgWatchItems.mwi"; - } - dialog.setFilterPath(saveFilePath); - dialog.setFileName(lastSaveFileName); - - String selectedFile = dialog.open(); - if (selectedFile != null) { - if (!selectedFile.endsWith(".mwi")) { - selectedFile += ".mwi"; - } - final File saveFile = new File(selectedFile); - saveFilePath = saveFile.getAbsolutePath(); - lastSaveFileName = saveFile.getName(); - saveWatchFile(saveFile); - } - } - }; - saveAction.setToolTipText("Save Watch Items"); - saveAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.SAVE)); - - Action loadAction = new Action("Load Items") { - private String loadFilePath = null; - private String lastLoadFileName = null; - - @Override - public void run() { - final FileDialog dialog = new FileDialog(treeViewer.getTree().getShell(), SWT.OPEN); - dialog.setFilterExtensions(new String[] {"*.mwi"}); - if (loadFilePath == null) { - loadFilePath = OseeData.getPath().toOSString(); - } - if (lastLoadFileName != null) { - dialog.setFileName(lastLoadFileName); - } - - dialog.setFilterPath(loadFilePath); - - String selectedFile = dialog.open(); - if (selectedFile != null) { - if (!selectedFile.endsWith(".mwi")) { - selectedFile += ".mwi"; - } - final File loadFile = new File(selectedFile); - loadFilePath = loadFile.getAbsolutePath(); - lastLoadFileName = loadFile.getName(); - loadWatchFile(loadFile); - } - } - }; - loadAction.setToolTipText("Load Watch Items"); - loadAction.setImageDescriptor(ImageManager.getImageDescriptor(OteMessageImage.OPEN)); - IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager(); - toolbarManager.add(showNameAction); - toolbarManager.add(refreshAction); - toolbarManager.add(expandAction); - toolbarManager.add(collapseAction); - toolbarManager.add(deleteAction); - toolbarManager.add(deleteAllAction); - toolbarManager.add(saveAction); - toolbarManager.add(loadAction); - } - - private void setHelpContexts() { - // TODO: Change to use OteHelpContext - HelpUtil.setHelp(parentComposite, "message_watch", "org.eclipse.osee.ote.help.ui"); - } - - @Override - public void setFocus() { - // Set focus so that context sensitive help will work as soon as this - // view is selected. - parentComposite.setFocus(); - } - - /** - * display details about specified node - * - * @param node node whose details will be displayed in the detail window of the GUI - */ - public void setDetailText(final AbstractTreeNode node) { - detailsBox.setDetailText(node); - } - - /** - * shows a context menu depending on the point - */ - void showContextMenu(Point p) { - final Tree tree = treeViewer.getTree(); - final Menu contextMenu = getPopupMenu(tree.getParent()); - if (contextMenu != null) { - p = tree.toDisplay(p); - contextMenu.setLocation(p); - contextMenu.setVisible(true); - } - } - - public void addWatchMessage(final AddWatchParameter parameter) { - for (String message : parameter.getMessages()) { - Collection<ElementPath> elements = parameter.getMessageElements(message); - OseeLog.logf(Activator.class, Level.FINEST, "Watch request for message %s", message); - try { - if (elements == null) { - elements = new ArrayList<ElementPath>(); - } - watchList.createElements(message, elements); - } catch (ClassNotFoundException ex1) { - if (openProceedWithProcessing("Could not find a class definition for " + message + "\n Do you wish to continue")) { - continue; - } else { - return; - } - } catch (InstantiationException ex1) { - if (openProceedWithProcessing("failed to instantiate " + message + "\n Do you wish to continue")) { - continue; - } else { - return; - } - } catch (Exception ex1) { - OseeLog.log(Activator.class, Level.SEVERE, "failed to create message node", ex1); - if (openProceedWithProcessing("Error processing " + message + ". See Error Log for details.\n Do you wish to continue")) { - continue; - } else { - return; - } - } - } - treeViewer.refresh(); - } - - public void refresh() { - treeViewer.refresh(); - saveWatchFile(); - } - - /** - * Convienence method. Opens an info dialog - */ - private void openInfo(final String title, final String message) { - MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, message); - } - - private boolean openProceedWithProcessing(final String message) { - MessageDialog dialog = - new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Proceed?", null, message, - MessageDialog.QUESTION, new String[] {"Continue processing with next message", "End message processing"}, 0); - return dialog.open() == Window.OK; - } - - private void onDisconnected() { - OseeLog.log(Activator.class, Level.INFO, "Entered onDisconnected()"); - if (!recordButton.isDisposed()) { - recordButton.setSelection(false); - } - try { - if (Benchmark.isBenchmarkingEnabled()) { - OseeLog.logf(Activator.class, Level.INFO, "%s: # samples=%d, max=%d, min=%d, avg=%d", benchMark.getName(), - benchMark.getTotalSamples(), benchMark.getLongestSample(), benchMark.getShortestSample(), - benchMark.getAverage()); - } - } catch (Throwable t) { - OseeLog.log(Activator.class, Level.WARNING, "Exception during disconnect", t); - } - - } - - private Menu getPopupMenu(final Composite composite) { - Menu menu = treeViewer.getMenuManager().createContextMenu(composite); - return menu; - } - - public void loadWatchFile() { - loadWatchFile(watchFile); - } - - public void loadWatchFile(final File watchFile) { - if (watchFile != null && watchFile.exists()) { - final Job job = new LoadWatchList(watchFile); - Jobs.startJob(job); - } - } - - public void loadWatchFile(final String watchFileText) { - final Job job = new LoadWatchList(watchFileText); - Jobs.startJob(job); - } - - private class LoadWatchList extends Job { - - private File watchFile; - private String text; - - LoadWatchList(File watchFile) { - super("Loading watch file"); - this.watchFile = watchFile; - } - - LoadWatchList(String watchFileText) { - super("Loading watch file"); - this.text = watchFileText; - } - - @Override - protected IStatus run(IProgressMonitor monitor) { - try { - if (watchFile != null) { - text = Lib.fileToString(watchFile); - } - final String[] msgs = text.split("\n"); - monitor.beginTask("loading watch elements", msgs.length + 10); - - if (msgs.length > 0) { - if (msgs[0].equals("version=2.0")) { - final Map<String, ArrayList<ElementPath>> pathsToAdd = new HashMap<String, ArrayList<ElementPath>>(); - final List<ElementPath> recBodyElementsToAdd = new ArrayList<ElementPath>(); - final List<ElementPath> recHeaderElementsToAdd = new ArrayList<ElementPath>(); - final Set<String> recHeaderHex = new HashSet<String>(); - final Set<String> recBodyHex = new HashSet<String>(); - for (int i = 1; i < msgs.length; i++) { - if (msgs[i].startsWith("#rec#")) { - // #rec#,message,[body|header|bodyHex| - // headerHex],[boolean|path] - String[] els = msgs[i].split(","); - if (els.length == 4) { - String message = els[1]; - String type = els[2]; - String value = els[3]; - if (type.equals("body")) { - recBodyElementsToAdd.add(new ElementPath(value)); - } else if (type.equals("header")) { - recHeaderElementsToAdd.add(new ElementPath(value)); - } else if (type.equals("headerHex")) { - if (Boolean.parseBoolean(value)) { - recHeaderHex.add(message); - } - } else if (type.equals("bodyHex")) { - if (Boolean.parseBoolean(value)) { - recBodyHex.add(message); - } - } - } - monitor.worked(1); - } else { - ElementPath path = new ElementPath(msgs[i]); - ArrayList<ElementPath> collection = pathsToAdd.get(path.getMessageName()); - if (collection == null) { - collection = new ArrayList<ElementPath>(); - pathsToAdd.put(path.getMessageName(), collection); - } - collection.add(path); - monitor.worked(1); - } - } - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - try { - treeViewer.getTree().setRedraw(false); - addWatchMessage(new AddWatchParameter(pathsToAdd)); - for (ElementPath path : recBodyElementsToAdd) { - WatchedMessageNode msgNode = watchList.getMessageNode(path.getMessageName()); - if (msgNode != null) { - msgNode.getRecordingState().addBody(path); - } - } - for (ElementPath path : recHeaderElementsToAdd) { - WatchedMessageNode msgNode = watchList.getMessageNode(path.getMessageName()); - if (msgNode != null) { - msgNode.getRecordingState().addHeader(path); - } - } - for (String msg : recBodyHex) { - WatchedMessageNode msgNode = watchList.getMessageNode(msg); - if (msgNode != null) { - msgNode.getRecordingState().setBodyDump(true); - } - } - for (String msg : recHeaderHex) { - WatchedMessageNode msgNode = watchList.getMessageNode(msg); - if (msgNode != null) { - msgNode.getRecordingState().setHeaderDump(true); - } - } - } finally { - treeViewer.getTree().setRedraw(true); - treeViewer.refresh(); - } - } - }); - - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - saveWatchFile(); - treeViewer.refresh(); - } - }); - monitor.worked(10); - } else { - - for (String msg : msgs) { - // final Matcher jarMatch = - // jarPattern.matcher(msg); - final Matcher elmMatch = elmPattern.matcher(msg); - final Matcher msgMatch = msgPattern.matcher(msg); - - if (elmMatch.find()) { - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - String msg = elmMatch.group(1); - String elm = elmMatch.group(2); - ElementPath element = new ElementPath(msg, elm); - AddWatchParameter parameter = new AddWatchParameter(elmMatch.group(1), element); - addWatchMessage(parameter); - } - }); - } else if (msgMatch.find()) { - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - addWatchMessage(new AddWatchParameter(msgMatch.group(1))); - } - }); - } - monitor.worked(1); - } - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - saveWatchFile(); - treeViewer.refresh(); - } - }); - monitor.worked(10); - - } - } - } catch (Throwable t) { - OseeLog.log(Activator.class, Level.SEVERE, "error loading watch file", t); - return org.eclipse.core.runtime.Status.CANCEL_STATUS; - } finally { - monitor.done(); - } - return org.eclipse.core.runtime.Status.OK_STATUS; - } - } - - public void saveWatchFile() { - saveWatchFile(watchFile); - } - - public void saveWatchFile(File watchFile) { - if (watchFile == null) { - return; - } - try { - final FileWriter fw = new FileWriter(watchFile); - fw.write("version=2.0\n"); - for (MessageNode treeItem : watchList.getMessages()) { - WatchedMessageNode msg = (WatchedMessageNode) treeItem; - msg.getRecordingState().write(fw); - LinkedList<ElementNode> descendants = new LinkedList<ElementNode>(); - msg.collectDescendants(descendants); - if (descendants.isEmpty()) { - fw.write(msg.getMessageClassName()); - fw.write('\n'); - } else { - for (ElementNode el : descendants) { - fw.write(el.getElementPath().asString()); - fw.write('\n'); - } - } - } - fw.close(); - } catch (Exception e) { - OseeLog.log(Activator.class, Level.SEVERE, "failed to write watch file at " + watchFile.getAbsolutePath(), e); - } - } - - public TreeViewer getTreeViewer() { - return treeViewer; - } - - public void updateMenuActions(final IMenuManager mm) { - - final IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection(); - if (selection.size() > 0) { - final AbstractTreeNode node = (AbstractTreeNode) selection.getFirstElement(); - node.visit(new INodeVisitor<Object>() { - - @Override - public Object elementNode(ElementNode node) { - if (selection.size() == 1) { - mm.insertBefore(XViewer.MENU_GROUP_PRE, new SetValueAction(node)); - mm.insertBefore(XViewer.MENU_GROUP_PRE, new ZeroizeElementAction(node)); - } - return null; - } - - @Override - public Object messageNode(MessageNode node) { - if (selection.size() == 1) { - WatchedMessageNode msgNode = (WatchedMessageNode) node; - mm.insertBefore(XViewer.MENU_GROUP_PRE, new WatchElementAction(WatchView.this, - (WatchedMessageNode) node)); - mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator()); - mm.insertBefore(XViewer.MENU_GROUP_PRE, SetDataSourceMenu.createMenu(msgNode)); - mm.insertBefore(XViewer.MENU_GROUP_PRE, SetMessageModeMenu.createMenu(msgNode)); - mm.insertBefore(XViewer.MENU_GROUP_PRE, new SendMessageAction(msgNode)); - mm.insertBefore(XViewer.MENU_GROUP_PRE, new ZeroizeMessageAction(msgNode)); - } - return null; - } - - @Override - public Object rootNode(RootNode node) { - return null; - } - - }); - mm.insertBefore(XViewer.MENU_GROUP_PRE, new ClearUpdatesAction(watchList, selection)); - mm.insertBefore(XViewer.MENU_GROUP_PRE, new DeleteSelectionAction(watchList, selection)); - } - mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator()); - } - - public void createMenuActions() { - MenuManager mm = treeViewer.getMenuManager(); - mm.createContextMenu(treeViewer.getControl()); - mm.addMenuListener(new IMenuListener() { - @Override - public void menuAboutToShow(IMenuManager manager) { - updateMenuActions(manager); - } - }); - - } - - @Override - public void onPostConnect(final ConnectionEvent event) { - OseeLog.log(Activator.class, Level.INFO, "Entered onConnectionEstablished()"); - - if (event.getEnvironment() instanceof ITestEnvironmentMessageSystem) { - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - recordButton.setEnabled(true); - watchList.clearAllUpdateCounters(); - } - }); - } - } - - @Override - public void onPreDisconnect(ConnectionEvent event) { - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - recordButton.setEnabled(false); - onDisconnected(); - } - }); - } - - private void setNoLibraryStatus() { - treeViewer.getTree().setToolTipText(""); - statusTxt.setText("no library detected"); - } - - @Override - public void onConnectionLost(IServiceConnector connector) { - } - - @Override - public void oteMessageServiceAcquired(final IOteMessageService service) { - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - messageService = service; - recordButton.setEnabled(true); - treeViewer.setInput(service); - } - }); - } - - @Override - public void oteMessageServiceReleased() { - Displays.pendInDisplayThread(new Runnable() { - @Override - public void run() { - if (!recordButton.isDisposed()) { - recordButton.setEnabled(false); - } - if (!treeViewer.getControl().isDisposed()) { - treeViewer.setInput(null); - } - messageService = null; - } - }); - } - - - - public void addMessageDefinitionProvider(MessageDefinitionProvider provider) { - messageProviderVersion.add(provider); - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - try { - - statusTxt.setText("libraries loaded"); - statusTxt.setToolTipText(messageProviderVersion.getVersion()); - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, "exception while processing library", ex); - } - } - }); - } - - public void removeMessageDefinitionProvider(MessageDefinitionProvider provider) { - messageProviderVersion.remove(provider); - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - if(messageProviderVersion.isAnyAvailable()){ - statusTxt.setText("libraries loaded"); - statusTxt.setToolTipText(messageProviderVersion.getVersion()); - } else { - setNoLibraryStatus(); - } - } - }); - } - -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchViewDropAdapter.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchViewDropAdapter.java deleted file mode 100644 index feeb4131626..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchViewDropAdapter.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch; - -import java.io.IOException; -import java.util.logging.Level; - -import org.eclipse.osee.framework.jdk.core.util.Lib; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.swt.dnd.DropTargetEvent; -import org.eclipse.swt.dnd.DropTargetListener; - -public class WatchViewDropAdapter implements DropTargetListener { - - private WatchView watchViewer; - - public WatchViewDropAdapter(WatchView watchViewer) { - this.watchViewer = watchViewer; - } - - @Override - public void dragEnter(DropTargetEvent event) { - } - - @Override - public void dragLeave(DropTargetEvent event) { - } - - @Override - public void dragOperationChanged(DropTargetEvent event) { - } - - @Override - public void dragOver(DropTargetEvent event) { - } - - @Override - public void drop(DropTargetEvent event) { - if(event.data instanceof String[]){ - for(String file: (String[])event.data){ - java.io.File realFile = new java.io.File(file); - if(realFile.exists() && !realFile.isDirectory()){ - try { - String fileAsString = Lib.fileToString(realFile); - SignalStripper signalStripper = new SignalStripper(); - String mwi = signalStripper.generateStringToWrite(fileAsString); - watchViewer.loadWatchFile(mwi); - } catch (IOException e) { - OseeLog.log(WatchViewDropAdapter.class, Level.SEVERE, "Failed to read file from drag and drop into message watch.", e); - } - } - } - } - } - - @Override - public void dropAccept(DropTargetEvent event) { - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchViewMessageDefinitionProviderTracker.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchViewMessageDefinitionProviderTracker.java deleted file mode 100644 index da63e2e6eb3..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchViewMessageDefinitionProviderTracker.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.osee.ote.ui.message.watch; - -import org.eclipse.osee.ote.message.MessageDefinitionProvider; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.util.tracker.ServiceTracker; - -class WatchViewMessageDefinitionProviderTracker extends ServiceTracker<MessageDefinitionProvider, MessageDefinitionProvider> { - - private final WatchView view; - - public WatchViewMessageDefinitionProviderTracker(BundleContext context, WatchView view){ - super(context, MessageDefinitionProvider.class.getName(), null); - this.view = view; - } - - @Override - public MessageDefinitionProvider addingService(ServiceReference<MessageDefinitionProvider> reference) { - MessageDefinitionProvider provider = super.addingService(reference); - view.addMessageDefinitionProvider(provider); - return provider; - } - - @Override - public void removedService(ServiceReference<MessageDefinitionProvider> reference, MessageDefinitionProvider service) { - view.removeMessageDefinitionProvider(service); - super.removedService(reference, service); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ClearUpdatesAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ClearUpdatesAction.java deleted file mode 100644 index b03269acaf1..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ClearUpdatesAction.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.osee.ote.ui.message.tree.WatchList; - -/** - * @author Ken J. Aguilar - */ -public class ClearUpdatesAction extends Action { - - private final IStructuredSelection selection; - private final WatchList watchList; - - public ClearUpdatesAction(WatchList watchList, IStructuredSelection selection) { - super("Clear Update Counter"); - this.selection = selection; - this.watchList = watchList; - } - - @Override - public void run() { - watchList.clearUpdateCounters(selection); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/DeleteSelectionAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/DeleteSelectionAction.java deleted file mode 100644 index ecd79abfcc8..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/DeleteSelectionAction.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.osee.ote.ui.message.tree.WatchList; - -/** - * @author Ken J. Aguilar - */ -public class DeleteSelectionAction extends Action { - - private final WatchList watchList; - private final IStructuredSelection selection; - - public DeleteSelectionAction(WatchList watchList, IStructuredSelection selection) { - super("Delete"); - this.watchList = watchList; - this.selection = selection; - } - - @Override - public void run() { - watchList.deleteSelection(selection); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/DisabledAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/DisabledAction.java deleted file mode 100644 index e82bf71c7d4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/DisabledAction.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; - -/** - * @author Ken J. Aguilar - */ -public class DisabledAction extends Action { - - public DisabledAction(String name) { - super(name, IAction.AS_PUSH_BUTTON); - setEnabled(false); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ElementLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ElementLabelProvider.java deleted file mode 100644 index 54b95d0ed97..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ElementLabelProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.swt.graphics.Image; - -public final class ElementLabelProvider extends LabelProvider { - private static final Image Img = ImageManager.getImage(OteMessageImage.PIPE); - - @Override - public Image getImage(Object element) { - return Img; - } - - @Override - public String getText(Object element) { - final Element elem = (Element) element; - return String.format("%s: byte=%d, msb=%d, lsb=%d", elem.getName(), elem.getByteOffset(), elem.getMsb(), - elem.getLsb()); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SendMessageAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SendMessageAction.java deleted file mode 100644 index c8fe8058e41..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SendMessageAction.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import java.util.logging.Level; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.message.tool.MessageMode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class SendMessageAction extends Action { - private final WatchedMessageNode msgNode; - - public SendMessageAction(WatchedMessageNode msgNode) { - super("Send"); - this.msgNode = msgNode; - setEnabled(msgNode.isEnabled() && msgNode.getSubscription().getMessageMode() == MessageMode.WRITER && msgNode.getSubscription().isActive()); - - } - - @Override - public void run() { - try { - msgNode.getSubscription().send(); - } catch (Exception e) { - String message = "could not send the message " + msgNode.getMessageClassName(); - OseeLog.log(SendMessageAction.class, Level.SEVERE, message, e); - MessageDialog.openError(Displays.getActiveShell(), "Send Message", message + ". Check error log for trace"); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetDataSourceAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetDataSourceAction.java deleted file mode 100644 index 446a23a6f8e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetDataSourceAction.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.osee.ote.message.enums.DataType; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class SetDataSourceAction extends Action { - - private final WatchedMessageNode node; - private final DataType type; - - public SetDataSourceAction(WatchedMessageNode node, DataType type) { - super(type.name(), IAction.AS_RADIO_BUTTON); - this.node = node; - this.type = type; - setChecked(node.getSubscription().getMemType() == type); - } - - @Override - public void run() { - node.getSubscription().changeMemType(type); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetDataSourceMenu.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetDataSourceMenu.java deleted file mode 100644 index 7ba072498a7..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetDataSourceMenu.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.nebula.widgets.xviewer.XSubMenuManager; -import org.eclipse.osee.ote.message.enums.DataType; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class SetDataSourceMenu extends XSubMenuManager implements IMenuListener { - private final static String NAME = "Set Data Source"; - private final WatchedMessageNode node; - - public static IContributionItem createMenu(WatchedMessageNode node) { - if (!node.getSubscription().getAvailableTypes().isEmpty()) { - return new SetDataSourceMenu(node); - } - return new ActionContributionItem(new DisabledAction(NAME)); - } - - protected SetDataSourceMenu(WatchedMessageNode node) { - super(NAME); - this.node = node; - setRemoveAllWhenShown(true); - setEnabled(!node.getSubscription().getAvailableTypes().isEmpty()); - addMenuListener(this); - } - - @Override - public void menuAboutToShow(IMenuManager manager) { - for (DataType type : node.getSubscription().getAvailableTypes()) { - add(new SetDataSourceAction(node, type)); - } - - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetMessageModeAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetMessageModeAction.java deleted file mode 100644 index d67950d21a5..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetMessageModeAction.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.Action; -import org.eclipse.osee.ote.message.tool.MessageMode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class SetMessageModeAction extends Action { - - private final WatchedMessageNode node; - private final MessageMode mode; - - public SetMessageModeAction(WatchedMessageNode node, MessageMode mode) { - super(mode.name()); - this.node = node; - this.mode = mode; - setChecked(node.getSubscription().getMessageMode() == mode); - } - - @Override - public void run() { - node.getSubscription().changeMessageMode(mode); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetMessageModeMenu.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetMessageModeMenu.java deleted file mode 100644 index 0cd99bbca29..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetMessageModeMenu.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.nebula.widgets.xviewer.XSubMenuManager; -import org.eclipse.osee.ote.message.tool.MessageMode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class SetMessageModeMenu extends XSubMenuManager implements IMenuListener { - private final static String NAME = "Set Reader/Writer Buffer"; - private final WatchedMessageNode node; - - public static IContributionItem createMenu(WatchedMessageNode node) { - if (node.isEnabled() && node.getSubscription().isResolved()) { - return new SetMessageModeMenu(node); - } - return new ActionContributionItem(new DisabledAction(NAME)); - } - - protected SetMessageModeMenu(WatchedMessageNode node) { - super(NAME); - this.node = node; - setRemoveAllWhenShown(true); - addMenuListener(this); - } - - @Override - public void menuAboutToShow(IMenuManager manager) { - for (MessageMode mode : MessageMode.values()) { - add(new SetMessageModeAction(node, mode)); - } - - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java deleted file mode 100644 index 6f61338509f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import java.util.List; -import java.util.logging.Level; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.IInputValidator; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.window.Window; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.elements.EnumeratedElement; -import org.eclipse.osee.ote.message.tool.MessageMode; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.osee.ote.ui.message.tree.ElementNode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; -import org.eclipse.ui.dialogs.ListDialog; - -/** - * @author Ken J. Aguilar - */ -public class SetValueAction extends Action { - private final WatchedMessageNode msgNode; - private final ElementNode node; - - public SetValueAction(ElementNode node) { - super("Set Value"); - this.node = node; - msgNode = (WatchedMessageNode) node.getMessageNode(); - setEnabled(node.isEnabled() && msgNode.getSubscription().getMessageMode() == MessageMode.WRITER && msgNode.getSubscription().isActive()); - } - - @Override - public void run() { - Message<?, ?, ?> msg = msgNode.getSubscription().getMessage(); - List<Object> path = node.getElementPath().getElementPath(); - Element element = msg.getElement(path); - if (element instanceof EnumeratedElement<?>) { - final EnumeratedElement<?> enumElement = (EnumeratedElement<?>) element; - try { - final Enum<?>[] values = enumElement.getEnumValues(); - int width = 0; - for (Enum<?> val : values) { - width = val.toString().length() > width ? val.toString().length() : width; - } - - final ListDialog dialog = new ListDialog(Displays.getActiveShell()); - dialog.setInput(values); - dialog.setTitle("Set Value"); - dialog.setAddCancelButton(true); - dialog.setWidthInChars(width + 5); - dialog.setMessage(element.getFullName() + "\nSelect New Value"); - dialog.setContentProvider(new ITreeContentProvider() { - - @Override - public Object[] getChildren(Object parentElement) { - return null; - } - - @Override - public Object getParent(Object element) { - return values; - } - - @Override - public boolean hasChildren(Object element) { - return false; - } - - @Override - public Object[] getElements(Object inputElement) { - return values; - } - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - }); - - dialog.setLabelProvider(new LabelProvider() { - @Override - public boolean isLabelProperty(Object element, String property) { - return false; - } - }); - - int result = dialog.open(); - if (result == Window.OK) { - final Object[] objs = dialog.getResult(); - if (objs.length == 1) { - final String value = ((Enum<?>) objs[0]).name(); - msgNode.getSubscription().setElementValue(path, value); - } - } - } catch (Throwable t) { - final String logMsg = - String.format("Exception while attempting to set element %s of message %s", element.getName(), - msg.getName()); - OseeLog.log(Activator.class, Level.SEVERE, logMsg, t); - } - - } else { - InputDialog dialog = - new InputDialog(Displays.getActiveShell(), "Set " + element.getFullName(), "Enter set value", "0", - new IInputValidator() { - - @Override - public String isValid(String newText) { - // No Error accept all values; - return null; - } - }); - - // final EntryDialog dialog = - // new EntryDialog(Displays.getActiveShell(), "Set " + element.getFullName(), null, - // "Enter set value", MessageDialog.QUESTION, new String[] {"Ok", "Cancel"}, 0); - if (dialog.open() == 0) { - try { - final String val = dialog.getValue(); - msgNode.getSubscription().setElementValue(path, val); - } catch (Exception ex) { - OseeLog.logf(Activator.class, Level.SEVERE, ex, "Unable to set the %s element for the message %s", - element.getName(), msg.getName()); - MessageDialog.openError(Displays.getActiveShell(), "Error", "Could not set value"); - } - } - } - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/WatchElementAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/WatchElementAction.java deleted file mode 100644 index a8ae9779d5f..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/WatchElementAction.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import java.util.Collection; -import java.util.LinkedList; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.window.Window; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.ote.client.msg.core.IMessageSubscription; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.elements.RecordElement; -import org.eclipse.osee.ote.ui.message.OteMessageImage; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; -import org.eclipse.osee.ote.ui.message.watch.AddWatchParameter; -import org.eclipse.osee.ote.ui.message.watch.ChildElementNodeContentProvider; -import org.eclipse.osee.ote.ui.message.watch.ChildElementNodeLabelProvider; -import org.eclipse.osee.ote.ui.message.watch.ChildSelectCheckedTreeSelectionDialog; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.osee.ote.ui.message.watch.WatchView; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -/** - * @author Andrew M. Finkbeiner - */ -public class WatchElementAction extends Action { - private final WatchView watchView; - - private final WatchedMessageNode msgNode; - - public WatchElementAction(WatchView watchView, WatchedMessageNode node) { - super("Watch Element", IAction.AS_PUSH_BUTTON); - setToolTipText("loads additional message elements"); - this.watchView = watchView; - this.msgNode = node; - setEnabled(node.isEnabled() && node.getSubscription().isResolved()); - } - - @Override - public void run() { - final String msgName = msgNode.getMessageClassName(); - final LinkedList<Element> list = new LinkedList<Element>(); - boolean needsTreeView = false; - - IMessageSubscription subscription = msgNode.getSubscription(); - Message<?, ?, ?> message = subscription.getMessage(); - Collection<Element> msgElements = message.getElements(); - - for (final Element element : msgElements) { - if (element instanceof RecordElement) { - needsTreeView = true; - list.add(element); - } else if (msgNode.findChildElement(new ElementPath(element.getElementPath())) == null) { - list.add(element); - } - } - if (needsTreeView) { - ChildSelectCheckedTreeSelectionDialog dialog = - new ChildSelectCheckedTreeSelectionDialog(Displays.getActiveShell(), new ChildElementNodeLabelProvider(), - new ChildElementNodeContentProvider()); - dialog.setTitle(msgNode.getName()); - - dialog.setImage(ImageManager.getImage(OteMessageImage.GEAR)); - dialog.setEmptyListMessage("No matching message elements"); - dialog.setInput(msgNode); - dialog.setMessage("Select elements to watch."); - if (dialog.open() == Window.OK) { - Object[] additions = dialog.getResult(); - if (additions.length > 0) { - AddWatchParameter parameter = new AddWatchParameter(); - for (Object elem : additions) { - if (!(elem instanceof RecordElement)) { - parameter.addMessage(msgName, new ElementPath(((Element) elem).getElementPath())); - } - } - watchView.addWatchMessage(parameter); - watchView.getTreeViewer().refresh(msgNode); - watchView.saveWatchFile(); - } - } - } else { - final Element[] elements = list.toArray(new Element[list.size()]); - ElementListSelectionDialog dialog = - new ElementListSelectionDialog(Displays.getActiveShell(), new ElementLabelProvider()); - dialog.setMultipleSelection(true); - dialog.setTitle(msgNode.getName()); - dialog.setImage(ImageManager.getImage(OteMessageImage.GEAR)); - dialog.setMessage("Select element to watch. (? matches any character, * matches any string)"); - dialog.setEmptySelectionMessage("No matching message elements"); - dialog.setElements(elements); - if (dialog.open() == Window.OK) { - Object[] additions = dialog.getResult(); - if (additions.length > 0) { - AddWatchParameter parameter = new AddWatchParameter(); - for (Object elem : additions) { - parameter.addMessage(msgName, new ElementPath(((Element) elem).getElementPath())); - } - watchView.addWatchMessage(parameter); - watchView.getTreeViewer().refresh(msgNode); - watchView.saveWatchFile(); - } - } - } - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ZeroizeElementAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ZeroizeElementAction.java deleted file mode 100644 index 2ed2f82476e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ZeroizeElementAction.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import java.util.List; -import java.util.logging.Level; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.message.tool.MessageMode; -import org.eclipse.osee.ote.ui.message.tree.ElementNode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class ZeroizeElementAction extends Action { - - private final WatchedMessageNode msgNode; - private final List<Object> path; - - public ZeroizeElementAction(ElementNode node) { - super("Zeroize Element"); - this.msgNode = (WatchedMessageNode) node.getMessageNode(); - setEnabled(node.isEnabled() && msgNode.getSubscription().getMessageMode() == MessageMode.WRITER); - path = node.getElementPath().getElementPath(); - } - - @Override - public void run() { - try { - msgNode.getSubscription().zeroize(path); - } catch (Exception e) { - String message = "could not zeroize the message " + msgNode.getMessageClassName(); - OseeLog.log(ZeroizeElementAction.class, Level.SEVERE, message, e); - MessageDialog.openError(Displays.getActiveShell(), "Zeroize Error", message + ". See error log for trace"); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ZeroizeMessageAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ZeroizeMessageAction.java deleted file mode 100644 index 4c1ab3e49f0..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/ZeroizeMessageAction.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.action; - -import java.util.logging.Level; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.message.tool.MessageMode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Ken J. Aguilar - */ -public class ZeroizeMessageAction extends Action { - - private final WatchedMessageNode msgNode; - - public ZeroizeMessageAction(WatchedMessageNode msgNode) { - super("Zeroize " + msgNode.getName()); - this.msgNode = msgNode; - setEnabled(msgNode.isEnabled() && msgNode.getSubscription().getMessageMode() == MessageMode.WRITER && msgNode.getSubscription().isActive()); - } - - @Override - public void run() { - try { - msgNode.getSubscription().zeroize(null); - } catch (Exception e) { - String message = "could not zeroize the message " + msgNode.getMessageClassName(); - OseeLog.log(ZeroizeMessageAction.class, Level.SEVERE, message, e); - MessageDialog.openError(Displays.getActiveShell(), "Zeroize Error", message + ". See error log for trace"); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/BodyDump.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/BodyDump.java deleted file mode 100644 index fa24c67c287..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/BodyDump.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class BodyDump extends DetailsWrapper { - - public BodyDump(MessageRecordDetails details) { - super(details); - } - - public BodyDump(MessageNode messageNode) { - super(messageNode); - } - - @Override - public String toString() { - return "Body Hex Data"; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/BodyElements.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/BodyElements.java deleted file mode 100644 index 469b62a08b8..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/BodyElements.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class BodyElements extends DetailsWrapper { - - public BodyElements(MessageRecordDetails details) { - super(details); - } - - public BodyElements(MessageNode messageNode) { - super(messageNode); - } - - @Override - public String toString() { - return "Body Elements"; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/DetailsWrapper.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/DetailsWrapper.java deleted file mode 100644 index 6a5ec3867bf..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/DetailsWrapper.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; - -/** - * @author Andrew M. Finkbeiner - */ -public class DetailsWrapper implements IElementPath { - - private MessageRecordDetails details; - private ElementPath elementPath; - private MessageNode messageNode; - - public DetailsWrapper(MessageRecordDetails details, ElementPath elementPath) { - this.details = details; - this.elementPath = elementPath; - } - - public DetailsWrapper(MessageRecordDetails details) { - this.details = details; - - } - - public DetailsWrapper(MessageNode messageNode) { - this.messageNode = messageNode; - elementPath = new ElementPath(messageNode.getMessageClassName()); - } - - public MessageRecordDetails getDetails() { - return details; - } - - @Override - public ElementPath getElementPath() { - return elementPath; - } - - public MessageNode getMessageNode() { - return messageNode; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/HeaderDump.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/HeaderDump.java deleted file mode 100644 index 20b0a759a85..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/HeaderDump.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class HeaderDump extends DetailsWrapper { - - public HeaderDump(MessageRecordDetails details) { - super(details); - } - - public HeaderDump(MessageNode messageNode) { - super(messageNode); - } - - @Override - public String toString() { - return "Header Hex Data"; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/HeaderElements.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/HeaderElements.java deleted file mode 100644 index 634a283a8ff..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/HeaderElements.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class HeaderElements extends DetailsWrapper { - - public HeaderElements(MessageRecordDetails details) { - super(details); - } - - public HeaderElements(MessageNode messageNode) { - super(messageNode); - } - - @Override - public String toString() { - return "Header Elements"; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/IElementPath.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/IElementPath.java deleted file mode 100644 index fa8d23e75af..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/IElementPath.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.osee.ote.ui.message.watch.ElementPath; - -/** - * @author Andrew M. Finkbeiner - */ -public interface IElementPath { - ElementPath getElementPath(); -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/MessageRecordDetailContentProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/MessageRecordDetailContentProvider.java deleted file mode 100644 index 947dc6f504e..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/MessageRecordDetailContentProvider.java +++ /dev/null @@ -1,205 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.osee.ote.message.IMessageHeader; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.ui.message.tree.AbstractTreeNode; -import org.eclipse.osee.ote.ui.message.tree.HeaderElementNode; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.WatchList; -import org.eclipse.osee.ote.ui.message.tree.WatchedElementNode; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; - -/** - * @author Andrew M. Finkbeiner - */ -public class MessageRecordDetailContentProvider implements ITreeContentProvider { - - private WatchList root; - // we can do this because the tree doesn't change - private final Map<Object, Object> childToParent = new HashMap<Object, Object>(1024); - private final Map<Object, Object[]> parentToChildren = new HashMap<Object, Object[]>(); - - public MessageRecordDetailContentProvider() { - } - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - childToParent.clear(); - parentToChildren.clear(); - if (newInput != null) { - root = (WatchList) newInput; - recursivePreLoad(newInput); - } - } - - /* - * We have do to this so that we can restore the recording state. Since we are utilizing the node structure of the MW - * tree but modifying it on the fly we have to rely on this content provider to find the nodes that need checks. So - * we need our lookup maps populated so that viewer.setSubtreeSelected can find the widget that it needs to update. - */ - private void recursivePreLoad(Object... input) { - for (Object obj : input) { - Object[] children = getChildren(obj); - if (children.length > 0) { - recursivePreLoad(children); - } - } - } - - @Override - public Object[] getChildren(Object parentElement) { - Object[] returnVals = parentToChildren.get(parentElement); - if (returnVals != null) { - return returnVals; - } - if (parentElement instanceof WatchList) { - HashSet<MessageNode> list = new HashSet<MessageNode>(); - for (MessageNode node : ((WatchList) parentElement).getMessages()) { - if (node.isEnabled()) { - list.add(node); - } - } - return list.toArray(); - } - if (parentElement instanceof MessageNode) { - MessageNode messageNode = (MessageNode) parentElement; - Object headerDump = new HeaderDump(messageNode); - Object headerElements = new HeaderElements(messageNode); - Object bodyDump = new BodyDump(messageNode); - Object bodyElements = new BodyElements(messageNode); - - childToParent.put(headerDump, parentElement); - childToParent.put(headerElements, parentElement); - childToParent.put(bodyDump, parentElement); - childToParent.put(bodyElements, parentElement); - - returnVals = new Object[] {headerDump, headerElements, bodyDump, bodyElements}; - } else if (parentElement instanceof BodyElements) { - Object[] children = ((BodyElements) parentElement).getMessageNode().getChildren().toArray(); - Arrays.sort(children, new ElementByteComparator()); - - for (Object obj : children) { - childToParent.put(obj, parentElement); - } - - returnVals = children; - } else if (parentElement instanceof HeaderElements) { - String msgName = ((HeaderElements) parentElement).getMessageNode().getMessageClassName(); - WatchedMessageNode node = root.getMessageNode(msgName); - if (node != null) { - IMessageHeader header = - node.getSubscription().getMessage().getActiveDataSource(node.getMemType()).getMsgHeader(); - - Element[] headerElements = header != null ? header.getElements() : new Element[0]; - Object[] objs = new Object[headerElements.length]; - for (int i = 0; i < headerElements.length; i++) { - HeaderElementNode elementNode = new HeaderElementNode(headerElements[i]); - objs[i] = elementNode; - childToParent.put(objs[i], parentElement); - } - returnVals = objs; - } - } else if (parentElement instanceof AbstractTreeNode) { - Object[] children = ((AbstractTreeNode) parentElement).getChildren().toArray(); - Arrays.sort(children, new ElementByteComparator()); - for (Object obj : children) { - childToParent.put(obj, parentElement); - } - returnVals = children; - } - if (returnVals != null) { - parentToChildren.put(parentElement, returnVals); - return returnVals; - } - return new Object[0]; - } - - @Override - public Object getParent(Object element) { - return childToParent.get(element); - } - - @Override - public boolean hasChildren(Object element) { - return getChildren(element).length > 0; - } - - @Override - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - private static final class ElementByteComparator implements Comparator<Object>, Serializable { - private static final long serialVersionUID = 7434564953521614526L; - - @Override - public int compare(Object o1, Object o2) { - if (o1 instanceof WatchedElementNode && o2 instanceof WatchedElementNode) { - Integer int1 = ((WatchedElementNode) o1).getByteOffset(); - Integer int2 = ((WatchedElementNode) o2).getByteOffset(); - if (int1 == null || int2 == null) { - return 0; - } else { - int byte1 = int1.intValue(); - int byte2 = int2.intValue(); - if (byte1 == byte2) { - Integer msb1 = ((WatchedElementNode) o1).getMsb(); - Integer msb2 = ((WatchedElementNode) o2).getMsb(); - if (msb1 == null || msb2 == null) { - return byte1 - byte2; - } else { - return msb1.intValue() - msb2.intValue(); - } - } else { - return byte1 - byte2; - } - } - } else if (o1 instanceof HeaderElementNode && o2 instanceof HeaderElementNode) { - Integer int1 = ((HeaderElementNode) o1).getByteOffset(); - Integer int2 = ((HeaderElementNode) o2).getByteOffset(); - if (int1 == null || int2 == null) { - return 0; - } else { - int byte1 = int1.intValue(); - int byte2 = int2.intValue(); - if (byte1 == byte2) { - Integer msb1 = ((HeaderElementNode) o1).getMsb(); - Integer msb2 = ((HeaderElementNode) o2).getMsb(); - if (msb1 == null || msb2 == null) { - return byte1 - byte2; - } else { - return msb1.intValue() - msb2.intValue(); - } - } else { - return byte1 - byte2; - } - } - } else { - return 0; - } - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/MessageRecordDetailLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/MessageRecordDetailLabelProvider.java deleted file mode 100644 index 782c5b335ad..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/MessageRecordDetailLabelProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.HeaderElementNode; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.WatchedElementNode; -import org.eclipse.swt.graphics.Image; - -/** - * @author Andrew M. Finkbeiner - */ -public class MessageRecordDetailLabelProvider extends LabelProvider { - - @Override - public Image getImage(Object element) { - return null; - } - - @Override - public String getText(Object element) { - if (element instanceof MessageRecordDetails) { - MessageRecordDetails details = (MessageRecordDetails) element; - return details.getName(); - } else if (element instanceof BodyElements || element instanceof HeaderElements || element instanceof BodyDump || element instanceof HeaderDump) { - return element.toString(); - } else if (element instanceof DetailsWrapper) { - DetailsWrapper details = (DetailsWrapper) element; - return details.getElementPath().asString(); - } else if (element instanceof MessageNode) { - return ((MessageNode) element).getMessageClassName(); - } else if (element instanceof WatchedElementNode) { - WatchedElementNode node = (WatchedElementNode) element; - return String.format("%s: byte=%d, msb=%d, lsb=%d", node.getElementName(), node.getByteOffset(), - node.getMsb(), node.getLsb()); - } else if (element instanceof HeaderElementNode) { - HeaderElementNode node = (HeaderElementNode) element; - return String.format("%s: byte=%d, msb=%d, lsb=%d", node.getElementName(), node.getByteOffset(), - node.getMsb(), node.getLsb()); - } - return element.toString(); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingFilePage.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingFilePage.java deleted file mode 100644 index 4d6a19a414a..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingFilePage.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import java.io.File; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.framework.ui.swt.Widgets; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -public class RecordingFilePage extends WizardPage { - private static final String SECTION = "ote.ui.message.settings.section"; - private static final String PATH_KEY = "ote.ui.message.settings.rec_file_path"; - - private String selectedFile; - private Text filePathTxt; - - public RecordingFilePage() { - super("filePage"); - setTitle("Select A File"); - setDescription("This is the file that will contain the recorded data."); - } - - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - Widgets.setFormLayout(composite); - Label fileLbl = new Label(composite, SWT.RIGHT); - fileLbl.setText("Path:"); - filePathTxt = new Text(composite, SWT.BORDER | SWT.READ_ONLY); - Button filePickBtn = new Button(composite, SWT.PUSH); - - Widgets.attachToParent(filePickBtn, SWT.RIGHT, 100, -10); - Widgets.attachToParent(filePickBtn, SWT.TOP, 50, 0); - - Widgets.attachToParent(fileLbl, SWT.LEFT, 0, 10); - - Widgets.attachToControl(filePathTxt, filePickBtn, SWT.RIGHT, SWT.LEFT, -5); - Widgets.attachToControl(filePathTxt, filePickBtn, SWT.TOP, SWT.CENTER, 0); - Widgets.attachToControl(filePathTxt, fileLbl, SWT.LEFT, SWT.RIGHT, 5); - - Widgets.attachToControl(fileLbl, filePathTxt, SWT.TOP, SWT.CENTER, 0); - - filePickBtn.setText("Browse..."); - filePickBtn.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - IDialogSettings settings = Activator.getDefault().getDialogSettings(); - IDialogSettings section = settings.getSection(SECTION); - if (section == null) { - section = settings.addNewSection(SECTION); - } - - FileDialog dialog = new FileDialog(Displays.getActiveShell(), SWT.SAVE); - String path = section.get(PATH_KEY); - if (path != null) { - File file = new File(path); - if (file.exists() && file.isDirectory()) { - dialog.setFilterPath(path); - } - } - dialog.setFilterExtensions(new String[] {"*.csv"}); - String result = dialog.open(); - if (result != null) { - File file = new File(result); - section.put(PATH_KEY, file.getParent()); - - int filterIndex = dialog.getFilterIndex(); - String[] extensions = dialog.getFilterExtensions(); - if (filterIndex >= 0 && filterIndex < extensions.length) { - if (!result.endsWith(extensions[filterIndex].substring(1))) { - result = result + extensions[filterIndex].substring(1); - } - } - selectedFile = result; - selectSource(); - } - } - - }); - if (selectedFile != null) { - selectSource(); - } else { - setPageComplete(false); - } - setControl(composite); - } - - private void selectSource() { - filePathTxt.setText(selectedFile); - setPageComplete(true); - } - - public String getFileName() { - return filePathTxt.getText(); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingFilter.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingFilter.java deleted file mode 100644 index 44f0bce67af..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingFilter.java +++ /dev/null @@ -1,288 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTreeViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.osee.ote.message.Message; -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.message.elements.Element; -import org.eclipse.osee.ote.message.enums.DataType; -import org.eclipse.osee.ote.ui.message.tree.ElementNode; -import org.eclipse.osee.ote.ui.message.tree.MessageNode; -import org.eclipse.osee.ote.ui.message.tree.WatchList; -import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode; -import org.eclipse.osee.ote.ui.message.watch.ElementPath; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -/** - * @author Andrew M. Finkbeiner - */ -public class RecordingFilter extends WizardPage { - - private CheckboxTreeViewer viewer; - private final WatchList watchList; - - public RecordingFilter(WatchList watchList) { - super("Filter Recording"); - setTitle("Recording File"); - setDescription("Check all of the elements you want to record."); - this.watchList = watchList; - } - - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.numColumns = 6; - - composite.setLayout(layout); - - GridData data = new GridData(GridData.FILL_BOTH); - data.grabExcessHorizontalSpace = true; - data.grabExcessVerticalSpace = true; - data.horizontalSpan = 6; - - viewer = new CheckboxTreeViewer(composite); - viewer.setUseHashlookup(true); - viewer.getTree().setLayoutData(data); - viewer.setLabelProvider(new MessageRecordDetailLabelProvider()); - viewer.setContentProvider(new MessageRecordDetailContentProvider()); - viewer.setInput(watchList); - - restoreCheckBoxSelectionState(); - - viewer.addCheckStateListener(new ICheckStateListener() { - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - viewer.expandToLevel(event.getElement(), 1); - viewer.setSubtreeChecked(event.getElement(), event.getChecked()); - - setPageComplete(isPageComplete()); - } - }); - - Button selectAll = new Button(composite, SWT.PUSH); - data = new GridData(); - selectAll.setText("Select All"); - selectAll.setLayoutData(data); - selectAll.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - viewer.expandAll(); - Object[] objects = viewer.getExpandedElements(); - for (Object element : objects) { - viewer.setSubtreeChecked(element, true); - } - setPageComplete(isPageComplete()); - } - - }); - - Button selectBodyElements = new Button(composite, SWT.PUSH); - selectBodyElements.setText("Select Body Elements"); - data = new GridData(); - selectBodyElements.setLayoutData(data); - selectBodyElements.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - for (Object node : ((MessageRecordDetailContentProvider) viewer.getContentProvider()).getChildren(watchList)) { - if (node instanceof MessageNode) { - for (Object messageChild : ((MessageRecordDetailContentProvider) viewer.getContentProvider()).getChildren(node)) { - if (messageChild instanceof BodyElements) { - viewer.setSubtreeChecked(messageChild, true); - } - } - } - } - setPageComplete(isPageComplete()); - } - - }); - - Button deselectAll = new Button(composite, SWT.PUSH); - deselectAll.setText("Deselect All"); - data = new GridData(); - deselectAll.setLayoutData(data); - deselectAll.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - for (Object obj : viewer.getCheckedElements()) { - viewer.setSubtreeChecked(obj, false); - } - setPageComplete(isPageComplete()); - } - - }); - setControl(composite); - } - - /** - * This method must be called after the input has been set so that the content provider lookups can find the tree - * items to restore. - */ - private void restoreCheckBoxSelectionState() { - for (Object node : ((MessageRecordDetailContentProvider) viewer.getContentProvider()).getChildren(watchList)) { - if (node instanceof MessageNode) { - WatchedMessageNode msgNode = (WatchedMessageNode) node; - Object[] headerElements = null; - for (Object messageChild : ((MessageRecordDetailContentProvider) viewer.getContentProvider()).getChildren(node)) { - if (msgNode.getRecordingState().getHeaderDump() && messageChild instanceof HeaderDump) { - viewer.setSubtreeChecked(messageChild, true); - } - if (msgNode.getRecordingState().getBodyDump() && messageChild instanceof BodyDump) { - viewer.setSubtreeChecked(messageChild, true); - } - - if (messageChild instanceof HeaderElements) { - headerElements = - ((MessageRecordDetailContentProvider) viewer.getContentProvider()).getChildren(messageChild); - } - - } - - for (ElementPath path : msgNode.getRecordingState().getBodyElements()) { - ElementNode child = msgNode.findChildElement(path); - viewer.setSubtreeChecked(child, true); - } - - if (headerElements != null) { - for (ElementPath child : msgNode.getRecordingState().getHeaderElements()) { - for (Object obj : headerElements) { - if (obj instanceof ElementNode) { - if (((ElementNode) obj).getElementPath().equals(child)) { - viewer.setSubtreeChecked(obj, true); - } - } - } - } - } - } - } - } - - public List<MessageRecordDetails> getData() { - Object[] objs = viewer.getCheckedElements(); - MessageDetailsTransform transform = new MessageDetailsTransform(); - for (Object obj : objs) { - transform.put(obj); - } - List<MessageRecordDetails> details = transform.getData(); - for (MessageRecordDetails detail : details) { - WatchedMessageNode msgNode = watchList.getMessageNode(detail.getName()); - if (msgNode != null) { - msgNode.getRecordingState().reset(); - msgNode.getRecordingState().setBodyDump(detail.getBodyDump()); - msgNode.getRecordingState().setHeaderDump(detail.getHeaderDump()); - for (List<Object> path : detail.getHeaderElementNames()) { - msgNode.getRecordingState().addHeader(new ElementPath(path)); - } - for (List<Object> path : detail.getBodyElementNames()) { - msgNode.getRecordingState().addBody(new ElementPath(path)); - } - } - } - return transform.getData(); - } - - private class MessageDetailsTransform { - private final Map<String, MessageRecordDetailsChecked> details = - new LinkedHashMap<String, MessageRecordDetailsChecked>(); - - public void put(Object checkedWrapper) { - if (checkedWrapper instanceof IElementPath) { - ElementPath path = ((IElementPath) checkedWrapper).getElementPath(); - if (path == null) { - System.out.println(checkedWrapper.getClass().getName()); - System.out.println(checkedWrapper); - } else { - String messageName = path.getMessageName(); - if (messageName.equals("UNKNOWN")) { - System.out.println("hello"); - } - MessageRecordDetailsChecked checked = details.get(messageName); - if (checked == null) { - checked = new MessageRecordDetailsChecked(); - details.put(messageName, checked); - } - checked.put(checkedWrapper); - } - } else { - checkedWrapper.getClass().toString(); - } - } - - public List<MessageRecordDetails> getData() { - List<MessageRecordDetails> data = new ArrayList<MessageRecordDetails>(); - for (String msg : details.keySet()) { - data.add(details.get(msg).create(msg, watchList.getMessageNode(msg).getMemType())); - } - return data; - } - } - - private class MessageRecordDetailsChecked { - private final List<List<Object>> headers = new ArrayList<List<Object>>(); - private final List<List<Object>> elements = new ArrayList<List<Object>>(); - private boolean bodyDump; - private boolean headerDump; - - public void put(Object checkedWrapper) { - if (checkedWrapper instanceof BodyDump) { - bodyDump = true; - } else if (checkedWrapper instanceof HeaderDump) { - headerDump = true; - } else if (checkedWrapper instanceof IElementPath) { - ElementPath path = ((IElementPath) checkedWrapper).getElementPath(); - if (path.isHeader()) { - headers.add(path.getElementPath()); - } else { - - if (getMessageElement(new ElementPath(path.getElementPath())) != null) { - elements.add(path.getElementPath()); - } else { - System.out.println(String.format("unable to record [%s]", - new ElementPath(path.getElementPath()).asString())); - } - } - } - } - - public MessageRecordDetails create(String msg, DataType currentMemType) { - return new MessageRecordDetails(msg, currentMemType, headerDump, headers, bodyDump, elements); - } - } - - public Element getMessageElement(ElementPath elementPath) { - Element el = null; - WatchedMessageNode node = watchList.getMessageNode((String) elementPath.get(0)); - Message<?, ?, ?> msg = node.getSubscription().getMessage(); - el = msg.getElement(elementPath.getElementPath()); - return el; - } - - @Override - public boolean isPageComplete() { - return viewer.getCheckedElements().length > 0; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingWizard.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingWizard.java deleted file mode 100644 index 31496cc24de..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/RecordingWizard.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording; - -import java.util.List; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.osee.ote.message.commands.RecordCommand.MessageRecordDetails; -import org.eclipse.osee.ote.ui.message.tree.WatchList; - -/** - * @author Andrew M. Finkbeiner - */ -public class RecordingWizard extends Wizard { - - private final RecordingFilter filter; - private String fileName; - private final RecordingFilePage fileCreation; - private List<MessageRecordDetails> filteredList; - - public RecordingWizard(WatchList watchList) { - setWindowTitle("Recording Options"); - fileCreation = new RecordingFilePage(); - filter = new RecordingFilter(watchList); - addPage(fileCreation); - addPage(filter); - } - - @Override - public boolean performFinish() { - filteredList = filter.getData(); - fileName = fileCreation.getFileName(); - return super.canFinish(); - } - - public List<MessageRecordDetails> getFilteredMessageRecordDetails() { - return filteredList; - } - - public String getFileName() { - return fileName; - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java deleted file mode 100644 index a213c2eb6c0..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording.xform; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.logging.Level; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.action.Action; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.FileDialog; - -/** - * @author Andrew M. Finkbeiner - */ -public class CsvTransform extends Action { - @Override - public void run() { - - FileDialogSelectionGetter getter = new FileDialogSelectionGetter(); - - AWorkbench.getDisplay().syncExec(getter); - if (getter.getPath() != null) { - File file = new File(getter.getPath()); - File csvFile = new File(getter.getPath() + "_transformed.csv"); - if (!file.exists()) { - OseeLog.logf(Activator.class, Level.SEVERE, - "[%s] does not exist. Exiting the csv transformer.", file.toString()); - } - - try { - BufferedReader br = new BufferedReader(new FileReader(file)); - LinkedHashSet<String> columns = new LinkedHashSet<String>(); - - String line; - while ((line = br.readLine()) != null) { - String[] items = line.split(","); - if (items.length <= 3) { - continue; - } - String msg = items[1]; - msg += "."; - for (int i = 3; i < items.length; i += 2) { - columns.add(msg + items[i]); - } - } - br.close(); - - String[] columnsArray = columns.toArray(new String[columns.size()]); - - BufferedWriter bw = new BufferedWriter(new FileWriter(csvFile)); - bw.write("time,"); - if (columnsArray.length >= 254) { - OseeLog.logf(CsvTransform.class, Level.SEVERE, - "%d columns have been lost in the CsvTransform because there is a limitation of 256 rows in excel.", - (columnsArray.length - 254)); - } - for (int i = 0; i < columnsArray.length && i < 254; i++) { - bw.write(columnsArray[i]); - bw.write(","); - } - bw.write("\n"); - - br = new BufferedReader(new FileReader(file)); - Map<String, String> values = new HashMap<String, String>(); - while ((line = br.readLine()) != null) { - values.clear(); - String[] items = line.split(","); - if (items.length <= 3) { - continue; - } - String time = items[0]; - String msg = items[1]; - msg += "."; - for (int i = 3; i < items.length; i += 2) { - String value = null; - if (i + 1 >= items.length) { - value = "null"; - } else { - value = items[i + 1]; - } - values.put(msg + items[i], value); - } - bw.write(time); - bw.write(","); - for (int i = 0; i < columnsArray.length && i < 254; i++) { - String value = values.get(columnsArray[i]); - if (value != null) { - bw.write(value); - } - bw.write(","); - } - bw.write("\n"); - } - br.close(); - bw.flush(); - bw.close(); - - OseeLog.logf(Activator.class, Level.INFO, "Wrote [%s].", csvFile.toString()); - } catch (Throwable ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - } else { - OseeLog.log(Activator.class, Level.INFO, "No file was selected for translating."); - } - } - - private static final class FileDialogSelectionGetter implements Runnable { - - String path; - - @Override - public void run() { - FileDialog fd = new FileDialog(AWorkbench.getActiveShell(), SWT.OPEN); - fd.setFilterPath(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()); - // fd.setFilterExtensions(new String[]{"*.rec"}); - if (fd.open() != null) { - path = fd.getFilterPath() + File.separator + fd.getFileName(); - // path = fd.getFileName(); - } else { - path = null; - } - } - - public String getPath() { - return path; - } - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/DetermineElementColumns.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/DetermineElementColumns.java deleted file mode 100644 index 82480a14f84..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/DetermineElementColumns.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording.xform; - -import java.util.LinkedHashSet; -import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * @author Andrew M. Finkbeiner - */ -public class DetermineElementColumns extends AbstractSaxHandler { - - private final String[] pubSubHeaderElementsToStore = new String[] {"timeTag", "sequenceNum"}; - private final LinkedHashSet<String> elementNames = new LinkedHashSet<String>(); - private String message; - - @Override - public void endElementFound(String uri, String localName, String qName) throws SAXException { - } - - @Override - public void startElementFound(String uri, String localName, String qName, Attributes attributes) throws SAXException { - - if ("Update".equals(localName)) { - message = attributes.getValue("message"); - } else if ("PubSubHeaderInfo".equals(localName)) { - for (String str : pubSubHeaderElementsToStore) { - elementNames.add(String.format("%s.PubSubHeader.%s", message, str)); - } - } else if ("Element".equals(localName)) { - elementNames.add(String.format("%s.%s", message, attributes.getValue("name"))); - } - } - - public String[] getElementColumns() { - return elementNames.toArray(new String[elementNames.size()]); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/ElementVsTimeCSV.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/ElementVsTimeCSV.java deleted file mode 100644 index 07ce1fe9870..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/ElementVsTimeCSV.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording.xform; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; - -/** - * @author Andrew M. Finkbeiner - */ -public class ElementVsTimeCSV extends AbstractSaxHandler { - private static String UPDATE = "Update"; - private static String PUBSUBHEADERINFO = "PubSubHeaderInfo"; - private final String[] pubSubHeaderElementsToStore = new String[] {"timeTag", "sequenceNum"}; - private String message; - private String time; - private final List<Storage> storage = new ArrayList<Storage>(); - private final List<String> columnsToPrint = new ArrayList<String>(); - private final StringBuilder builder = new StringBuilder(); - - public ElementVsTimeCSV(String[] elementColumns) { - for (String str : elementColumns) { - columnsToPrint.add(str); - } - } - - @Override - public void endElementFound(String uri, String localName, String qName) throws SAXException { - if ("WatchRecord".equals(localName)) { - Collections.sort(storage); - HashMap<String, String> timeSlice = new HashMap<String, String>(); - - builder.append("time"); - for (String str : columnsToPrint) { - builder.append(","); - builder.append(str); - } - builder.append("\n"); - - for (int i = 0; i < storage.size(); i++) { - Storage o = storage.get(i); - long lastTime = o.time; - timeSlice.put(o.name, o.value); - for (; i < storage.size(); i++) { - o = storage.get(i); - if (o.time == lastTime) { - timeSlice.put(o.name, o.value); - } else { - i--; - break; - } - } - - builder.append(lastTime); - for (String str : columnsToPrint) { - builder.append(","); - String value = timeSlice.get(str); - builder.append((value == null ? "" : value)); - } - builder.append("\n"); - timeSlice.clear(); - } - } - } - - @Override - public void startElementFound(String uri, String localName, String qName, Attributes attributes) throws SAXException { - - if (UPDATE.equals(localName)) { - time = attributes.getValue("time"); - message = attributes.getValue("message"); - } else if (PUBSUBHEADERINFO.equals(localName)) { - for (String str : pubSubHeaderElementsToStore) { - storage.add(new Storage(time, String.format("%s.PubSubHeader.%s", message, str), attributes.getValue(str))); - } - } else if ("Element".equals(localName)) { - storage.add(new Storage(time, String.format("%s.%s", message, attributes.getValue("name")), - attributes.getValue("value"))); - } - } - - private static final class Storage implements Comparable<Storage> { - public long time; - public String name; - public String value; - - public Storage(String time, String name, String value) { - this.time = Long.parseLong(time); - this.name = name; - this.value = value; - } - - @Override - public int compareTo(Storage o) { - if (time > o.time) { - return 1; - } else if (time == o.time) { - return 0; - } else { - return -1; - } - } - } - - /** - * @return the builder - */ - public StringBuilder getBuilder() { - return builder; - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java deleted file mode 100644 index 68d2b6e134d..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording.xform; - -import java.io.File; -import java.io.FileInputStream; -import java.util.logging.Level; -import org.eclipse.equinox.app.IApplication; -import org.eclipse.equinox.app.IApplicationContext; -import org.eclipse.osee.framework.jdk.core.util.Lib; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.xml.sax.InputSource; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -public class RunCSVConversion implements IApplication { - - @Override - public Object start(IApplicationContext context) throws Exception { - String filepath = System.getProperty("csvprocess"); - - if (filepath == null) { - OseeLog.log(Activator.class, Level.SEVERE, - "Java Property 'csvprocess' was not set, the program will exit. Use '-vmargs -Dcsvprocess=<filetoprocess>' "); - return null; - } - - File file = new File(filepath); - File csvFile = new File(filepath + ".csv"); - if (!file.exists()) { - OseeLog.logf(Activator.class, Level.SEVERE, - "[%s] does not exist. Exiting the csv processor.", file.toString()); - return null; - } - - XMLReader reader = XMLReaderFactory.createXMLReader(); - DetermineElementColumns detElCols = new DetermineElementColumns(); - reader.setContentHandler(detElCols); - reader.parse(new InputSource(new FileInputStream(file))); - - reader = XMLReaderFactory.createXMLReader(); - ElementVsTimeCSV csv = new ElementVsTimeCSV(detElCols.getElementColumns()); - reader.setContentHandler(csv); - reader.parse(new InputSource(new FileInputStream(file))); - - Lib.writeBytesToFile(csv.getBuilder().toString().getBytes(), csvFile); - OseeLog.logf(Activator.class, Level.INFO, "Wrote [%s].", csvFile.toString()); - return IApplication.EXIT_OK; - } - - @Override - public void stop() { - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java deleted file mode 100644 index 7f9973966f5..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.message.watch.recording.xform; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.logging.Level; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.osee.framework.jdk.core.util.Lib; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.plugin.util.AWorkbench; -import org.eclipse.osee.ote.ui.message.internal.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.FileDialog; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -public class RunCsvAction extends Action { - - public RunCsvAction() { - super(); - } - - public RunCsvAction(String text) { - super(text); - } - - public RunCsvAction(String text, ImageDescriptor image) { - super(text, image); - } - - public RunCsvAction(String text, int style) { - super(text, style); - } - - @Override - public void run() { - - FileDialogSelectionGetter getter = new FileDialogSelectionGetter(); - - AWorkbench.getDisplay().syncExec(getter); - if (getter.getPath() != null) { - File file = new File(getter.getPath()); - File csvFile = new File(getter.getPath() + ".csv"); - if (!file.exists()) { - OseeLog.logf(Activator.class, Level.SEVERE, - "[%s] does not exist. Exiting the csv processor.", file.toString()); - } - - XMLReader reader; - try { - reader = XMLReaderFactory.createXMLReader(); - DetermineElementColumns detElCols = new DetermineElementColumns(); - reader.setContentHandler(detElCols); - reader.parse(new InputSource(new FileInputStream(file))); - reader = XMLReaderFactory.createXMLReader(); - ElementVsTimeCSV csv = new ElementVsTimeCSV(detElCols.getElementColumns()); - reader.setContentHandler(csv); - reader.parse(new InputSource(new FileInputStream(file))); - - Lib.writeBytesToFile(csv.getBuilder().toString().getBytes(), csvFile); - OseeLog.logf(Activator.class, Level.INFO, "Wrote [%s].", csvFile.toString()); - } catch (SAXException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } catch (FileNotFoundException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } catch (IOException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - - } else { - OseeLog.log(Activator.class, Level.INFO, "No file was selected for translating."); - } - } - - private static final class FileDialogSelectionGetter implements Runnable { - - String path; - - @Override - public void run() { - FileDialog fd = new FileDialog(AWorkbench.getActiveShell(), SWT.OPEN); - fd.setFilterExtensions(new String[] {"*.rec"}); - if (fd.open() != null) { - path = fd.getFilterPath() + File.separator + fd.getFileName(); - // path = fd.getFileName(); - } else { - path = null; - } - } - - public String getPath() { - return path; - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/.classpath b/plugins/org.eclipse.osee.ote.ui.mux/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/plugins/org.eclipse.osee.ote.ui.mux/.pmd b/plugins/org.eclipse.osee.ote.ui.mux/.pmd deleted file mode 100644 index c7b0a9fb3f5..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/.pmd +++ /dev/null @@ -1,925 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<pmd> - <useProjectRuleSet>false</useProjectRuleSet> - <ruleSetFile>.ruleset</ruleSetFile> - <rules> - <rule> - <name>LooseCoupling</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>CloneMethodMustImplementCloneable</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>UnusedImports</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>SignatureDeclareThrowsException</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>IfStmtsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>WhileLoopsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>IfElseStmtsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>ForLoopsMustUseBraces</name> - <ruleset>Braces Rules</ruleset> - </rule> - <rule> - <name>UseSingleton</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanReturns</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanExpressions</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SwitchStmtsShouldHaveDefault</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidDeeplyNestedIfStmts</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidReassigningParameters</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SwitchDensity</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ConstructorCallsOverridableMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AccessorClassGeneration</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>FinalFieldCouldBeStatic</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>CloseResource</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonStaticInitializer</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>DefaultLabelNotLastInSwitchStmt</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonCaseLabelInSwitchStatement</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>OptimizableToArrayCall</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>BadComparison</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>EqualsNull</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ConfusingTernary</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>InstantiationToGetClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>IdempotentOperations</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimpleDateFormatNeedsLocale</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ImmutableField</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseLocaleWithCaseConversions</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidProtectedFieldInFinalClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AssignmentToNonFinalStatic</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>MissingStaticMethodInNonInstantiatableClass</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidSynchronizedAtMethodLevel</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>MissingBreakInSwitch</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseNotifyAllInsteadOfNotify</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidInstanceofChecksInCatchClause</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AbstractClassWithoutAbstractMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SimplifyConditional</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>CompareObjectsWithEquals</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>PositionLiteralsFirstInComparisons</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryLocalBeforeReturn</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>NonThreadSafeSingleton</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UncommentedEmptyMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UncommentedEmptyConstructor</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidConstantsInterface</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UnsynchronizedStaticDateFormatter</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>PreserveStackTrace</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>UseCollectionIsEmpty</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ClassWithOnlyPrivateConstructorsShouldBeFinal</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>EmptyMethodInAbstractClassShouldBeAbstract</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>SingularField</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>ReturnEmptyArrayRatherThanNull</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AbstractClassWithoutAnyMethod</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>TooFewBranchesForASwitchStatement</name> - <ruleset>Design Rules</ruleset> - </rule> - <rule> - <name>AvoidCatchingThrowable</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>SignatureDeclareThrowsException</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>ExceptionAsFlowControl</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidCatchingNPE</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingRawExceptionTypes</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingNullPointerException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidRethrowingException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>DoNotExtendJavaLangError</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>DoNotThrowExceptionInFinally</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>AvoidThrowingNewInstanceOfSameException</name> - <ruleset>Strict Exception Rules</ruleset> - </rule> - <rule> - <name>UnusedPrivateField</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedLocalVariable</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedPrivateMethod</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>UnusedFormalParameter</name> - <ruleset>Unused Code Rules</ruleset> - </rule> - <rule> - <name>MoreThanOneLogger</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>LoggerIsNotStaticFinal</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>SystemPrintln</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>AvoidPrintStackTrace</name> - <ruleset>Java Logging Rules</ruleset> - </rule> - <rule> - <name>AvoidDuplicateLiterals</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringInstantiation</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringToString</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InefficientStringBuffering</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryCaseChange</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseStringBufferLength</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>AppendCharacterWithChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>ConsecutiveLiteralAppends</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseIndexOfChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InefficientEmptyStringCheck</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>InsufficientStringBufferDeclaration</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UselessStringValueOf</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>StringBufferInstantiationWithChar</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>UseEqualsToCompareStrings</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>AvoidStringBufferField</name> - <ruleset>String and StringBuffer Rules</ruleset> - </rule> - <rule> - <name>ReplaceVectorWithList</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ReplaceHashtableWithMap</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ReplaceEnumerationWithIterator</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>AvoidEnumAsIdentifier</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>AvoidAssertAsIdentifier</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>IntegerInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ByteInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>ShortInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>LongInstantiation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseBeforeAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseAfterAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4TestShouldUseTestAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnit4SuitesShouldUseSuiteAnnotation</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>JUnitUseExpected</name> - <ruleset>Migration Rules</ruleset> - </rule> - <rule> - <name>UseProperClassLoader</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>MDBAndSessionBeanNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>RemoteSessionInterfaceNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>LocalInterfaceSessionNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>LocalHomeNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>RemoteInterfaceNamingConvention</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>DoNotCallSystemExit</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>StaticEJBFieldShouldBeFinal</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>DoNotUseThreads</name> - <ruleset>J2EE Rules</ruleset> - </rule> - <rule> - <name>AvoidInstantiatingObjectsInLoops</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseArrayListInsteadOfVector</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>SimplifyStartsWith</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseStringBufferForStringAppends</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UseArraysAsList</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>AvoidArrayLoops</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryWrapperObjectCreation</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>AddEmptyString</name> - <ruleset>Optimization Rules</ruleset> - </rule> - <rule> - <name>EmptyCatchBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyIfStmt</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyWhileStmt</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyTryBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyFinallyBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptySwitchStatements</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>JumbledIncrementer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ForLoopShouldBeWhileLoop</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryConversionTemporary</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>OverrideBothEqualsAndHashcode</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>DoubleCheckedLocking</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ReturnFromFinallyBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptySynchronizedBlock</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryReturn</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyStaticInitializer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnconditionalIfStatement</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyStatementNotInLoop</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BooleanInstantiation</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryFinalModifier</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>CollapsibleIfStatements</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UselessOverridingMethod</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>ClassCastExceptionWithToArray</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidDecimalLiteralsInBigDecimalConstructor</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UselessOperationOnImmutable</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>MisplacedNullCheck</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>UnusedNullCheckInEquals</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidThreadGroup</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BrokenNullCheck</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>BigIntegerInstantiation</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingOctalValues</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingHardCodedIP</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>CheckResultSet</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>AvoidMultipleUnaryOperators</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>EmptyInitializer</name> - <ruleset>Basic Rules</ruleset> - </rule> - <rule> - <name>MethodReturnsInternalArray</name> - <ruleset>Security Code Guidelines</ruleset> - </rule> - <rule> - <name>ArrayIsStoredDirectly</name> - <ruleset>Security Code Guidelines</ruleset> - </rule> - <rule> - <name>CouplingBetweenObjects</name> - <ruleset>Coupling Rules</ruleset> - </rule> - <rule> - <name>ExcessiveImports</name> - <ruleset>Coupling Rules</ruleset> - </rule> - <rule> - <name>LooseCoupling</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>DuplicateImports</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>DontImportJavaLang</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>UnusedImports</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - <rule> - <name>ImportFromSamePackage</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>TooManyStaticImports</name> - <ruleset>Import Statement Rules</ruleset> - </rule> - <rule> - <name>JUnitStaticSuite</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitSpelling</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitAssertionsShouldIncludeMessage</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>JUnitTestsShouldIncludeAssert</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>TestClassWithoutTestCases</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryBooleanAssertion</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertEqualsInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertSameInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UseAssertNullInsteadOfAssertTrue</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>SimplifyBooleanAssertion</name> - <ruleset>JUnit Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>NullAssignment</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>UnusedModifier</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AssignmentInOperand</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AtLeastOneConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DontImportSun</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>SuspiciousOctalEscape</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>CallSuperInConstructor</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>UnnecessaryParentheses</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DefaultPackage</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>BooleanInversion</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DataflowAnomalyAnalysis</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidFinalLocalVariable</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingShortType</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingVolatile</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidUsingNativeCode</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>AvoidAccessibilityAlteration</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>DoNotCallGarbageCollectionExplicitly</name> - <ruleset>Controversial Rules</ruleset> - </rule> - <rule> - <name>MethodNamingConventions</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>ClassNamingConventions</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AbstractNaming</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidDollarSigns</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>MethodWithSameNameAsEnclosingClass</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousHashcodeMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousConstantFieldName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>SuspiciousEqualsMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidFieldNameMatchingTypeName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>AvoidFieldNameMatchingMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>NoPackage</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>PackageCase</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>MisleadingVariableName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>BooleanGetMethodName</name> - <ruleset>Naming Rules</ruleset> - </rule> - <rule> - <name>NPathComplexity</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveMethodLength</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveParameterList</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessiveClassLength</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>CyclomaticComplexity</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>ExcessivePublicCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>TooManyFields</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssMethodCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssTypeCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>NcssConstructorCount</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>TooManyMethods</name> - <ruleset>Code Size Rules</ruleset> - </rule> - <rule> - <name>EmptyFinalizer</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeOnlyCallsSuperFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeOverloaded</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeDoesNotCallSuperFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>FinalizeShouldBeProtected</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>AvoidCallingFinalize</name> - <ruleset>Finalizer Rules</ruleset> - </rule> - <rule> - <name>UseCorrectExceptionLogging</name> - <ruleset>Jakarta Commons Logging Rules</ruleset> - </rule> - <rule> - <name>ProperLogger</name> - <ruleset>Jakarta Commons Logging Rules</ruleset> - </rule> - <rule> - <name>MissingSerialVersionUID</name> - <ruleset>JavaBean Rules</ruleset> - </rule> - <rule> - <name>ProperCloneImplementation</name> - <ruleset>Clone Implementation Rules</ruleset> - </rule> - <rule> - <name>CloneThrowsCloneNotSupportedException</name> - <ruleset>Clone Implementation Rules</ruleset> - </rule> - <rule> - <name>CloneMethodMustImplementCloneable</name> - <ruleset>Type Resolution Rules</ruleset> - </rule> - </rules> - <includeDerivedFiles>false</includeDerivedFiles> - <violationsAsErrors>true</violationsAsErrors> -</pmd> diff --git a/plugins/org.eclipse.osee.ote.ui.mux/.project b/plugins/org.eclipse.osee.ote.ui.mux/.project deleted file mode 100644 index b8d1a2b72cf..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.osee.ote.ui.mux</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/plugins/org.eclipse.osee.ote.ui.mux/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ote.ui.mux/META-INF/MANIFEST.MF deleted file mode 100644 index e388dcd22da..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: MuxTool Plug-in (Incubation) -Bundle-SymbolicName: org.eclipse.osee.ote.ui.mux;singleton:=true -Bundle-Version: 0.11.0.qualifier -Bundle-Activator: org.eclipse.osee.ote.ui.mux.MuxToolPlugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.osee.ote.message, - org.eclipse.osee.framework.plugin.core, - org.eclipse.osee.framework.jdk.core, - org.eclipse.osee.framework.ui.swt, - org.eclipse.osee.ote.core, - org.eclipse.osee.ote.client, - org.eclipse.osee.ote.ui, - org.eclipse.osee.ote.connection.service -Bundle-ActivationPolicy: lazy -Bundle-Vendor: Eclipse Open System Engineering Environment -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Import-Package: org.eclipse.osee.framework.logging, - org.eclipse.osee.framework.ui.plugin.util, - org.eclipse.osee.framework.ui.plugin.xnavigate diff --git a/plugins/org.eclipse.osee.ote.ui.mux/build.properties b/plugins/org.eclipse.osee.ote.ui.mux/build.properties deleted file mode 100644 index 5bf780d62c4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/ -
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.mux/icons/1553.gif b/plugins/org.eclipse.osee.ote.ui.mux/icons/1553.gif Binary files differdeleted file mode 100644 index b50eb79de05..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/icons/1553.gif +++ /dev/null diff --git a/plugins/org.eclipse.osee.ote.ui.mux/plugin.xml b/plugins/org.eclipse.osee.ote.ui.mux/plugin.xml deleted file mode 100644 index b552df976d1..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/plugin.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin> - - <extension - point="org.eclipse.ui.views"> - <category - name="OSEE Test" - id="osee.test.category"> - </category> - <view - name="MuxView" - icon="icons/1553.gif" - category="osee.test.category" - class="org.eclipse.osee.ote.ui.mux.view.MuxView" - id="osee.test.muxTool.views.MuxView"> - </view> - </extension> - <extension - point="org.eclipse.ui.perspectiveExtensions"> - <perspectiveExtension - targetID="org.eclipse.osee.ote.ui.TestPerspective"> - <viewShortcut - id="osee.test.muxTool.views.MuxView"> - </viewShortcut> - </perspectiveExtension> - </extension> - <extension - point="org.eclipse.osee.framework.ui.plugin.XNavigateItem"> - <XNavigateItem - category="Messaging" - classname="org.eclipse.osee.ote.ui.mux.actions.MuxViewNavigatorItem" - viewId="org.eclipse.osee.ote.ui.navigate.OteNavigateView"> - </XNavigateItem> - </extension> -</plugin> diff --git a/plugins/org.eclipse.osee.ote.ui.mux/pom.xml b/plugins/org.eclipse.osee.ote.ui.mux/pom.xml deleted file mode 100644 index 46597f5b6d4..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.eclipse.osee</groupId> - <artifactId>org.eclipse.osee.ote.parent</artifactId> - <version>0.11.0-SNAPSHOT</version> - <relativePath>../../plugins/org.eclipse.osee.ote.parent</relativePath> - </parent> - - <artifactId>org.eclipse.osee.ote.ui.mux</artifactId> - <packaging>eclipse-plugin</packaging> - <name>OTE Ui Mux (Incubation)</name> - - <build> - <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 --> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.eclipse.tycho</groupId> - <artifactId>tycho-source-plugin</artifactId> - </plugin> - </plugins> - </build> - -</project>
\ No newline at end of file diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java deleted file mode 100644 index 43483753692..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.osee.ote.service.IOteClientService; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.osgi.util.tracker.ServiceTracker; - -/** - * The main plugin class to be used in the desktop. - */ -public class MuxToolPlugin extends AbstractUIPlugin { - - private ServiceTracker oteClientServiceTracker; - - // The shared instance. - private static MuxToolPlugin plugin; - - public static String PLUGIN_ID = "org.eclipse.osee.ote.ui.mux"; - - /** - * The constructor. - */ - public MuxToolPlugin() { - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - oteClientServiceTracker = new ServiceTracker(context, IOteClientService.class.getName(), null); - oteClientServiceTracker.open(); - } - - /** - * This method is called when the plug-in is stopped - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - oteClientServiceTracker.close(); - } - - /** - * Returns the shared instance. - */ - public static MuxToolPlugin getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given plug-in relative path. - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.osee.ote.ui.mux", path); - } - - public IOteClientService getOteClientService() { - return (IOteClientService) oteClientServiceTracker.getService(); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java deleted file mode 100644 index 25ea0dbe7a3..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.osee.framework.ui.swt.ImageManager; -import org.eclipse.osee.framework.ui.swt.KeyedImage; - -/** - * @author Andrew M. Finkbeiner - */ -public enum OteMuxImage implements KeyedImage { - MUX("1553.gif"); - - private final String fileName; - - private OteMuxImage(String fileName) { - this.fileName = fileName; - } - - @Override - public ImageDescriptor createImageDescriptor() { - return ImageManager.createImageDescriptor(MuxToolPlugin.PLUGIN_ID, "icons", fileName); - } - - @Override - public String getImageKey() { - return MuxToolPlugin.PLUGIN_ID + ".icons." + fileName; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java deleted file mode 100644 index e09cb023ada..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.actions; - -import java.util.Collections; -import java.util.List; -import org.eclipse.osee.framework.ui.plugin.xnavigate.IXNavigateContainer; -import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem; -import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction; -import org.eclipse.osee.ote.ui.mux.OteMuxImage; - -public class MuxViewNavigatorItem implements IXNavigateContainer { - - public MuxViewNavigatorItem() { - // TODO Auto-generated constructor stub - } - - @Override - public List<XNavigateItem> getNavigateItems() { - XNavigateItem action = new XNavigateItemAction(null, new OpenMuxViewAction(), OteMuxImage.MUX, false); - return Collections.singletonList(action); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java deleted file mode 100644 index ba80dd957cb..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.actions; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.ui.mux.view.MuxView; -import org.eclipse.ui.PlatformUI; - -public class OpenMuxViewAction extends Action { - - public OpenMuxViewAction() { - super("Open Mux View"); - } - - @Override - public void run() { - try { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(MuxView.VIEW_ID); - } catch (Exception e) { - MessageDialog.openError(Displays.getActiveShell(), "Error", "got an exception"); - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java deleted file mode 100644 index 445b373909a..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.datatable; - -import java.nio.ByteBuffer; - -/** - * @author Ky Komadino - */ -public class DataNode { - RowNode row1, row2, row3, row4; - byte[] temp; - - public DataNode() { - row1 = new RowNode(); - row2 = new RowNode(); - row3 = new RowNode(); - row4 = new RowNode(); - temp = new byte[16]; - } - - public RowNode getRow(int row) { - switch (row) { - case 1: - return row1; - case 2: - return row2; - case 3: - return row3; - case 4: - return row4; - default: - return row1; - } - } - - public synchronized void setData(ByteBuffer data) { - // discard header bytes - if (data.remaining() <= 15) { - return; - } else { - temp = new byte[15]; - data.get(temp, 0, 15); - } - - int copySize = data.remaining() >= 16 ? 16 : data.remaining(); - temp = new byte[copySize]; - data.get(temp, 0, copySize); - row1.setData(temp); - copySize = data.remaining() >= 16 ? 16 : data.remaining(); - temp = new byte[copySize]; - data.get(temp, 0, copySize); - row2.setData(temp); - copySize = data.remaining() >= 16 ? 16 : data.remaining(); - temp = new byte[copySize]; - data.get(temp, 0, copySize); - row3.setData(temp); - copySize = data.remaining() >= 16 ? 16 : data.remaining(); - temp = new byte[copySize]; - data.get(temp, 0, copySize); - row4.setData(temp); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java deleted file mode 100644 index a83089ac1ba..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.datatable; - -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.osee.ote.ui.mux.model.DatawordModel; - -/** - * @author Ky Komadino - */ -public class DatawordContentProvider implements IStructuredContentProvider { - private final static Object[] EMPTY_ARRAY = new Object[0]; - private Viewer viewer; - - public void refresh() { - viewer.refresh(); - } - - @Override - public void inputChanged(Viewer v, Object oldInput, Object newInput) { - viewer = v; - } - - @Override - public void dispose() { - } - - @Override - public Object[] getElements(Object parent) { - if (parent instanceof DatawordModel) { - return ((DatawordModel) parent).getChildren(); - } else { - return EMPTY_ARRAY; - } - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java deleted file mode 100644 index 2218d34b671..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.datatable; - -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode; -import org.eclipse.swt.graphics.Image; - -/** - * @author Ky Komadino - */ -public class DatawordLabelProvider extends LabelProvider implements ITableLabelProvider { - @Override - public String getColumnText(Object obj, int index) { - if (obj != null && obj instanceof RowNode) { - if (index >= 0 && index <= 7) { - return String.valueOf(((RowNode) obj).getDataword(index)); - } else { - return ""; - } - } else { - return ""; - } - } - - @Override - public Image getColumnImage(Object obj, int index) { - return getImage(obj); - } - - @Override - public String getText(Object obj) { - return ((MessageNode) obj).getName(); - } - -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java deleted file mode 100644 index a85b6d7d045..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.datatable; - -/** - * @author Ky Komadino - */ -public class RowNode { - private final byte[] databytes; - private int numDatabytes; - - public RowNode() { - databytes = new byte[16]; - numDatabytes = 0; - } - - public synchronized void setData(byte[] data) { - numDatabytes = data.length; - for (int i = 0; i < data.length && i < databytes.length; i++) { - databytes[i] = data[i]; - } - } - - public synchronized void setDataword(int data, int index) { - databytes[index * 2] = (byte) ((data & 0x0000FF00) >> 8); - databytes[index * 2 + 1] = (byte) (data & 0x000000FF); - } - - public synchronized byte getDatabyte(int index) { - return databytes[index]; - } - - public synchronized String getDataword(int index) { - if (numDatabytes > index * 2 + 1) { - return String.format("%02X%02X", (short) (databytes[index * 2] & 0x00FF), - (short) (databytes[index * 2 + 1] & 0x00FF)); - } else { - return ""; - } - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java deleted file mode 100644 index da2ba106b56..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.model; - -import java.nio.ByteBuffer; -import java.nio.CharBuffer; -import java.util.HashMap; -import org.eclipse.osee.ote.ui.mux.datatable.DataNode; - -/** - * @author Ky Komadino - */ -public class DatawordModel { - private final static Object[] EMPTY_ARRAY = new Object[0]; - private final HashMap<String, DataNode> dataNodes; - private final CharBuffer buffer = ByteBuffer.allocate(16).asCharBuffer(); - private String currentNode = null; - - public DatawordModel() { - dataNodes = new HashMap<String, DataNode>(); - }; - - /** - * @param muxId - message ID - * @param node - node to add to list - */ - public void addNode(String muxId, DataNode node) { - dataNodes.put(muxId, node); - } - - /** - * @param node - currently selected node - */ - public void setCurrentNode(String node) { - currentNode = node; - } - - /** - * @return - values in list - */ - public Object[] getChildren() { - if (currentNode != null) { - DataNode node = dataNodes.get(currentNode); - Object nodes[] = new Object[] {node.getRow(1), node.getRow(2), node.getRow(3), node.getRow(4)}; - return nodes; - } - return EMPTY_ARRAY; - } - - public void removeDatawords() { - dataNodes.clear(); - } - - public void onDataAvailable(ByteBuffer data) { - buffer.clear(); - buffer.append(String.format("%02d", (short) (data.array()[1] & 0x00F8) >> 3)); - final char transmitReceive = (data.array()[1] & 0x04) >> 2 == 1 ? 'T' : 'R'; - buffer.append(transmitReceive); - buffer.append(String.format("%02d", - ((short) (data.array()[1] & 0x0003) << 3) + ((short) (data.array()[2] & 0x00E0) >> 5))); - String muxId = buffer.flip().toString(); - DataNode receiveData = dataNodes.get(muxId); - if (receiveData == null) { - receiveData = new DataNode(); - addNode(muxId, receiveData); - } - receiveData.setData(data); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java deleted file mode 100644 index cc3ffb85eeb..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.model; - -import java.nio.ByteBuffer; -import java.nio.CharBuffer; -import java.util.Collection; -import java.util.HashMap; -import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode; - -/** - * @author Ky Komadino - */ -public class MessageModel { - private final HashMap<String, MessageNode> messageNodes; - private final CharBuffer buffer = ByteBuffer.allocate(16).asCharBuffer(); - - public MessageModel() { - messageNodes = new HashMap<String, MessageNode>(); - }; - - /** - * @param muxId - message ID - * @param node - node to add to list - */ - public void addNode(String muxId, MessageNode node) { - messageNodes.put(muxId, node); - } - - /** - * @return - values in list - */ - public Collection<MessageNode> getChildren() { - return messageNodes.values(); - } - - public void removeMessages() { - messageNodes.clear(); - } - - public void onDataAvailable(ByteBuffer data) { - // if this is the "T" side of an RT-RT message, then discard - if ((data.array()[1] & 0x04) >> 2 == 1 && data.array()[3] != 0 && data.array()[4] != 0) { - return; - } - - buffer.clear(); - buffer.append(String.format("%02d", (short) (data.array()[1] & 0x00F8) >> 3)); - final char transmitReceive = (data.array()[1] & 0x04) >> 2 == 1 ? 'T' : 'R'; - buffer.append(transmitReceive); - buffer.append(String.format("%02d", - ((short) (data.array()[1] & 0x0003) << 3) + ((short) (data.array()[2] & 0x00E0) >> 5))); - String muxId = buffer.flip().toString(); - MessageNode receiveMessage = messageNodes.get(muxId); - if (receiveMessage == null) { - receiveMessage = new MessageNode(muxId); - addNode(muxId, receiveMessage); - } - receiveMessage.setData(data); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java deleted file mode 100644 index afd50cbe9a1..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java +++ /dev/null @@ -1,190 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.msgtable; - -import java.nio.ByteBuffer; -import java.nio.CharBuffer; - -/** - * @author Ky Komadino - */ -public class MessageNode { - private final String name; - private int rt; - private String rtRt; - private int transmitReceive; - private int subaddress; - private int wordCount; - private String statusWord; - private String emulation; - private String bus; - private int activity; - private int errCount; - private String errType; - private final CharBuffer temp = ByteBuffer.allocate(32).asCharBuffer(); - - public MessageNode(String muxId) { - this.name = muxId; - } - - /** - * @param data - raw mux data from 1553 driver - */ - public synchronized void setData(ByteBuffer data) { - if (data.array()[3] == 0 && data.array()[4] == 0) { // not an RT-RT msg - rt = (short) (data.array()[1] & 0x00F8) >> 3; - transmitReceive = (short) (data.array()[1] & 0x0004) >> 2; - subaddress = ((short) (data.array()[1] & 0x0003) << 3) + ((short) (data.array()[2] & 0x00E0) >> 5); - temp.clear(); - temp.append(String.format(" ")); - rtRt = temp.flip().toString(); - } else { // is an RT-RT msg, reference the "T" side datawords - rt = (short) (data.array()[3] & 0x00F8) >> 3; - transmitReceive = (short) (data.array()[3] & 0x0004) >> 2; - subaddress = ((short) (data.array()[3] & 0x0003) << 3) + ((short) (data.array()[4] & 0x00E0) >> 5); - temp.clear(); - temp.append(String.format("%02d", (short) (data.array()[3] & 0x00F8) >> 3)); - temp.append((data.array()[3] & 0x0004) >> 2 == 1 ? 'T' : 'R'); - temp.append(String.format("%02d", - ((short) (data.array()[3] & 0x0003) << 3) + ((short) (data.array()[4] & 0x00E0) >> 5))); - rtRt = temp.flip().toString(); - } - - if (subaddress == 0 || subaddress == 31) { - wordCount = (short) (data.array()[2] & 0x001F) >= 16 ? 1 : 0; - } else { - wordCount = (short) (data.array()[2] & 0x001F) == 0 ? 32 : (short) (data.array()[2] & 0x001F); - } - - temp.clear(); - temp.append(String.format("0x%02X%02X", data.array()[5], data.array()[6])); - statusWord = temp.flip().toString(); - - temp.clear(); - switch ((short) (data.array()[9] & 0x00C0) >> 6) { - case 1: - temp.append("-/B"); - break; - case 2: - temp.append("A/-"); - break; - case 3: - temp.append("A/B"); - break; - default: - temp.append("MON"); - } - emulation = temp.flip().toString(); - - temp.clear(); - if ((short) (data.array()[10] & 0x0008) == 0) { - temp.append(String.format("PRI")); - } else { - temp.append(String.format("SEC")); - } - bus = temp.flip().toString(); - - activity++; - - temp.clear(); - if ((short) (data.array()[10] & 0x0080) == 0) { - temp.append(" "); - } else { - errCount++; - temp.append("NO RESPONSE"); - } - errType = temp.flip().toString(); - } - - /** - * @return Returns the activity. - */ - public synchronized int getActivity() { - return activity; - } - - /** - * @return Returns the bus. - */ - public synchronized String getBus() { - return bus.toString(); - } - - /** - * @return Returns the emulation. - */ - public synchronized String getEmulation() { - return emulation.toString(); - } - - /** - * @return Returns the errCount. - */ - public synchronized int getErrCount() { - return errCount; - } - - /** - * @return Returns the errType. - */ - public synchronized String getErrType() { - return errType.toString(); - } - - /** - * @return Returns the name. - */ - public synchronized String getName() { - return name; - } - - /** - * @return Returns the rt. - */ - public synchronized int getRt() { - return rt; - } - - /** - * @return Returns the rtRt. - */ - public synchronized String getRtRt() { - return rtRt.toString(); - } - - /** - * @return Returns the statusWord. - */ - public synchronized String getStatusWord() { - return statusWord.toString(); - } - - /** - * @return Returns the subaddress. - */ - public synchronized int getSubaddress() { - return subaddress; - } - - /** - * @return Returns the transmitReceive. - */ - public synchronized int getTransmitReceive() { - return transmitReceive; - } - - /** - * @return Returns the wordCount. - */ - public synchronized int getWordCount() { - return wordCount; - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java deleted file mode 100644 index e6e0a61a4bf..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.msgtable; - -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.osee.ote.ui.mux.model.MessageModel; - -/** - * @author Ky Komadino - */ -public class MuxMsgContentProvider implements IStructuredContentProvider { - private final static Object[] EMPTY_ARRAY = new Object[0]; - private Viewer viewer; - - public void refresh() { - viewer.refresh(); - } - - @Override - public void inputChanged(Viewer v, Object oldInput, Object newInput) { - viewer = v; - } - - @Override - public void dispose() { - } - - @Override - public Object[] getElements(Object parent) { - if (parent instanceof MessageModel) { - return ((MessageModel) parent).getChildren().toArray(); - } else { - return EMPTY_ARRAY; - } - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java deleted file mode 100644 index a501eae2463..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.msgtable; - -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; - -/** - * @author Ky Komadino - */ -public class MuxMsgLabelProvider extends LabelProvider implements ITableLabelProvider { - @Override - public String getColumnText(Object obj, int index) { - if (obj != null && obj instanceof MessageNode) { - switch (index) { - case 0: - return ((MessageNode) obj).getName(); - case 1: - return ((MessageNode) obj).getRtRt(); - case 2: - return String.valueOf(((MessageNode) obj).getWordCount()); - case 3: - return ((MessageNode) obj).getStatusWord(); - case 4: - return ((MessageNode) obj).getEmulation(); - case 5: - return ((MessageNode) obj).getBus(); - case 6: - return String.valueOf(((MessageNode) obj).getActivity()); - case 7: - return String.valueOf(((MessageNode) obj).getErrCount()); - case 8: - return ((MessageNode) obj).getErrType(); - default: - return ""; - } - } else { - return ""; - } - } - - @Override - public Image getColumnImage(Object obj, int index) { - return getImage(obj); - } - - @Override - public String getText(Object obj) { - return ((MessageNode) obj).getName(); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java deleted file mode 100644 index 936a1013bfe..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.view; - -import java.rmi.Remote; -import java.rmi.RemoteException; -import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener; -import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation; - -/** - * @author Ken J. Aguilar - */ -public interface IRegistrationListener extends Remote, IInstrumentationRegistrationListener { - - @Override - void onRegistered(String name, IOInstrumentation instrumentation) throws RemoteException; - - @Override - void onDeregistered(String name) throws RemoteException; -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java deleted file mode 100644 index 2800cc06669..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java +++ /dev/null @@ -1,443 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.view; - -import java.nio.ByteBuffer; -import java.rmi.RemoteException; -import java.util.logging.Level; - -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation; -import org.eclipse.osee.ote.ui.mux.MuxToolPlugin; -import org.eclipse.osee.ote.ui.mux.datatable.DatawordContentProvider; -import org.eclipse.osee.ote.ui.mux.datatable.DatawordLabelProvider; -import org.eclipse.osee.ote.ui.mux.datatable.RowNode; -import org.eclipse.osee.ote.ui.mux.model.DatawordModel; -import org.eclipse.osee.ote.ui.mux.model.MessageModel; -import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode; -import org.eclipse.osee.ote.ui.mux.msgtable.MuxMsgContentProvider; -import org.eclipse.osee.ote.ui.mux.msgtable.MuxMsgLabelProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ControlEditor; -import org.eclipse.swt.custom.TableCursor; -import org.eclipse.swt.events.FocusAdapter; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -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.graphics.Color; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.swt.widgets.Text; - -public class MuxChannelComposite extends Composite { - - private TableViewer msgViewer; - private TableViewer dataViewer; - private MessageModel chanMsgs; - private DatawordModel chanDwrds; - private final int selectedChannel; - private int selectedRt; - private int selectedTR; - private int selectedSubaddr; - private IOInstrumentation muxProbe; - private final static Color GRAY = Displays.getSystemColor(SWT.COLOR_GRAY); - private final static Color WHITE = Displays.getSystemColor(SWT.COLOR_WHITE); - - public MuxChannelComposite(Composite parent, int style, int channel) { - super(parent, style); - createPartControl(parent); - this.selectedChannel = channel; - } - - public void setMuxProbe(IOInstrumentation muxProbe) { - this.muxProbe = muxProbe; - } - - private void createPartControl(Composite parent) { - GridLayout chanLayout = new GridLayout(1, false); - this.setLayout(chanLayout); - - msgViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION); - msgViewer.setLabelProvider(new MuxMsgLabelProvider()); - msgViewer.setSorter(new ViewerSorter()); - msgViewer.setContentProvider(new MuxMsgContentProvider()); - - createMsgTable(msgViewer); - - Composite bottom1 = new Composite(this, SWT.NONE); - bottom1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); - bottom1.setLayout(new GridLayout(2, false)); - - Composite data1 = new Composite(bottom1, SWT.NONE); - RowLayout dataLayout1 = new RowLayout(SWT.HORIZONTAL); - data1.setLayout(dataLayout1); - - Composite labels1 = new Composite(data1, SWT.NONE); - RowLayout labelLayout1 = new RowLayout(SWT.VERTICAL); - labelLayout1.marginTop = 5; - labelLayout1.spacing = 1; - labels1.setLayout(labelLayout1); - Label label1_1 = new Label(labels1, SWT.NONE); - label1_1.setText("Datawords 1-8"); - Label label2_1 = new Label(labels1, SWT.NONE); - label2_1.setText("Datawords 9-16"); - Label label3_1 = new Label(labels1, SWT.NONE); - label3_1.setText("Datawords 17-24"); - Label label4_1 = new Label(labels1, SWT.NONE); - label4_1.setText("Datawords 25-32"); - - Composite datawords1 = new Composite(data1, SWT.NONE); - datawords1.setLayout(new GridLayout(1, false)); - dataViewer = new TableViewer(datawords1, SWT.BORDER - | SWT.FULL_SELECTION); - dataViewer.setContentProvider(new DatawordContentProvider()); - dataViewer.setLabelProvider(new DatawordLabelProvider()); - createDwordTable(dataViewer); - msgViewer.addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - IStructuredSelection selection = (IStructuredSelection) event - .getSelection(); - MessageNode node = (MessageNode) selection.getFirstElement(); - if (node != null) { - selectedRt = node.getRt(); - selectedTR = node.getTransmitReceive(); - selectedSubaddr = node.getSubaddress(); - chanDwrds.setCurrentNode(node.getName()); - } - } - }); - final Button reset1 = new Button(bottom1, SWT.PUSH); - reset1.setText("Reset Display"); - reset1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER - | GridData.GRAB_HORIZONTAL)); - reset1.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - selectedRt = 0; - selectedTR = 0; - selectedSubaddr = 0; - chanMsgs.removeMessages(); - chanDwrds.setCurrentNode(null); - } - }); - - msgViewer.setInput(chanMsgs = new MessageModel()); - dataViewer.setInput(chanDwrds = new DatawordModel()); - updateColors(false); - } - - private void createMsgTable(TableViewer parent) { - final Table table = parent.getTable(); - GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL - | GridData.VERTICAL_ALIGN_FILL); - int height = table.getItemHeight() * 20; - Rectangle trim = table.computeTrim(0, 0, 0, height); - gridData.heightHint = trim.height; - table.setLayoutData(gridData); - table.setHeaderVisible(true); - TableColumn column = new TableColumn(table, SWT.CENTER, 0); - column.setText("Message"); - column.setWidth(70); - column = new TableColumn(table, SWT.CENTER, 1); - column.setText("RT-RT"); - column.setWidth(60); - column = new TableColumn(table, SWT.CENTER, 2); - column.setText("Word Cnt"); - column.setWidth(70); - column = new TableColumn(table, SWT.CENTER, 3); - column.setText("StatusWd"); - column.setWidth(70); - column = new TableColumn(table, SWT.CENTER, 4); - column.setText("Emulation"); - column.setWidth(70); - column = new TableColumn(table, SWT.CENTER, 5); - column.setText("Bus"); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 6); - column.setText("Activity"); - column.setWidth(60); - column = new TableColumn(table, SWT.CENTER, 7); - column.setText("Error Cnt"); - column.setWidth(70); - column = new TableColumn(table, SWT.CENTER, 8); - column.setText("Error Type"); - column.setWidth(150); - - table.addMouseListener(new MouseAdapter() { - @Override - public void mouseDown(final MouseEvent event) { - if (event.button == 3) { - Menu menu = new Menu(table.getShell(), SWT.POP_UP); - MenuItem enableBoth = new MenuItem(menu, SWT.PUSH); - enableBoth.setText("Emulate RT (Pri + Sec)"); - enableBoth.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - if (muxProbe != null) { - byte[] cmd = new byte[4]; - cmd[0] = 'R'; // RT simulation cmd - cmd[1] = (byte) selectedChannel; - cmd[2] = (byte) selectedRt; - cmd[3] = (byte) 3; - try { - muxProbe.command(cmd); - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, - Level.WARNING, - "MuxView unable to send RT simulation command"); - } - } - } - }); - MenuItem enableA = new MenuItem(menu, SWT.PUSH); - enableA.setText("Emulate RT (Pri Only)"); - enableA.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (muxProbe != null) { - byte[] cmd = new byte[4]; - cmd[0] = 'R'; // RT simulation cmd - cmd[1] = (byte) selectedChannel; - cmd[2] = (byte) selectedRt; - cmd[3] = (byte) 1; - try { - muxProbe.command(cmd); - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, - Level.WARNING, - "MuxView unable to send RT simulation command"); - } - } - } - }); - MenuItem enableB = new MenuItem(menu, SWT.PUSH); - enableB.setText("Emulate RT (Sec only)"); - enableB.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (muxProbe != null) { - byte[] cmd = new byte[4]; - cmd[0] = 'R'; // RT simulation cmd - cmd[1] = (byte) selectedChannel; - cmd[2] = (byte) selectedRt; - cmd[3] = (byte) 2; - try { - muxProbe.command(cmd); - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, - Level.WARNING, - "MuxView unable to send RT simulation command"); - } - } - } - }); - new MenuItem(menu, SWT.SEPARATOR); - MenuItem disableBoth = new MenuItem(menu, SWT.PUSH); - disableBoth.setText("Monitor RT (Pri + Sec)"); - disableBoth.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (muxProbe != null) { - byte[] cmd = new byte[4]; - cmd[0] = 'R'; // RT simulation cmd - cmd[1] = (byte) selectedChannel; - cmd[2] = (byte) selectedRt; - cmd[3] = (byte) 0; - try { - muxProbe.command(cmd); - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, - Level.WARNING, - "MuxView unable to send RT simulation command"); - } - } - } - }); - - // draws pop up menu: - Point pt = new Point(event.x, event.y); - pt = table.toDisplay(pt); - menu.setLocation(pt.x, pt.y); - menu.setVisible(true); - } - } - }); - - } - - /** - * Create the Datawords Tree - */ - private void createDwordTable(final TableViewer parent) { - final Table table = parent.getTable(); - GridData gridData = new GridData(); - int height = table.getItemHeight() * 2; - Rectangle trim = table.computeTrim(0, 0, 0, height); - gridData.heightHint = trim.height; - table.setLayoutData(gridData); - table.setHeaderVisible(false); - table.setLinesVisible(true); - - TableColumn column = new TableColumn(table, SWT.CENTER, 0); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 1); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 2); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 3); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 4); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 5); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 6); - column.setWidth(50); - column = new TableColumn(table, SWT.CENTER, 7); - column.setWidth(50); - - table.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - - final TableCursor cursor = new TableCursor(table, SWT.NONE); - final ControlEditor editor = new ControlEditor(cursor); - editor.grabHorizontal = true; - editor.grabVertical = true; - - cursor.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - final Text text = new Text(cursor, SWT.NONE); - text.setTextLimit(4); - TableItem row = cursor.getRow(); - int column = cursor.getColumn(); - text.setText(row.getText(column)); - text.addKeyListener(new KeyAdapter() { - - @Override - public void keyPressed(KeyEvent e) { - // close the text editor and copy the data over - // when the user hits "ENTER" - if (e.character == SWT.CR) { - TableItem row = cursor.getRow(); - int column = cursor.getColumn(); - int newVal = Integer.parseInt( - text.getText(), 16); - row.setText(column, text.getText()); - text.dispose(); - cursor.dispose(); - if (muxProbe != null) { - byte[] cmd = new byte[100]; - int index = 0; - cmd[index++] = 'S'; // set 1553 data cmd - cmd[index++] = (byte) selectedChannel; - cmd[index++] = (byte) selectedRt; - cmd[index++] = (byte) selectedTR; - cmd[index++] = (byte) selectedSubaddr; - Object[] o = ((DatawordModel) parent - .getInput()).getChildren(); - ((RowNode) o[table.indexOf(row)]) - .setDataword(newVal, column); - for (Object r : o) { - for (int i = 0; i < 16; i++) { - cmd[index++] = ((RowNode) r) - .getDatabyte(i); - } - } - try { - muxProbe.command(cmd); - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, - Level.WARNING, - "MuxView unable to send RT simulation command"); - } - } - } - // close the text editor when the user hits - // "ESC" - if (e.character == SWT.ESC) { - text.dispose(); - cursor.dispose(); - } - // allow only hexadecimal characters, backspace, - // delete, - // left and right arrow keys - if (e.character >= 0x30 && e.character <= 0x39 - || e.character >= 0x41 - && e.character <= 0x46 - || e.character >= 0x61 - && e.character <= 0x66 - || e.character == SWT.BS - || (e.character == SWT.DEL && (e.stateMask & SWT.CTRL) == 0) - || e.keyCode == SWT.ARROW_LEFT - || e.keyCode == SWT.ARROW_RIGHT) { - e.doit = true; - } else { - e.doit = false; - } - } - }); - // close the text editor when the user clicks away - text.addFocusListener(new FocusAdapter() { - @Override - public void focusLost(FocusEvent e) { - text.dispose(); - cursor.dispose(); - } - }); - editor.setEditor(text); - text.setFocus(); - } - }); - table.deselectAll(); - } - }); - } - - void updateColors(boolean connected) { - msgViewer.getTable().setBackground(connected ? WHITE : GRAY); - dataViewer.getTable().setBackground(connected ? WHITE : GRAY); - } - - public void refresh() { - msgViewer.refresh(); - dataViewer.refresh(); - } - - public void onDataAvailable(ByteBuffer buffer) { - chanMsgs.onDataAvailable(buffer); - chanDwrds.onDataAvailable(buffer); - } -} diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java deleted file mode 100644 index c5957189454..00000000000 --- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java +++ /dev/null @@ -1,360 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.ui.mux.view; - -import java.io.IOException; -import java.io.InterruptedIOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.nio.ByteBuffer; -import java.nio.channels.DatagramChannel; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.util.Map; -import java.util.TreeMap; -import java.util.logging.Level; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.osee.connection.service.IServiceConnector; -import org.eclipse.osee.framework.jdk.core.util.network.PortUtil; -import org.eclipse.osee.framework.logging.OseeLog; -import org.eclipse.osee.framework.ui.plugin.util.HelpUtil; -import org.eclipse.osee.framework.ui.swt.Displays; -import org.eclipse.osee.framework.ui.swt.PeriodicDisplayTask; -import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment; -import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener; -import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation; -import org.eclipse.osee.ote.message.interfaces.ITestEnvironmentMessageSystem; -import org.eclipse.osee.ote.service.ConnectionEvent; -import org.eclipse.osee.ote.service.ITestConnectionListener; -import org.eclipse.osee.ote.ui.mux.MuxToolPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.TabFolder; -import org.eclipse.swt.widgets.TabItem; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.ViewPart; - -/** - * This sample class demonstrates how to plug-in a new workbench view. The view shows data obtained from the model. The - * sample creates a dummy model on the fly, but a real implementation would connect to the model available either in - * this or another plug-in (e.g. the workspace). The view is connected to the model using a content provider. - * <p> - * The view uses a label provider to define how model objects should be presented in the view. Each view can present the - * same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared - * between views in order to ensure that objects of the same type are presented in the same way everywhere. - * <p> - */ - -public class MuxView extends ViewPart implements ITestConnectionListener, IInstrumentationRegistrationListener, Remote { - private IOInstrumentation muxProbe; - private PeriodicDisplayTask task; - private ListenerThread thread; - private int port; - private final Map<Integer, MuxChannelComposite> channelComposites; - - private IInstrumentationRegistrationListener exportedThis; - private TabFolder tabFolder; - - public static final String VIEW_ID = "osee.test.muxTool.views.MuxView"; - class NameSorter extends ViewerSorter { - } - - /** - * The constructor. - */ - public MuxView() { - super(); - channelComposites = new TreeMap<Integer, MuxChannelComposite>(); - } - - /** - * This is a callback that will allow us to create the viewers and initialize them. - */ - @Override - public void createPartControl(Composite parent) { - tabFolder = new TabFolder(parent, SWT.WRAP); - addChannelToView(1); - try { - thread = new ListenerThread(); - } catch (Exception e) { - OseeLog.log(MuxView.class, Level.SEVERE, "Mux View could not start listening thread", e); - MessageDialog.openError(parent.getShell(), "Error", "Mux View could not initialize. See Error Log for details"); - return; - } - thread.start(); - - task = new PeriodicDisplayTask(Display.getDefault(), 333) { - @Override - protected void update() { - try { - for(MuxChannelComposite mux:channelComposites.values()){ - mux.refresh(); - } - } catch (Throwable t) { - OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "problems refreshing viewer", t); - stop(); - } - } - }; - task.start(); - - // TODO: Change to use OteHelpContext - HelpUtil.setHelp(parent, "mux_view", "org.eclipse.osee.ote.help.ui"); - MuxToolPlugin.getDefault().getOteClientService().addConnectionListener(this); - } - - - private MuxChannelComposite addChannelToView(int channel){ - if(!channelComposites.containsKey(channel)){ - Composite chanTabComp = new Composite(tabFolder, SWT.NONE); - MuxChannelComposite muxChannelComposite = new MuxChannelComposite(chanTabComp, SWT.NONE, channel); - GridLayout chanLayout = new GridLayout(1, false); - chanTabComp.setLayout(chanLayout); - channelComposites.put(channel, muxChannelComposite); - - int index = 0; - for(MuxChannelComposite muxChannel : channelComposites.values()){ - if(muxChannelComposite == muxChannel){ - break; - } - index++; - } - TabItem chanTab = new TabItem(tabFolder, SWT.NONE, index); - chanTab.setText("Channel "+ channel); - chanTab.setControl(chanTabComp); - return muxChannelComposite; - } else { - return null; - } - } - - /** - * Passing the focus request to the viewer's control. - */ - @Override - public void setFocus() { - // msgViewer1.getControl().setFocus(); - } - - @Override - public void dispose() { - MuxToolPlugin.getDefault().getOteClientService().removeConnectionListener(this); - ITestEnvironment env = MuxToolPlugin.getDefault().getOteClientService().getConnectedEnvironment(); - if (env != null) { - try { - ((ITestEnvironmentMessageSystem) env).removeInstrumentationRegistrationListener(exportedThis); - } catch (RemoteException ex) { - OseeLog.log(MuxView.class, Level.WARNING, "could not deregister instrumentation registration listener", ex); - } - IServiceConnector connector = MuxToolPlugin.getDefault().getOteClientService().getConnector(); - try { - connector.unexport(this); - } catch (Exception ex) { - OseeLog.log(MuxView.class, Level.WARNING, "could not unexport this", ex); - } - } - if (muxProbe != null) { - try { - muxProbe.unregister(thread.address); - } catch (RemoteException ex) { - OseeLog.log(MuxView.class, Level.WARNING, "could not disconnect from mux probe", ex); - } - muxProbe = null; - } - if (task != null) { - task.stop(); - } - thread.shutdown(); - - super.dispose(); - } - - class ListenerThread extends Thread { - private volatile boolean done = false; - private final DatagramChannel channel; - private final InetSocketAddress address; - - public ListenerThread() throws IOException { - super("Mux View Listener Thread"); - channel = DatagramChannel.open(); - port = PortUtil.getInstance().getValidPort(); - address = new InetSocketAddress(InetAddress.getLocalHost(), port); - channel.socket().bind(address); - OseeLog.log(MuxToolPlugin.class, Level.INFO, - "MuxView connection - host: " + address.getHostName() + " port: " + address.getPort()); - } - - @Override - public void run() { - final ByteBuffer buffer = ByteBuffer.wrap(new byte[256]); - try { - while (!done) { - buffer.clear(); - channel.receive(buffer); - buffer.flip(); - final int channel = buffer.array()[0]; - MuxChannelComposite composite = channelComposites.get(channel); - if(composite != null){ - composite.onDataAvailable(buffer); - } else { - PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){ - - @Override - public void run() { - MuxChannelComposite muxChannelComposite = addChannelToView(channel); - muxChannelComposite.updateColors(true); - muxChannelComposite.setMuxProbe(muxProbe); - muxChannelComposite.onDataAvailable(buffer); - } - }); - } - } - } catch (InterruptedIOException e) { - Thread.currentThread().interrupt(); - } catch (IOException e) { - if (!isInterrupted()) { - OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "Interrupted", e); - } - } finally { - try { - channel.close(); - } catch (IOException e) { - // do nothing - } - } - } - - public void shutdown() { - done = true; - interrupt(); - try { - thread.join(5000); - assert !channel.isOpen(); - } catch (InterruptedException e) { - OseeLog.log(MuxView.class, Level.SEVERE, "could not join wiht listener thread", e); - } - } - } - - @Override - public void onConnectionLost(IServiceConnector connector) { - handleConnectionLostStatus(); - } - - @Override - public void onPostConnect(final ConnectionEvent event) { - final ITestEnvironmentMessageSystem environment = (ITestEnvironmentMessageSystem) event.getEnvironment(); - if (environment != null) { - // we are connected - try { - exportedThis = (IInstrumentationRegistrationListener) event.getConnector().findExport(MuxView.this); - if (exportedThis == null) { - exportedThis = (IInstrumentationRegistrationListener) event.getConnector().export(MuxView.this); - } - environment.addInstrumentationRegistrationListener(exportedThis); - } catch (Exception ex) { - OseeLog.log(MuxView.class, Level.SEVERE, "could not register for instrumentation events", ex); - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - MessageDialog.openError(Displays.getActiveShell(), "Connect Error", - "Could not register for instrumentation events. See Error Log for details"); - } - - }); - - } - } - - } - - private void detach() { - - } - - @Override - public void onPreDisconnect(ConnectionEvent event) { - final ITestEnvironmentMessageSystem environment = (ITestEnvironmentMessageSystem) event.getEnvironment(); - try { - environment.removeInstrumentationRegistrationListener(exportedThis); - } catch (RemoteException ex1) { - OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "Problem unregistering instrumentation registration listener", - ex1); - } - - if (muxProbe != null) { - try { - muxProbe.unregister(thread.address); - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "Problem unregistering socket address", ex); - } finally { - muxProbe = null; - } - } - handleConnectionLostStatus(); - } - - private void handleConnectionLostStatus() { - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - for(MuxChannelComposite mux:channelComposites.values()){ - mux.updateColors(false); - mux.setMuxProbe(null); - } - // we are not connected - if (task != null) { - task.stop(); - } - } - }); - } - - @Override - public void onDeregistered(String name) throws RemoteException { - if (muxProbe != null && name.equals("MUXIO")) { - muxProbe = null; - handleConnectionLostStatus(); - } - } - - @Override - public void onRegistered(String name, IOInstrumentation instrumentation) throws RemoteException { - try { - if (muxProbe == null && name.equals("MUXIO")) { - muxProbe = instrumentation; - Displays.ensureInDisplayThread(new Runnable() { - @Override - public void run() { - if (task != null) { - task.start(); - } - for(MuxChannelComposite mux:channelComposites.values()){ - mux.updateColors(true); - mux.setMuxProbe(muxProbe); - } - } - - }); - muxProbe.register(thread.address); - - } - } catch (RemoteException ex) { - OseeLog.log(MuxToolPlugin.class, Level.SEVERE, - "Problem registering socket address with remote instrumentation service", ex); - } - - } -} |