├── .gitignore ├── README.md ├── com.mousefeed.feature ├── .project ├── build.properties ├── feature.properties ├── feature.xml └── pom.xml ├── com.mousefeed.test ├── .checkstyle ├── .classpath ├── .fbprefs ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.eclipse.ltk.core.refactoring.prefs ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── findBugsExclude.xml ├── formatter.xml ├── global.properties ├── header.txt ├── plugin.properties ├── pom.xml └── test │ └── com │ └── mousefeed │ ├── AllTests.java │ ├── client │ ├── AllClientTests.java │ ├── AssertEnabledTest.java │ ├── MessagesTest.java │ ├── OnWrongInvocationModeTest.java │ └── collector │ │ ├── ActionDescTest.java │ │ └── CollectorTest.java │ └── eclipse │ ├── ActionDescImplTest.java │ ├── AllEclipseTests.java │ └── preferences │ ├── ActionInvocationModeTableCellModifierTest.java │ ├── ActionInvocationModeTableLabelProviderTest.java │ ├── ActionOnWrongInvocationModeTest.java │ └── PreferenceAccessorTest.java ├── com.mousefeed.update-site ├── .project ├── artifacts.jar ├── content.jar ├── features │ ├── com.mousefeed.feature.source_2.0.0.jar │ ├── com.mousefeed.feature_1.1.0.jar │ ├── com.mousefeed.feature_1.1.1.jar │ └── com.mousefeed.feature_2.0.0.jar ├── logs.zip ├── plugins │ ├── com.mousefeed.source_2.0.0.jar │ ├── com.mousefeed_1.1.0.jar │ ├── com.mousefeed_1.1.1.jar │ └── com.mousefeed_2.0.0.jar ├── pom.xml └── site.xml ├── com.mousefeed ├── .checkstyle ├── .classpath ├── .fbprefs ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.eclipse.ltk.core.refactoring.prefs ├── COPYING ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── checkstyle.xml ├── checkstyleSuppressions.xml ├── doc │ ├── developmentStandards.txt │ ├── package-template.html │ └── testPlan.txt ├── formatter.xml ├── header.txt ├── html │ ├── concepts │ │ ├── maintopic.html │ │ ├── subtopic.html │ │ └── subtopic2.html │ ├── gettingstarted │ │ ├── maintopic.html │ │ ├── subtopic.html │ │ └── subtopic2.html │ ├── reference │ │ ├── maintopic.html │ │ ├── subtopic.html │ │ └── subtopic2.html │ ├── tasks │ │ ├── maintopic.html │ │ ├── subtopic.html │ │ └── subtopic2.html │ └── toc.html ├── plugin.properties ├── plugin.xml ├── pom.xml ├── src │ └── com │ │ └── mousefeed │ │ ├── client │ │ ├── Messages.java │ │ ├── OnWrongInvocationMode.java │ │ ├── collector │ │ │ ├── AbstractActionDesc.java │ │ │ ├── Collector.java │ │ │ └── package.html │ │ ├── messages.properties │ │ └── package.html │ │ └── eclipse │ │ ├── AcceleratorSearchResult.java │ │ ├── ActionActionDescGenerator.java │ │ ├── ActionDescImpl.java │ │ ├── Activator.java │ │ ├── CommandActionDescGenerator.java │ │ ├── CommandContributionItemCommandLocator.java │ │ ├── DestroyFontDisposeListener.java │ │ ├── GlobalSelectionListener.java │ │ ├── HandledActionDescGenerator.java │ │ ├── HandledContributionItemCommandLocator.java │ │ ├── LastActionInvocationRemiderFactory.java │ │ ├── Layout.java │ │ ├── NagPopUp.java │ │ ├── Startup.java │ │ ├── TextActionHandlerActionLocator.java │ │ ├── commands │ │ ├── ConfigureActionInvocationDialog.java │ │ ├── ConfigureActionInvocationHandler.java │ │ ├── OnWrongInvocationModeUI.java │ │ └── package.html │ │ ├── package.html │ │ └── preferences │ │ ├── ActionInvocationModeControl.java │ │ ├── ActionInvocationModeTableCellModifier.java │ │ ├── ActionInvocationModeTableContentProvider.java │ │ ├── ActionInvocationModeTableLabelProvider.java │ │ ├── ActionInvocationPreferencePage.java │ │ ├── ActionOnWrongInvocationMode.java │ │ ├── PreferenceAccessor.java │ │ ├── PreferenceConstants.java │ │ ├── PreferenceInitializer.java │ │ ├── PreferencePage.java │ │ └── package.html ├── suppressions.xml ├── toc.xml ├── tocconcepts.xml ├── tocgettingstarted.xml ├── tocreference.xml └── toctasks.xml ├── pom.xml └── setVersionNumber.sh /.gitignore: -------------------------------------------------------------------------------- 1 | /com.mousefeed/bin 2 | /com.mousefeed/ztemp/testBin 3 | /com.mousefeed/ztemp/test-build 4 | /com.mousefeed/ztemp/build 5 | /com.mousefeed/ztemp 6 | /com.mousefeed/target 7 | /com.mousefeed.test/target 8 | /com.mousefeed.test/bin 9 | /com.mousefeed.test/ztemp/testBin 10 | /com.mousefeed.test/ztemp/test-build 11 | /com.mousefeed.test/ztemp/build 12 | /com.mousefeed.feature/target 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ***Note:*** Starting with Eclipse Platform 4.13/Eclipse IDE 2019-09, the functionality offered by this plugin is now built-in the Eclipse Platform: https://www.eclipse.org/eclipse/news/4.13/platform.php#show-keybinding 2 | 3 | MouseFeed helps to form a habit of using keyboard shortcuts. When the user clicks on a button or on a menu item, the plugin shows a popup reminding about the key shortcut. After a few times, you remember the keyboard shortcut and you will start using it, rather than clicking through menus. This will save you a lot of time at the end of the day. 4 | 5 | MouseFeed was originally hosted at SourceForge (http://sourceforge.net/projects/mousefeed/). We have tried to contact the original developer, but we failed. 6 | For a lack of maintainer, Sigasi has adopted this project. We have fixed a few bugs, and we are now publishing it on the Eclipse Marketplace. Robert Wloch ported Mousefeed to Eclipse 4.x. 7 | We want to acknowledge and thank Andriy Palamarchuk and Heavy Lifting Software for starting the MouseFeed project back in 2007. 8 | 9 | You can install Mousefeed from the p2 update site: http://download.sigasi.com/updates/mousefeed 10 | 11 | -------------------------------------------------------------------------------- /com.mousefeed.feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mousefeed.feature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.FeatureNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /com.mousefeed.feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | feature.properties 3 | -------------------------------------------------------------------------------- /com.mousefeed.feature/feature.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (C) Heavy Lifting Software 2007, Sigasi & Robert Wloch 2012. 3 | # 4 | # This file is part of MouseFeed. 5 | # 6 | # MouseFeed is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # MouseFeed is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License 17 | # along with MouseFeed. If not, see . 18 | ############################################################################### 19 | # feature.properties 20 | # contains externalized strings for feature.xml 21 | # "%foo" in feature.xml corresponds to the key "foo" in this file 22 | # java.io.Properties file (ISO 8859-1 with "\" escapes) 23 | # This file should be translated. 24 | 25 | # "featureName" property - name of the feature 26 | featureName=MouseFeed 27 | 28 | # "providerName" property - name of the company that provides the feature 29 | providerName=Heavy Lifting Software, Sigasi & Robert Wloch 30 | 31 | # "description" property - description of the feature 32 | description=MouseFeed Eclipse plugin. Helps to remember keyboard shortcuts. \ 33 | Shows a popup with the keyboard shortcut for the actions called with a menu or \ 34 | a toolbar button. 35 | 36 | # "copyright" property - text of the "Feature Update Copyright" 37 | copyright=Copyright (C) Heavy Lifting Software 2007, Sigasi & Robert Wloch 2012. All rights reserved. 38 | 39 | # "license" property - text of the "Feature Update License" 40 | # should be plain text version of license agreement pointed to be "licenseURL" 41 | license=\ 42 | MouseFeed is free software: you can redistribute it and/or modify \ 43 | it under the terms of the GNU Lesser General Public License as published by \ 44 | the Free Software Foundation, either version 3 of the License, or \ 45 | (at your option) any later version. \ 46 | \ 47 | MouseFeed is distributed in the hope that it will be useful, \ 48 | but WITHOUT ANY WARRANTY; without even the implied warranty of \ 49 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \ 50 | GNU Lesser General Public License for more details. \ 51 | \ 52 | You should have received a copy of the GNU Lesser General Public License \ 53 | along with MouseFeed. If not, see . 54 | 55 | # "updateSiteName" property - label for the update site 56 | updateSiteName=MouseFeed Fork Eclipse Plugin Update Site 57 | 58 | # "secondarySiteName" property - label for the update site 59 | #secondaryUpdateSiteName=Europa Discovery Site 60 | 61 | 62 | # "licenseURL" property - URL of the "Feature License" 63 | # do not translate value - just change to point to a locale-specific HTML page 64 | #licenseURL=license.html 65 | 66 | 67 | -------------------------------------------------------------------------------- /com.mousefeed.feature/feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | %description 10 | 11 | 12 | 13 | %copyright 14 | 15 | 16 | 17 | %license 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /com.mousefeed.feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | com.mousefeed 9 | parent 10 | 2.0.3-SNAPSHOT 11 | ../pom.xml 12 | 13 | 14 | com.mousefeed 15 | com.mousefeed.feature 16 | Mousefeed Feature 17 | 2.0.3-SNAPSHOT 18 | 19 | eclipse-feature 20 | 21 | 22 | 23 | 24 | org.eclipse.tycho 25 | tycho-packaging-plugin 26 | ${tycho-version} 27 | 28 | true 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /com.mousefeed.test/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /com.mousefeed.test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mousefeed.test/.fbprefs: -------------------------------------------------------------------------------- 1 | #FindBugs User Preferences 2 | #Fri Nov 16 22:08:32 GMT 2007 3 | detectorBCPMethodReturnCheck=BCPMethodReturnCheck|false 4 | detectorBadAppletConstructor=BadAppletConstructor|false 5 | detectorBadResultSetAccess=BadResultSetAccess|true 6 | detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true 7 | detectorBadUseOfReturnValue=BadUseOfReturnValue|true 8 | detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true 9 | detectorCalledMethods=CalledMethods|true 10 | detectorCheckCalls=CheckCalls|false 11 | detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true 12 | detectorCheckTypeQualifiers=CheckTypeQualifiers|true 13 | detectorCloneIdiom=CloneIdiom|true 14 | detectorComparatorIdiom=ComparatorIdiom|true 15 | detectorConfusedInheritance=ConfusedInheritance|true 16 | detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true 17 | detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true 18 | detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true 19 | detectorDontUseEnum=DontUseEnum|true 20 | detectorDroppedException=DroppedException|true 21 | detectorDumbMethodInvocations=DumbMethodInvocations|true 22 | detectorDumbMethods=DumbMethods|true 23 | detectorDuplicateBranches=DuplicateBranches|true 24 | detectorEmptyZipFileEntry=EmptyZipFileEntry|true 25 | detectorEqStringTest=EqStringTest|false 26 | detectorFinalizerNullsFields=FinalizerNullsFields|true 27 | detectorFindBadCast=FindBadCast|false 28 | detectorFindBadCast2=FindBadCast2|true 29 | detectorFindBadEqualsImplementation=FindBadEqualsImplementation|false 30 | detectorFindBadForLoop=FindBadForLoop|true 31 | detectorFindBugsSummaryStats=FindBugsSummaryStats|true 32 | detectorFindCircularDependencies=FindCircularDependencies|true 33 | detectorFindDeadLocalStores=FindDeadLocalStores|true 34 | detectorFindDoubleCheck=FindDoubleCheck|true 35 | detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true 36 | detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true 37 | detectorFindFinalizeInvocations=FindFinalizeInvocations|true 38 | detectorFindFloatEquality=FindFloatEquality|true 39 | detectorFindFloatMath=FindFloatMath|false 40 | detectorFindHEmismatch=FindHEmismatch|true 41 | detectorFindInconsistentSync2=FindInconsistentSync2|true 42 | detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true 43 | detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true 44 | detectorFindMaskedFields=FindMaskedFields|true 45 | detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true 46 | detectorFindNakedNotify=FindNakedNotify|true 47 | detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true 48 | detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true 49 | detectorFindNonShortCircuit=FindNonShortCircuit|true 50 | detectorFindNullDeref=FindNullDeref|true 51 | detectorFindOpenStream=FindOpenStream|true 52 | detectorFindPuzzlers=FindPuzzlers|true 53 | detectorFindRefComparison=FindRefComparison|true 54 | detectorFindReturnRef=FindReturnRef|true 55 | detectorFindRunInvocations=FindRunInvocations|true 56 | detectorFindSelfComparison=FindSelfComparison|true 57 | detectorFindSelfComparison2=FindSelfComparison2|true 58 | detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true 59 | detectorFindSpinLoop=FindSpinLoop|true 60 | detectorFindSqlInjection=FindSqlInjection|true 61 | detectorFindTwoLockWait=FindTwoLockWait|true 62 | detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true 63 | detectorFindUnconditionalWait=FindUnconditionalWait|true 64 | detectorFindUninitializedGet=FindUninitializedGet|true 65 | detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true 66 | detectorFindUnreleasedLock=FindUnreleasedLock|true 67 | detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|false 68 | detectorFindUnsyncGet=FindUnsyncGet|true 69 | detectorFindUselessControlFlow=FindUselessControlFlow|true 70 | detectorHugeSharedStringConstants=HugeSharedStringConstants|true 71 | detectorIDivResultCastToDouble=IDivResultCastToDouble|true 72 | detectorIncompatMask=IncompatMask|true 73 | detectorInefficientMemberAccess=InefficientMemberAccess|false 74 | detectorInefficientToArray=InefficientToArray|true 75 | detectorInfiniteLoop=InfiniteLoop|true 76 | detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true 77 | detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|true 78 | detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true 79 | detectorInitializationChain=InitializationChain|true 80 | detectorInstantiateStaticClass=InstantiateStaticClass|true 81 | detectorInvalidJUnitTest=InvalidJUnitTest|true 82 | detectorIteratorIdioms=IteratorIdioms|true 83 | detectorLazyInit=LazyInit|true 84 | detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true 85 | detectorLockedFields=LockedFields|false 86 | detectorMethodReturnCheck=MethodReturnCheck|true 87 | detectorMethods=Methods|true 88 | detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true 89 | detectorMutableLock=MutableLock|true 90 | detectorMutableStaticFields=MutableStaticFields|true 91 | detectorNaming=Naming|true 92 | detectorNoteAnnotationRetention=NoteAnnotationRetention|true 93 | detectorNoteCheckReturnValue=NoteCheckReturnValue|true 94 | detectorNoteCheckReturnValueAnnotations=NoteCheckReturnValueAnnotations|true 95 | detectorNoteDirectlyRelevantTypeQualifiers=NoteDirectlyRelevantTypeQualifiers|true 96 | detectorNoteJCIPAnnotation=NoteJCIPAnnotation|true 97 | detectorNoteNonNullAnnotations=NoteNonNullAnnotations|true 98 | detectorNoteNonnullReturnValues=NoteNonnullReturnValues|true 99 | detectorNoteSuppressedWarnings=NoteSuppressedWarnings|true 100 | detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true 101 | detectorNumberConstructor=NumberConstructor|true 102 | detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true 103 | detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true 104 | detectorPublicSemaphores=PublicSemaphores|true 105 | detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true 106 | detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true 107 | detectorRedundantInterfaces=RedundantInterfaces|true 108 | detectorReflectiveClasses=ReflectiveClasses|true 109 | detectorResolveAllReferences=ResolveAllReferences|false 110 | detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true 111 | detectorSerializableIdiom=SerializableIdiom|true 112 | detectorStartInConstructor=StartInConstructor|true 113 | detectorStaticCalendarDetector=StaticCalendarDetector|true 114 | detectorStringConcatenation=StringConcatenation|true 115 | detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true 116 | detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true 117 | detectorSwitchFallthrough=SwitchFallthrough|true 118 | detectorSynchronizationOnSharedBuiltinConstant=SynchronizationOnSharedBuiltinConstant|true 119 | detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true 120 | detectorTestASM=TestASM|false 121 | detectorTestDataflowAnalysis=TestDataflowAnalysis|false 122 | detectorTestingGround=TestingGround|false 123 | detectorTrainFieldStoreTypes=TrainFieldStoreTypes|true 124 | detectorTrainNonNullAnnotations=TrainNonNullAnnotations|true 125 | detectorTrainUnconditionalDerefParams=TrainUnconditionalDerefParams|true 126 | detectorURLProblems=URLProblems|true 127 | detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true 128 | detectorUnnecessaryMath=UnnecessaryMath|true 129 | detectorUnreadFields=UnreadFields|true 130 | detectorUseObjectEquals=UseObjectEquals|true 131 | detectorUselessSubclassMethod=UselessSubclassMethod|true 132 | detectorVarArgsProblems=VarArgsProblems|true 133 | detectorVolatileUsage=VolatileUsage|true 134 | detectorWaitInLoop=WaitInLoop|true 135 | detectorWrongMapIterator=WrongMapIterator|true 136 | detectorXMLFactoryBypass=XMLFactoryBypass|true 137 | detector_threshold=3 138 | effort=max 139 | excludefilter0=findBugsExclude.xml 140 | filter_settings=Low|STYLE,MALICIOUS_CODE,BAD_PRACTICE,CORRECTNESS,I18N,PERFORMANCE,MT_CORRECTNESS|false 141 | filter_settings_neg=| 142 | -------------------------------------------------------------------------------- /com.mousefeed.test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mousefeed.test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder 25 | 26 | 27 | 28 | 29 | net.sf.eclipsecs.core.CheckstyleBuilder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.pde.PluginNature 36 | org.eclipse.jdt.core.javanature 37 | edu.umd.cs.findbugs.plugin.eclipse.findbugsNature 38 | net.sf.eclipsecs.core.CheckstyleNature 39 | 40 | 41 | -------------------------------------------------------------------------------- /com.mousefeed.test/.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | formatter_profile=_Java Conventions [Andriy] 3 | formatter_settings_version=11 4 | org.eclipse.jdt.ui.exception.name=e 5 | org.eclipse.jdt.ui.gettersetter.use.is=true 6 | org.eclipse.jdt.ui.ignorelowercasenames=true 7 | org.eclipse.jdt.ui.importorder= 8 | org.eclipse.jdt.ui.javadoc=false 9 | org.eclipse.jdt.ui.keywordthis=false 10 | org.eclipse.jdt.ui.ondemandthreshold=99 11 | org.eclipse.jdt.ui.overrideannotation=true 12 | org.eclipse.jdt.ui.staticondemandthreshold=99 13 | org.eclipse.jdt.ui.text.custom_code_templates= 14 | -------------------------------------------------------------------------------- /com.mousefeed.test/.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | #Fri Oct 12 23:47:56 EDT 2007 2 | eclipse.preferences.version=1 3 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 4 | -------------------------------------------------------------------------------- /com.mousefeed.test/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: MouseFeed Test 4 | Bundle-SymbolicName: com.mousefeed.test;singleton:=true 5 | Bundle-Version: 2.0.3.qualifier 6 | Bundle-Vendor: Heavy Lifting Software, Sigasi & Robert Wloch 7 | Bundle-Localization: plugin 8 | Fragment-Host: com.mousefeed 9 | Require-Bundle: org.eclipse.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.10.0", 12 | org.eclipse.e4.ui.model.workbench;bundle-version="0.10.0", 13 | org.junit 14 | Bundle-ActivationPolicy: lazy 15 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 16 | Bundle-ClassPath: . 17 | -------------------------------------------------------------------------------- /com.mousefeed.test/build.properties: -------------------------------------------------------------------------------- 1 | source.. = test/ 2 | bin.includes = META-INF/,\ 3 | .,\ 4 | plugin.properties 5 | -------------------------------------------------------------------------------- /com.mousefeed.test/findBugsExclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mousefeed.test/global.properties: -------------------------------------------------------------------------------- 1 | # Build properties, which do not actually change. 2 | # Have lowest precendence 3 | 4 | #Eclipse directory 5 | eclipse=D:/e42/e-sdk-m6 -------------------------------------------------------------------------------- /com.mousefeed.test/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software, Sigasi & Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ -------------------------------------------------------------------------------- /com.mousefeed.test/plugin.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) Heavy Lifting Software, Sigasi & Robert Wloch 2012. 2 | # 3 | # This file is part of MouseFeed. 4 | # 5 | # MouseFeed is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # MouseFeed is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with MouseFeed. If not, see . 17 | actionInvocation=Action Invocation 18 | configureActionInvocation=Last Action Invocation... 19 | configureActionInvocationDesc=Configure previous action invocation (MouseFeed Plugin). 20 | mouseFeedCommandCategory=MouseFeed -------------------------------------------------------------------------------- /com.mousefeed.test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | com.mousefeed 7 | parent 8 | 2.0.3-SNAPSHOT 9 | ../pom.xml 10 | 11 | 12 | com.mousefeed 13 | com.mousefeed.test 14 | Mousefeed Plugin 15 | 2.0.3-SNAPSHOT 16 | 17 | eclipse-test-plugin 18 | 19 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/AllTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software, Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed; 20 | 21 | import com.mousefeed.client.AllClientTests; 22 | import com.mousefeed.eclipse.AllEclipseTests; 23 | import org.junit.runner.RunWith; 24 | import org.junit.runners.Suite; 25 | import org.junit.runners.Suite.SuiteClasses; 26 | 27 | /** 28 | * 29 | * @author Robert Wloch (robert@rowlo.de) 30 | */ 31 | @RunWith(Suite.class) 32 | @SuiteClasses({ AllClientTests.class, AllEclipseTests.class }) 33 | public class AllTests { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/client/AllClientTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software, Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client; 20 | 21 | import com.mousefeed.client.collector.ActionDescTest; 22 | import com.mousefeed.client.collector.CollectorTest; 23 | import org.junit.runner.RunWith; 24 | import org.junit.runners.Suite; 25 | import org.junit.runners.Suite.SuiteClasses; 26 | 27 | /** 28 | * 29 | * @author Robert Wloch (robert@rowlo.de) 30 | */ 31 | @RunWith(Suite.class) 32 | @SuiteClasses({ AssertEnabledTest.class, MessagesTest.class, 33 | OnWrongInvocationModeTest.class, ActionDescTest.class, 34 | CollectorTest.class }) 35 | public class AllClientTests { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/client/AssertEnabledTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client; 20 | 21 | import static org.junit.Assert.assertTrue; 22 | 23 | import org.junit.Test; 24 | 25 | /** 26 | * Insures that tests run with assert enabled. 27 | * This check is done because "assert" is used to check some conditions 28 | * instead of using org.junit.Assert.assertTrue. 29 | * 30 | * @author Andriy Palamarchuk 31 | */ 32 | public class AssertEnabledTest { 33 | @Test public void assertsEnabled() { 34 | boolean assertsEnabled = false; 35 | // intentional side effect! 36 | assert assertsEnabled = true; 37 | assertTrue("Asserts must be enabled!", assertsEnabled); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/client/MessagesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client; 20 | 21 | import static org.apache.commons.lang.StringUtils.isNotBlank; 22 | import static org.junit.Assert.assertEquals; 23 | 24 | import java.util.MissingResourceException; 25 | 26 | import org.junit.Test; 27 | 28 | /** 29 | * @author Andriy Palamarchuk 30 | */ 31 | public class MessagesTest { 32 | /** 33 | * A short key example. 34 | */ 35 | private static final String SHORT_KEY = "message"; 36 | 37 | /** 38 | * A full key example. 39 | */ 40 | private static final String FULL_KEY = 41 | MessagesTest.class.getSimpleName() + "." + SHORT_KEY; 42 | 43 | @Test public void get_common() { 44 | assertEquals("OK", new Messages().get("common.ok")); 45 | } 46 | 47 | @Test public void get_class() { 48 | final Messages messages = new Messages(MessagesTest.class); 49 | assert isNotBlank(messages.get(SHORT_KEY)); 50 | assertEquals(messages.get(SHORT_KEY), messages.get(FULL_KEY)); 51 | assert isNotBlank(new Messages().get(FULL_KEY)); 52 | assert isNotBlank(new Messages(null).get(FULL_KEY)); 53 | } 54 | 55 | @Test(expected = MissingResourceException.class) 56 | public void get_nonexisting() { 57 | new Messages().get(SHORT_KEY); 58 | } 59 | 60 | @Test(expected = MissingResourceException.class) 61 | public void get_nonexisting2() { 62 | new Messages(null).get(SHORT_KEY); 63 | } 64 | 65 | @Test(expected = NullPointerException.class) 66 | public void get_nullKey() { 67 | new Messages().get(null); 68 | } 69 | 70 | @Test(expected = NullPointerException.class) 71 | public void get_emptyKey() { 72 | new Messages().get(""); 73 | } 74 | 75 | @Test(expected = NullPointerException.class) 76 | public void get_blankKey() { 77 | new Messages().get(" \t\n"); 78 | } 79 | 80 | @Test public void get_withParameters() { 81 | final Messages m = new Messages(MessagesTest.class); 82 | final String p1 = "Parameter 1"; 83 | final String p2 = "Parameter 2"; 84 | final String p3 = "Parameter 3"; 85 | 86 | // the test value has only 2 parameters 87 | assert m.get(SHORT_KEY).contains("{0}") : "Template returned as is"; 88 | { 89 | final String s = m.get(SHORT_KEY, p1); 90 | assert s.contains(p1); 91 | assert !s.contains(p2); 92 | } 93 | { 94 | final String s = m.get(SHORT_KEY, p1, p2); 95 | assert s.contains(p1); 96 | assert s.contains(p2); 97 | assert !s.contains(p3); 98 | } 99 | { 100 | final String s = m.get(SHORT_KEY, p1, p2, p3); 101 | assert s.contains(p1); 102 | assert s.contains(p2); 103 | assert !s.contains(p3); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/client/OnWrongInvocationModeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client; 20 | 21 | import static com.mousefeed.client.OnWrongInvocationMode.getLabels; 22 | import static com.mousefeed.client.OnWrongInvocationMode.values; 23 | import static org.apache.commons.lang.StringUtils.isNotBlank; 24 | import static org.junit.Assert.assertEquals; 25 | 26 | import org.apache.commons.lang.Validate; 27 | import org.junit.Test; 28 | 29 | /** 30 | * @author Andriy Palamarchuk 31 | */ 32 | public class OnWrongInvocationModeTest { 33 | @Test public void general() { 34 | assert values().length > 1; 35 | } 36 | 37 | @Test public void getLabel() { 38 | for (OnWrongInvocationMode e : values()) { 39 | assert isNotBlank(e.getLabel()); 40 | assert !e.name().equals(e.getLabel()); 41 | } 42 | } 43 | 44 | @Test public void getLabelsTest() { 45 | assertEquals(getLabels().length, values().length); 46 | assertEquals(getLabels()[0], values()[0].getLabel()); 47 | Validate.noNullElements(getLabels()); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/client/collector/ActionDescTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client.collector; 20 | 21 | import static junit.framework.Assert.assertEquals; 22 | import static junit.framework.Assert.assertFalse; 23 | import static junit.framework.Assert.assertNull; 24 | import static junit.framework.Assert.assertTrue; 25 | 26 | import org.junit.Test; 27 | 28 | /** 29 | * @author Andriy Palamarchuk 30 | */ 31 | public class ActionDescTest { 32 | 33 | @Test(expected = IllegalArgumentException.class) 34 | public void setLabel_null() { 35 | new TestActionDesc().setLabel(null); 36 | } 37 | 38 | @Test 39 | public void setLabel_blank() { 40 | final AbstractActionDesc d = new TestActionDesc(); 41 | d.setLabel(" \n\t"); 42 | assertEquals("", d.getLabel()); 43 | } 44 | 45 | @Test public void setLabel() { 46 | final AbstractActionDesc d = new TestActionDesc(); 47 | final String s1 = "abc"; 48 | d.setLabel(s1); 49 | assertEquals(s1, d.getLabel()); 50 | 51 | d.setLabel("a&b"); 52 | assertEquals("ab", d.getLabel()); 53 | assertEquals("ab", d.getId()); 54 | } 55 | 56 | @Test public void setAccelerator() { 57 | final AbstractActionDesc d = new TestActionDesc(); 58 | assertFalse(d.hasAccelerator()); 59 | d.setAccelerator(null); 60 | assertFalse(d.hasAccelerator()); 61 | assertNull(d.getAccelerator()); 62 | d.setAccelerator("something"); 63 | assertTrue(d.hasAccelerator()); 64 | } 65 | 66 | private static class TestActionDesc extends AbstractActionDesc {} 67 | } 68 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/client/collector/CollectorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client.collector; 20 | 21 | import static junit.framework.Assert.assertEquals; 22 | import static junit.framework.Assert.assertNull; 23 | 24 | import org.junit.Test; 25 | 26 | /** 27 | * @author Andriy Palamarchuk 28 | */ 29 | public class CollectorTest { 30 | // sample data 31 | private static final String LABEL = "Label 1"; 32 | private static final String ACCELERATOR = "Ctrl+Alt+F1"; 33 | 34 | @Test(expected = IllegalArgumentException.class) 35 | public void onAction_null() { 36 | new Collector().onAction(null); 37 | } 38 | 39 | @Test public void getLastAction() { 40 | final Collector c = new Collector(); 41 | assertNull(c.getLastAction()); 42 | 43 | final AbstractActionDesc action = new TestActionDesc(); 44 | action.setLabel(LABEL); 45 | action.setAccelerator(ACCELERATOR); 46 | c.onAction(action); 47 | assertEquals(action, c.getLastAction()); 48 | } 49 | 50 | private static class TestActionDesc extends AbstractActionDesc {} 51 | } 52 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/eclipse/ActionDescImplTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static junit.framework.Assert.assertEquals; 22 | import static junit.framework.Assert.assertNull; 23 | 24 | import org.junit.Test; 25 | 26 | /** 27 | * @author Andriy Palamarchuk 28 | */ 29 | public class ActionDescImplTest { 30 | final static String label = "label 1"; 31 | final static String className = "class 1"; 32 | final static String def = "def 1"; 33 | 34 | @Test public void setClassName() { 35 | final ActionDescImpl desc = new ActionDescImpl(); 36 | assertNull(desc.getClassName()); 37 | desc.setClassName(className); 38 | assertEquals(className, desc.getClassName()); 39 | desc.setClassName(" \n\t"); 40 | assertEquals(className, desc.getClassName()); 41 | } 42 | 43 | @Test public void setDef() { 44 | final ActionDescImpl desc = new ActionDescImpl(); 45 | assertNull(desc.getDef()); 46 | desc.setDef(def); 47 | assertEquals(def, desc.getDef()); 48 | desc.setDef(" \n\t"); 49 | assertEquals(def, desc.getDef()); 50 | } 51 | 52 | @Test public void getId() { 53 | final ActionDescImpl desc = new ActionDescImpl(); 54 | assertNull(desc.getId()); 55 | desc.setLabel(label); 56 | assertEquals(label, desc.getId()); 57 | 58 | // action or command class name 59 | desc.setClassName(className); 60 | assertEquals(className, desc.getClassName()); 61 | assertEquals(className, desc.getId()); 62 | 63 | // action or command def string 64 | desc.setDef(def); 65 | assertEquals(def, desc.getDef()); 66 | assertEquals(def, desc.getId()); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/eclipse/AllEclipseTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software, Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import com.mousefeed.eclipse.preferences.ActionInvocationModeTableCellModifierTest; 22 | import com.mousefeed.eclipse.preferences.ActionInvocationModeTableLabelProviderTest; 23 | import com.mousefeed.eclipse.preferences.ActionOnWrongInvocationModeTest; 24 | import com.mousefeed.eclipse.preferences.PreferenceAccessorTest; 25 | import org.junit.runner.RunWith; 26 | import org.junit.runners.Suite; 27 | import org.junit.runners.Suite.SuiteClasses; 28 | 29 | /** 30 | * 31 | * @author Robert Wloch (robert@rowlo.de) 32 | */ 33 | @RunWith(Suite.class) 34 | @SuiteClasses({ ActionDescImplTest.class, 35 | ActionInvocationModeTableCellModifierTest.class, 36 | ActionInvocationModeTableLabelProviderTest.class, 37 | ActionOnWrongInvocationModeTest.class, PreferenceAccessorTest.class }) 38 | public class AllEclipseTests { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/eclipse/preferences/ActionInvocationModeTableCellModifierTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | import static org.junit.Assert.assertFalse; 23 | import static org.junit.Assert.assertNull; 24 | import static org.junit.Assert.assertTrue; 25 | 26 | import com.mousefeed.client.OnWrongInvocationMode; 27 | import com.mousefeed.eclipse.preferences.ActionInvocationModeControl.Column; 28 | import org.eclipse.jface.viewers.TableViewer; 29 | import org.junit.Test; 30 | 31 | /** 32 | * @author Andriy Palamarchuk 33 | */ 34 | public class ActionInvocationModeTableCellModifierTest { 35 | // sample data 36 | private static final String ID = "id1"; 37 | private static final String LABEL = "Label 1"; 38 | private static final OnWrongInvocationMode MODE = 39 | OnWrongInvocationMode.DO_NOTHING; 40 | private static final OnWrongInvocationMode MODE2 = 41 | OnWrongInvocationMode.ENFORCE; 42 | 43 | @Test (expected = IllegalArgumentException.class) 44 | public void constructor() { 45 | new ActionInvocationModeControl(null); 46 | } 47 | 48 | @Test public void canModify() { 49 | final ActionInvocationModeTableCellModifier m = 50 | new TestModifier(null); 51 | assertFalse(m.canModify(null, Column.LABEL.name())); 52 | assertTrue(m.canModify(new Object(), Column.MODE.name())); 53 | } 54 | 55 | @Test public void canModify_unknownProperty() { 56 | final ActionInvocationModeTableCellModifier m = new TestModifier(null); 57 | assertFalse(m.canModify(null, "unknown property")); 58 | } 59 | 60 | @Test public void getValue() { 61 | final ActionInvocationModeTableCellModifier m = new TestModifier(null); 62 | assertEquals(LABEL, m.getValue(getMode(), Column.LABEL.name())); 63 | assertEquals(MODE.ordinal(), m.getValue(getMode(), Column.MODE.name())); 64 | } 65 | 66 | @Test public void getValue_unknownProperty() { 67 | final ActionInvocationModeTableCellModifier m = new TestModifier(null); 68 | assertNull(m.getValue(getMode(), "unknown property")); 69 | } 70 | 71 | @Test public void modify_mode() { 72 | final ActionInvocationModeTableCellModifier m = new TestModifier(null); 73 | final ActionOnWrongInvocationMode mode = getMode(); 74 | 75 | assertFalse(mode.getOnWrongInvocationMode().equals(MODE2)); 76 | m.modify(mode, Column.MODE.name(), MODE2.ordinal()); 77 | assertEquals(MODE2, mode.getOnWrongInvocationMode()); 78 | } 79 | 80 | @Test public void modify_label() { 81 | final ActionInvocationModeTableCellModifier m = new TestModifier(null); 82 | m.modify(getMode(), Column.LABEL.name(), "some value"); 83 | } 84 | 85 | @Test public void modify_unknownProperty() { 86 | final ActionInvocationModeTableCellModifier m = new TestModifier(null); 87 | m.modify(getMode(), "unknown property", "some value"); 88 | } 89 | 90 | /** 91 | * The sample mode. 92 | * @return never null. 93 | */ 94 | private ActionOnWrongInvocationMode getMode() { 95 | final ActionOnWrongInvocationMode mode = 96 | new ActionOnWrongInvocationMode(); 97 | mode.setId(ID); 98 | mode.setLabel(LABEL); 99 | mode.setOnWrongInvocationMode(MODE); 100 | return mode; 101 | } 102 | 103 | private static final class TestModifier extends 104 | ActionInvocationModeTableCellModifier { 105 | private TestModifier(TableViewer tableViewer) { 106 | super(tableViewer); 107 | } 108 | 109 | // see base 110 | @Override 111 | void validateTableViewer(TableViewer tableViewer) { 112 | // does nothing 113 | } 114 | 115 | // see base 116 | @Override 117 | void updateTableViewer(Object element, String property) { 118 | // does nothing 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/eclipse/preferences/ActionInvocationModeTableLabelProviderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | import static org.junit.Assert.assertFalse; 23 | import static org.junit.Assert.assertTrue; 24 | 25 | import com.mousefeed.client.OnWrongInvocationMode; 26 | import com.mousefeed.eclipse.preferences.ActionInvocationModeControl.Column; 27 | import org.junit.Test; 28 | 29 | 30 | /** 31 | * @author Andriy Palamarchuk 32 | */ 33 | public class ActionInvocationModeTableLabelProviderTest { 34 | // sample data 35 | private static final String ID = "id1"; 36 | private static final String LABEL = "Label 1"; 37 | private static final OnWrongInvocationMode MODE = 38 | OnWrongInvocationMode.DO_NOTHING; 39 | 40 | @Test public void isLabelProperty() { 41 | final ActionInvocationModeTableLabelProvider labelProvider = 42 | new ActionInvocationModeTableLabelProvider(); 43 | assertFalse(labelProvider.isLabelProperty(null, Column.LABEL.name())); 44 | assertTrue(labelProvider.isLabelProperty(null, Column.MODE.name())); 45 | } 46 | 47 | @Test (expected = IllegalArgumentException.class) 48 | public void isLabelProperty_unknownProperty() { 49 | final ActionInvocationModeTableLabelProvider labelProvider = 50 | new ActionInvocationModeTableLabelProvider(); 51 | labelProvider.isLabelProperty(null, "unknown property"); 52 | } 53 | 54 | @Test public void getColumnImage() { 55 | final ActionInvocationModeTableLabelProvider labelProvider = 56 | new ActionInvocationModeTableLabelProvider(); 57 | labelProvider.getColumnImage(null, Column.LABEL.ordinal()); 58 | labelProvider.getColumnImage(null, Column.MODE.ordinal()); 59 | labelProvider.getColumnImage(null, -100); 60 | } 61 | 62 | @Test public void getColumnText() { 63 | final ActionInvocationModeTableLabelProvider labelProvider = 64 | new ActionInvocationModeTableLabelProvider(); 65 | assertEquals(LABEL, 66 | labelProvider.getColumnText(getMode(), Column.LABEL.ordinal())); 67 | assertEquals(MODE.getLabel(), 68 | labelProvider.getColumnText(getMode(), Column.MODE.ordinal())); 69 | } 70 | 71 | @Test (expected = IllegalArgumentException.class) 72 | public void getColumnText_unknownColumnIdx() { 73 | final ActionInvocationModeTableLabelProvider labelProvider = 74 | new ActionInvocationModeTableLabelProvider(); 75 | labelProvider.getColumnText(getMode(), -100); 76 | } 77 | 78 | /** 79 | * The sample mode. 80 | * @return never null. 81 | */ 82 | private ActionOnWrongInvocationMode getMode() { 83 | final ActionOnWrongInvocationMode mode = 84 | new ActionOnWrongInvocationMode(); 85 | mode.setId(ID); 86 | mode.setLabel(LABEL); 87 | mode.setOnWrongInvocationMode(MODE); 88 | return mode; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/eclipse/preferences/ActionOnWrongInvocationModeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | import static org.junit.Assert.assertNull; 23 | 24 | import com.mousefeed.client.OnWrongInvocationMode; 25 | import com.mousefeed.client.collector.AbstractActionDesc; 26 | import com.mousefeed.eclipse.ActionDescImpl; 27 | import com.mousefeed.eclipse.preferences.ActionOnWrongInvocationMode.LabelComparator; 28 | import org.apache.commons.lang.builder.EqualsBuilder; 29 | import org.junit.Test; 30 | 31 | 32 | /** 33 | * @author Andriy Palamarchuk 34 | */ 35 | public class ActionOnWrongInvocationModeTest { 36 | // sample data 37 | private static final String ID = "Id 1"; 38 | private static final String LABEL = "Label 1"; 39 | 40 | @Test(expected = IllegalArgumentException.class) 41 | public void constructor_null() { 42 | create(null); 43 | } 44 | 45 | @Test public void constructor() { 46 | final ActionDescImpl actionDesc = new ActionDescImpl(); 47 | actionDesc.setLabel(LABEL); 48 | actionDesc.setDef(ID); 49 | final ActionOnWrongInvocationMode mode = create(actionDesc); 50 | assertEquals(LABEL, mode.getLabel()); 51 | assertEquals(ID, mode.getId()); 52 | assertNull(mode.getOnWrongInvocationMode()); 53 | } 54 | 55 | @Test public void testClone() throws CloneNotSupportedException { 56 | final ActionOnWrongInvocationMode mode = 57 | new ActionOnWrongInvocationMode(); 58 | mode.setId(ID); 59 | mode.setLabel(LABEL); 60 | mode.setOnWrongInvocationMode(OnWrongInvocationMode.ENFORCE); 61 | 62 | final ActionOnWrongInvocationMode mode2 = 63 | (ActionOnWrongInvocationMode) mode.clone(); 64 | EqualsBuilder.reflectionEquals(mode, mode2); 65 | } 66 | 67 | @Test public void testLabelComparator() throws CloneNotSupportedException { 68 | final ActionOnWrongInvocationMode mode1 = 69 | new ActionOnWrongInvocationMode(); 70 | mode1.setId(ID); 71 | mode1.setLabel(LABEL); 72 | mode1.setOnWrongInvocationMode(OnWrongInvocationMode.ENFORCE); 73 | 74 | final LabelComparator comparator = new LabelComparator(); 75 | final ActionOnWrongInvocationMode mode2 = 76 | (ActionOnWrongInvocationMode) mode1.clone(); 77 | assertEquals(0, comparator.compare(mode1, mode2)); 78 | 79 | mode1.setLabel(LABEL + "a"); 80 | mode2.setLabel(LABEL + "b"); 81 | assertEquals(-1, comparator.compare(mode1, mode2)); 82 | 83 | mode1.setLabel(LABEL + "b"); 84 | mode2.setLabel(LABEL + "a"); 85 | assertEquals(1, comparator.compare(mode1, mode2)); 86 | } 87 | 88 | /** 89 | * Creates new object. 90 | * @param actionDesc the action description to create the new object with. 91 | * Can be null. 92 | * @return the new object. 93 | */ 94 | private ActionOnWrongInvocationMode create(AbstractActionDesc actionDesc) { 95 | return new ActionOnWrongInvocationMode(actionDesc); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /com.mousefeed.test/test/com/mousefeed/eclipse/preferences/PreferenceAccessorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import static org.junit.Assert.assertEquals; 22 | import static org.junit.Assert.assertNull; 23 | import static org.junit.Assert.assertTrue; 24 | 25 | import com.mousefeed.client.OnWrongInvocationMode; 26 | import com.mousefeed.eclipse.ActionDescImpl; 27 | import java.io.File; 28 | import java.io.IOException; 29 | import org.junit.After; 30 | import org.junit.Before; 31 | import org.junit.Test; 32 | 33 | 34 | /** 35 | * @author Andriy Palamarchuk 36 | */ 37 | public class PreferenceAccessorTest { 38 | // sample data 39 | private static final String ID1 = "action <> &id \n\t\"1!"; 40 | private static final String ID2 = "action <> &id 1@ &s"; 41 | private File FILE; 42 | 43 | @Before public void initFile() throws IOException { 44 | FILE = File.createTempFile("test", null); 45 | } 46 | 47 | @After public void removeFile() { 48 | FILE.delete(); 49 | } 50 | 51 | @Test public void getActionsWrongInvocationModeFile() throws IOException { 52 | final PreferenceAccessor preferences = new TestPreferenceAccessor(); 53 | 54 | assertNull(preferences.getOnWrongInvocationMode(ID1)); 55 | 56 | { 57 | final ActionOnWrongInvocationMode mode = 58 | new ActionOnWrongInvocationMode(); 59 | mode.setLabel("Label"); 60 | mode.setId(ID1); 61 | 62 | assertEquals(0, FILE.length()); 63 | mode.setOnWrongInvocationMode(OnWrongInvocationMode.ENFORCE); 64 | // is saved 65 | preferences.setOnWrongInvocationMode(mode); 66 | } 67 | assertTrue(FILE.length() > 0); 68 | assertEquals(OnWrongInvocationMode.ENFORCE, 69 | preferences.getOnWrongInvocationMode(ID1)); 70 | 71 | { 72 | final ActionDescImpl actionDesc = new ActionDescImpl(); 73 | actionDesc.setDef(ID2); 74 | actionDesc.setLabel("Label"); 75 | 76 | final ActionOnWrongInvocationMode mode = 77 | new ActionOnWrongInvocationMode(actionDesc); 78 | mode.setOnWrongInvocationMode(OnWrongInvocationMode.DO_NOTHING); 79 | preferences.setOnWrongInvocationMode(mode); 80 | } 81 | 82 | // the saved value is correctly retrieved 83 | { 84 | final PreferenceAccessor p = new TestPreferenceAccessor(); 85 | assertEquals(OnWrongInvocationMode.ENFORCE, 86 | p.getOnWrongInvocationMode(ID1)); 87 | assertEquals(OnWrongInvocationMode.DO_NOTHING, 88 | p.getOnWrongInvocationMode(ID2)); 89 | } 90 | 91 | // removing action-specific handling 92 | assertEquals(OnWrongInvocationMode.ENFORCE, 93 | preferences.getOnWrongInvocationMode(ID1)); 94 | preferences.removeOnWrongInvocaitonMode(ID1); 95 | assertNull(preferences.getOnWrongInvocationMode(ID1)); 96 | 97 | // the saved value is correctly retrieved 98 | { 99 | final PreferenceAccessor p = new TestPreferenceAccessor(); 100 | assertNull(p.getOnWrongInvocationMode(ID1)); 101 | assertEquals(OnWrongInvocationMode.DO_NOTHING, 102 | p.getOnWrongInvocationMode(ID2)); 103 | } 104 | } 105 | 106 | /** 107 | * Provides the provided file as the actions invocation mode file. 108 | */ 109 | private class TestPreferenceAccessor extends PreferenceAccessor { 110 | // see base 111 | @Override 112 | File getActionsWrongInvocationModeFile() { 113 | return FILE; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /com.mousefeed.update-site/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mousefeed.update-site 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.UpdateSiteBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.UpdateSiteNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /com.mousefeed.update-site/artifacts.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/artifacts.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/content.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/content.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/features/com.mousefeed.feature.source_2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/features/com.mousefeed.feature.source_2.0.0.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/features/com.mousefeed.feature_1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/features/com.mousefeed.feature_1.1.0.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/features/com.mousefeed.feature_1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/features/com.mousefeed.feature_1.1.1.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/features/com.mousefeed.feature_2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/features/com.mousefeed.feature_2.0.0.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/logs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/logs.zip -------------------------------------------------------------------------------- /com.mousefeed.update-site/plugins/com.mousefeed.source_2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/plugins/com.mousefeed.source_2.0.0.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/plugins/com.mousefeed_1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/plugins/com.mousefeed_1.1.0.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/plugins/com.mousefeed_1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/plugins/com.mousefeed_1.1.1.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/plugins/com.mousefeed_2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heeckhau/mousefeed/5cae8c65879886b78e593cbda8528e1643d85744/com.mousefeed.update-site/plugins/com.mousefeed_2.0.0.jar -------------------------------------------------------------------------------- /com.mousefeed.update-site/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | com.mousefeed 7 | parent 8 | 2.0.3-SNAPSHOT 9 | ../pom.xml 10 | 11 | 12 | com.mousefeed 13 | com.mousefeed.update-site 14 | Mousefeed Plugin 15 | 2.0.3-SNAPSHOT 16 | 17 | eclipse-update-site 18 | 19 | 20 | -------------------------------------------------------------------------------- /com.mousefeed.update-site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The main MouseFeed Fork Eclipse Update server. Fork was started on branch 1.0. 5 | 6 | Versions 2.x.x are for Eclipse 4, versions 1.x.x work up to Eclipse 3.7. 7 | 8 | 16 | 17 | 18 | 19 | 20 | 21 | MouseFeed Eclipse plugin. Helps to remember keyboard shortcuts. Shows a popup with the keyboard shortcut for the actions called with a menu or a toolbar button. 22 | 23 | Versions 2.x.x are for Eclipse 4, versions 1.x.x work up to Eclipse 3.7. 24 | 25 | 26 | 27 | 28 | MouseFeed Eclipse plugin. Helps to remember keyboard shortcuts. Shows a popup with the keyboard shortcut for the actions called with a menu or a toolbar button. 29 | 30 | Versions 2.x.x DO NOT WORK with Eclipse 3.7 or below. These versions contain support for e4 workbench model and cannot be used with earlier versions of Eclipse. Versions 1.x.x work up to Eclipse 3.7. 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /com.mousefeed/.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /com.mousefeed/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mousefeed/.fbprefs: -------------------------------------------------------------------------------- 1 | #FindBugs User Preferences 2 | #Fri Nov 16 22:08:32 GMT 2007 3 | detectorBCPMethodReturnCheck=BCPMethodReturnCheck|false 4 | detectorBadAppletConstructor=BadAppletConstructor|false 5 | detectorBadResultSetAccess=BadResultSetAccess|true 6 | detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true 7 | detectorBadUseOfReturnValue=BadUseOfReturnValue|true 8 | detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true 9 | detectorCalledMethods=CalledMethods|true 10 | detectorCheckCalls=CheckCalls|false 11 | detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true 12 | detectorCheckTypeQualifiers=CheckTypeQualifiers|true 13 | detectorCloneIdiom=CloneIdiom|true 14 | detectorComparatorIdiom=ComparatorIdiom|true 15 | detectorConfusedInheritance=ConfusedInheritance|true 16 | detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true 17 | detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true 18 | detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true 19 | detectorDontUseEnum=DontUseEnum|true 20 | detectorDroppedException=DroppedException|true 21 | detectorDumbMethodInvocations=DumbMethodInvocations|true 22 | detectorDumbMethods=DumbMethods|true 23 | detectorDuplicateBranches=DuplicateBranches|true 24 | detectorEmptyZipFileEntry=EmptyZipFileEntry|true 25 | detectorEqStringTest=EqStringTest|false 26 | detectorFinalizerNullsFields=FinalizerNullsFields|true 27 | detectorFindBadCast=FindBadCast|false 28 | detectorFindBadCast2=FindBadCast2|true 29 | detectorFindBadEqualsImplementation=FindBadEqualsImplementation|false 30 | detectorFindBadForLoop=FindBadForLoop|true 31 | detectorFindBugsSummaryStats=FindBugsSummaryStats|true 32 | detectorFindCircularDependencies=FindCircularDependencies|true 33 | detectorFindDeadLocalStores=FindDeadLocalStores|true 34 | detectorFindDoubleCheck=FindDoubleCheck|true 35 | detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true 36 | detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true 37 | detectorFindFinalizeInvocations=FindFinalizeInvocations|true 38 | detectorFindFloatEquality=FindFloatEquality|true 39 | detectorFindFloatMath=FindFloatMath|false 40 | detectorFindHEmismatch=FindHEmismatch|true 41 | detectorFindInconsistentSync2=FindInconsistentSync2|true 42 | detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true 43 | detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true 44 | detectorFindMaskedFields=FindMaskedFields|true 45 | detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true 46 | detectorFindNakedNotify=FindNakedNotify|true 47 | detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true 48 | detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true 49 | detectorFindNonShortCircuit=FindNonShortCircuit|true 50 | detectorFindNullDeref=FindNullDeref|true 51 | detectorFindOpenStream=FindOpenStream|true 52 | detectorFindPuzzlers=FindPuzzlers|true 53 | detectorFindRefComparison=FindRefComparison|true 54 | detectorFindReturnRef=FindReturnRef|true 55 | detectorFindRunInvocations=FindRunInvocations|true 56 | detectorFindSelfComparison=FindSelfComparison|true 57 | detectorFindSelfComparison2=FindSelfComparison2|true 58 | detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true 59 | detectorFindSpinLoop=FindSpinLoop|true 60 | detectorFindSqlInjection=FindSqlInjection|true 61 | detectorFindTwoLockWait=FindTwoLockWait|true 62 | detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true 63 | detectorFindUnconditionalWait=FindUnconditionalWait|true 64 | detectorFindUninitializedGet=FindUninitializedGet|true 65 | detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true 66 | detectorFindUnreleasedLock=FindUnreleasedLock|true 67 | detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|false 68 | detectorFindUnsyncGet=FindUnsyncGet|true 69 | detectorFindUselessControlFlow=FindUselessControlFlow|true 70 | detectorHugeSharedStringConstants=HugeSharedStringConstants|true 71 | detectorIDivResultCastToDouble=IDivResultCastToDouble|true 72 | detectorIncompatMask=IncompatMask|true 73 | detectorInefficientMemberAccess=InefficientMemberAccess|false 74 | detectorInefficientToArray=InefficientToArray|true 75 | detectorInfiniteLoop=InfiniteLoop|true 76 | detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true 77 | detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|true 78 | detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true 79 | detectorInitializationChain=InitializationChain|true 80 | detectorInstantiateStaticClass=InstantiateStaticClass|true 81 | detectorInvalidJUnitTest=InvalidJUnitTest|true 82 | detectorIteratorIdioms=IteratorIdioms|true 83 | detectorLazyInit=LazyInit|true 84 | detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true 85 | detectorLockedFields=LockedFields|false 86 | detectorMethodReturnCheck=MethodReturnCheck|true 87 | detectorMethods=Methods|true 88 | detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true 89 | detectorMutableLock=MutableLock|true 90 | detectorMutableStaticFields=MutableStaticFields|true 91 | detectorNaming=Naming|true 92 | detectorNoteAnnotationRetention=NoteAnnotationRetention|true 93 | detectorNoteCheckReturnValue=NoteCheckReturnValue|true 94 | detectorNoteCheckReturnValueAnnotations=NoteCheckReturnValueAnnotations|true 95 | detectorNoteDirectlyRelevantTypeQualifiers=NoteDirectlyRelevantTypeQualifiers|true 96 | detectorNoteJCIPAnnotation=NoteJCIPAnnotation|true 97 | detectorNoteNonNullAnnotations=NoteNonNullAnnotations|true 98 | detectorNoteNonnullReturnValues=NoteNonnullReturnValues|true 99 | detectorNoteSuppressedWarnings=NoteSuppressedWarnings|true 100 | detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true 101 | detectorNumberConstructor=NumberConstructor|true 102 | detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true 103 | detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true 104 | detectorPublicSemaphores=PublicSemaphores|true 105 | detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true 106 | detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true 107 | detectorRedundantInterfaces=RedundantInterfaces|true 108 | detectorReflectiveClasses=ReflectiveClasses|true 109 | detectorResolveAllReferences=ResolveAllReferences|false 110 | detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true 111 | detectorSerializableIdiom=SerializableIdiom|true 112 | detectorStartInConstructor=StartInConstructor|true 113 | detectorStaticCalendarDetector=StaticCalendarDetector|true 114 | detectorStringConcatenation=StringConcatenation|true 115 | detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true 116 | detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true 117 | detectorSwitchFallthrough=SwitchFallthrough|true 118 | detectorSynchronizationOnSharedBuiltinConstant=SynchronizationOnSharedBuiltinConstant|true 119 | detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true 120 | detectorTestASM=TestASM|false 121 | detectorTestDataflowAnalysis=TestDataflowAnalysis|false 122 | detectorTestingGround=TestingGround|false 123 | detectorTrainFieldStoreTypes=TrainFieldStoreTypes|true 124 | detectorTrainNonNullAnnotations=TrainNonNullAnnotations|true 125 | detectorTrainUnconditionalDerefParams=TrainUnconditionalDerefParams|true 126 | detectorURLProblems=URLProblems|true 127 | detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true 128 | detectorUnnecessaryMath=UnnecessaryMath|true 129 | detectorUnreadFields=UnreadFields|true 130 | detectorUseObjectEquals=UseObjectEquals|true 131 | detectorUselessSubclassMethod=UselessSubclassMethod|true 132 | detectorVarArgsProblems=VarArgsProblems|true 133 | detectorVolatileUsage=VolatileUsage|true 134 | detectorWaitInLoop=WaitInLoop|true 135 | detectorWrongMapIterator=WrongMapIterator|true 136 | detectorXMLFactoryBypass=XMLFactoryBypass|true 137 | detector_threshold=3 138 | effort=max 139 | excludefilter0=findBugsExclude.xml 140 | filter_settings=Low|STYLE,MALICIOUS_CODE,BAD_PRACTICE,CORRECTNESS,I18N,PERFORMANCE,MT_CORRECTNESS|false 141 | filter_settings_neg=| 142 | -------------------------------------------------------------------------------- /com.mousefeed/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mousefeed 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder 25 | 26 | 27 | 28 | 29 | net.sf.eclipsecs.core.CheckstyleBuilder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.pde.PluginNature 36 | org.eclipse.jdt.core.javanature 37 | edu.umd.cs.findbugs.plugin.eclipse.findbugsNature 38 | net.sf.eclipsecs.core.CheckstyleNature 39 | 40 | 41 | 42 | 1302609013026 43 | 44 | 10 45 | 46 | org.eclipse.ui.ide.multiFilter 47 | 1.0-projectRelativePath-matches-false-false-target 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /com.mousefeed/.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | formatter_profile=_Java Conventions [Andriy] 3 | formatter_settings_version=11 4 | org.eclipse.jdt.ui.exception.name=e 5 | org.eclipse.jdt.ui.gettersetter.use.is=true 6 | org.eclipse.jdt.ui.ignorelowercasenames=true 7 | org.eclipse.jdt.ui.importorder= 8 | org.eclipse.jdt.ui.javadoc=false 9 | org.eclipse.jdt.ui.keywordthis=false 10 | org.eclipse.jdt.ui.ondemandthreshold=99 11 | org.eclipse.jdt.ui.overrideannotation=true 12 | org.eclipse.jdt.ui.staticondemandthreshold=99 13 | org.eclipse.jdt.ui.text.custom_code_templates= 14 | -------------------------------------------------------------------------------- /com.mousefeed/.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | #Fri Oct 12 23:47:56 EDT 2007 2 | eclipse.preferences.version=1 3 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 4 | -------------------------------------------------------------------------------- /com.mousefeed/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) Heavy Lifting Software, Sigasi & Robert Wloch 2012. All rights reserved. 2 | 3 | MouseFeed is free software: you can redistribute it and/or modify 4 | it under the terms of the GNU Lesser General Public License as published by 5 | the Free Software Foundation, either version 3 of the License, or 6 | (at your option) any later version. 7 | 8 | MouseFeed is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU Lesser General Public License for more details. 12 | 13 | You should have received a copy of the GNU Lesser General Public License 14 | along with MouseFeed. If not, see . 15 | -------------------------------------------------------------------------------- /com.mousefeed/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: MouseFeed 4 | Bundle-SymbolicName: com.mousefeed; singleton:=true 5 | Bundle-Version: 2.0.3.qualifier 6 | Bundle-Activator: com.mousefeed.eclipse.Activator 7 | Bundle-Vendor: Heavy Lifting Software, Sigasi & Robert Wloch 8 | Bundle-Localization: plugin 9 | Require-Bundle: org.eclipse.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.10.0", 12 | org.eclipse.e4.ui.model.workbench;bundle-version="0.10.0", 13 | org.apache.commons.lang;bundle-version="2.6.0" 14 | Bundle-ActivationPolicy: lazy 15 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 16 | Bundle-ClassPath: . 17 | -------------------------------------------------------------------------------- /com.mousefeed/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | bin.includes = plugin.xml,\ 3 | META-INF/,\ 4 | .,\ 5 | html/,\ 6 | toc.xml,\ 7 | tocconcepts.xml,\ 8 | tocgettingstarted.xml,\ 9 | tocreference.xml,\ 10 | toctasks.xml,\ 11 | COPYING,\ 12 | plugin.properties 13 | -------------------------------------------------------------------------------- /com.mousefeed/checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /com.mousefeed/checkstyleSuppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /com.mousefeed/doc/developmentStandards.txt: -------------------------------------------------------------------------------- 1 | DEVELOPMENT PRINCIPLES 2 | Always do "The Right Thing". 3 | Zero-tolerance policy for warnings and errors from development 4 | and code validation tools. 5 | Review the existing code in the com.mousefeed.client package to get a feel 6 | of the approaches described in this document. 7 | 8 | Test Driven Development. Strive for good tests, 100% test code coverage 9 | (as practical). Remember, high test coverage does not mean good tests. 10 | At the current stage Eclipse UI is not automatically tested. 11 | 12 | DEVELOPMENT ENVIRONMENT 13 | Code is being developed using Ecipse IDE with following code validation plugins: 14 | * CheckSyle - uses the checkstyle.xml configuration file. 15 | * FindBugs - turned on to maximum sensitivity. 16 | * EclEmma - the plugin for Emma code coverage tool. 17 | The configurations for these tools are checked in with the project. 18 | The existing validations are not set in stone. 19 | They are subject to discussion and change. 20 | 21 | BEFORE CHECKING IN 22 | Rebuild the project, make sure there are no messages from the validation 23 | tools described in the "Development Environment" section. 24 | Make sure the "dist" target runs successfully. 25 | 26 | CODING CONVENTIONS 27 | Are based on the standard Sun Java coding conventions. 28 | 29 | All classes, methods except the private ones must have *full* Javadoc comments. 30 | Methods should indicate whether null values are acceptable for the method 31 | parameters, whether method can return null. -------------------------------------------------------------------------------- /com.mousefeed/doc/package-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | See 26 | http://72.5.124.55/j2se/javadoc/writingdoccomments/index.html 27 | http://72.5.124.55/j2se/javadoc/writingdoccomments/package.html-example 28 | ##### THIS IS THE TEMPLATE FOR THE PACKAGE DOC COMMENTS. ##### 29 | ##### TYPE YOUR PACKAGE COMMENTS HERE. BEGIN WITH A ##### 30 | ##### ONE-SENTENCE SUMMARY STARTING WITH A VERB LIKE: ##### 31 | Provides for.... 32 | 33 |

Package Specification

34 | 35 | ##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT ##### 36 | 39 | 40 |

Related Documentation

41 | 42 | For overviews, tutorials, examples, guides, and tool documentation, please see: 43 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /com.mousefeed/doc/testPlan.txt: -------------------------------------------------------------------------------- 1 | Start Eclipse Application 2 | 3 | SHORTCUT REMINDER 4 | 5 | Click File/Refresh menu item 6 | 7 | The reminder popup "F5 (Refresh)" shows up near the cursor. 8 | It disappears in a few seconds. 9 | 10 | Click on the "Search" ToolBar button. 11 | 12 | The reminder popup "Ctrl+H (Search...)" shows up near the cursor. 13 | 14 | Open a text file. Call the actions "Copy", "Paste", "Find/Replace", "Find Next" 15 | 16 | The reminder popup should show up after the each action, 17 | reminding their keyboard shortcuts. 18 | 19 | 20 | 21 | PREFERENCES 22 | 23 | - PROMOTE KEYS CHECKBOX 24 | 25 | Uncheck it, click File/Refresh menu item 26 | 27 | No reminder popup 28 | 29 | Check it, click File/Refresh menu item 30 | 31 | Reminder popup 32 | -------------------------------------------------------------------------------- /com.mousefeed/header.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software, Sigasi & Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ -------------------------------------------------------------------------------- /com.mousefeed/html/concepts/maintopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Main Topic 7 | 8 | 9 | 10 |

Main Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/concepts/subtopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 7 | 8 | 9 | 10 |

Sub Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/concepts/subtopic2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 2 7 | 8 | 9 | 10 |

Sub Topic 2

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/gettingstarted/maintopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Main Topic 7 | 8 | 9 | 10 |

Main Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/gettingstarted/subtopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 7 | 8 | 9 | 10 |

Sub Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/gettingstarted/subtopic2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 2 7 | 8 | 9 | 10 |

Sub Topic 2

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/reference/maintopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Main Topic 7 | 8 | 9 | 10 |

Main Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/reference/subtopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 7 | 8 | 9 | 10 |

Sub Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/reference/subtopic2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 2 7 | 8 | 9 | 10 |

Sub Topic 2

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/tasks/maintopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Main Topic 7 | 8 | 9 | 10 |

Main Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/tasks/subtopic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 7 | 8 | 9 | 10 |

Sub Topic

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/tasks/subtopic2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sub Topic 2 7 | 8 | 9 | 10 |

Sub Topic 2

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/html/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Table of Contents 7 | 8 | 9 | 10 |

Table of Contents

11 | Please enter your text here. 12 | 13 | -------------------------------------------------------------------------------- /com.mousefeed/plugin.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) Heavy Lifting Software, Sigasi & Robert Wloch 2012. 2 | # 3 | # This file is part of MouseFeed. 4 | # 5 | # MouseFeed is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # MouseFeed is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with MouseFeed. If not, see . 17 | actionInvocation=Action Invocation 18 | configureActionInvocation=Last Action Invocation... 19 | configureActionInvocationDesc=Configure previous action invocation (MouseFeed Plugin). 20 | mouseFeedCommandCategory=MouseFeed -------------------------------------------------------------------------------- /com.mousefeed/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 11 | 13 | 14 | 16 | 17 | 19 | 20 | 22 | 23 | 24 | 26 | 30 | 31 | 36 | 37 | 38 | 40 | 42 | 43 | 44 | 46 | 48 | 49 | 50 | 52 | 56 | 57 | 62 | 63 | 64 | 66 | 69 | 70 | 71 | 73 | 77 | 78 | 79 | 81 | 83 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /com.mousefeed/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | 6 | com.mousefeed 7 | parent 8 | 2.0.3-SNAPSHOT 9 | ../pom.xml 10 | 11 | 12 | com.mousefeed 13 | com.mousefeed 14 | Mousefeed Plugin 15 | 2.0.3-SNAPSHOT 16 | 17 | eclipse-plugin 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/Messages.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client; 20 | 21 | import static org.apache.commons.lang.StringUtils.isBlank; 22 | 23 | import java.text.MessageFormat; 24 | import java.util.MissingResourceException; 25 | import java.util.ResourceBundle; 26 | 27 | /** 28 | * Provides localized messages. Messages are retrieved with 29 | * {@link #get(String, Object...)}. If it is be provided with a class to 30 | * retrieve the messages for, one can drop this class name from the key names. 31 | * 32 | * @see #get(String, Object...) 33 | * @author Andriy Palamarchuk 34 | */ 35 | public class Messages { 36 | /** 37 | * The base name of the messages properties file for {@link #BUNDLE}. 38 | */ 39 | private static final String MESSAGES_BASE = Messages.class.getPackage() 40 | .getName() + ".messages"; 41 | 42 | /** 43 | * The messages resource bundle. 44 | */ 45 | private static final ResourceBundle BUNDLE = ResourceBundle 46 | .getBundle(MESSAGES_BASE); 47 | 48 | /** 49 | * The class to find messages for by using keys missing class name. 50 | */ 51 | private final Class forClass; 52 | 53 | /** 54 | * Constructor. For an object created by this constructor it is necessary to 55 | * pass full message key to {@link #get(String, Object...)}. 56 | * 57 | * @see #Messages(Class) 58 | */ 59 | public Messages() { 60 | this(AbstractNoForClassIsSpecified.class); 61 | } 62 | 63 | /** 64 | * Constructor. For an object created by this constructor the messages 65 | * associated with the specified class can be retrieved by passing a key 66 | * part after class base name as well as full message key to 67 | * {@link #get(String, Object...)}. 68 | * 69 | * @param forClass 70 | * the class to retrieve messages for. Passing null 71 | * value is equivalent to {@link #Messages()}. 72 | * @see #get(String, Object...) 73 | */ 74 | public Messages(final Class forClass) { 75 | this.forClass = forClass == null ? AbstractNoForClassIsSpecified.class 76 | : forClass; 77 | } 78 | 79 | /** 80 | * Returns the message for the defined key. If the object is provided with a 81 | * class to retrieve messages for (e.g. is created with 82 | * {@link #Messages(Class)}), this method tries to retrieve the message on a 83 | * key composed with that class name and the provided key. If the message is 84 | * not found, it finds the message using the provided key as is. If no class 85 | * is provided, the method returns searches the message using the provided 86 | * key. 87 | * 88 | * @param key 89 | * the message id. Not null or empty string. 90 | * @param arguments 91 | * the message arguments when the message will be formatted by 92 | * {@link MessageFormat#format}. 93 | * @return the message for the defined key. Never null. 94 | * @throws NullPointerException 95 | * if the provided key is blank. 96 | * @throws MissingResourceException 97 | * if the provided key is not found. 98 | */ 99 | public String get(final String key, final Object... arguments) 100 | throws NullPointerException, MissingResourceException { 101 | if (isBlank(key)) { 102 | throw new NullPointerException("Blank key was provided: '" + key 103 | + "'"); 104 | } 105 | try { 106 | final String forClassKey = forClass.getSimpleName() + "." + key; 107 | return getFromBundle(forClassKey, arguments); 108 | } catch (final MissingResourceException e) { 109 | return getFromBundle(key, arguments); 110 | } 111 | } 112 | 113 | /** 114 | * Retrieves the string specified by the key from bundle. 115 | * 116 | * @param key 117 | * the message key. Not blank. 118 | * @return the message by the key. The message is formatted with 119 | * {@link MessageFormat#format(Object)} if any arguments are 120 | * provided. 121 | */ 122 | private String getFromBundle(final String key, final Object... arguments) { 123 | final String pattern = BUNDLE.getString(key); 124 | return arguments.length == 0 ? pattern : MessageFormat.format(pattern, 125 | arguments); 126 | } 127 | 128 | /** 129 | * A "null" class used to initialize {@link Messages#forClass} if no class 130 | * is specified. 131 | */ 132 | private abstract static class AbstractNoForClassIsSpecified { 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/OnWrongInvocationMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client; 20 | 21 | /** 22 | * What to do if an action is called with a wrong mode. 23 | * E.g. in a situation when an action must be called with a keyboard, 24 | * but is called with a mouse. 25 | * 26 | * @author Andriy Palamarchuk 27 | */ 28 | public enum OnWrongInvocationMode { 29 | /** 30 | * Allow user to proceed. 31 | */ 32 | DO_NOTHING, 33 | 34 | /** 35 | * Remind the user that he uses incorrect access mode. 36 | */ 37 | REMIND, 38 | 39 | /** 40 | * Prevent the action from running, remind the user. 41 | */ 42 | ENFORCE; 43 | 44 | /** 45 | * The default access mode. 46 | */ 47 | public static final OnWrongInvocationMode DEFAULT = REMIND; 48 | 49 | /** 50 | * Provides label text. 51 | */ 52 | private static final Messages MESSAGES = 53 | new Messages(OnWrongInvocationMode.class); 54 | 55 | /** 56 | * Human-readable label text. 57 | * @return the label text. Never null. 58 | */ 59 | public String getLabel() { 60 | return MESSAGES.get(name()); 61 | } 62 | 63 | /** 64 | * Labels of the enumeration values. 65 | * @return the labels of the enumeration values. 66 | * Array of the same size as {@link #values()}. 67 | */ 68 | public static String[] getLabels() { 69 | final String[] labels = new String[values().length]; 70 | for (int i = 0; i < values().length; i++) { 71 | labels[i] = values()[i].getLabel(); 72 | } 73 | return labels; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/collector/AbstractActionDesc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client.collector; 20 | 21 | import static org.apache.commons.lang.StringUtils.isBlank; 22 | import static org.apache.commons.lang.Validate.isTrue; 23 | /** 24 | * Information about an action invoked by the user. 25 | * 26 | * @author Andriy Palamarchuk 27 | */ 28 | public abstract class AbstractActionDesc { 29 | /** 30 | * @see #getLabel() 31 | */ 32 | private String label; 33 | 34 | /** 35 | * @see #getAccelerator() 36 | */ 37 | private String accelerator; 38 | 39 | /** 40 | * The id of the user action. 41 | * @return the string identifying the action invoked by the user. 42 | * The default behavior is to return {@link #getLabel()}. 43 | * Subclasses should provide better values. 44 | * Never blank. 45 | */ 46 | public String getId() { 47 | return getLabel(); 48 | } 49 | 50 | /** 51 | * The action human-readable label. 52 | * @return the label. Should not be blank after initialized. 53 | * The '&' characters are removed from the original value. 54 | */ 55 | public String getLabel() { 56 | return label; 57 | } 58 | 59 | /** 60 | * @param label the new label. Not blank. 61 | * @see #getLabel() 62 | */ 63 | public void setLabel(final String label) { 64 | isTrue(label != null); 65 | if (isBlank(label)) 66 | this.label = ""; 67 | else 68 | this.label = label.replace("&", ""); 69 | } 70 | 71 | /** 72 | * Indicates whether the action has a keyboard shortcut. 73 | * @return true if the action description has 74 | * keyboard shortcut. 75 | */ 76 | public boolean hasAccelerator() { 77 | return getAccelerator() != null; 78 | } 79 | 80 | /** 81 | * The keyboard combination to call the action. 82 | * @return a string describing the action keyboard combination. 83 | * Can be null if there is no keyboard combination for the 84 | * action. 85 | */ 86 | public String getAccelerator() { 87 | return accelerator; 88 | } 89 | 90 | /** 91 | * @param accelerator the new shortcut value. Can be null. 92 | * @see #getAccelerator() 93 | */ 94 | public void setAccelerator(final String accelerator) { 95 | this.accelerator = accelerator; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/collector/Collector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.client.collector; 20 | 21 | import static org.apache.commons.lang.Validate.notNull; 22 | 23 | /** 24 | * Collects user activity data. 25 | * @author Andriy Palamarchuk 26 | */ 27 | public class Collector { 28 | 29 | /** 30 | * @see #getLastAction() 31 | */ 32 | private AbstractActionDesc lastAction; 33 | 34 | /** 35 | * Default constructor. Does nothing. 36 | */ 37 | public Collector() { 38 | } 39 | 40 | /** 41 | * The last non-internal action provided to the collector. 42 | * @return the last action provided to the method 43 | * {@link #onAction(AbstractActionDesc)}, 44 | * null if there were no calls to that method yet. 45 | * @see #onAction(AbstractActionDesc) 46 | */ 47 | public AbstractActionDesc getLastAction() { 48 | return lastAction; 49 | } 50 | 51 | /** 52 | * Must be called on user action. 53 | * @param action the action. Not be null. 54 | */ 55 | public void onAction(final AbstractActionDesc action) { 56 | notNull(action); 57 | lastAction = action; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/collector/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Classes to collect and analyze user data. 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/messages.properties: -------------------------------------------------------------------------------- 1 | # Properties naming conventions: 2 | # [ | common][.type].id[.usage] 3 | # 4 | # [ | common] - "common" if the key is used in multiple classes. 5 | # If it is a class-specific key use the base name of the class, 6 | # e.g. PreferencePage 7 | # 8 | # type - dot delimited words from the most general to the most specific. 9 | # Construct it, so the message for the same area are kept together. 10 | # Common types - 'error', 'validation', 'types'. 11 | # 12 | # id - the message id. 13 | # 14 | # usage - the message usage. For grouping messages for the same area. 15 | # For example, a message dialog can take a title and a text message 16 | # as parameters. The code calling message dialog can define keys, which are 17 | # the same except this field will have value "title" for the title text 18 | # and "message" for the message text. 19 | # 20 | # First are listed the common messages 21 | 22 | common.cancel=Cancel 23 | common.ok=OK 24 | 25 | ActionInvocationModeControl.actionTable.column.action=Action 26 | ActionInvocationModeControl.actionTable.column.onWrongInvocationMode=On Mouse Click 27 | ActionInvocationModeControl.label.addActionConfigReminder=Use action "" Invocation... to add entries. 28 | ActionInvocationModeControl.removeButton.label=&Remove Selected 29 | 30 | ActionInvocationPreferencePage.description=How actions are accessed: 31 | ActionInvocationPreferencePage.field.defaultOnWrongInvocationMode.label=When an action is called with a mouse click 32 | ActionInvocationPreferencePage.field.invocationControlEnabledCheckbox.label=Enable action invocation control 33 | ActionInvocationPreferencePage.field.invocationControlEnabledCheckbox.tooltip=Help to learn the desired way to invoke actions 34 | ActionInvocationPreferencePage.field.configureKeyboardShortcutCheckbox.label=Configure keyboard shortcut for often used actions 35 | ActionInvocationPreferencePage.field.configureKeyboardShortcutCheckbox.tooltip=Open the Keys preference page to set a keyboard shortcut for actions without one that you use often 36 | ActionInvocationPreferencePage.field.configureKeyboardShortcutThreshold.label=Action invocation counter threshold for configuring keyboard shortcut for often used actions 37 | ActionInvocationPreferencePage.field.configureKeyboardShortcutThreshold.tooltip=Open the Keys preference page to set a keyboard shortcut for actions without one that you used as many time as you set here 38 | 39 | ConfigureActionInvocationDialog.field.actionName.label=Action: {0} 40 | ConfigureActionInvocationDialog.field.onWrongInvocationMode.label=When the action is called with a mouse click 41 | ConfigureActionInvocationDialog.field.onWrongInvocationMode.value.default=Do as Configured in MouseFeed Preferences 42 | ConfigureActionInvocationDialog.title=MouseFeed: Action "{0}" Invocation 43 | 44 | ConfigureActionInvocationHandler.menuItem.lastActionInvocation.label="{0}" Invocation... 45 | 46 | LastActionInvocationRemiderFactory.text=Tip: Last Action Invocation... ({0}) 47 | LastActionInvocationRemiderFactory.configureActionInvocation-noBinding= 48 | 49 | # this message is used for the Messages unit tests only 50 | MessagesTest.message=Message with arguments {0}, {1} 51 | 52 | NagPopUp.title.canceled=Canceled by MouseFeed 53 | NagPopUp.title.reminder=MouseFeed 54 | NagPopUp.message.configureShortcut=Configure a shortcut for {0}... 55 | 56 | OnWrongInvocationMode.DO_NOTHING=Do Nothing 57 | OnWrongInvocationMode.ENFORCE=Enforce the Action Keyboard Shortcut 58 | OnWrongInvocationMode.REMIND=Remind the Action Keyboard Shortcut 59 | 60 | PreferencePage.description=Set general MouseFeed preferences: -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/client/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Provides classes shared between the MouseFeed clients. 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/AcceleratorSearchResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | /** 22 | * Result of an action accelerator search. 23 | * 24 | * @author Andriy Palamarchuk 25 | */ 26 | public class AcceleratorSearchResult { 27 | /** 28 | * Default constructor does nothing. 29 | */ 30 | public AcceleratorSearchResult() { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/ActionDescImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.StringUtils.isBlank; 22 | import static org.apache.commons.lang.StringUtils.isNotBlank; 23 | import static org.apache.commons.lang.Validate.isTrue; 24 | 25 | import com.mousefeed.client.collector.AbstractActionDesc; 26 | 27 | /** 28 | * Eclipse-specific action description. 29 | * 30 | * @author Andriy Palamarchuk 31 | */ 32 | public class ActionDescImpl extends AbstractActionDesc { 33 | /** 34 | * @see #getClassName() 35 | */ 36 | private String className; 37 | 38 | /** 39 | * @see #getDef() 40 | */ 41 | private String def; 42 | 43 | /** 44 | * Default constructor does nothing. 45 | */ 46 | public ActionDescImpl() { 47 | } 48 | 49 | /** 50 | * @return the id. Returns the first non-blank value of the following: 51 | * {@link #getDef()}, {@link #getClassName()}. If all of these are blank, 52 | * returns base implementation. 53 | */ 54 | @Override 55 | public String getId() { 56 | if (isNotBlank(getDef())) { 57 | return getDef(); 58 | } 59 | if (isNotBlank(getClassName())) { 60 | return getClassName(); 61 | } 62 | return super.getId(); 63 | } 64 | 65 | /** 66 | * The action/command class name. 67 | * @return the className. Can be null. 68 | * @see #getId() 69 | */ 70 | public String getClassName() { 71 | return className; 72 | } 73 | 74 | /** 75 | * @param className the className to set. 76 | * If blank, the existing value does not change. 77 | * @see #getClassName() 78 | */ 79 | public void setClassName(final String className) { 80 | if (isBlank(className)) { 81 | return; 82 | } 83 | 84 | isNullOrNotEqual(this.className, className); 85 | this.className = className; 86 | } 87 | 88 | /** 89 | * The action/command definition id. 90 | * @return the definition id. Can be null. 91 | * @see #getId() 92 | */ 93 | public String getDef() { 94 | return def; 95 | } 96 | 97 | /** 98 | * @param def the definition id to set. 99 | * If blank, the existing value does not change. 100 | * @see #getDef() 101 | */ 102 | public void setDef(final String def) { 103 | if (isBlank(def)) { 104 | return; 105 | } 106 | 107 | isNullOrNotEqual(this.def, def); 108 | this.def = def; 109 | } 110 | 111 | /** 112 | * Throws IllegalArgumentException if val1 is not 113 | * null and is equal val2. 114 | * @param val1 the main value to check. Can be null. 115 | * @param val2 the value to check against. Assumed not null. 116 | */ 117 | private void isNullOrNotEqual(final String val1, final String val2) { 118 | isTrue(val1 == null || val2.equals(val1), 119 | "Should be different: " + val2 + " and " + val1); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/Activator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.isTrue; 22 | 23 | import com.mousefeed.client.collector.Collector; 24 | import org.eclipse.jface.resource.ImageDescriptor; 25 | import org.eclipse.ui.plugin.AbstractUIPlugin; 26 | 27 | /** 28 | * The activator class controls the plug-in life cycle. 29 | * @author Andriy Palamarchuk 30 | */ 31 | public class Activator extends AbstractUIPlugin { 32 | 33 | /** 34 | * The plug-in ID. 35 | */ 36 | public static final String PLUGIN_ID = "com.mousefeed"; 37 | 38 | /** 39 | * The shared instance. 40 | */ 41 | private static Activator plugin; 42 | 43 | /** 44 | * @see #getCollector() 45 | */ 46 | private final Collector collector = new Collector(); 47 | 48 | /** 49 | * The constructor. 50 | */ 51 | public Activator() { 52 | isTrue(plugin == null); 53 | plugin = this; 54 | } 55 | 56 | /** 57 | * Returns the shared instance. 58 | * 59 | * @return the shared instance. 60 | * null before an activator is created or after it is stopped. 61 | */ 62 | public static Activator getDefault() { 63 | return plugin; 64 | } 65 | 66 | /** 67 | * Returns an image descriptor for the image file at the given 68 | * plug-in relative path. 69 | * 70 | * @param path the path 71 | * @return the image descriptor 72 | */ 73 | public static ImageDescriptor getImageDescriptor(final String path) { 74 | return imageDescriptorFromPlugin(PLUGIN_ID, path); 75 | } 76 | 77 | /** 78 | * Gathers user activity data. 79 | * @return the data collector. Not null. 80 | */ 81 | public Collector getCollector() { 82 | return collector; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/CommandActionDescGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.notNull; 22 | 23 | import com.mousefeed.client.collector.AbstractActionDesc; 24 | import org.eclipse.core.commands.Command; 25 | import org.eclipse.core.commands.common.NotDefinedException; 26 | import org.eclipse.jface.bindings.TriggerSequence; 27 | import org.eclipse.ui.PlatformUI; 28 | import org.eclipse.ui.keys.IBindingService; 29 | import org.eclipse.ui.menus.CommandContributionItem; 30 | 31 | /** 32 | /** 33 | * Generates {@link ActionDescImpl} from {@link CommandContributionItem}. 34 | * Pure strategy. 35 | * 36 | * @author Andriy Palamarchuk 37 | */ 38 | class CommandActionDescGenerator { 39 | /** 40 | * Retrieves a command from a command contribution item. 41 | */ 42 | private final CommandContributionItemCommandLocator locator = 43 | new CommandContributionItemCommandLocator(); 44 | 45 | /** 46 | * The binding service used to retrieve bindings data. 47 | */ 48 | private final IBindingService bindingService; 49 | 50 | /** 51 | * Constructor. 52 | */ 53 | public CommandActionDescGenerator() { 54 | bindingService = 55 | (IBindingService) PlatformUI.getWorkbench().getAdapter( 56 | IBindingService.class); 57 | } 58 | 59 | /** 60 | * Generates action description from the command contribution item. 61 | * @param commandContributionItem the contribution item to generate 62 | * an action description for. 63 | * Not null. 64 | * @return the action description for the provided action. 65 | * Never null. 66 | */ 67 | public AbstractActionDesc generate( 68 | final CommandContributionItem commandContributionItem) { 69 | notNull(commandContributionItem); 70 | 71 | final ActionDescImpl actionDesc = new ActionDescImpl(); 72 | final Command command = locator.get(commandContributionItem); 73 | if (command == null) { 74 | return null; 75 | } 76 | try { 77 | actionDesc.setLabel(command.getName()); 78 | } catch (final NotDefinedException e) { 79 | // should never happen 80 | throw new RuntimeException(e); 81 | } 82 | final String commandId = command.getId(); 83 | actionDesc.setDef(commandId); 84 | final TriggerSequence binding = 85 | bindingService.getBestActiveBindingFor(commandId); 86 | if (binding != null) { 87 | actionDesc.setAccelerator(binding.format()); 88 | } 89 | return actionDesc; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/CommandContributionItemCommandLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.notNull; 22 | import java.lang.reflect.Field; 23 | import org.eclipse.core.commands.Command; 24 | import org.eclipse.core.commands.ParameterizedCommand; 25 | import org.eclipse.ui.menus.CommandContributionItem; 26 | 27 | /** 28 | * Retrieves {@link Command} from {@link CommandContributionItem}. 29 | * 30 | * @author Andriy Palamarchuk 31 | */ 32 | public class CommandContributionItemCommandLocator { 33 | /** 34 | * Name of the field storing command in the {@link CommandContributionItem} 35 | * object. 36 | */ 37 | private static final String COMMAND_FIELD = "command"; 38 | 39 | /** 40 | * Default constructor does nothing. 41 | */ 42 | public CommandContributionItemCommandLocator() { 43 | } 44 | 45 | /** 46 | * Performs the actual retrieval. 47 | * @param item the command contribution item to retrieve command from. 48 | * @return the command stored in the command contribution item. 49 | * Can be null if the command can't be found. 50 | */ 51 | public Command get(final CommandContributionItem item) { 52 | final ParameterizedCommand parCommand = getItemParCommand(item); 53 | return parCommand == null ? null : parCommand.getCommand(); 54 | } 55 | 56 | /** 57 | * Parameterized command of the command contribution item. 58 | * @param item the item to extract the command from. 59 | * @return the command or null if can't be found. 60 | */ 61 | private ParameterizedCommand getItemParCommand( 62 | final CommandContributionItem item) { 63 | final Field commandField = getCommandField(); 64 | try { 65 | commandField.setAccessible(true); 66 | return (ParameterizedCommand) commandField.get(item); 67 | } catch (final SecurityException e) { 68 | throw new RuntimeException(e); 69 | } catch (final IllegalArgumentException e) { 70 | throw new RuntimeException(e); 71 | } catch (final IllegalAccessException e) { 72 | throw new RuntimeException(e); 73 | } 74 | } 75 | 76 | /** 77 | * The command field of the command contribution item class. 78 | * @return the command field. Never null. 79 | */ 80 | private Field getCommandField() { 81 | try { 82 | final Field commandField = 83 | CommandContributionItem.class.getDeclaredField( 84 | COMMAND_FIELD); 85 | notNull(commandField); 86 | return commandField; 87 | } catch (final SecurityException e) { 88 | throw new RuntimeException(e); 89 | } catch (final NoSuchFieldException e) { 90 | throw new RuntimeException(e); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/DestroyFontDisposeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import org.eclipse.swt.events.DisposeEvent; 22 | import org.eclipse.swt.events.DisposeListener; 23 | import org.eclipse.swt.graphics.Font; 24 | 25 | /** 26 | * Disposes the provided font when the widget it listens to is disposed. 27 | * @author Andriy Palamarchuk 28 | */ 29 | class DestroyFontDisposeListener implements DisposeListener { 30 | /** 31 | * The font to destroy. 32 | */ 33 | private final Font newFont; 34 | 35 | public DestroyFontDisposeListener(final Font newFont) { 36 | this.newFont = newFont; 37 | } 38 | 39 | public void widgetDisposed(final DisposeEvent e) { 40 | newFont.dispose(); 41 | } 42 | } -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/HandledActionDescGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.notNull; 22 | 23 | import com.mousefeed.client.collector.AbstractActionDesc; 24 | import org.eclipse.core.commands.Command; 25 | import org.eclipse.core.commands.common.NotDefinedException; 26 | import org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem; 27 | import org.eclipse.jface.bindings.TriggerSequence; 28 | import org.eclipse.ui.PlatformUI; 29 | import org.eclipse.ui.keys.IBindingService; 30 | 31 | /** 32 | * /** Generates {@link ActionDescImpl} from {@link HandledContributionItem}. 33 | * Pure strategy. 34 | * 35 | * @author Robert Wloch (robert@rowlo.de) 36 | */ 37 | @SuppressWarnings("restriction") 38 | class HandledActionDescGenerator { 39 | /** 40 | * Retrieves a command from a handled contribution item. 41 | */ 42 | private final HandledContributionItemCommandLocator locator = new HandledContributionItemCommandLocator(); 43 | 44 | /** 45 | * The binding service used to retrieve bindings data. 46 | */ 47 | private final IBindingService bindingService; 48 | 49 | /** 50 | * Constructor. 51 | */ 52 | public HandledActionDescGenerator() { 53 | bindingService = (IBindingService) PlatformUI.getWorkbench() 54 | .getAdapter(IBindingService.class); 55 | } 56 | 57 | /** 58 | * Generates action description from the handled contribution item. 59 | * 60 | * @param handledContributionItem 61 | * the contribution item to generate an action description for. 62 | * Not null. 63 | * @return the action description for the provided action. 64 | */ 65 | public AbstractActionDesc generate( 66 | final HandledContributionItem handledContributionItem) { 67 | notNull(handledContributionItem); 68 | 69 | final ActionDescImpl actionDesc = new ActionDescImpl(); 70 | final Command command = locator.get(handledContributionItem); 71 | if (command == null) { 72 | return null; 73 | } 74 | try { 75 | actionDesc.setLabel(command.getName()); 76 | } catch (final NotDefinedException e) { 77 | // should never happen 78 | throw new RuntimeException(e); 79 | } 80 | final String commandId = command.getId(); 81 | actionDesc.setDef(commandId); 82 | final TriggerSequence binding = bindingService 83 | .getBestActiveBindingFor(commandId); 84 | if (binding != null) { 85 | actionDesc.setAccelerator(binding.format()); 86 | } 87 | return actionDesc; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/HandledContributionItemCommandLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.notNull; 22 | 23 | import java.lang.reflect.Field; 24 | import org.eclipse.core.commands.Command; 25 | import org.eclipse.core.commands.ParameterizedCommand; 26 | import org.eclipse.e4.ui.model.application.ui.menu.MHandledItem; 27 | import org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem; 28 | 29 | /** 30 | * Retrieves {@link Command} from {@link HandledContributionItem}. 31 | * 32 | * @author Robert Wloch (robert@rowlo.de) 33 | */ 34 | @SuppressWarnings("restriction") 35 | public class HandledContributionItemCommandLocator { 36 | /** 37 | * Name of the field storing model in the {@link HandledContributionItem} 38 | * object. 39 | */ 40 | private static final String MODEL_FIELD = "model"; 41 | private static final String MODELITEM_FIELD = "modelItem"; 42 | 43 | /** 44 | * Default constructor does nothing. 45 | */ 46 | public HandledContributionItemCommandLocator() { 47 | } 48 | 49 | /** 50 | * Performs the actual retrieval. 51 | * 52 | * @param item 53 | * the handled contribution item to retrieve command from. 54 | * @return the command stored in the handled contribution item. Can be 55 | * null if the command can't be found. 56 | */ 57 | public Command get(final HandledContributionItem item) { 58 | final ParameterizedCommand parCommand = getItemParCommand(item); 59 | return parCommand == null ? null : parCommand.getCommand(); 60 | } 61 | 62 | /** 63 | * Parameterized command of the handled contribution item. 64 | * 65 | * @param item 66 | * the item to extract the command from. 67 | * @return the command or null if can't be found. 68 | */ 69 | private ParameterizedCommand getItemParCommand( 70 | final HandledContributionItem item) { 71 | // the ParameterizedCommand is stored in the field 72 | // HandledContributionItem.model.wbCommand 73 | final Field modelField = getModelField(item); 74 | try { 75 | modelField.setAccessible(true); 76 | final MHandledItem mItem = (MHandledItem) modelField.get(item); 77 | return mItem.getWbCommand(); 78 | } catch (final SecurityException e) { 79 | throw new RuntimeException(e); 80 | } catch (final IllegalArgumentException e) { 81 | throw new RuntimeException(e); 82 | } catch (final IllegalAccessException e) { 83 | throw new RuntimeException(e); 84 | } 85 | } 86 | 87 | /** 88 | * The model field of the handled contribution item class. 89 | * 90 | * @return the model field. Never null. 91 | */ 92 | private Field getModelField(final HandledContributionItem item) { 93 | try { 94 | final Field modelField = item.getClass().getDeclaredField(MODEL_FIELD); //Eclipse 4.2-4.5 get model field in HandledContributionItem 95 | notNull(modelField); 96 | return modelField; 97 | } catch (final SecurityException e) { 98 | throw new RuntimeException(e); 99 | } catch (final NoSuchFieldException e) { 100 | try { 101 | final Field modelItemField = item.getClass().getSuperclass() //Eclipse 4.6 get modelItem field in AbstractContributionItem 102 | .getDeclaredField(MODELITEM_FIELD); 103 | notNull(modelItemField); 104 | return modelItemField; 105 | } catch (final SecurityException ee) { 106 | throw new RuntimeException(ee); 107 | } catch (final NoSuchFieldException ee) { 108 | throw new RuntimeException(ee); 109 | } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/LastActionInvocationRemiderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import com.mousefeed.client.Messages; 22 | import org.eclipse.jface.bindings.TriggerSequence; 23 | import org.eclipse.ui.IWorkbench; 24 | import org.eclipse.ui.PlatformUI; 25 | import org.eclipse.ui.keys.IBindingService; 26 | 27 | /** 28 | * Generates text for the reminder to configure the last action invocation. 29 | * 30 | * @author Andriy Palamarchuk 31 | */ 32 | public class LastActionInvocationRemiderFactory { 33 | /** 34 | * The id of the action to configure action invocation. 35 | */ 36 | private static final String CONFIGURE_ACTION_INVOCATION_ACTION_ID = 37 | "com.mousefeed.commands.configureActionInvocation"; 38 | 39 | /** 40 | * Provides messages text. 41 | */ 42 | private static final Messages MESSAGES = new Messages( 43 | LastActionInvocationRemiderFactory.class); 44 | 45 | /** 46 | * Default constructor does nothing. 47 | */ 48 | public LastActionInvocationRemiderFactory() { 49 | } 50 | 51 | /** 52 | * The reminder text. 53 | * @return the reminder text. Not null. 54 | */ 55 | public String getText() { 56 | final TriggerSequence[] bindings = 57 | getBindingService().getActiveBindingsFor( 58 | CONFIGURE_ACTION_INVOCATION_ACTION_ID); 59 | final String binding = bindings.length == 0 60 | ? MESSAGES.get("configureActionInvocation-noBinding") 61 | : bindings[0].format(); 62 | return MESSAGES.get("text", binding); 63 | } 64 | 65 | /** 66 | * The workbench binding service. 67 | * @return the binding service. Not null. 68 | */ 69 | 70 | private IBindingService getBindingService() { 71 | return (IBindingService) getWorkbench().getAdapter( 72 | IBindingService.class); 73 | } 74 | 75 | /** 76 | * Current workbench. Not null. 77 | */ 78 | private IWorkbench getWorkbench() { 79 | return PlatformUI.getWorkbench(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/Layout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.isTrue; 22 | import static org.apache.commons.lang.Validate.notNull; 23 | 24 | import org.eclipse.swt.SWT; 25 | import org.eclipse.swt.layout.FormAttachment; 26 | import org.eclipse.swt.layout.FormData; 27 | import org.eclipse.swt.layout.FormLayout; 28 | import org.eclipse.swt.widgets.Control; 29 | 30 | /** 31 | * A layout helper. 32 | * Provides routines and constant for layout out the plugin UI. 33 | * Is not intended to be instantiated or sub-classed. 34 | * 35 | * @author Andriy Palamarchuk 36 | */ 37 | public final class Layout { 38 | /** 39 | * Distance between controls placed one above another. 40 | */ 41 | public static final int STACKED_V_OFFSET = 10; 42 | 43 | /** 44 | * Horizontal distance between two different consecutive controls. 45 | */ 46 | public static final int H_OFFSET = 10; 47 | 48 | /** 49 | * Distance between a label and its control below. 50 | */ 51 | public static final int STACKED_LABEL_V_OFFSET = 0; 52 | 53 | /** 54 | * Margin around the borders of a window. 55 | */ 56 | public static final int WINDOW_MARGIN = 10; 57 | 58 | /** 59 | * Numerator of 100% when denominator is 100. 60 | */ 61 | public static final int WHOLE_SIZE = 100; 62 | 63 | /** 64 | * Private constructor to insure no instances are ever created. 65 | */ 66 | private Layout() { } 67 | 68 | /** 69 | * Places control right under aboveControl. 70 | * The controls' container must have FormLayout. 71 | * @param control the control to place. Must have the same parent as 72 | * aboveControl. Not null. 73 | * @param aboveControl the control to place under. 74 | * If null, control is placed 75 | * {@link #WINDOW_MARGIN} pixels from the left side of the container, 76 | * and gap is interpreted as 0. 77 | * This is done to eliminate a special treatment of the topmost controls 78 | * in the client code. 79 | * @param gap distance in pixels between the bottom of 80 | * aboveControl and top of control. 81 | * Greater than 0. 82 | * @return the layout data of the control. 83 | */ 84 | public static FormData placeUnder(final Control control, final Control aboveControl, 85 | final int gap) { 86 | notNull(control); 87 | isTrue(aboveControl == null 88 | || control.getParent().equals(aboveControl.getParent())); 89 | isTrue(control.getParent().getLayout() instanceof FormLayout); 90 | isTrue(gap >= 0); 91 | 92 | final FormData formData = new FormData(); 93 | formData.left = aboveControl == null 94 | ? getLeftAttachment() 95 | : new FormAttachment(aboveControl, 0, SWT.LEFT); 96 | final int offset = aboveControl == null ? WINDOW_MARGIN : gap; 97 | formData.top = new FormAttachment(aboveControl, offset); 98 | control.setLayoutData(formData); 99 | return formData; 100 | } 101 | 102 | /** 103 | * Form attachment placing the control {@link #WINDOW_MARGIN} pixels from 104 | * the left border. 105 | * @return form attachment. Never null. 106 | */ 107 | private static FormAttachment getLeftAttachment() { 108 | return new FormAttachment(0, WINDOW_MARGIN); 109 | } 110 | } -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/Startup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import org.eclipse.swt.SWT; 22 | import org.eclipse.swt.widgets.Display; 23 | import org.eclipse.ui.IStartup; 24 | import org.eclipse.ui.PlatformUI; 25 | 26 | /** 27 | * Hooks up the plugin listeners. 28 | * @author Andriy Palamarchuk 29 | */ 30 | public class Startup implements IStartup { 31 | 32 | /** 33 | * Default constructor does nothing. 34 | */ 35 | public Startup() { 36 | } 37 | 38 | /** 39 | * Hooks up event listeners. 40 | */ 41 | public void earlyStartup() { 42 | getDisplay().asyncExec(new Runnable() { 43 | public void run() { 44 | getDisplay().addFilter( 45 | SWT.Selection, new GlobalSelectionListener()); 46 | } 47 | }); 48 | } 49 | 50 | /** 51 | * Current workbench display. 52 | * Not null. 53 | * @return the workbench display. 54 | */ 55 | public Display getDisplay() { 56 | return PlatformUI.getWorkbench().getDisplay(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/TextActionHandlerActionLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse; 20 | 21 | import static org.apache.commons.lang.Validate.isTrue; 22 | import static org.apache.commons.lang.Validate.notNull; 23 | 24 | import java.lang.reflect.Field; 25 | import java.util.Collections; 26 | import java.util.HashMap; 27 | import java.util.Map; 28 | import org.eclipse.jface.action.IAction; 29 | 30 | /** 31 | * Searches for an action inside of 32 | * org.eclipse.ui.actions.TextActionHandler utility actions. 33 | * If an action is found, provides action definition id, for the global 34 | * action belonging to the same command. 35 | * 36 | * @author Andriy Palamarchuk 37 | */ 38 | public class TextActionHandlerActionLocator { 39 | 40 | /** 41 | * Name of class org.eclipse.ui.actions.TextActionHandler. 42 | */ 43 | private static final String HANDLER_CLASS_NAME = 44 | "org.eclipse.ui.actions.TextActionHandler"; 45 | 46 | /** 47 | * Action fields mapped to an action definition id. 48 | * Key - name of the field in 49 | * org.eclipse.ui.actions.TextActionHandler, storing an 50 | * action, value - the action definitions id for this action. 51 | */ 52 | private static final Map HANDLER_ACTIONS; 53 | static { 54 | final Map map = new HashMap(); 55 | map.put("copyAction", "org.eclipse.ui.edit.copy"); 56 | HANDLER_ACTIONS = Collections.unmodifiableMap(map); 57 | } 58 | 59 | /** 60 | * Default constructor does nothing. 61 | */ 62 | public TextActionHandlerActionLocator() { 63 | } 64 | 65 | /** 66 | * Indicates whether this class can search for an action inside 67 | * of the search target. 68 | * @param searchTarget where to search. Not null. 69 | * @return true if this class can search for an action inside 70 | * of the search target. 71 | */ 72 | public boolean isSearchable(final IAction searchTarget) { 73 | notNull(searchTarget); 74 | return searchTarget.getClass().getName().startsWith( 75 | HANDLER_CLASS_NAME + "$"); 76 | } 77 | 78 | /** 79 | * Finds an action inside of searchTarget. 80 | * @param action the action to search. Not null. 81 | * @param searchTarget where to search. Not null. 82 | * @return the action definition id for the global action for the same 83 | * command as action, if it 84 | */ 85 | public String findActionDefinitionId(final IAction action, final IAction searchTarget) { 86 | try { 87 | return doFindActionDefinitionId(action, searchTarget); 88 | } catch (final SecurityException e) { 89 | throw new AssertionError(e); 90 | } catch (final NoSuchFieldException e) { 91 | throw new AssertionError(e); 92 | } catch (final IllegalAccessException e) { 93 | throw new AssertionError(e); 94 | } 95 | } 96 | 97 | /** 98 | * Contains all the logic of 99 | * {@link #findActionDefinitionId(IAction, IAction)}, leaving to it only 100 | * exception handling. 101 | */ 102 | private String doFindActionDefinitionId(final IAction action, 103 | final IAction searchTarget) 104 | throws NoSuchFieldException, IllegalAccessException { 105 | notNull(action); 106 | notNull(searchTarget); 107 | 108 | final Object handler = getTextActionHandler(searchTarget); 109 | for (final String fieldName : HANDLER_ACTIONS.keySet()) { 110 | final IAction handlerAction = 111 | getActionFromField(handler, fieldName); 112 | if (handlerAction == null) { 113 | continue; 114 | } 115 | if (action.getClass().equals( 116 | handlerAction.getClass())) { 117 | return HANDLER_ACTIONS.get(fieldName); 118 | } 119 | } 120 | return null; 121 | } 122 | 123 | /** 124 | * Retrieves an action from the provided action field. 125 | */ 126 | private IAction getActionFromField(final Object o, final String fieldName) 127 | throws NoSuchFieldException, IllegalAccessException { 128 | final Field actionField = 129 | o.getClass().getDeclaredField(fieldName); 130 | actionField.setAccessible(true); 131 | return (IAction) actionField.get(o); 132 | } 133 | 134 | /** 135 | * Retrieves org.eclipse.ui.actions.TextActionHandler from the 136 | * nested class action. 137 | * @param action the action to retrieve handler from. Not null. 138 | * @return the handler. Never null. 139 | */ 140 | private Object getTextActionHandler(final IAction action) 141 | throws NoSuchFieldException, IllegalAccessException { 142 | notNull(action); 143 | final Field handlerField = 144 | action.getClass().getDeclaredField("this$0"); 145 | notNull(handlerField); 146 | handlerField.setAccessible(true); 147 | 148 | final Object handler = handlerField.get(action); 149 | notNull(handler); 150 | isTrue(handler.getClass().getName().equals(HANDLER_CLASS_NAME)); 151 | return handler; 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/commands/ConfigureActionInvocationDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.commands; 20 | 21 | import static com.mousefeed.eclipse.Layout.STACKED_V_OFFSET; 22 | import static com.mousefeed.eclipse.Layout.placeUnder; 23 | import static org.apache.commons.lang.Validate.notNull; 24 | 25 | import com.mousefeed.client.Messages; 26 | import com.mousefeed.client.OnWrongInvocationMode; 27 | import com.mousefeed.client.collector.AbstractActionDesc; 28 | import com.mousefeed.eclipse.preferences.ActionOnWrongInvocationMode; 29 | import com.mousefeed.eclipse.preferences.PreferenceAccessor; 30 | import org.eclipse.jface.dialogs.Dialog; 31 | import org.eclipse.swt.SWT; 32 | import org.eclipse.swt.layout.FormLayout; 33 | import org.eclipse.swt.widgets.Combo; 34 | import org.eclipse.swt.widgets.Composite; 35 | import org.eclipse.swt.widgets.Control; 36 | import org.eclipse.swt.widgets.Label; 37 | import org.eclipse.swt.widgets.Shell; 38 | 39 | /** 40 | * The dialog to configure action invocation mode. 41 | * 42 | * @author Andriy Palamarchuk 43 | */ 44 | public class ConfigureActionInvocationDialog extends Dialog { 45 | /** 46 | * Provides messages text. 47 | */ 48 | private static final Messages MESSAGES = 49 | new Messages(ConfigureActionInvocationDialog.class); 50 | 51 | /** 52 | * The index of the value indicating using of the default on wrong 53 | * invocation mode handling. 54 | */ 55 | private static final int DEFAULT_ON_WRONG_INVOCATION_MODE_IDX = 0; 56 | 57 | /** 58 | * The action description of the action to configure invocation mode for. 59 | */ 60 | private final AbstractActionDesc actionDesc; 61 | 62 | /** 63 | * Setting what to do when user invokes an action using wrong invocation 64 | * mode. 65 | */ 66 | private Combo onWrongInvocationModeCombo; 67 | 68 | /** 69 | * Provides access to the plugin preferences. 70 | */ 71 | private final PreferenceAccessor preferences = 72 | PreferenceAccessor.getInstance(); 73 | 74 | /** 75 | * The UI factory class. 76 | */ 77 | private final OnWrongInvocationModeUI onWrongInvocationModeUI = 78 | new OnWrongInvocationModeUI(); 79 | 80 | /** 81 | * The constructor. Creates the dialog. 82 | * @param parentShell the parent shell. Not null. 83 | * @param actionDesc the action description to create the dialog for. 84 | * Not null. 85 | */ 86 | public ConfigureActionInvocationDialog(final Shell parentShell, 87 | final AbstractActionDesc actionDesc) { 88 | super(parentShell); 89 | notNull(parentShell); 90 | notNull(actionDesc); 91 | this.actionDesc = actionDesc; 92 | } 93 | 94 | // see base 95 | @Override 96 | protected Control createDialogArea(final Composite parent) { 97 | final Composite composite = new Composite(parent, SWT.NONE); 98 | composite.setLayout(new FormLayout()); 99 | Control c; 100 | c = createActionNameLabel(composite, null); 101 | 102 | c = onWrongInvocationModeUI.createLabel(composite, c, 103 | MESSAGES.get("field.onWrongInvocationMode.label")); 104 | onWrongInvocationModeCombo = 105 | onWrongInvocationModeUI.createCombo(composite, c); 106 | onWrongInvocationModeCombo.add(getDefaultInvocationMode(), 0); 107 | updateOnWrongInvocationModeCombo( 108 | preferences.getOnWrongInvocationMode(actionDesc.getId())); 109 | 110 | applyDialogFont(composite); 111 | return composite; 112 | } 113 | 114 | // see base 115 | @Override 116 | protected void configureShell(final Shell shell) { 117 | super.configureShell(shell); 118 | shell.setText(MESSAGES.get("title", actionDesc.getLabel())); 119 | } 120 | 121 | /** 122 | * Creates a label for {@link #onWrongInvocationModeCombo}. 123 | */ 124 | private Control createActionNameLabel( 125 | final Composite container, final Control above) { 126 | notNull(container); 127 | final Label label = new Label(container, SWT.NULL); 128 | final String text = MESSAGES.get( 129 | "field.actionName.label", actionDesc.getLabel()); 130 | label.setText(text); 131 | placeUnder(label, above, STACKED_V_OFFSET); 132 | return label; 133 | } 134 | 135 | // see base 136 | @Override 137 | protected void okPressed() { 138 | final OnWrongInvocationMode mode = getSelectedOnWrongInvocationMode(); 139 | if (mode == null) { 140 | preferences.removeOnWrongInvocaitonMode(actionDesc.getId()); 141 | } else { 142 | final ActionOnWrongInvocationMode actionMode = 143 | new ActionOnWrongInvocationMode(actionDesc); 144 | actionMode.setOnWrongInvocationMode( 145 | getSelectedOnWrongInvocationMode()); 146 | preferences.setOnWrongInvocationMode(actionMode); 147 | } 148 | super.okPressed(); 149 | } 150 | 151 | /** 152 | * Set the name in the combo widget to the specified value. 153 | * @param mode the value to set the combo to. null means to use 154 | * global settings. 155 | */ 156 | private void updateOnWrongInvocationModeCombo(final OnWrongInvocationMode mode) { 157 | onWrongInvocationModeCombo.setText(mode == null 158 | ? getDefaultInvocationMode() 159 | : mode.getLabel()); 160 | } 161 | 162 | /** 163 | * The currently selected wrong invocation mode handling. 164 | * @return the wrong invocation mode handling. null if the 165 | * user selected the default handling. 166 | */ 167 | private OnWrongInvocationMode getSelectedOnWrongInvocationMode() { 168 | final int i = onWrongInvocationModeCombo.getSelectionIndex(); 169 | return i == DEFAULT_ON_WRONG_INVOCATION_MODE_IDX 170 | ? null : OnWrongInvocationMode.values()[i - 1]; 171 | } 172 | 173 | /** 174 | * The text for the {@link OnWrongInvocationMode} value indicating to use 175 | * invocation handling as defined by preferences. 176 | * @return the default invocation handling option. Never null. 177 | */ 178 | private String getDefaultInvocationMode() { 179 | return MESSAGES.get("field.onWrongInvocationMode.value.default"); 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/commands/ConfigureActionInvocationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.commands; 20 | 21 | import static org.apache.commons.lang.Validate.notNull; 22 | 23 | import com.mousefeed.client.Messages; 24 | import com.mousefeed.client.collector.AbstractActionDesc; 25 | import com.mousefeed.client.collector.Collector; 26 | import com.mousefeed.eclipse.Activator; 27 | import java.util.Map; 28 | import org.eclipse.core.commands.AbstractHandler; 29 | import org.eclipse.core.commands.ExecutionEvent; 30 | import org.eclipse.core.commands.ExecutionException; 31 | import org.eclipse.ui.IWorkbenchWindow; 32 | import org.eclipse.ui.commands.IElementUpdater; 33 | import org.eclipse.ui.handlers.HandlerUtil; 34 | import org.eclipse.ui.menus.UIElement; 35 | 36 | /** 37 | * Configures invocation mode for the last called action. 38 | * @author Andriy Palamarchuk 39 | */ 40 | public class ConfigureActionInvocationHandler extends AbstractHandler 41 | implements IElementUpdater { 42 | /** 43 | * Provides messages text. 44 | */ 45 | private static final Messages MESSAGES = 46 | new Messages(ConfigureActionInvocationHandler.class); 47 | 48 | /** 49 | * The user activity data collector. 50 | */ 51 | private final Collector collector = 52 | Activator.getDefault().getCollector(); 53 | 54 | /** 55 | * Default constructor does nothing. 56 | */ 57 | public ConfigureActionInvocationHandler() { 58 | } 59 | 60 | // see base 61 | public Object execute(final ExecutionEvent event) throws ExecutionException { 62 | if (getLastAction() == null) { 63 | return null; 64 | } 65 | final IWorkbenchWindow window = 66 | HandlerUtil.getActiveWorkbenchWindowChecked(event); 67 | final ConfigureActionInvocationDialog dlg = 68 | new ConfigureActionInvocationDialog( 69 | window.getShell(), getLastAction()); 70 | dlg.open(); 71 | return null; 72 | } 73 | 74 | 75 | /** 76 | * Expected to be called after each detected user action. 77 | * @param element presents the Last Action Invocation menu item. 78 | * Not null. 79 | * @param parameters not used. 80 | */ 81 | @SuppressWarnings("rawtypes") 82 | public void updateElement(final UIElement element, final Map parameters) { 83 | notNull(element); 84 | if (getLastAction() != null) 85 | element.setText(MESSAGES.get("menuItem.lastActionInvocation.label", 86 | getLastAction().getLabel())); 87 | } 88 | 89 | /** 90 | * The last action called by the user. 91 | * @return the last action. null if there was no action 92 | * called before since Eclipse started. 93 | */ 94 | private AbstractActionDesc getLastAction() { 95 | return collector.getLastAction(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/commands/OnWrongInvocationModeUI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.commands; 20 | 21 | import static com.mousefeed.eclipse.Layout.STACKED_LABEL_V_OFFSET; 22 | import static com.mousefeed.eclipse.Layout.STACKED_V_OFFSET; 23 | import static com.mousefeed.eclipse.Layout.WHOLE_SIZE; 24 | import static com.mousefeed.eclipse.Layout.WINDOW_MARGIN; 25 | import static com.mousefeed.eclipse.Layout.placeUnder; 26 | import static org.apache.commons.lang.Validate.isTrue; 27 | import static org.apache.commons.lang.Validate.notNull; 28 | 29 | import com.mousefeed.client.OnWrongInvocationMode; 30 | import org.eclipse.swt.SWT; 31 | import org.eclipse.swt.layout.FormAttachment; 32 | import org.eclipse.swt.layout.FormData; 33 | import org.eclipse.swt.widgets.Combo; 34 | import org.eclipse.swt.widgets.Composite; 35 | import org.eclipse.swt.widgets.Control; 36 | import org.eclipse.swt.widgets.Label; 37 | 38 | /** 39 | * Helper class to generate on wrong invocation mode action handling UI - 40 | * a label and a dropdown. 41 | * 42 | * @author Andriy Palamarchuk 43 | */ 44 | public class OnWrongInvocationModeUI { 45 | 46 | /** 47 | * Default constructor does nothing. 48 | */ 49 | public OnWrongInvocationModeUI() { 50 | } 51 | 52 | /** 53 | * Creates the label. 54 | * @param container the container to create this control in. 55 | * Not null. 56 | * @param aboveControl the control above. null if this 57 | * is the topmost control in the container. 58 | * @param labelText the label text. Not null. 59 | * @return the label control. Never null. 60 | */ 61 | public Label createLabel(final Composite container, final Control aboveControl, 62 | final String labelText) { 63 | notNull(container); 64 | notNull(labelText); 65 | final Label label = new Label(container, SWT.NULL); 66 | label.setText(labelText); 67 | placeUnder(label, aboveControl, STACKED_V_OFFSET); 68 | return label; 69 | } 70 | 71 | /** 72 | * Creates the on wrong invocation mode handling dropdown. 73 | * @param container the container to create this control in. 74 | * Not null. 75 | * @param aboveControl the control above. null if this 76 | * is the topmost control in the container. 77 | * @return the combo control. Never null. 78 | */ 79 | public Combo createCombo(final Composite container, final Control aboveControl) { 80 | notNull(container); 81 | isTrue(aboveControl == null || aboveControl instanceof Label); 82 | 83 | final Combo combo = new Combo(container, SWT.READ_ONLY); 84 | combo.setItems(OnWrongInvocationMode.getLabels()); 85 | final FormData formData = 86 | placeUnder(combo, aboveControl, STACKED_LABEL_V_OFFSET); 87 | formData.right = new FormAttachment(WHOLE_SIZE, -WINDOW_MARGIN); 88 | return combo; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/commands/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Provides MouseFeed command classes. 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Provides Eclipse-specific classes of the Eclipse MouseFeed plugin. 26 | No other classes except in this package should use Eclipse and SWT API. 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/ActionInvocationModeTableCellModifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | 22 | import static org.apache.commons.lang.Validate.notNull; 23 | 24 | import com.mousefeed.client.OnWrongInvocationMode; 25 | import com.mousefeed.eclipse.preferences.ActionInvocationModeControl.Column; 26 | import org.eclipse.jface.viewers.ICellModifier; 27 | import org.eclipse.jface.viewers.TableViewer; 28 | import org.eclipse.swt.widgets.Item; 29 | 30 | /** 31 | * Cell modifier for the {@link ActionInvocationModeControl} table. 32 | * 33 | * @author Andriy Palamarchuk 34 | */ 35 | public class ActionInvocationModeTableCellModifier implements ICellModifier { 36 | /** 37 | * @see #ActionInvocationModeTableCellModifier(TableViewer) 38 | */ 39 | private final TableViewer tableViewer; 40 | 41 | /** 42 | * Creates new table cell modifier. 43 | * @param tableViewer the table viewer backing the modifier table. 44 | * Not null. 45 | */ 46 | public ActionInvocationModeTableCellModifier(final TableViewer tableViewer) { 47 | validateTableViewer(tableViewer); 48 | this.tableViewer = tableViewer; 49 | } 50 | 51 | /** 52 | * Validates table viewer constructor parameter. 53 | * @param viewer the object to validate. 54 | */ 55 | void validateTableViewer(final TableViewer viewer) { 56 | notNull(viewer); 57 | } 58 | 59 | // see base 60 | public boolean canModify(final Object element, final String property) { 61 | // non-existing properties are not modifiable 62 | // do this instead of throwing an exception because other 63 | // methods don't throw an exception in this situation 64 | return property.equals(Column.MODE.name()); 65 | } 66 | 67 | // see base 68 | public Object getValue(final Object element, final String property) { 69 | final ActionOnWrongInvocationMode mode = 70 | (ActionOnWrongInvocationMode) element; 71 | if (property.equals(Column.LABEL.name())) { 72 | return mode.getLabel(); 73 | } else if (property.equals(Column.MODE.name())) { 74 | return mode.getOnWrongInvocationMode().ordinal(); 75 | } else { 76 | // by the method contract 77 | return null; 78 | } 79 | } 80 | 81 | // see base 82 | public void modify(final Object element, final String property, final Object value) { 83 | final Object actionModeObject = element instanceof Item 84 | ? ((Item) element).getData() 85 | : element; 86 | final ActionOnWrongInvocationMode actionMode = 87 | (ActionOnWrongInvocationMode) actionModeObject; 88 | if (property.equals(Column.MODE.name())) { 89 | final OnWrongInvocationMode mode = 90 | OnWrongInvocationMode.values()[(Integer) value]; 91 | actionMode.setOnWrongInvocationMode(mode); 92 | updateTableViewer(actionModeObject, property); 93 | } else { 94 | // by the method contract 95 | return; 96 | } 97 | } 98 | 99 | /** 100 | * Updates table viewer for the provided element and a property. 101 | * @param element the element to update. Assumed not null. 102 | * @param property the property to update. Assumed not null. 103 | */ 104 | void updateTableViewer(final Object element, final String property) { 105 | tableViewer.update(element, new String[] {property}); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/ActionInvocationModeTableContentProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import java.util.Collection; 22 | import org.eclipse.jface.viewers.IStructuredContentProvider; 23 | import org.eclipse.jface.viewers.Viewer; 24 | 25 | /** 26 | * 27 | * @author Andriy Palamarchuk 28 | */ 29 | public class ActionInvocationModeTableContentProvider implements 30 | IStructuredContentProvider { 31 | 32 | /** 33 | * Default constructor does nothing. 34 | */ 35 | public ActionInvocationModeTableContentProvider() { 36 | } 37 | 38 | public Object[] getElements(final Object inputElement) { 39 | return ((Collection) inputElement).toArray(); 40 | } 41 | 42 | /** 43 | * Does nothing. 44 | */ 45 | public void dispose() {} 46 | 47 | // see base 48 | public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) { 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/ActionInvocationModeTableLabelProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import com.mousefeed.eclipse.preferences.ActionInvocationModeControl.Column; 22 | import org.eclipse.jface.viewers.BaseLabelProvider; 23 | import org.eclipse.jface.viewers.ITableLabelProvider; 24 | import org.eclipse.swt.graphics.Image; 25 | 26 | /** 27 | * @author Andriy Palamarchuk 28 | */ 29 | class ActionInvocationModeTableLabelProvider extends BaseLabelProvider 30 | implements ITableLabelProvider { 31 | 32 | /** 33 | * Default constructor does nothing. 34 | */ 35 | public ActionInvocationModeTableLabelProvider() { 36 | } 37 | 38 | // see base 39 | public boolean isLabelProperty(final Object element, final String property) { 40 | if (property.equals(Column.LABEL.name())) { 41 | return false; 42 | } else if (property.equals(Column.MODE.name())) { 43 | return true; 44 | } else { 45 | throw new IllegalArgumentException( 46 | "Unrecognized property " + property); 47 | } 48 | } 49 | 50 | /** 51 | * Returns null. 52 | */ 53 | public Image getColumnImage(final Object element, final int columnIndex) { 54 | return null; 55 | } 56 | 57 | // see base 58 | public String getColumnText(final Object element, final int columnIndex) { 59 | final ActionOnWrongInvocationMode mode = 60 | (ActionOnWrongInvocationMode) element; 61 | if (columnIndex == Column.LABEL.ordinal()) { 62 | return mode.getLabel(); 63 | } else if (columnIndex == Column.MODE.ordinal()) { 64 | return mode.getOnWrongInvocationMode().getLabel(); 65 | } else { 66 | throw new IllegalArgumentException( 67 | "Unrecognized column index: " + columnIndex); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/ActionOnWrongInvocationMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import static org.apache.commons.lang.StringUtils.isNotBlank; 22 | import static org.apache.commons.lang.Validate.isTrue; 23 | import static org.apache.commons.lang.Validate.notNull; 24 | 25 | import com.mousefeed.client.OnWrongInvocationMode; 26 | import com.mousefeed.client.collector.AbstractActionDesc; 27 | import java.io.Serializable; 28 | import java.util.Comparator; 29 | 30 | /** 31 | * Stores action-specific preferences for handling action invocation using 32 | * wrong mode. 33 | * Data stored in this class somewhat overlaps with {@link AbstractActionDesc}. 34 | * 35 | * @author Andriy Palamarchuk 36 | */ 37 | public class ActionOnWrongInvocationMode implements Cloneable { 38 | /** 39 | * @see #getId() 40 | */ 41 | private String id; 42 | 43 | /** 44 | * @see #getLabel() 45 | */ 46 | private String label; 47 | 48 | /** 49 | * @see #getOnWrongInvocationMode() 50 | */ 51 | private OnWrongInvocationMode onWrongInvocationMode; 52 | 53 | /** 54 | * Creates a new instance. 55 | */ 56 | public ActionOnWrongInvocationMode() { 57 | } 58 | 59 | /** 60 | * Creates a new instance from the {@link AbstractActionDesc} instance. Copies all 61 | * the data. 62 | * @param actionDesc the instance to create this instance from. 63 | * Not null 64 | */ 65 | public ActionOnWrongInvocationMode(final AbstractActionDesc actionDesc) { 66 | notNull(actionDesc); 67 | setId(actionDesc.getId()); 68 | setLabel(actionDesc.getLabel()); 69 | } 70 | 71 | // see base 72 | @Override 73 | public Object clone() throws CloneNotSupportedException { 74 | return super.clone(); 75 | } 76 | 77 | /** 78 | * The action id. Used to identify this preference. 79 | * @return the id. Never null after initialization. 80 | */ 81 | public String getId() { 82 | return id; 83 | } 84 | 85 | /** 86 | * @param id the id to set. Not null. 87 | * @see #getId() 88 | */ 89 | public void setId(final String id) { 90 | isTrue(isNotBlank(id)); 91 | this.id = id; 92 | } 93 | 94 | /** 95 | * The action label. Used for display purposes. 96 | * @return the label. Not null after initialized. 97 | */ 98 | public String getLabel() { 99 | return label; 100 | } 101 | 102 | /** 103 | * @param label the label to set. Not blank. 104 | * @see #getLabel() 105 | */ 106 | public void setLabel(final String label) { 107 | isTrue(isNotBlank(label)); 108 | this.label = label; 109 | } 110 | 111 | /** 112 | * What to do on wrong invocation. 113 | * @return the value. Never null after initialized. 114 | */ 115 | public OnWrongInvocationMode getOnWrongInvocationMode() { 116 | return onWrongInvocationMode; 117 | } 118 | 119 | /** 120 | * @param onWrongInvocationMode the new value. Not null. 121 | * @see #getOnWrongInvocationMode() 122 | */ 123 | public void setOnWrongInvocationMode( 124 | final OnWrongInvocationMode onWrongInvocationMode) { 125 | notNull(onWrongInvocationMode); 126 | this.onWrongInvocationMode = onWrongInvocationMode; 127 | } 128 | 129 | /** 130 | * Compares these objects by label. 131 | */ 132 | public static class LabelComparator implements 133 | Comparator, Serializable { 134 | /** 135 | * Serialization version id. 136 | */ 137 | static final long serialVersionUID = 1; 138 | 139 | /** 140 | * Default constructor does nothing. 141 | */ 142 | public LabelComparator() { 143 | } 144 | 145 | public int compare(final ActionOnWrongInvocationMode mode1, 146 | final ActionOnWrongInvocationMode mode2) { 147 | return mode1.getLabel().compareTo(mode2.getLabel()); 148 | } 149 | 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/PreferenceConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007, Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | /** 22 | * Constant definitions for plug-in preferences. 23 | * 24 | * @author Andriy Palamarchuk 25 | * @author Robert Wloch 26 | */ 27 | public final class PreferenceConstants { 28 | 29 | /** 30 | * Whether invocation control is enabled preference. 31 | * The preference indicates whether to help to learn the desired way to 32 | * invoke actions. 33 | */ 34 | public static final String P_INVOCATION_CONTROL_ENABLED = 35 | "InvocationControlEnabled"; 36 | 37 | /** 38 | * The default value for the setting {@link #P_INVOCATION_CONTROL_ENABLED} 39 | * setting. 40 | */ 41 | public static final boolean INVOCATION_CONTROL_ENABLED_DEFAULT = true; 42 | 43 | /** 44 | * Whether keyboard shortcut configuration is enabled preference. 45 | * The preference indicates whether to show the Keys preference page 46 | * for often used actions without a shortcut. 47 | */ 48 | public static final String P_CONFIGURE_KEYBOARD_SHORTCUT_ENABLED = 49 | "ConfigureKeyboardShortcutEnabled"; 50 | 51 | /** 52 | * The default value for the setting {@link #P_CONFIGURE_KEYBOARD_SHORTCUT_ENABLED} 53 | * setting. 54 | */ 55 | public static final boolean CONFIGURE_KEYBOARD_SHORTCUT_ENABLED_DEFAULT = true; 56 | 57 | /** 58 | * Threshold for action invocation counter above which keyboard shortcut 59 | * configuration is enabled preference. 60 | * The preference indicates whether to show the Keys preference page 61 | * for often used actions without a shortcut. 62 | */ 63 | public static final String P_CONFIGURE_KEYBOARD_SHORTCUT_THRESHOLD = 64 | "ConfigureKeyboardShortcutThreshold"; 65 | 66 | /** 67 | * The default value for the setting {@link #P_CONFIGURE_KEYBOARD_SHORTCUT_THRESHOLD} 68 | * setting. 69 | */ 70 | public static final int CONFIGURE_KEYBOARD_SHORTCUT_THRESHOLD_DEFAULT = 2; 71 | 72 | /** 73 | * Indicates how to deal with actions called with wrong action invocation 74 | * mode if there is no specific handling defined. 75 | */ 76 | public static final String P_DEFAULT_ON_WRONG_INVOCATION_MODE = 77 | "DefaultOnWrongInvocationMode"; 78 | 79 | private PreferenceConstants() { 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/PreferenceInitializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007, Robert Wloch 2012. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 22 | import org.eclipse.jface.preference.IPreferenceStore; 23 | 24 | import com.mousefeed.client.OnWrongInvocationMode; 25 | import com.mousefeed.eclipse.Activator; 26 | 27 | /** 28 | * Initializes default preference values. 29 | * 30 | * @author Andriy Palamarchuk 31 | * @author Robert Wloch 32 | */ 33 | public class PreferenceInitializer extends AbstractPreferenceInitializer { 34 | 35 | /** 36 | * Default constructor does nothing. 37 | */ 38 | public PreferenceInitializer() { 39 | } 40 | 41 | /** {@inheritDoc} */ 42 | @Override 43 | public void initializeDefaultPreferences() { 44 | final IPreferenceStore store = 45 | Activator.getDefault().getPreferenceStore(); 46 | store.setDefault( 47 | PreferenceConstants.P_DEFAULT_ON_WRONG_INVOCATION_MODE, 48 | OnWrongInvocationMode.DEFAULT.name()); 49 | store.setDefault( 50 | PreferenceConstants.P_INVOCATION_CONTROL_ENABLED, 51 | PreferenceConstants.INVOCATION_CONTROL_ENABLED_DEFAULT); 52 | store.setDefault( 53 | PreferenceConstants.P_CONFIGURE_KEYBOARD_SHORTCUT_ENABLED, 54 | PreferenceConstants.CONFIGURE_KEYBOARD_SHORTCUT_ENABLED_DEFAULT); 55 | store.setDefault( 56 | PreferenceConstants.P_CONFIGURE_KEYBOARD_SHORTCUT_THRESHOLD, 57 | PreferenceConstants.CONFIGURE_KEYBOARD_SHORTCUT_THRESHOLD_DEFAULT); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/PreferencePage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Heavy Lifting Software 2007. 3 | * 4 | * This file is part of MouseFeed. 5 | * 6 | * MouseFeed is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * MouseFeed is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with MouseFeed. If not, see . 18 | */ 19 | package com.mousefeed.eclipse.preferences; 20 | 21 | import com.mousefeed.client.Messages; 22 | import com.mousefeed.eclipse.Activator; 23 | import org.eclipse.jface.preference.FieldEditorPreferencePage; 24 | import org.eclipse.ui.IWorkbench; 25 | import org.eclipse.ui.IWorkbenchPreferencePage; 26 | 27 | /** 28 | * Main MouseFeed preferences page. 29 | * 30 | * @author Andriy Palamarchuk 31 | */ 32 | public class PreferencePage 33 | extends FieldEditorPreferencePage 34 | implements IWorkbenchPreferencePage { 35 | 36 | /** 37 | * Provides messages text. 38 | */ 39 | private static final Messages MESSAGES = new Messages(PreferencePage.class); 40 | 41 | /** 42 | * Creates new preference page. 43 | */ 44 | public PreferencePage() { 45 | super(GRID); 46 | setPreferenceStore(Activator.getDefault().getPreferenceStore()); 47 | setDescription(MESSAGES.get("description")); 48 | } 49 | 50 | /** 51 | * Creates the field editors. Field editors are abstractions of 52 | * the common GUI blocks needed to manipulate various types 53 | * of preferences. Each field editor knows how to save and 54 | * restore itself. 55 | */ 56 | @Override 57 | public void createFieldEditors() { 58 | } 59 | 60 | /** 61 | * Does not do anything. 62 | * @param workbench not used. 63 | */ 64 | public void init(final IWorkbench workbench) {} 65 | } -------------------------------------------------------------------------------- /com.mousefeed/src/com/mousefeed/eclipse/preferences/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | 25 | Provides classes for managing the plugin references. 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /com.mousefeed/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /com.mousefeed/toc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /com.mousefeed/tocconcepts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mousefeed/tocgettingstarted.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mousefeed/tocreference.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mousefeed/toctasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.mousefeed 5 | parent 6 | 2.0.3-SNAPSHOT 7 | Parent 8 | pom 9 | 10 | 11 | com.mousefeed 12 | com.mousefeed.test 13 | com.mousefeed.feature 14 | com.mousefeed.update-site 15 | 16 | 17 | 18 | 0.24.0 19 | UTF-8 20 | 21 | 22 | 23 | 24 | eclipse-juno 25 | p2 26 | http://download.eclipse.org/releases/juno 27 | 28 | 29 | eclipse-4.2 30 | p2 31 | http://download.eclipse.org/eclipse/updates/4.2 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.eclipse.tycho 40 | tycho-compiler-plugin 41 | ${tycho-version} 42 | 43 | UTF-8 44 | true 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | org.eclipse.tycho 53 | tycho-maven-plugin 54 | ${tycho-version} 55 | true 56 | 57 | 1.6 58 | 1.6 59 | 60 | 61 | 62 | org.eclipse.tycho 63 | target-platform-configuration 64 | ${tycho-version} 65 | 66 | p2 67 | 68 | 69 | linux 70 | gtk 71 | x86_64 72 | 73 | 74 | linux 75 | gtk 76 | x86 77 | 78 | 79 | win32 80 | win32 81 | x86 82 | 83 | 84 | win32 85 | win32 86 | x86_64 87 | 88 | 89 | macosx 90 | cocoa 91 | x86_64 92 | 93 | 96 | 97 | 98 | 99 | 100 | org.apache.maven.plugins 101 | maven-jarsigner-plugin 102 | 1.4 103 | 104 | 105 | 106 | org.eclipse.tycho 107 | tycho-surefire-plugin 108 | ${tycho-version} 109 | 110 | false 111 | true 112 | -enableassertions ${os-jvm-flags} 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | macosx-jvm-flags 121 | 122 | mac 123 | 124 | 125 | -XstartOnFirstThread 126 | 127 | 128 | 129 | sign 130 | 131 | 132 | 133 | org.apache.maven.plugins 134 | maven-jarsigner-plugin 135 | 136 | 137 | sign 138 | 139 | sign 140 | 141 | 142 | 143 | verify 144 | 145 | verify 146 | 147 | 148 | 149 | 150 | /home/heeckhau/workspace-xtext/sigasi.sigasi/com.sigasi.hdt.target/sigasiKeyStore 151 | ${sigasi.keystore.alias} 152 | ${sigasi.keystore.store.password} 153 | ${sigasi.keystore.key.password} 154 | 155 | -digestalg 156 | SHA1 157 | -sigalg 158 | SHA1withRSA 159 | -tsa 160 | https://timestamp.geotrust.com/tsa 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /setVersionNumber.sh: -------------------------------------------------------------------------------- 1 | NEW_VERSION=2.0.3.qualifier 2 | mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=${NEW_VERSION} -Dtycho.mode=maven 3 | 4 | --------------------------------------------------------------------------------