summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2011-12-03 17:01:11 (EST)
committerSteffen Pingel2011-12-03 17:01:11 (EST)
commit51f69a0d966888bda697d03f1dfcd5f3c4f94b36 (patch)
tree30e210791b46846eb92eaf4c9203689e8f6d799c
parent71d317f128271fa11827435e9a8096e9b9e5aa85 (diff)
downloadorg.eclipse.mylyn.commons-51f69a0d966888bda697d03f1dfcd5f3c4f94b36.zip
org.eclipse.mylyn.commons-51f69a0d966888bda697d03f1dfcd5f3c4f94b36.tar.gz
org.eclipse.mylyn.commons-51f69a0d966888bda697d03f1dfcd5f3c4f94b36.tar.bz2
NEW - bug 360301: [api] make provisional packages API
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360301 Change-Id: I8bf991f79dcc7c13f66d636dbe493ba6e5d54568
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/.cvsignore1
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/.project17
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/build.properties12
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/epl-v10.html328
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/feature.properties139
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/feature.xml42
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/license.html108
-rw-r--r--org.eclipse.mylyn.commons.activity-feature/pom.xml13
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CommonMessages.java47
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CoreUtil.java11
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/HtmlUtil.java2
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ICoreRunnable.java24
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/messages.properties17
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/Html2TextReader.java317
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SingleCharReader.java74
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SubstitutionTextReader.java173
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/CommonMessages.java4
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/Html2TextReader.java3
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SingleCharReader.java3
-rw-r--r--org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SubstitutionTextReader.java3
-rw-r--r--org.eclipse.mylyn.commons.notifications/.classpath1
-rw-r--r--org.eclipse.mylyn.commons.notifications/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java4
-rw-r--r--org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java12
-rw-r--r--org.eclipse.mylyn.commons.team/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryLocationPart.java2
-rw-r--r--org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java2
-rw-r--r--org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java2
-rw-r--r--org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java2
-rw-r--r--org.eclipse.mylyn.commons.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/AllCommonsTests.java2
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/NoticicationPopupMain.java2
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/SampleNotificationPopup.java2
-rw-r--r--org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/ui/CommonUiUtilTest.java33
-rw-r--r--org.eclipse.mylyn.commons.ui.identity/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.commons.ui.identity/src/org/eclipse/mylyn/internal/commons/ui/identity/PeopleView.java2
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.classpath7
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.project34
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.core.prefs352
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.ui.prefs63
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.team.ui.prefs3
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.pde.prefs18
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/META-INF/MANIFEST.MF13
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/about.html27
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/build.properties6
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/pom.xml22
-rw-r--r--org.eclipse.mylyn.commons.ui.tests/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorterTest.java98
-rw-r--r--org.eclipse.mylyn.commons.ui/.settings/.api_filters12
-rw-r--r--org.eclipse.mylyn.commons.ui/META-INF/MANIFEST.MF15
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorter.java129
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSupport.java434
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ClipboardCopier.java105
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonImages.java431
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonUiUtil.java209
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListItem.java275
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListViewer.java501
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientCanvas.java351
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientColors.java186
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientToolTip.java87
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java197
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ProgressContainer.java257
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/SelectionProviderAdapter.java79
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableSorter.java38
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableViewerSupport.java132
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeSorter.java39
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeViewerSupport.java130
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/CollapseAllAction.java42
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/ExpandAllAction.java42
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonColors.java40
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonFonts.java112
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonThemes.java64
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractInPlaceDialog.java311
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractNotificationPopup.java584
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/EnhancedWizardDialog.java123
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IInPlaceDialogListener.java24
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IValidatable.java26
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/InPlaceDialogEvent.java39
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/ValidatableWizardDialog.java126
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage.java76
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/AnimationUtil.java155
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorCanvas.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorSelectionWindow.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiConstants.java21
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiPlugin.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CompositeSyncImageDescriptor.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListItem.java8
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListViewer.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/Messages.java20
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/NotificationPopupColors.java10
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SectionComposite.java6
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SwtUtil.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/TaskBarManager.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/WindowUtil.java9
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/messages.properties13
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSorter.java6
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSupport.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractFilteredTree.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotification.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java20
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AdaptiveRefreshPolicy.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ClipboardCopier.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonColors.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFonts.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFormUtil.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImageManger.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImages.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonPropertyTester.java6
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonTextSupport.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonThemes.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePicker.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePickerPanel.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DateSelectionDialog.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DecoratingPatternStyledCellLabelProvider.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DelayedRefreshJob.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/EnhancedFilteredTree.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientCanvas.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientDrawer.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientToolTip.java9
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ICoreRunnable.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/IFilteredTreeListener.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/PlatformUiUtil.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ProgressContainer.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/RichToolTip.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScalingHyperlink.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScreenshotCreationPage.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SearchHistoryPopUpDialog.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SelectionProviderAdapter.java6
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ServiceMessageControl.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SubstringPatternFilter.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableSorter.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableTreePatternFilter.java5
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableViewerSupport.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TextSearchControl.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeSorter.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeViewerSupport.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchActionSupport.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchUtil.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/CollapseAllAction.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/ExpandAllAction.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/PropertiesAction.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractDeleteLineHandler.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractTextViewerHandler.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineHandler.java4
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToBeginningHandler.java4
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToEndHandler.java4
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineHandler.java4
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToBeginningHandler.java4
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToEndHandler.java4
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/AbstractInPlaceDialog.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/EnhancedWizardDialog.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IInPlaceDialogListener.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IValidatable.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceCheckBoxTreeDialog.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDateSelectionDialog.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDialogEvent.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/Messages.java3
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/ValidatableWizardDialog.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/WebBrowserDialog.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/EditorBusyIndicator.java2
-rw-r--r--org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/IBusyEditor.java2
-rw-r--r--org.eclipse.mylyn.commons.workbench/.classpath12
-rw-r--r--org.eclipse.mylyn.commons.workbench/.cvsignore2
-rw-r--r--org.eclipse.mylyn.commons.workbench/.project34
-rw-r--r--org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.core.prefs359
-rw-r--r--org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.ui.prefs65
-rw-r--r--org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.ltk.core.refactoring.prefs3
-rw-r--r--org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.mylyn.tasks.ui.prefs4
-rw-r--r--org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.pde.prefs18
-rw-r--r--org.eclipse.mylyn.commons.workbench/META-INF/MANIFEST.MF30
-rw-r--r--org.eclipse.mylyn.commons.workbench/about.html27
-rw-r--r--org.eclipse.mylyn.commons.workbench/build.properties17
-rw-r--r--org.eclipse.mylyn.commons.workbench/plugin.properties13
-rw-r--r--org.eclipse.mylyn.commons.workbench/pom.xml29
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java246
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractWorkbenchNotificationPopup.java38
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AdaptiveRefreshPolicy.java144
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/BusyAnimator.java169
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/CommonImageManger.java71
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DecoratingPatternStyledCellLabelProvider.java254
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DelayedRefreshJob.java104
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/EnhancedFilteredTree.java157
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/GradientDrawer.java215
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/InPlaceCheckBoxTreeDialog.java202
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/PropertiesAction.java33
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/SubstringPatternFilter.java30
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TableTreePatternFilter.java31
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TaskBarManager.java151
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchActionSupport.java258
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchUtil.java334
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/BrowserUtil.java127
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/WebBrowserDialog.java154
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/editors/CommonTextSupport.java333
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/CommonFormUtil.java76
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/DatePicker.java324
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/DatePickerPanel.java286
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/DateSelectionDialog.java105
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/InPlaceDateSelectionDialog.java96
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/NotificationControl.java88
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/RichToolTip.java209
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/ScalingHyperlink.java109
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/SectionComposite.java132
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/forms/ServiceMessageControl.java289
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/search/SearchHistoryPopupDialog.java455
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/search/TextSearchControl.java488
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/AbstractDeleteLineHandler.java56
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/AbstractTextViewerHandler.java50
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/CutLineHandler.java28
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/CutLineToBeginningHandler.java28
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/CutLineToEndHandler.java28
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/DeleteLineHandler.java28
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/DeleteLineToBeginningHandler.java28
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/texteditor/DeleteLineToEndHandler.java28
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/internal/commons/workbench/CommonsWorkbenchPlugin.java60
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/internal/commons/workbench/Messages.java81
-rw-r--r--org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/internal/commons/workbench/messages.properties46
-rw-r--r--org.eclipse.mylyn.discovery.ui/.classpath6
-rw-r--r--org.eclipse.mylyn.discovery.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.discovery.ui/src/org/eclipse/mylyn/internal/discovery/ui/commands/ShowConnectorDiscoveryWizardCommandHandler.java2
-rw-r--r--org.eclipse.mylyn.discovery.ui/src/org/eclipse/mylyn/internal/discovery/ui/wizards/ConnectorDiscoveryWizard.java2
-rw-r--r--org.eclipse.mylyn.discovery.ui/src/org/eclipse/mylyn/internal/discovery/ui/wizards/DiscoveryViewer.java12
-rw-r--r--org.eclipse.mylyn.discovery.ui/src/org/eclipse/mylyn/internal/discovery/ui/wizards/OverviewToolTip.java6
-rw-r--r--pom.xml3
229 files changed, 14428 insertions, 131 deletions
diff --git a/org.eclipse.mylyn.commons.activity-feature/.cvsignore b/org.eclipse.mylyn.commons.activity-feature/.cvsignore
new file mode 100644
index 0000000..eb5a316
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/.cvsignore
@@ -0,0 +1 @@
+target
diff --git a/org.eclipse.mylyn.commons.activity-feature/.project b/org.eclipse.mylyn.commons.activity-feature/.project
new file mode 100644
index 0000000..a3b3d5a
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.mylyn.commons.activity-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 0000000..a4b9fa9
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Thu Dec 20 14:08:45 PST 2007
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.commons.activity-feature/build.properties b/org.eclipse.mylyn.commons.activity-feature/build.properties
new file mode 100644
index 0000000..d1c6704
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/build.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2004, 2010 Tasktop Technologies and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+
+bin.includes = feature.properties,\
+ feature.xml,\
+ license.html,\
+ epl-v10.html
diff --git a/org.eclipse.mylyn.commons.activity-feature/epl-v10.html b/org.eclipse.mylyn.commons.activity-feature/epl-v10.html
new file mode 100644
index 0000000..ed4b196
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/epl-v10.html
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor (&quot;Commercial
+Contributor&quot;) hereby agrees to defend and indemnify every other
+Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
+costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.activity-feature/feature.properties b/org.eclipse.mylyn.commons.activity-feature/feature.properties
new file mode 100644
index 0000000..04ac732
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/feature.properties
@@ -0,0 +1,139 @@
+###############################################################################
+# Copyright (c) 2009, 2010 Tasktop Technologies and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+featureName=Mylyn Commons
+description=Provides common utilities for task repository connectors.
+providerName=Eclipse Mylyn
+copyright=Copyright (c) 2010, 2011 Tasktop Technologies and others. All rights reserved.
+
+license=\
+Eclipse Foundation Software User Agreement\n\
+February 1, 2011\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
diff --git a/org.eclipse.mylyn.commons.activity-feature/feature.xml b/org.eclipse.mylyn.commons.activity-feature/feature.xml
new file mode 100644
index 0000000..3b7b530
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/feature.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2010 Tasktop Technologies and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Tasktop Technologies - initial API and implementation
+ -->
+<feature
+ id="org.eclipse.mylyn.commons.activity"
+ label="%featureName"
+ version="3.7.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.mylyn">
+
+ <description url="http://eclipse.org/mylyn">
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="license.html">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.mylyn.commons" version="3.7.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.mylyn.commons.activity.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/org.eclipse.mylyn.commons.activity-feature/license.html b/org.eclipse.mylyn.commons.activity-feature/license.html
new file mode 100644
index 0000000..f19c483
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/license.html
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/org.eclipse.mylyn.commons.activity-feature/pom.xml b/org.eclipse.mylyn.commons.activity-feature/pom.xml
new file mode 100644
index 0000000..73ff966
--- /dev/null
+++ b/org.eclipse.mylyn.commons.activity-feature/pom.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.mylyn.commons-parent</artifactId>
+ <groupId>org.eclipse.mylyn.commons</groupId>
+ <version>3.7.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.mylyn.commons.activity</artifactId>
+ <version>3.7.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CommonMessages.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CommonMessages.java
new file mode 100644
index 0000000..5e81aea
--- /dev/null
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CommonMessages.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.core;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class CommonMessages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.mylyn.commons.core.messages"; //$NON-NLS-1$
+
+ static {
+ // load message values from bundle file
+ reloadMessages();
+ }
+
+ public static void reloadMessages() {
+ NLS.initializeMessages(BUNDLE_NAME, CommonMessages.class);
+ }
+
+ public static String Friday;
+
+ public static String Monday;
+
+ public static String Saturday;
+
+ public static String Sunday;
+
+ public static String Thursday;
+
+ public static String Tuesday;
+
+ public static String Wednesday;
+
+}
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CoreUtil.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CoreUtil.java
index f10aae6..1e3686b 100644
--- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CoreUtil.java
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/CoreUtil.java
@@ -89,7 +89,7 @@ public class CoreUtil {
*/
// TODO e3.5 remove this method and replace with bundle.getVersion()
public static Version getVersion(Bundle bundle) {
- String header = (String) bundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
+ String header = bundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
return (header != null) ? Version.parseVersion(header) : null;
}
@@ -105,4 +105,13 @@ public class CoreUtil {
return key1.compareTo(key2);
}
+ /**
+ * Compares a boolean value.
+ *
+ * @since 3.7
+ */
+ public static boolean propertyEquals(boolean value, Object expectedValue) {
+ return (expectedValue == null) ? value == true : new Boolean(value).equals(expectedValue);
+ }
+
}
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/HtmlUtil.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/HtmlUtil.java
index d57aeec..471fb54 100644
--- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/HtmlUtil.java
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/HtmlUtil.java
@@ -14,7 +14,7 @@ package org.eclipse.mylyn.commons.core;
import java.io.IOException;
import java.io.StringReader;
-import org.eclipse.mylyn.internal.provisional.commons.core.Html2TextReader;
+import org.eclipse.mylyn.internal.commons.core.Html2TextReader;
/**
* @author Steffen Pingel
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ICoreRunnable.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ICoreRunnable.java
new file mode 100644
index 0000000..2832f60
--- /dev/null
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/ICoreRunnable.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.commons.core;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public interface ICoreRunnable {
+
+ public void run(IProgressMonitor monitor) throws CoreException;
+
+}
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/messages.properties b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/messages.properties
new file mode 100644
index 0000000..9754366
--- /dev/null
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/commons/core/messages.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+Friday=Friday
+Monday=Monday
+Saturday=Saturday
+Sunday=Sunday
+Tuesday=Tuesday
+Thursday=Thursday
+Wednesday=Wednesday
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/Html2TextReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/Html2TextReader.java
new file mode 100644
index 0000000..df3dfae
--- /dev/null
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/Html2TextReader.java
@@ -0,0 +1,317 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.internal.commons.core;
+
+import java.io.IOException;
+import java.io.PushbackReader;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Reads the text contents from a reader of HTML contents and translates the tags or cut them out.
+ * <p>
+ * Moved into this package from <code>org.eclipse.jface.internal.text.revisions</code>.
+ * </p>
+ * <p>
+ * Based on {@link org.eclipse.jface.internal.text.html.HTML2TextReader}.
+ * </p>
+ */
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class Html2TextReader extends SubstitutionTextReader {
+
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+ private static final Map fgEntityLookup;
+
+ private static final Set fgTags;
+
+ static {
+
+ fgTags = new HashSet();
+ fgTags.add("b"); //$NON-NLS-1$
+ fgTags.add("br"); //$NON-NLS-1$
+ fgTags.add("br/"); //$NON-NLS-1$
+ fgTags.add("div"); //$NON-NLS-1$
+ fgTags.add("h1"); //$NON-NLS-1$
+ fgTags.add("h2"); //$NON-NLS-1$
+ fgTags.add("h3"); //$NON-NLS-1$
+ fgTags.add("h4"); //$NON-NLS-1$
+ fgTags.add("h5"); //$NON-NLS-1$
+ fgTags.add("p"); //$NON-NLS-1$
+ fgTags.add("dl"); //$NON-NLS-1$
+ fgTags.add("dt"); //$NON-NLS-1$
+ fgTags.add("dd"); //$NON-NLS-1$
+ fgTags.add("li"); //$NON-NLS-1$
+ fgTags.add("ul"); //$NON-NLS-1$
+ fgTags.add("pre"); //$NON-NLS-1$
+ fgTags.add("head"); //$NON-NLS-1$
+
+ fgEntityLookup = new HashMap(7);
+ fgEntityLookup.put("lt", "<"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgEntityLookup.put("gt", ">"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgEntityLookup.put("nbsp", " "); //$NON-NLS-1$ //$NON-NLS-2$
+ fgEntityLookup.put("amp", "&"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgEntityLookup.put("circ", "^"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgEntityLookup.put("tilde", "~"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgEntityLookup.put("quot", "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private boolean fInParagraph = false;
+
+ private boolean fIsPreformattedText = false;
+
+ private boolean fIgnore = false;
+
+ /**
+ * Transforms the HTML text from the reader to formatted text.
+ *
+ * @param reader
+ * the reader
+ * @param presentation
+ * If not <code>null</code>, formattings will be applied to the presentation.
+ */
+ public Html2TextReader(Reader reader) {
+ super(new PushbackReader(reader));
+ }
+
+ protected void startBold() {
+ }
+
+ protected void startPreformattedText() {
+ fIsPreformattedText = true;
+ //setSkipWhitespace(false);
+ }
+
+ protected void stopPreformattedText() {
+ fIsPreformattedText = false;
+ //setSkipWhitespace(true);
+ }
+
+ protected void stopBold() {
+ }
+
+ /*
+ * @see org.eclipse.jdt.internal.ui.text.SubstitutionTextReader#computeSubstitution(int)
+ */
+ @Override
+ protected String computeSubstitution(int c) throws IOException {
+
+ if (c == '<') {
+ return processHTMLTag();
+ } else if (fIgnore) {
+ return EMPTY_STRING;
+ } else if (c == '&') {
+ return processEntity();
+ } else if (fIsPreformattedText) {
+ return processPreformattedText(c);
+ } else if (c == '\n') {
+ return EMPTY_STRING;
+ }
+
+ return null;
+ }
+
+ private String html2Text(String html) {
+
+ if (html == null || html.length() == 0) {
+ return EMPTY_STRING;
+ }
+
+ html = html.toLowerCase(Locale.ENGLISH);
+
+ String tag = html;
+ if ('/' == tag.charAt(0)) {
+ tag = tag.substring(1);
+ }
+
+ if (!fgTags.contains(tag)) {
+ return EMPTY_STRING;
+ }
+
+ if ("pre".equals(html)) { //$NON-NLS-1$
+ startPreformattedText();
+ return EMPTY_STRING;
+ }
+
+ if ("/pre".equals(html)) { //$NON-NLS-1$
+ stopPreformattedText();
+ return EMPTY_STRING;
+ }
+
+ if (fIsPreformattedText) {
+ return EMPTY_STRING;
+ }
+
+ if ("b".equals(html)) { //$NON-NLS-1$
+ startBold();
+ return EMPTY_STRING;
+ }
+
+ if ((html.length() > 1 && html.charAt(0) == 'h' && Character.isDigit(html.charAt(1))) || "dt".equals(html)) { //$NON-NLS-1$
+ startBold();
+ return EMPTY_STRING;
+ }
+
+ if ("dl".equals(html)) { //$NON-NLS-1$
+ return LINE_DELIM;
+ }
+
+ if ("dd".equals(html)) { //$NON-NLS-1$
+ return "\t"; //$NON-NLS-1$
+ }
+
+ if ("li".equals(html)) { //$NON-NLS-1$
+ return LINE_DELIM + " - "; //$NON-NLS-1$
+ }
+
+ if ("/b".equals(html)) { //$NON-NLS-1$
+ stopBold();
+ return EMPTY_STRING;
+ }
+
+ if ("p".equals(html)) { //$NON-NLS-1$
+ fInParagraph = true;
+ return LINE_DELIM;
+ }
+
+ if ("br".equals(html) || "br/".equals(html) || "div".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return LINE_DELIM;
+ }
+
+ if ("/p".equals(html)) { //$NON-NLS-1$
+ boolean inParagraph = fInParagraph;
+ fInParagraph = false;
+ return inParagraph ? EMPTY_STRING : LINE_DELIM;
+ }
+
+ if ((html.startsWith("/h") && html.length() > 2 && Character.isDigit(html.charAt(2))) || "/dt".equals(html)) { //$NON-NLS-1$ //$NON-NLS-2$
+ stopBold();
+ return LINE_DELIM;
+ }
+
+ if ("/dd".equals(html)) { //$NON-NLS-1$
+ return LINE_DELIM;
+ }
+
+ if ("head".equals(html)) { //$NON-NLS-1$
+ fIgnore = true;
+ return EMPTY_STRING;
+ }
+
+ if ("/head".equals(html)) { //$NON-NLS-1$
+ fIgnore = false;
+ return EMPTY_STRING;
+ }
+
+ return EMPTY_STRING;
+ }
+
+ /*
+ * A '<' has been read. Process a html tag
+ */
+ private String processHTMLTag() throws IOException {
+
+ StringBuilder buf = new StringBuilder();
+ int ch;
+ do {
+
+ ch = nextChar();
+
+ while (ch != -1 && ch != '>') {
+ buf.append(Character.toLowerCase((char) ch));
+ ch = nextChar();
+ if (ch == '"') {
+ buf.append(Character.toLowerCase((char) ch));
+ ch = nextChar();
+ while (ch != -1 && ch != '"') {
+ buf.append(Character.toLowerCase((char) ch));
+ ch = nextChar();
+ }
+ }
+ if (ch == '<') {
+ unread(ch);
+ return '<' + buf.toString();
+ }
+ }
+
+ if (ch == -1) {
+ return null;
+ }
+
+ int tagLen = buf.length();
+ // needs special treatment for comments
+ if ((tagLen >= 3 && "!--".equals(buf.substring(0, 3))) //$NON-NLS-1$
+ && !(tagLen >= 5 && "--".equals(buf.substring(tagLen - 2)))) { //$NON-NLS-1$
+ // unfinished comment
+ buf.append(ch);
+ } else {
+ break;
+ }
+ } while (true);
+
+ return html2Text(buf.toString());
+ }
+
+ private String processPreformattedText(int c) {
+ return null;
+ }
+
+ private void unread(int ch) throws IOException {
+ ((PushbackReader) getReader()).unread(ch);
+ }
+
+ protected String entity2Text(String symbol) {
+ if (symbol.length() > 1 && symbol.charAt(0) == '#') {
+ int ch;
+ try {
+ if (symbol.charAt(1) == 'x') {
+ ch = Integer.parseInt(symbol.substring(2), 16);
+ } else {
+ ch = Integer.parseInt(symbol.substring(1), 10);
+ }
+ return EMPTY_STRING + (char) ch;
+ } catch (NumberFormatException e) {
+ }
+ } else {
+ String str = (String) fgEntityLookup.get(symbol);
+ if (str != null) {
+ return str;
+ }
+ }
+ return "&" + symbol; // not found //$NON-NLS-1$
+ }
+
+ /*
+ * A '&' has been read. Process a entity
+ */
+ private String processEntity() throws IOException {
+ StringBuilder buf = new StringBuilder();
+ int ch = nextChar();
+ while (Character.isLetterOrDigit((char) ch) || ch == '#') {
+ buf.append((char) ch);
+ ch = nextChar();
+ }
+
+ if (ch == ';') {
+ return entity2Text(buf.toString());
+ }
+
+ buf.insert(0, '&');
+ if (ch != -1) {
+ buf.append((char) ch);
+ }
+ return buf.toString();
+ }
+}
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SingleCharReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SingleCharReader.java
new file mode 100644
index 0000000..db64249
--- /dev/null
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SingleCharReader.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.internal.commons.core;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * <p>
+ * Moved into this package from <code>org.eclipse.jface.internal.text.revisions</code>.
+ * </p>
+ * <p>
+ * Based on {@link org.eclipse.mylyn.internal.commons.core.jface.internal.text.html.SingleCharReader}.
+ * </p>
+ */
+public abstract class SingleCharReader extends Reader {
+
+ /**
+ * @see Reader#read()
+ */
+ @Override
+ public abstract int read() throws IOException;
+
+ /**
+ * @see Reader#read(char[],int,int)
+ */
+ @Override
+ public int read(char cbuf[], int off, int len) throws IOException {
+ int end = off + len;
+ for (int i = off; i < end; i++) {
+ int ch = read();
+ if (ch == -1) {
+ if (i == off) {
+ return -1;
+ }
+ return i - off;
+ }
+ cbuf[i] = (char) ch;
+ }
+ return len;
+ }
+
+ /**
+ * @see Reader#ready()
+ */
+ @Override
+ public boolean ready() throws IOException {
+ return true;
+ }
+
+ /**
+ * Returns the readable content as string.
+ *
+ * @return the readable content as string
+ * @exception IOException
+ * in case reading fails
+ */
+ public String getString() throws IOException {
+ StringBuffer buf = new StringBuffer();
+ int ch;
+ while ((ch = read()) != -1) {
+ buf.append((char) ch);
+ }
+ return buf.toString();
+ }
+}
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SubstitutionTextReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SubstitutionTextReader.java
new file mode 100644
index 0000000..58ca681
--- /dev/null
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/commons/core/SubstitutionTextReader.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.internal.commons.core;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Reads the text contents from a reader and computes for each character a potential substitution. The substitution may
+ * eat more characters than only the one passed into the computation routine.
+ * <p>
+ * Moved into this package from <code>org.eclipse.jface.internal.text.revisions</code>.
+ * </p>
+ * <p>
+ * Based on {@link org.eclipse.mylyn.internal.commons.core.jface.internal.text.html.SubstitutionTextReader}.
+ * </p>
+ */
+public abstract class SubstitutionTextReader extends SingleCharReader {
+
+ protected static final String LINE_DELIM = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ private final Reader fReader;
+
+ protected boolean fWasWhiteSpace;
+
+ private int fCharAfterWhiteSpace;
+
+ /**
+ * Tells whether white space characters are skipped.
+ */
+ private boolean fSkipWhiteSpace = true;
+
+ private boolean fReadFromBuffer;
+
+ private final StringBuffer fBuffer;
+
+ private int fIndex;
+
+ protected SubstitutionTextReader(Reader reader) {
+ fReader = reader;
+ fBuffer = new StringBuffer();
+ fIndex = 0;
+ fReadFromBuffer = false;
+ fCharAfterWhiteSpace = -1;
+ fWasWhiteSpace = true;
+ }
+
+ /**
+ * Computes the substitution for the given character and if necessary subsequent characters. Implementation should
+ * use <code>nextChar</code> to read subsequent characters.
+ *
+ * @param c
+ * the character to be substituted
+ * @return the substitution for <code>c</code>
+ * @throws IOException
+ * in case computing the substitution fails
+ */
+ protected abstract String computeSubstitution(int c) throws IOException;
+
+ /**
+ * Returns the internal reader.
+ *
+ * @return the internal reader
+ */
+ protected Reader getReader() {
+ return fReader;
+ }
+
+ /**
+ * Returns the next character.
+ *
+ * @return the next character
+ * @throws IOException
+ * in case reading the character fails
+ */
+ protected int nextChar() throws IOException {
+ fReadFromBuffer = (fBuffer.length() > 0);
+ if (fReadFromBuffer) {
+ char ch = fBuffer.charAt(fIndex++);
+ if (fIndex >= fBuffer.length()) {
+ fBuffer.setLength(0);
+ fIndex = 0;
+ }
+ return ch;
+ }
+
+ int ch = fCharAfterWhiteSpace;
+ if (ch == -1) {
+ ch = fReader.read();
+ }
+ if (fSkipWhiteSpace && Character.isWhitespace((char) ch)) {
+ do {
+ ch = fReader.read();
+ } while (Character.isWhitespace((char) ch));
+ if (ch != -1) {
+ fCharAfterWhiteSpace = ch;
+ return ' ';
+ }
+ } else {
+ fCharAfterWhiteSpace = -1;
+ }
+ return ch;
+ }
+
+ /**
+ * @see Reader#read()
+ */
+ @Override
+ public int read() throws IOException {
+ int c;
+ do {
+
+ c = nextChar();
+ while (!fReadFromBuffer) {
+ String s = computeSubstitution(c);
+ if (s == null) {
+ break;
+ }
+ if (s.length() > 0) {
+ fBuffer.insert(0, s);
+ }
+ c = nextChar();
+ }
+
+ } while (fSkipWhiteSpace && fWasWhiteSpace && (c == ' '));
+ fWasWhiteSpace = (c == ' ' || c == '\r' || c == '\n');
+ return c;
+ }
+
+ /**
+ * @see Reader#ready()
+ */
+ @Override
+ public boolean ready() throws IOException {
+ return fReader.ready();
+ }
+
+ /**
+ * @see Reader#close()
+ */
+ @Override
+ public void close() throws IOException {
+ fReader.close();
+ }
+
+ /**
+ * @see Reader#reset()
+ */
+ @Override
+ public void reset() throws IOException {
+ fReader.reset();
+ fWasWhiteSpace = true;
+ fCharAfterWhiteSpace = -1;
+ fBuffer.setLength(0);
+ fIndex = 0;
+ }
+
+ protected final void setSkipWhitespace(boolean state) {
+ fSkipWhiteSpace = state;
+ }
+
+ protected final boolean isSkippingWhitespace() {
+ return fSkipWhiteSpace;
+ }
+}
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/CommonMessages.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/CommonMessages.java
index 4652e9b..782d8ef 100644
--- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/CommonMessages.java
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/CommonMessages.java
@@ -13,6 +13,10 @@ package org.eclipse.mylyn.internal.provisional.commons.core;
import org.eclipse.osgi.util.NLS;
+/**
+ * @deprecated use {@link org.eclipse.mylyn.commons.core.CommonMessages} instead
+ */
+@Deprecated
public class CommonMessages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.provisional.commons.core.messages"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/Html2TextReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/Html2TextReader.java
index 0023c04..bac0879 100644
--- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/Html2TextReader.java
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/Html2TextReader.java
@@ -27,7 +27,10 @@ import java.util.Set;
* <p>
* Based on {@link org.eclipse.jface.internal.text.html.HTML2TextReader}.
* </p>
+ *
+ * @deprecated use {@link org.eclipse.mylyn.internal.commons.core.Html2TextReader} instead
*/
+@Deprecated
@SuppressWarnings({ "rawtypes", "unchecked" })
public class Html2TextReader extends SubstitutionTextReader {
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SingleCharReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SingleCharReader.java
index 02f3c31..c24ca9e 100644
--- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SingleCharReader.java
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SingleCharReader.java
@@ -20,7 +20,10 @@ import java.io.Reader;
* <p>
* Based on {@link org.eclipse.jface.internal.text.html.SingleCharReader}.
* </p>
+ *
+ * @deprecated use {@link org.eclipse.mylyn.internal.commons.core.SingleCharReader} instead
*/
+@Deprecated
public abstract class SingleCharReader extends Reader {
/**
diff --git a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SubstitutionTextReader.java b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SubstitutionTextReader.java
index 6f46e86..a554ec5 100644
--- a/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SubstitutionTextReader.java
+++ b/org.eclipse.mylyn.commons.core/src/org/eclipse/mylyn/internal/provisional/commons/core/SubstitutionTextReader.java
@@ -22,7 +22,10 @@ import java.io.Reader;
* <p>
* Based on {@link org.eclipse.jface.internal.text.html.SubstitutionTextReader}.
* </p>
+ *
+ * @deprecated use {@link org.eclipse.mylyn.internal.commons.core.SubstitutionTextReader} instead
*/
+@Deprecated
public abstract class SubstitutionTextReader extends SingleCharReader {
protected static final String LINE_DELIM = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.mylyn.commons.notifications/.classpath b/org.eclipse.mylyn.commons.notifications/.classpath
index fd34f56..fcedc47 100644
--- a/org.eclipse.mylyn.commons.notifications/.classpath
+++ b/org.eclipse.mylyn.commons.notifications/.classpath
@@ -4,7 +4,6 @@
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
<accessrule kind="accessible" pattern="org/eclipse/core/internal/runtime/*"/>
- <accessrule kind="accessible" pattern="**/mylyn/internal/provisional/**"/>
</accessrules>
</classpathentry>
<classpathentry kind="src" path="src"/>
diff --git a/org.eclipse.mylyn.commons.notifications/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.notifications/META-INF/MANIFEST.MF
index d32f85b..7f3f3d4 100644
--- a/org.eclipse.mylyn.commons.notifications/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.commons.notifications/META-INF/MANIFEST.MF
@@ -14,6 +14,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.workbench,
org.eclipse.mylyn.commons.core;bundle-version="3.5.0",
org.eclipse.mylyn.commons.ui;bundle-version="3.5.0",
+ org.eclipse.mylyn.commons.workbench;bundle-version="3.5.0",
org.eclipse.ui.forms
Bundle-ClassPath: .
Bundle-Localization: plugin
diff --git a/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java b/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java
index 82d4e54..6db7e29 100644
--- a/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java
+++ b/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java
@@ -35,8 +35,8 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
-import org.eclipse.mylyn.internal.provisional.commons.ui.SubstringPatternFilter;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.commons.workbench.SubstringPatternFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
diff --git a/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java b/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java
index 3f2628f..477aaf7 100644
--- a/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java
+++ b/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java
@@ -16,11 +16,11 @@ import java.util.List;
import org.eclipse.jface.action.LegacyActionTools;
import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.mylyn.commons.ui.compatibility.CommonColors;
import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification;
-import org.eclipse.mylyn.internal.commons.ui.CommonsUiPlugin;
-import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup;
-import org.eclipse.mylyn.internal.provisional.commons.ui.CommonColors;
-import org.eclipse.mylyn.internal.provisional.commons.ui.ScalingHyperlink;
+import org.eclipse.mylyn.commons.workbench.AbstractWorkbenchNotificationPopup;
+import org.eclipse.mylyn.commons.workbench.forms.ScalingHyperlink;
+import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -39,7 +39,7 @@ import org.eclipse.ui.forms.events.HyperlinkEvent;
* @author Rob Elves
* @author Mik Kersten
*/
-public class NotificationPopup extends AbstractNotificationPopup {
+public class NotificationPopup extends AbstractWorkbenchNotificationPopup {
private static final int NUM_NOTIFICATIONS_TO_DISPLAY = 4;
@@ -165,7 +165,7 @@ public class NotificationPopup extends AbstractNotificationPopup {
@Override
protected Color getTitleForeground() {
- return CommonsUiPlugin.getDefault().getFormColors(Display.getDefault()).getColor(IFormColors.TITLE);
+ return CommonsWorkbenchPlugin.getDefault().getFormColors(Display.getDefault()).getColor(IFormColors.TITLE);
}
diff --git a/org.eclipse.mylyn.commons.team/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.team/META-INF/MANIFEST.MF
index 9b4405a..045ffba 100644
--- a/org.eclipse.mylyn.commons.team/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.commons.team/META-INF/MANIFEST.MF
@@ -15,7 +15,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.databinding.property;resolution:=optional,
org.eclipse.jface.databinding,
org.eclipse.mylyn.commons.repositories;bundle-version="0.1.0",
- org.eclipse.mylyn.commons.ui;bundle-version="3.5.0"
+ org.eclipse.mylyn.commons.ui;bundle-version="3.5.0",
+ org.eclipse.mylyn.commons.workbench;bundle-version="3.5.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.mylyn.commons.ui.team;x-internal:=true,
diff --git a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryLocationPart.java b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryLocationPart.java
index ff8474a..3bbc33f 100644
--- a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryLocationPart.java
+++ b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryLocationPart.java
@@ -41,7 +41,7 @@ import org.eclipse.mylyn.commons.repositories.RepositoryLocation;
import org.eclipse.mylyn.commons.repositories.RepositoryValidator;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationType;
import org.eclipse.mylyn.commons.repositories.auth.UsernamePasswordCredentials;
-import org.eclipse.mylyn.internal.commons.ui.SectionComposite;
+import org.eclipse.mylyn.commons.workbench.forms.SectionComposite;
import org.eclipse.mylyn.internal.commons.ui.team.RepositoryLocationValueProperty;
import org.eclipse.mylyn.internal.commons.ui.team.TeamUiPlugin;
import org.eclipse.swt.SWT;
diff --git a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java
index 572cdb9..01c4297 100644
--- a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java
+++ b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java
@@ -15,10 +15,10 @@ import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.mylyn.commons.ui.dialogs.ValidatableWizardDialog;
import org.eclipse.mylyn.internal.commons.ui.team.Messages;
import org.eclipse.mylyn.internal.commons.ui.team.TeamUiPlugin;
import org.eclipse.mylyn.internal.commons.ui.team.wizards.NewRepositoryWizard;
-import org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.ValidatableWizardDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
diff --git a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java
index 1bf3c6f..3412917 100644
--- a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java
+++ b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java
@@ -19,7 +19,7 @@ import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylyn.commons.repositories.RepositoryLocation;
-import org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.IValidatable;
+import org.eclipse.mylyn.commons.ui.dialogs.IValidatable;
import org.eclipse.swt.widgets.Composite;
/**
diff --git a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java
index 94152ad..6b5fdda 100644
--- a/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java
+++ b/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java
@@ -12,7 +12,7 @@
package org.eclipse.mylyn.internal.commons.ui.team;
import org.eclipse.mylyn.commons.repositories.RepositoryCategory;
-import org.eclipse.mylyn.internal.provisional.commons.ui.GradientDrawer;
+import org.eclipse.mylyn.commons.workbench.GradientDrawer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.navigator.CommonNavigator;
import org.eclipse.ui.navigator.CommonViewer;
diff --git a/org.eclipse.mylyn.commons.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.tests/META-INF/MANIFEST.MF
index 4390633..283d43d 100644
--- a/org.eclipse.mylyn.commons.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.commons.tests/META-INF/MANIFEST.MF
@@ -16,13 +16,13 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.mylyn.commons.screenshots,
org.eclipse.mylyn.commons.team,
org.eclipse.mylyn.commons.xmlrpc,
+ org.eclipse.mylyn.commons.workbench,
org.apache.xmlrpc
Export-Package: org.eclipse.mylyn.commons.core;x-internal:=true,
org.eclipse.mylyn.commons.tests;x-internal:=true,
org.eclipse.mylyn.commons.tests.manual;x-internal:=true,
org.eclipse.mylyn.commons.tests.net;x-internal:=true,
org.eclipse.mylyn.commons.tests.support;x-internal:=true,
- org.eclipse.mylyn.commons.tests.ui;x-internal:=true,
org.eclipse.mylyn.commons.tests.xmlrpc;x-internal:=true,
org.eclipse.mylyn.commons.ui.screenshots;x-internal:=true
Bundle-Vendor: Eclipse Mylyn
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/AllCommonsTests.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/AllCommonsTests.java
index 01348a0..c941c47 100644
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/AllCommonsTests.java
+++ b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/AllCommonsTests.java
@@ -17,7 +17,6 @@ import junit.framework.TestSuite;
import org.eclipse.mylyn.commons.tests.net.SslProtocolSocketFactoryTest;
import org.eclipse.mylyn.commons.tests.net.TimeoutInputStreamTest;
import org.eclipse.mylyn.commons.tests.net.WebUtilTest;
-import org.eclipse.mylyn.commons.tests.ui.CommonUiUtilTest;
/**
* @author Mik Kersten
@@ -28,7 +27,6 @@ public class AllCommonsTests {
TestSuite suite = new TestSuite("Test for org.eclipse.mylyn.commons.tests");
suite.addTestSuite(SslProtocolSocketFactoryTest.class);
suite.addTestSuite(WebUtilTest.class);
- suite.addTestSuite(CommonUiUtilTest.class);
suite.addTestSuite(TimeoutInputStreamTest.class);
return suite;
}
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/NoticicationPopupMain.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/NoticicationPopupMain.java
index 1acbcbf..b425d29 100644
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/NoticicationPopupMain.java
+++ b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/NoticicationPopupMain.java
@@ -12,7 +12,7 @@
package org.eclipse.mylyn.commons.tests.manual;
-import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup;
+import org.eclipse.mylyn.commons.ui.dialogs.AbstractNotificationPopup;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.layout.FillLayout;
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/SampleNotificationPopup.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/SampleNotificationPopup.java
index 72b24bb..475f2a7 100644
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/SampleNotificationPopup.java
+++ b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/manual/SampleNotificationPopup.java
@@ -12,7 +12,7 @@
package org.eclipse.mylyn.commons.tests.manual;
-import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup;
+import org.eclipse.mylyn.commons.ui.dialogs.AbstractNotificationPopup;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
diff --git a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/ui/CommonUiUtilTest.java b/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/ui/CommonUiUtilTest.java
deleted file mode 100644
index 3b32f7a..0000000
--- a/org.eclipse.mylyn.commons.tests/src/org/eclipse/mylyn/commons/tests/ui/CommonUiUtilTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-package org.eclipse.mylyn.commons.tests.ui;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jface.action.LegacyActionTools;
-
-/**
- * @author Steffen Pingel
- */
-public class CommonUiUtilTest extends TestCase {
-
- public void testToLabel() {
- assertNull(LegacyActionTools.escapeMnemonics(null));
- assertEquals("", LegacyActionTools.escapeMnemonics(""));
- assertEquals(" ", LegacyActionTools.escapeMnemonics(" "));
- assertEquals("abc def", LegacyActionTools.escapeMnemonics("abc def"));
- assertEquals("a&&b", LegacyActionTools.escapeMnemonics("a&b"));
- assertEquals("a&&b&&c", LegacyActionTools.escapeMnemonics("a&b&c"));
- assertEquals("&&", LegacyActionTools.escapeMnemonics("&"));
- assertEquals("&&&&", LegacyActionTools.escapeMnemonics("&&"));
- }
-
-}
diff --git a/org.eclipse.mylyn.commons.ui.identity/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.ui.identity/META-INF/MANIFEST.MF
index 13a49ff..c19c877 100644
--- a/org.eclipse.mylyn.commons.ui.identity/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.commons.ui.identity/META-INF/MANIFEST.MF
@@ -13,6 +13,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.navigator.resources,
org.eclipse.mylyn.commons.identity,
org.eclipse.mylyn.commons.ui,
+ org.eclipse.mylyn.commons.workbench,
org.eclipse.mylyn.tasks.ui
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.mylyn.commons.ui.identity/src/org/eclipse/mylyn/internal/commons/ui/identity/PeopleView.java b/org.eclipse.mylyn.commons.ui.identity/src/org/eclipse/mylyn/internal/commons/ui/identity/PeopleView.java
index fb4eb9a..bb53060 100644
--- a/org.eclipse.mylyn.commons.ui.identity/src/org/eclipse/mylyn/internal/commons/ui/identity/PeopleView.java
+++ b/org.eclipse.mylyn.commons.ui.identity/src/org/eclipse/mylyn/internal/commons/ui/identity/PeopleView.java
@@ -11,7 +11,7 @@
package org.eclipse.mylyn.internal.commons.ui.identity;
-import org.eclipse.mylyn.internal.provisional.commons.ui.GradientDrawer;
+import org.eclipse.mylyn.commons.workbench.GradientDrawer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.navigator.CommonNavigator;
import org.eclipse.ui.navigator.CommonViewer;
diff --git a/org.eclipse.mylyn.commons.ui.tests/.classpath b/org.eclipse.mylyn.commons.ui.tests/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.mylyn.commons.ui.tests/.project b/org.eclipse.mylyn.commons.ui.tests/.project
new file mode 100644
index 0000000..baa5832
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.mylyn.commons.ui.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..be36399
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,352 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..f6c0a16
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,63 @@
+#Wed Mar 02 16:00:06 PST 2011
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Mylyn based on Eclipse
+formatter_settings_version=12
+internal.default.compliance=default
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} Tasktop Technologies and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * Tasktop Technologies - initial API and implementation\r\n *******************************************************************************/\r\n\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\r\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 0000000..5e7f2bd
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
+#Tue Aug 18 22:42:26 PDT 2009
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 0000000..d8c6d26
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Mon Jun 25 03:02:37 GMT 2007
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.team.ui.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.team.ui.prefs
new file mode 100644
index 0000000..0aaa5ca
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.mylyn.team.ui.prefs
@@ -0,0 +1,3 @@
+#Tue Sep 06 15:54:36 CEST 2011
+commit.comment.template=${task.description} \n\nBug\: ${task.key}
+eclipse.preferences.version=1
diff --git a/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..e8f2d56
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,18 @@
+#Tue Apr 15 11:07:59 PDT 2008
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=2
+compilers.p.missing-bundle-classpath-entries=1
+compilers.p.missing-packages=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/org.eclipse.mylyn.commons.ui.tests/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.ui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..682237e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Mylyn Commons UI
+Bundle-SymbolicName: org.eclipse.mylyn.commons.ui.tests;singleton:=true
+Bundle-Version: 3.7.0.qualifier
+Bundle-Vendor: Eclipse Mylyn
+Fragment-Host: org.eclipse.mylyn.commons.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="4.5.0",
+ org.mockito;bundle-version="[1.8.4,2.0.0)",
+ org.objenesis;bundle-version="[1.0.0,2.0.0)",
+ org.hamcrest;bundle-version="[1.0.0,2.0.0)"
+Export-Package: org.eclipse.mylyn.commons.ui;x-internal:=true
diff --git a/org.eclipse.mylyn.commons.ui.tests/about.html b/org.eclipse.mylyn.commons.ui.tests/about.html
new file mode 100644
index 0000000..d774b07
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/about.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 25, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui.tests/build.properties b/org.eclipse.mylyn.commons.ui.tests/build.properties
new file mode 100644
index 0000000..9cbab3c
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html
+src.includes = about.html
diff --git a/org.eclipse.mylyn.commons.ui.tests/pom.xml b/org.eclipse.mylyn.commons.ui.tests/pom.xml
new file mode 100644
index 0000000..a347f88
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.mylyn.commons-parent</artifactId>
+ <groupId>org.eclipse.mylyn.commons</groupId>
+ <version>3.7.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.mylyn.commons.ui.tests</artifactId>
+ <version>3.7.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/org.eclipse.mylyn.commons.ui.tests/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorterTest.java b/org.eclipse.mylyn.commons.ui.tests/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorterTest.java
new file mode 100644
index 0000000..dcf4ab6
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui.tests/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorterTest.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.mylyn.commons.ui.AbstractColumnViewerSorter;
+import org.eclipse.swt.widgets.Item;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+/**
+ * @author Steffen Pingel
+ */
+public class AbstractColumnViewerSorterTest {
+
+ class StubColumnViewerSorter extends AbstractColumnViewerSorter<ColumnViewer, Item> {
+
+ Item sortColumn;
+
+ int sortDirection;
+
+ int columnIndex;
+
+ @Override
+ Item getSortColumn(ColumnViewer viewer) {
+ return sortColumn;
+ }
+
+ @Override
+ int getSortDirection(ColumnViewer viewer) {
+ return sortDirection;
+ }
+
+ @Override
+ int getColumnIndex(ColumnViewer viewer, Item column) {
+ return columnIndex;
+ }
+
+ }
+
+ private StubColumnViewerSorter sorter;
+
+ @Before
+ public void setUp() {
+ sorter = new StubColumnViewerSorter();
+ }
+
+ @Test
+ public void testCompare() {
+ ColumnViewer viewer = mock(ColumnViewer.class);
+ assertEquals(-1, sorter.compare(viewer, "a", "b"));
+ assertEquals(0, sorter.compare(viewer, "a", "a"));
+ assertEquals(1, sorter.compare(viewer, 2, 1));
+ }
+
+ @Test
+ public void testCompareSortColumn() {
+ ColumnViewer viewer = mock(ColumnViewer.class);
+ sorter.sortColumn = mock(Item.class);
+ assertEquals(-1, sorter.compare(viewer, "a", "b"));
+ assertEquals(0, sorter.compare(viewer, "a", "a"));
+ assertEquals(1, sorter.compare(viewer, 2, 1));
+ }
+
+ @Test
+ public void testCompareSortColumnLabelProvider() {
+ ColumnViewer viewer = Mockito.mock(ColumnViewer.class);
+ sorter.sortColumn = mock(Item.class);
+ assertEquals(-1, sorter.compare(viewer, "a", "b"));
+ assertEquals(0, sorter.compare(viewer, "a", "a"));
+ assertEquals(1, sorter.compare(viewer, 2, 1));
+ }
+
+ @Test
+ public void testCompareColumn() {
+ assertEquals(-1, sorter.compare(null, "a", "b", 0));
+ }
+
+ @Test
+ public void testCompareDefault() {
+ ColumnViewer viewer = mock(ColumnViewer.class);
+ assertEquals(-1, sorter.compareDefault(viewer, "a", "b"));
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/.settings/.api_filters b/org.eclipse.mylyn.commons.ui/.settings/.api_filters
deleted file mode 100644
index c98c412..0000000
--- a/org.eclipse.mylyn.commons.ui/.settings/.api_filters
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.mylyn.commons.ui" version="2">
- <resource path="src/org/eclipse/mylyn/internal/provisional/commons/ui/EnhancedFilteredTree.java" type="org.eclipse.mylyn.internal.provisional.commons.ui.EnhancedFilteredTree">
- <filter comment="Needed to remove the key listener added by filtered tree" id="640712815">
- <message_arguments>
- <message_argument value="TypedListener"/>
- <message_argument value="EnhancedFilteredTree"/>
- <message_argument value="getEventListener()"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
diff --git a/org.eclipse.mylyn.commons.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.ui/META-INF/MANIFEST.MF
index 1a914ff..7bd08d5 100644
--- a/org.eclipse.mylyn.commons.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.commons.ui/META-INF/MANIFEST.MF
@@ -5,16 +5,26 @@ Bundle-SymbolicName: org.eclipse.mylyn.commons.ui;singleton:=true
Bundle-Version: 3.7.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.expressions,
+ org.eclipse.swt,
+ org.eclipse.jface,
org.eclipse.jface.text,
org.eclipse.ui,
+ org.eclipse.ui.browser,
org.eclipse.ui.editors,
org.eclipse.ui.forms,
- org.eclipse.ui.browser,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.mylyn.commons.core;bundle-version="3.7.0",
org.eclipse.mylyn.commons.screenshots;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Activator: org.eclipse.mylyn.internal.commons.ui.CommonsUiPlugin
-Export-Package: org.eclipse.mylyn.internal.commons.ui;x-internal:=true,
+Export-Package: org.eclipse.mylyn.commons.ui,
+ org.eclipse.mylyn.commons.ui.actions,
+ org.eclipse.mylyn.commons.ui.compatibility,
+ org.eclipse.mylyn.commons.ui.dialogs,
+ org.eclipse.mylyn.commons.ui.wizard,
+ org.eclipse.mylyn.internal.commons.ui;x-internal:=true,
org.eclipse.mylyn.internal.provisional.commons.ui;x-internal:=true,
org.eclipse.mylyn.internal.provisional.commons.ui.actions;x-internal:=true,
org.eclipse.mylyn.internal.provisional.commons.ui.commands;x-internal:=true,
@@ -22,3 +32,4 @@ Export-Package: org.eclipse.mylyn.internal.commons.ui;x-internal:=true,
org.eclipse.mylyn.internal.provisional.commons.ui.editor;x-internal:=true
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
+
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorter.java
new file mode 100644
index 0000000..f0d5034
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSorter.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.CellLabelProvider;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ContentViewer;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Item;
+
+/**
+ * Provides sorting support for column-based viewers such as tables and tree-tables.
+ *
+ * @author Shawn Minto
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public abstract class AbstractColumnViewerSorter<V extends ColumnViewer, I extends Item> extends ViewerSorter {
+
+ /**
+ * Returns the current sort column.
+ *
+ * @return the column that is being sorted; <code>null</code>, if no column is sorted
+ */
+ abstract I getSortColumn(V viewer);
+
+ /**
+ * Returns the current sort order.
+ *
+ * @return {@link SWT#DOWN}, if sorting descending; 0, if no sort order is specified; {@link SWT#UP}, if sorting
+ * ascending
+ */
+ abstract int getSortDirection(V viewer);
+
+ /**
+ * Returns the index of <code>I</code>.
+ */
+ abstract int getColumnIndex(V viewer, I column);
+
+ /**
+ * Compares <code>e1</code> and <code>e2</code> according to the current sort column and order. Delegates to
+ * {@link #compareDefault(ColumnViewer, Object, Object)} if no sort column is selected.
+ *
+ * @see #getSortColumn(ColumnViewer)
+ * @see #getSortDirection(ColumnViewer)
+ * @see #compareDefault(ColumnViewer, Object, Object)
+ */
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ Assert.isLegal(viewer instanceof ColumnViewer);
+ @SuppressWarnings("unchecked")
+ V columnViewer = (V) viewer;
+ I column = getSortColumn(columnViewer);
+ if (column != null) {
+ int index = getColumnIndex(columnViewer, column);
+ int result = compare(columnViewer, e1, e2, index);
+ if (getSortDirection(columnViewer) == SWT.UP) {
+ return -result;
+ }
+ return result;
+ }
+ return compareDefault(columnViewer, e1, e2);
+ }
+
+ /**
+ * Compares <code>e1</code> and <code>e2</code> following the contract of
+ * {@link ViewerComparator#compare(Viewer, Object, Object)}. Subclasses may override.
+ *
+ * @see ViewerComparator#compare(Viewer, Object, Object)
+ */
+ protected int compareDefault(V viewer, Object e1, Object e2) {
+ return super.compare(viewer, e1, e2);
+ }
+
+ /**
+ * Compares <code>e1</code> and <code>e2</code> according based on their category and column specific label.
+ */
+ @SuppressWarnings("unchecked")
+ public int compare(V viewer, Object e1, Object e2, int columnIndex) {
+ int cat1 = category(e1);
+ int cat2 = category(e2);
+
+ if (cat1 != cat2) {
+ return cat1 - cat2;
+ }
+
+ String name1;
+ String name2;
+
+ if (viewer == null || !(viewer instanceof ContentViewer)) {
+ name1 = e1.toString();
+ name2 = e2.toString();
+ } else {
+ CellLabelProvider prov = viewer.getLabelProvider(columnIndex);
+ if (prov instanceof ILabelProvider) {
+ ILabelProvider lprov = (ILabelProvider) prov;
+ name1 = lprov.getText(e1);
+ name2 = lprov.getText(e2);
+ } else {
+ name1 = e1.toString();
+ name2 = e2.toString();
+ }
+ }
+ if (name1 == null) {
+ name1 = "";//$NON-NLS-1$
+ }
+ if (name2 == null) {
+ name2 = "";//$NON-NLS-1$
+ }
+
+ // use the comparator to compare the strings
+ return getComparator().compare(name1, name2);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSupport.java
new file mode 100644
index 0000000..27f962d
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/AbstractColumnViewerSupport.java
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.layout.AbstractColumnLayout;
+import org.eclipse.jface.util.Policy;
+import org.eclipse.jface.viewers.ColumnLayoutData;
+import org.eclipse.jface.viewers.ColumnPixelData;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.mylyn.commons.core.XmlMemento;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+
+/**
+ * Provides an abstract implementation for persisting the column and sorting state of a {@link ColumnViewer}.
+ *
+ * @author Shawn Minto
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public abstract class AbstractColumnViewerSupport<T extends Item> {
+
+ private static class ColumnState {
+ // this represents the width of the column or the weight if it was weight data
+ int width;
+ }
+
+ public static final String KEY_COLUMN_CAN_HIDE = "org.eclipse.mylyn.column.viewer.support.column.can.hide"; //$NON-NLS-1$
+
+ // from AbstractColumnLayout
+ private static final String KEY_LAYOUT_DATA = Policy.JFACE + ".LAYOUT_DATA"; //$NON-NLS-1$
+
+ public static final String KEY_SUPPORTS_SORTING = "org.eclipse.mylyn.column.viewer.support.sorting"; //$NON-NLS-1$
+
+ private Menu contextMenu;
+
+ private final Control control;
+
+ private int[] defaultOrder;
+
+ private ColumnState[] defaults;
+
+ private int defaultSortColumnIndex;
+
+ private int defaultSortDirection;
+
+ private final boolean[] defaultVisibilities;
+
+ private final Menu headerMenu;
+
+ private ColumnState[] lastStates;
+
+ private final File stateFile;
+
+ private boolean supportsSorting;
+
+ private final ColumnViewer viewer;
+
+ public AbstractColumnViewerSupport(ColumnViewer viewer, File stateFile) {
+ this(viewer, stateFile, new boolean[0]);
+ }
+
+ public AbstractColumnViewerSupport(ColumnViewer viewer, File stateFile, boolean[] defaultVisibilities) {
+ Assert.isNotNull(viewer);
+ Assert.isNotNull(stateFile);
+ Assert.isNotNull(defaultVisibilities);
+ Object supportSort = viewer.getControl().getData(KEY_SUPPORTS_SORTING);
+ if (supportSort instanceof Boolean) {
+ supportsSorting = (Boolean) supportSort;
+ } else {
+ supportsSorting = true;
+ }
+ this.defaultVisibilities = defaultVisibilities;
+ this.viewer = viewer;
+ this.stateFile = stateFile;
+
+ control = viewer.getControl();
+
+ Composite parent = viewer.getControl().getParent();
+ headerMenu = new Menu(parent);
+ }
+
+ abstract void addColumnSelectionListener(T column, SelectionListener selectionListener);
+
+ private MenuItem createMenuItem(Menu parent, final T column, final int i) {
+ final MenuItem item = new MenuItem(parent, SWT.CHECK);
+ item.setText(column.getText());
+ item.setSelection(getWidth(column) > 0);
+ item.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ int lastWidth = getWidth(column);
+ if (lastWidth != 0) {
+ lastStates[i].width = lastWidth;
+ }
+ if (lastStates[i].width == 0) {
+ // if the user shrunk it to 0, use the default
+ lastStates[i].width = defaults[i].width;
+ }
+ if (lastStates[i].width == 0) {
+ // if the default and the last width was 0, then set to 150 pixels
+ lastStates[i].width = 150;
+ }
+ if (item.getSelection()) {
+ setWidth(column, lastStates[i].width);
+ } else {
+ setWidth(column, 0);
+ }
+ }
+ });
+ return item;
+ }
+
+ private void createRestoreDefaults(Menu parent) {
+
+ new MenuItem(parent, SWT.SEPARATOR);
+
+ final MenuItem restoreDefaults = new MenuItem(parent, SWT.PUSH);
+ restoreDefaults.setText(Messages.AbstractColumnViewerSupport_Restore_defaults);
+ restoreDefaults.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ restoreDefaults();
+ }
+ });
+ }
+
+ abstract Rectangle getClientArea();
+
+ abstract T getColumn(int index);
+
+ abstract int getColumnIndexOf(T column);
+
+ abstract AbstractColumnLayout getColumnLayout();
+
+ private ColumnLayoutData getColumnLayoutData(Item column) {
+ Object data = column.getData(KEY_LAYOUT_DATA);
+ if (data instanceof ColumnLayoutData) {
+ return (ColumnLayoutData) data;
+ } else {
+ return null;
+ }
+ }
+
+ abstract int[] getColumnOrder();
+
+ abstract T[] getColumns();
+
+ abstract int getColumnWidth(T column);
+
+ abstract int getHeaderHeight();
+
+ abstract T getSortColumn();
+
+ abstract int getSortDirection();
+
+ private int getWidth(T column) {
+ ColumnLayoutData data = getColumnLayoutData(column);
+ AbstractColumnLayout columnLayout = getColumnLayout();
+ if (data != null && columnLayout != null) {
+ if (data instanceof ColumnWeightData) {
+ return ((ColumnWeightData) data).weight;
+ } else if (data instanceof ColumnPixelData) {
+ // turn this into a weighted width
+ int width = ((ColumnPixelData) data).width;
+ int totalWidth = control.getSize().x;
+ if (totalWidth == 0) {
+ return width;
+ } else {
+ return (width * 100) / totalWidth;
+ }
+ } else {
+ // we dont know
+ return getColumnWidth(column);
+ }
+ } else {
+ // if has column data, use that (pixel or weight)
+ return getColumnWidth(column);
+ }
+ }
+
+ private void initialize() {
+ T[] columns = getColumns();
+ defaults = new ColumnState[columns.length];
+ defaultSortColumnIndex = -1;
+ for (int i = 0; i < columns.length; i++) {
+ final T column = columns[i];
+
+ if (supportsSorting) {
+ addColumnSelectionListener(column, new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int direction = getSortDirection();
+ if (getSortColumn() == column && direction != SWT.NONE) {
+ direction = (direction == SWT.DOWN) ? SWT.UP : SWT.NONE;
+ } else {
+ direction = SWT.DOWN;
+ }
+
+ setSortDirection(direction);
+ if (direction == SWT.NONE) {
+ setSortColumn(null);
+ } else {
+ setSortColumn(column);
+ }
+ viewer.refresh();
+ }
+ });
+ if (column == getSortColumn()) {
+ defaultSortColumnIndex = i;
+ }
+ }
+
+ MenuItem item = createMenuItem(headerMenu, column, i);
+ item.setEnabled(canHide(column));
+
+ defaults[i] = new ColumnState();
+ defaults[i].width = getWidth(column);
+
+ }
+
+ createRestoreDefaults(headerMenu);
+
+ defaultOrder = getColumnOrder();
+ defaultSortDirection = getSortDirection();
+
+ control.addListener(SWT.MenuDetect, new Listener() {
+ public void handleEvent(Event event) {
+ Menu menu = control.getMenu();
+ if (menu != null && menu != headerMenu) {
+ contextMenu = menu;
+ }
+
+ Display display = control.getDisplay();
+ Point pt = display.map(null, control, new Point(event.x, event.y));
+ Rectangle clientArea = getClientArea();
+ boolean header = clientArea.y <= pt.y && pt.y < (clientArea.y + getHeaderHeight());
+
+ control.setMenu(header ? headerMenu : contextMenu);
+ }
+ });
+
+ control.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent event) {
+ save();
+ }
+ });
+ }
+
+ private boolean canHide(T column) {
+ Object canHide = column.getData(KEY_COLUMN_CAN_HIDE);
+ return !(canHide instanceof Boolean) || ((Boolean) canHide).booleanValue();
+ }
+
+ void initializeViewerSupport() {
+ initialize();
+ restore();
+
+ T[] columns = getColumns();
+ lastStates = new ColumnState[columns.length];
+ for (int i = 0; i < columns.length; i++) {
+ final T column = columns[i];
+ lastStates[i] = new ColumnState();
+ lastStates[i].width = getWidth(column);
+ }
+ }
+
+ private void restore() {
+ if (stateFile.exists()) {
+ try {
+ FileReader reader = new FileReader(stateFile);
+ try {
+ XmlMemento memento = XmlMemento.createReadRoot(reader);
+
+ XmlMemento[] children = memento.getChildren("Column"); //$NON-NLS-1$
+ int[] order = new int[children.length];
+ for (int i = 0; i < children.length; i++) {
+ T column = getColumn(i);
+ Integer widthInteger = children[i].getInteger("width"); //$NON-NLS-1$
+ if (widthInteger != null) {
+ int width = widthInteger;
+ // ensure that columns that may not be hidden have a non zero width
+ if (width >= 0 && (width > 0 || canHide(column))) {
+ setWidth(column, width);
+ }
+ }
+ headerMenu.getItem(i).setSelection(getWidth(column) > 0);
+ Integer orderInteger = children[i].getInteger("order"); //$NON-NLS-1$
+ order[i] = (orderInteger != null) ? orderInteger.intValue() : 0;
+ }
+ try {
+ setColumnOrder(order);
+ } catch (IllegalArgumentException e) {
+ // ignore
+ }
+
+ XmlMemento child = memento.getChild("Sort"); //$NON-NLS-1$
+ if (child != null) {
+ int columnIndex = child.getInteger("column"); //$NON-NLS-1$
+ T column = getColumn(columnIndex);
+ setSortColumn(column);
+ setSortDirection(child.getInteger("direction")); //$NON-NLS-1$
+ }
+ } catch (Exception e) {
+ // ignore
+ } finally {
+ reader.close();
+ }
+ } catch (IOException e) {
+ // ignore
+ }
+
+ viewer.refresh();
+ } else {
+ T[] columns = getColumns();
+ for (int i = 0; i < columns.length; i++) {
+ T column = columns[i];
+ if (i < defaultVisibilities.length && !defaultVisibilities[i]) {
+ setWidth(column, 0);
+ headerMenu.getItem(i).setSelection(false);
+ }
+ }
+ }
+ }
+
+ private void restoreDefaults() {
+ for (int index = 0; index < defaults.length; index++) {
+ T column = getColumn(index);
+ if (index < defaultVisibilities.length && !defaultVisibilities[index]) {
+ setWidth(column, 0);
+ } else {
+ setWidth(column, defaults[index].width);
+ }
+ // update the menu
+ headerMenu.getItem(index).setSelection(getWidth(column) > 0);
+ }
+ setColumnOrder(defaultOrder);
+ if (defaultSortColumnIndex != -1) {
+ setSortColumn(getColumn(defaultSortColumnIndex));
+ setSortDirection(defaultSortDirection);
+ } else {
+ setSortColumn(null);
+ }
+ viewer.refresh();
+ }
+
+ private void save() {
+ XmlMemento memento = XmlMemento.createWriteRoot("Viewer"); //$NON-NLS-1$
+
+ int[] order = getColumnOrder();
+ T[] columns = getColumns();
+ for (int i = 0; i < columns.length; i++) {
+ T column = columns[i];
+ XmlMemento child = memento.createChild("Column"); //$NON-NLS-1$
+ child.putInteger("width", getWidth(column)); //$NON-NLS-1$
+ child.putInteger("order", order[i]); //$NON-NLS-1$
+ }
+
+ T sortColumn = getSortColumn();
+ if (sortColumn != null) {
+ XmlMemento child = memento.createChild("Sort"); //$NON-NLS-1$
+ child.putInteger("column", getColumnIndexOf(sortColumn)); //$NON-NLS-1$
+ child.putInteger("direction", getSortDirection()); //$NON-NLS-1$
+ }
+
+ try {
+ FileWriter writer = new FileWriter(stateFile);
+ try {
+ memento.save(writer);
+ } finally {
+ writer.close();
+ }
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+
+ abstract void setColumnOrder(int[] order);
+
+ abstract void setColumnResizable(T column, boolean resizable);
+
+ abstract void setColumnWidth(T column, int width);
+
+ abstract void setSortColumn(T column);
+
+ abstract void setSortDirection(int direction);
+
+ private void setWidth(T column, int width) {
+ // if has column data, set that (pixel or weight)
+ ColumnLayoutData data = getColumnLayoutData(column);
+ AbstractColumnLayout columnLayout = getColumnLayout();
+ if (data != null && columnLayout != null) {
+ if (width == 0) {
+ columnLayout.setColumnData(column, new ColumnPixelData(width, data.resizable));
+ } else {
+ columnLayout.setColumnData(column, new ColumnWeightData(width, data.resizable));
+ }
+ control.getParent().layout();
+ } else {
+ setColumnWidth(column, width);
+ }
+ setColumnResizable(column, width > 0);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ClipboardCopier.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ClipboardCopier.java
new file mode 100644
index 0000000..d6043a6
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ClipboardCopier.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * A helper class for copying text to the clipboard.
+ *
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class ClipboardCopier {
+
+ /**
+ * Provides a textual representation when copying objects to the clipboard.
+ */
+ public interface TextProvider {
+
+ public abstract String getTextForElement(Object element);
+
+ }
+
+ private static ClipboardCopier instance = new ClipboardCopier();
+
+ public static String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * Returns the default instance.
+ */
+ public static ClipboardCopier getDefault() {
+ return instance;
+ }
+
+ private Clipboard clipboard;
+
+ /**
+ * Constructs a new instance. Instances must be disposed by invoking {@link #dispose()} when they are no longer
+ * needed.
+ */
+ public ClipboardCopier() {
+ }
+
+ public void copy(IStructuredSelection selection, TextProvider provider) {
+ copy(selection.toList(), provider);
+ }
+
+ public void copy(List<?> selection, TextProvider provider) {
+ if (!selection.isEmpty()) {
+ StringBuilder sb = new StringBuilder();
+ for (Object item : selection) {
+ String textForElement = provider.getTextForElement(item);
+ if (textForElement != null) {
+ if (sb.length() > 0) {
+ sb.append(LINE_SEPARATOR);
+ sb.append(LINE_SEPARATOR);
+ }
+ sb.append(textForElement);
+ }
+ }
+ if (sb.length() > 0) {
+ copy(sb.toString());
+ }
+ }
+ }
+
+ public void copy(String text) {
+ Assert.isNotNull(text);
+ Assert.isTrue(text.length() > 0);
+
+ if (clipboard == null) {
+ clipboard = new Clipboard(Display.getDefault());
+ }
+
+ TextTransfer textTransfer = TextTransfer.getInstance();
+ clipboard.setContents(new Object[] { text }, new Transfer[] { textTransfer });
+ }
+
+ /**
+ * Frees resources.
+ */
+ public void dispose() {
+ if (clipboard != null) {
+ clipboard.dispose();
+ clipboard = null;
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonImages.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonImages.java
new file mode 100644
index 0000000..e46190e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonImages.java
@@ -0,0 +1,431 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.mylyn.internal.commons.ui.CommonsUiConstants;
+import org.eclipse.mylyn.internal.commons.ui.CompositeContainerImageDescriptor;
+import org.eclipse.mylyn.internal.commons.ui.CompositeElementImageDescriptor;
+import org.eclipse.mylyn.internal.commons.ui.CompositeSyncImageDescriptor;
+import org.eclipse.mylyn.internal.commons.ui.TaskListImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public class CommonImages {
+
+ private static final URL baseURL = Platform.getBundle(CommonsUiConstants.ID_PLUGIN).getEntry("/icons/"); //$NON-NLS-1$
+
+ private static ImageRegistry imageRegistry;
+
+ private static final String T_ELCL = "elcl16"; //$NON-NLS-1$
+
+ private static final String T_EVIEW = "eview16"; //$NON-NLS-1$
+
+ private static final String T_TOOL = "etool16"; //$NON-NLS-1$
+
+ private static final String T_OBJ = "obj16"; //$NON-NLS-1$
+
+ private static final String T_OBJ_32 = "obj32"; //$NON-NLS-1$
+
+ private static final String T_OBJ48 = "obj48"; //$NON-NLS-1$
+
+ private static final String T_WIZBAN = "wizban"; //$NON-NLS-1$
+
+ private static final String T_OVR = "ovr16"; //$NON-NLS-1$
+
+ // Priorities
+
+ public static final ImageDescriptor PRIORITY_1 = create(T_OBJ, "priority-1.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_2 = create(T_OBJ, "priority-2.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_3 = create(T_OBJ, "priority-3.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_4 = create(T_OBJ, "priority-4.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_5 = create(T_OBJ, "priority-5.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_1_LARGE = create(T_OBJ_32, "priority-critical.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_2_LARGE = create(T_OBJ_32, "priority-high.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_3_LARGE = create(T_OBJ_32, "priority-normal.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_4_LARGE = create(T_OBJ_32, "priority-low.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRIORITY_5_LARGE = create(T_OBJ_32, "priority-very-low.png"); //$NON-NLS-1$
+
+ // Calendars, people and notifications
+
+ public static final ImageDescriptor CALENDAR = create(T_TOOL, "calendar.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor CALENDAR_SMALL = create(T_OBJ, "calendar-small.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SCHEDULE = create(T_TOOL, "schedule.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SCHEDULE_DAY = create(T_TOOL, "schedule-day.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SCHEDULE_WEEK = create(T_TOOL, "schedule-week.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PERSON = create(T_TOOL, "person.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PERSON_NARROW = create(T_TOOL, "person-narrow.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PERSON_ME = create(T_TOOL, "person-me.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PERSON_ME_SMALL = create(T_TOOL, "person-me-small.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PERSON_ME_NARROW = create(T_TOOL, "person-me-narrow.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NOTIFICATION_CLOSE = create(T_EVIEW, "notification-close.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NOTIFICATION_CLOSE_HOVER = create(T_EVIEW, "notification-close-active.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NOTIFICATION_PREFERENCES_HOVER = create(T_EVIEW,
+ "notification-preferences-active.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NOTIFICATION_PREFERENCES = create(T_EVIEW,
+ "notification-preferences-inactive.png"); //$NON-NLS-1$
+
+ // Date and synchronization overlays
+
+ public static final ImageDescriptor OVERLAY_DATE_DUE = create(T_EVIEW, "overlay-has-due.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_DATE_OVERDUE = create(T_EVIEW, "overlay-overdue.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_IN_PROGRESS = create(T_EVIEW, "overlay-synchronizing.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_INCOMMING = create(T_EVIEW, "overlay-incoming.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_INCOMMING_NEW = create(T_EVIEW, "overlay-incoming-new.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_OUTGOING = create(T_EVIEW, "overlay-outgoing.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_OUTGOING_NEW = create(T_EVIEW, "overlay-outgoing-new.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_CONFLICT = create(T_EVIEW, "overlay-conflict.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_WARNING = create(T_OVR, "overlay-sync-warning.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_WARNING = create(T_OVR, "warning_ovr.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SUCCESS = create(T_OVR, "success_ovr.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_ERROR = create(T_OVR, "error_ovr.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_FAILED = create(T_OVR, "failed_ovr.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_OLD_INCOMMING = create(T_EVIEW, "overlay-synch-incoming.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_OLD_INCOMMING_NEW = create(T_EVIEW,
+ "overlay-synch-incoming-new.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_SYNC_OLD_OUTGOING = create(T_EVIEW, "overlay-synch-outgoing.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_CLEAR = create(T_OVR, "overlay-blank.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor OVERLAY_WHITE = create(T_OVR, "solid-white.gif"); //$NON-NLS-1$
+
+ // Wizard banners
+
+ public static final ImageDescriptor BANNER_SCREENSHOT = create(T_WIZBAN, "banner-screenshot.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor BANNER_IMPORT = create(T_WIZBAN, "banner-import.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor BANNER_EXPORT = create(T_WIZBAN, "banner-export.gif"); //$NON-NLS-1$
+
+ // Discovery
+
+ public static final ImageDescriptor DISCOVERY = create(T_TOOL, "discovery.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor BANNER_DISOVERY = create(T_WIZBAN, "banner-discovery.png"); //$NON-NLS-1$
+
+ // Miscellaneous
+ // TODO: some of the common images below come from the workbench
+
+ public static final ImageDescriptor COMPLETE = create(T_OBJ, "complete.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor CHECKED = create(T_OBJ, "checked.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REMOVE = create(T_ELCL, "remove.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor DELETE = create(T_ELCL, "delete.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor WARNING = create(T_ELCL, "warning.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILTER_COMPLETE = create(T_ELCL, "filter-complete.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILTER_ARCHIVE = create(T_ELCL, "filter-archive.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILTER_PRIORITY = create(T_ELCL, "filter-priority.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COLOR_PALETTE = create(T_ELCL, "color-palette.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILTER = create(T_TOOL, "view-filter.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FIND_CLEAR = create(T_TOOL, "find-clear.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FIND_CLEAR_DISABLED = create(T_TOOL, "find-clear-disabled.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor BROWSER_SMALL = create(T_OBJ, "browser-small.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor BROWSER_OPEN_TASK = create(T_TOOL, "open-browser.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor TOOLBAR_ARROW_RIGHT = create(T_TOOL, "toolbar-arrow-right.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor TOOLBAR_ARROW_DOWN = create(T_TOOL, "toolbar-arrow-down.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor LINK_EDITOR = create(T_TOOL, "link-editor.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor CLEAR = create(T_TOOL, "clear.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EDIT = create(T_TOOL, "edit.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EDIT_SMALL = create(T_TOOL, "edit-small.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor CUT = create(T_TOOL, "cut.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor UNDO = create(T_TOOL, "undo_edit.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REDO = create(T_TOOL, "redo_edit.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor STATUS_NORMAL = create(T_EVIEW, "status-normal.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor STATUS_CONTEXT = create(T_EVIEW, "status-server-context.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PRESENTATION = create(T_TOOL, "presentation.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor GROUPING = create(T_TOOL, "grouping.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COPY = create(T_TOOL, "copy.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor GO_UP = create(T_TOOL, "go-up.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor GO_INTO = create(T_TOOL, "go-into.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REFRESH = create(T_ELCL, "refresh.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor REFRESH_SMALL = create(T_ELCL, "refresh-small.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COLLAPSE_ALL = create(T_ELCL, "collapseall.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor COLLAPSE_ALL_SMALL = create(T_ELCL, "collapseall-small.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EXPAND_ALL = create(T_ELCL, "expandall.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EXPAND = create(T_ELCL, "expand.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor EXPAND_ALL_SMALL = create(T_ELCL, "expandall-small.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor BLANK = create(T_ELCL, "blank.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor IMAGE_CAPTURE = create(T_TOOL, "capture-screen.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor IMAGE_FIT = create(T_TOOL, "capture-fit.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor IMAGE_FILE = create(T_OBJ, "file-image.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILE_PLAIN = create(T_OBJ, "file-plain.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FILE_PLAIN_SMALL = create(T_OBJ, "file-small.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NOTES_SMALL = create(T_OBJ, "notes-small.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor QUESTION = create(T_OBJ, "question.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor INFORMATION = create(T_OBJ, "message_info.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SEPARATOR_LIST = create(T_TOOL, "content-assist-separator.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PART_MAXIMIZE = create(T_TOOL, "maximize.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor PREVIEW_WEB = create(T_TOOL, "preview-web.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor WEB = create(T_TOOL, "web.png"); //$NON-NLS-1$
+
+ public static final ImageDescriptor FIND = create(T_TOOL, "find.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor SAVE = create(T_TOOL, "save.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor VALIDATE = create(T_OBJ, "resource_obj.gif"); //$NON-NLS-1$
+
+ public static final ImageDescriptor NOTIFICATION_CONFIGURE = create(T_TOOL, "notification-configure.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor NOTIFICATION_CONFIGURE_HOVER = create(T_TOOL,
+ "notification-configure-active.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor CHECKBOX_CLEARED = create(T_ELCL, "checkboxcleared.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor CHECKBOX_SELECTED = create(T_ELCL, "checkboxselected.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor CHECKBOX_UNSELECTED = create(T_ELCL, "checkboxunselected.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor CHECKBOX_DISABLED = create(T_ELCL, "checkboxgreyed.gif"); //$NON-NLS-1$;
+
+ public static final ImageDescriptor PERSON_LARGE = create(T_OBJ48, "person.gif"); //$NON-NLS-1$;
+
+ private static ImageDescriptor create(String prefix, String name) {
+ try {
+ return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
+ } catch (MalformedURLException e) {
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+ }
+
+ /**
+ * Lazily initializes image map.
+ *
+ * @param imageDescriptor
+ * @return Image
+ */
+ public static Image getImage(ImageDescriptor imageDescriptor) {
+ ImageRegistry imageRegistry = getImageRegistry();
+ Image image = imageRegistry.get("" + imageDescriptor.hashCode()); //$NON-NLS-1$
+ if (image == null) {
+ image = imageDescriptor.createImage(true);
+ imageRegistry.put("" + imageDescriptor.hashCode(), image); //$NON-NLS-1$
+ }
+ return image;
+ }
+
+ public static Image getImageWithOverlay(ImageDescriptor icon, ImageDescriptor overlay, boolean top, boolean left) {
+ if (icon == null) {
+ return null;
+ }
+ String key = "" + icon.hashCode(); //$NON-NLS-1$
+ if (overlay != null) {
+ key += overlay.hashCode();
+ }
+ key += new Boolean(top).hashCode();
+ key += new Boolean(left).hashCode();
+
+ Image image = getImageRegistry().get(key);
+
+ if (image == null) {
+ TaskListImageDescriptor imageDescriptor = new TaskListImageDescriptor(icon, overlay, top, left);
+ image = imageDescriptor.createImage(true);
+ getImageRegistry().put(key, image);
+ }
+ return image;
+ }
+
+ /**
+ * Lazily initializes image map.
+ *
+ * @param icon
+ * cannot be null
+ * @param overlayKind
+ * @param wide
+ * @return Image
+ */
+ public static Image getCompositeTaskImage(ImageDescriptor icon, ImageDescriptor overlayKind, boolean wide) {
+ if (icon == null) {
+ return null;
+ }
+ String key = "" + icon.hashCode(); //$NON-NLS-1$
+ if (overlayKind != null) {
+ key += overlayKind.hashCode();
+ }
+ if (wide) {
+ key += ".wide"; //$NON-NLS-1$
+ }
+ Image image = getImageRegistry().get(key);
+
+ if (image == null) {
+ CompositeElementImageDescriptor imageDescriptor = new CompositeElementImageDescriptor(icon, overlayKind,
+ wide);
+ image = imageDescriptor.createImage(true);
+ getImageRegistry().put(key, image);
+ }
+ return image;
+ }
+
+ @Deprecated
+ public static Image getCompositeContainerImage(ImageDescriptor icon, boolean wide) {
+ if (icon == null) {
+ return null;
+ }
+ String key = "" + icon.hashCode(); //$NON-NLS-1$
+ if (wide) {
+ key += ".wide"; //$NON-NLS-1$
+ }
+ Image image = getImageRegistry().get(key);
+ if (image == null) {
+ CompositeContainerImageDescriptor imageDescriptor = new CompositeContainerImageDescriptor(icon,
+ OVERLAY_CLEAR, wide);
+ image = imageDescriptor.createImage(true);
+ getImageRegistry().put(key, image);
+ }
+ return image;
+ }
+
+ @Deprecated
+ public static Image getCompositeSynchImage(ImageDescriptor icon, boolean background) {
+ String key = "" + icon.hashCode(); //$NON-NLS-1$
+ if (background) {
+ key += ".background"; //$NON-NLS-1$
+ }
+
+ Image image = getImageRegistry().get(key);
+ if (image == null) {
+ CompositeSyncImageDescriptor imageDescriptor = new CompositeSyncImageDescriptor(icon, background);
+ image = imageDescriptor.createImage(true);
+ getImageRegistry().put(key, image);
+ }
+ return image;
+ }
+
+ private static ImageRegistry getImageRegistry() {
+ if (imageRegistry == null) {
+ imageRegistry = new ImageRegistry();
+ }
+
+ return imageRegistry;
+ }
+
+ private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
+ if (baseURL == null) {
+ throw new MalformedURLException();
+ }
+
+ StringBuffer buffer = new StringBuffer(prefix);
+ buffer.append('/');
+ buffer.append(name);
+ return new URL(baseURL, buffer.toString());
+ }
+
+ private static Image[] progressImages;
+
+ public static Image[] getProgressImages() {
+ if (progressImages != null) {
+ return progressImages;
+ }
+
+ progressImages = new Image[8];
+
+ for (int i = 1; i <= 8; i++) {
+ ImageDescriptor imageDescriptor = create(T_EVIEW + "/progress", i + ".png"); //$NON-NLS-1$ //$NON-NLS-2$
+ progressImages[i - 1] = getImage(imageDescriptor);
+ }
+
+ return progressImages;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonUiUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonUiUtil.java
new file mode 100644
index 0000000..369bb1e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/CommonUiUtil.java
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProduct;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.LegacyActionTools;
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.mylyn.commons.core.ICoreRunnable;
+import org.eclipse.mylyn.internal.commons.ui.CommonsUiConstants;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class CommonUiUtil {
+
+ private static final String KEY_ENABLED = "org.eclipse.mylyn.commons.ui.enabled"; //$NON-NLS-1$
+
+ public static void run(IRunnableContext context, final ICoreRunnable runnable) throws CoreException {
+ try {
+ IRunnableWithProgress runner = new IRunnableWithProgress() {
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ runnable.run(monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } catch (OperationCanceledException e) {
+ throw new InterruptedException();
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ context.run(true, true, runner);
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof CoreException) {
+ throw (CoreException) e.getCause();
+ } else {
+ Platform.getLog(Platform.getBundle(CommonsUiConstants.ID_PLUGIN)).log(
+ new Status(IStatus.ERROR, CommonsUiConstants.ID_PLUGIN, "Unexpected exception", e)); //$NON-NLS-1$
+ }
+ } catch (InterruptedException e) {
+ throw new OperationCanceledException();
+ }
+ }
+
+ public static void setMessage(DialogPage page, IStatus status) {
+ String message = status.getMessage();
+ switch (status.getSeverity()) {
+ case IStatus.OK:
+ page.setMessage(null, IMessageProvider.NONE);
+ break;
+ case IStatus.INFO:
+ page.setMessage(message, IMessageProvider.INFORMATION);
+ break;
+ case IStatus.WARNING:
+ page.setMessage(message, IMessageProvider.WARNING);
+ break;
+ default:
+ page.setMessage(message, IMessageProvider.ERROR);
+ break;
+ }
+ }
+
+ /**
+ * Recursively sets the menu of all children of <code>composite</code>.
+ */
+ public static void setMenu(Composite composite, Menu menu) {
+ if (!composite.isDisposed()) {
+ composite.setMenu(menu);
+ for (Control child : composite.getChildren()) {
+ child.setMenu(menu);
+ if (child instanceof Composite) {
+ setMenu((Composite) child, menu);
+ }
+ }
+ }
+ }
+
+ public static void setEnabled(Composite composite, boolean restore) {
+ if (restore) {
+ restoreState(composite);
+ } else {
+ saveStateAndDisable(composite);
+ }
+ }
+
+ private static void saveStateAndDisable(Composite composite) {
+ if (!composite.isDisposed()) {
+ Object data = composite.getData(KEY_ENABLED);
+ if (data == null) {
+ if (!composite.getEnabled()) {
+ composite.setData(KEY_ENABLED, Boolean.FALSE);
+ } else {
+ composite.setData(KEY_ENABLED, Boolean.TRUE);
+ composite.setEnabled(false);
+ }
+ }
+ for (Control control : composite.getChildren()) {
+ if (control instanceof Composite) {
+ saveStateAndDisable((Composite) control);
+ } else {
+ data = control.getData(KEY_ENABLED);
+ if (data == null) {
+ if (!control.getEnabled()) {
+ control.setData(KEY_ENABLED, Boolean.FALSE);
+ } else {
+ control.setData(KEY_ENABLED, Boolean.TRUE);
+ control.setEnabled(false);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static void restoreState(Composite composite) {
+ if (!composite.isDisposed()) {
+ Object data = composite.getData(KEY_ENABLED);
+ if (data != null) {
+ if (data == Boolean.TRUE) {
+ composite.setEnabled(data == Boolean.TRUE);
+ }
+ composite.setData(KEY_ENABLED, null);
+ }
+ for (Control control : composite.getChildren()) {
+ if (control instanceof Composite) {
+ restoreState((Composite) control);
+ } else {
+ data = control.getData(KEY_ENABLED);
+ if (data != null) {
+ if (data == Boolean.TRUE) {
+ control.setEnabled(true);
+ }
+ control.setData(KEY_ENABLED, null);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns text masking the &amp;-character from decoration as an accelerator in SWT labels.
+ *
+ * @deprecated use {@link LegacyActionTools#extractMnemonic(String)} instead
+ */
+ @Deprecated
+ public static String toLabel(String text) {
+ return (text != null) ? text.replaceAll("&", "&&") : null; // mask & from SWT //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Returns text for use as the label of an action to ensure that it is displayed properly.
+ *
+ * @return the cleaned text
+ */
+ public static String toMenuLabel(String label) {
+ // a tab at the end of the text will make sure that the @ will not create a weird space in the action text
+ // bug 287347: @ at start of task name cause a weird space in activation history menu
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=287347
+ if (label.contains("@")) { //$NON-NLS-1$
+ label += "\t"; //$NON-NLS-1$
+ }
+ return LegacyActionTools.escapeMnemonics(label);
+ }
+
+ public static String getProductName() {
+ return getProductName(null);
+ }
+
+ public static String getProductName(String defaultName) {
+ IProduct product = Platform.getProduct();
+ if (product != null) {
+ String productName = product.getName();
+ if (productName != null) {
+ String LABEL_SDK = "SDK"; //$NON-NLS-1$
+ if (productName.endsWith(LABEL_SDK)) {
+ productName = productName.substring(0, productName.length() - LABEL_SDK.length()).trim();
+ }
+ return productName;
+ }
+ }
+ return defaultName;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListItem.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListItem.java
new file mode 100644
index 0000000..0cbc42d
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListItem.java
@@ -0,0 +1,275 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Based on <code>org.eclipse.ui.internal.progress.ProgressInfoItem</code>.
+ *
+ * @author Steffen Pingel
+ */
+public abstract class ControlListItem extends Composite {
+
+ static String DARK_COLOR_KEY = "org.eclipse.mylyn.commons.ui.ControlListItem.DARK_COLOR"; //$NON-NLS-1$
+
+ interface IndexListener {
+
+ /**
+ * Select the item previous to the receiver.
+ */
+ public void selectPrevious();
+
+ /**
+ * Select the next previous to the receiver.
+ */
+ public void selectNext();
+
+ /**
+ * Select the receiver.
+ */
+ public void select();
+
+ public void open();
+
+ }
+
+ IndexListener indexListener;
+
+ private int currentIndex;
+
+ private boolean selected;
+
+ private final MouseAdapter mouseListener;
+
+ private boolean isShowing = true;
+
+ private final MouseTrackAdapter mouseTrackListener;
+
+ private boolean hot;
+
+ static {
+ // Mac has different Gamma value
+ int shift = "carbon".equals(SWT.getPlatform()) ? -25 : -10;//$NON-NLS-1$
+
+ Color lightColor = Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+
+ // Determine a dark color by shifting the list color
+ RGB darkRGB = new RGB(Math.max(0, lightColor.getRed() + shift), Math.max(0, lightColor.getGreen() + shift),
+ Math.max(0, lightColor.getBlue() + shift));
+ JFaceResources.getColorRegistry().put(DARK_COLOR_KEY, darkRGB);
+ }
+
+ /**
+ * Create a new instance of the receiver with the specified parent, style and info object/
+ *
+ * @param parent
+ * @param style
+ * @param progressInfo
+ */
+ public ControlListItem(Composite parent, int style, Object element) {
+ super(parent, style | SWT.NO_FOCUS);
+ setData(element);
+ setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+ mouseListener = doCreateMouseListener();
+ mouseTrackListener = doCreateMouseTrackListener();
+ createContent();
+ registerChild(this);
+ Control[] children = getChildren();
+ for (Control child : children) {
+ registerChild(child);
+ }
+ setHot(false);
+ refresh();
+ }
+
+ private MouseTrackAdapter doCreateMouseTrackListener() {
+ return new MouseTrackAdapter() {
+ private int enterCount;
+
+ @Override
+ public void mouseEnter(MouseEvent e) {
+ enterCount++;
+ updateHotState();
+ }
+
+ @Override
+ public void mouseExit(MouseEvent e) {
+ enterCount--;
+ getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (!isDisposed()) {
+ updateHotState();
+ }
+ }
+ });
+ }
+
+ private void updateHotState() {
+ if (enterCount == 0) {
+ if (isHot()) {
+ setHot(false);
+ }
+ } else {
+ if (!isHot()) {
+ setHot(true);
+ }
+ }
+ }
+ };
+ }
+
+ private MouseAdapter doCreateMouseListener() {
+ return new MouseAdapter() {
+ @Override
+ public void mouseDown(MouseEvent e) {
+ if (indexListener != null) {
+ if (e.count == 2) {
+ indexListener.open();
+ } else {
+ indexListener.select();
+ }
+ }
+ }
+ };
+ }
+
+ /**
+ * Create the child widgets of the receiver.
+ */
+ protected abstract void createContent();
+
+ public boolean isHot() {
+ return hot;
+ }
+
+ public void setHot(boolean hot) {
+ this.hot = hot;
+ }
+
+ protected void registerChild(Control child) {
+ child.addMouseListener(mouseListener);
+ child.addMouseTrackListener(mouseTrackListener);
+
+ }
+
+ /**
+ * Refresh the contents of the receiver.
+ */
+ protected abstract void refresh();
+
+ /**
+ * Set the color base on the index
+ *
+ * @param index
+ */
+ public void updateColors(int index) {
+ currentIndex = index;
+
+ if (selected) {
+ setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));
+ setForeground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
+ } else {
+ if (index % 2 == 0) {
+ setBackground(JFaceResources.getColorRegistry().get(DARK_COLOR_KEY));
+ } else {
+ setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+ }
+ setForeground(getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
+ }
+ }
+
+ @Override
+ public void setForeground(Color color) {
+ super.setForeground(color);
+ Control[] children = getChildren();
+ for (Control child : children) {
+ child.setForeground(color);
+ }
+ }
+
+ @Override
+ public void setBackground(Color color) {
+ super.setBackground(color);
+ Control[] children = getChildren();
+ for (Control child : children) {
+ child.setBackground(color);
+ }
+ }
+
+ /**
+ * Set the selection colors.
+ *
+ * @param select
+ * boolean that indicates whether or not to show selection.
+ */
+ public void setSelected(boolean select) {
+ selected = select;
+ updateColors(currentIndex);
+ }
+
+ /**
+ * Set the listener for index changes.
+ *
+ * @param indexListener
+ */
+ void setIndexListener(IndexListener indexListener) {
+ this.indexListener = indexListener;
+ }
+
+ /**
+ * Return whether or not the receiver is selected.
+ *
+ * @return boolean
+ */
+ public boolean isSelected() {
+ return selected;
+ }
+
+ /**
+ * Set whether or not the receiver is being displayed based on the top and bottom of the currently visible area.
+ *
+ * @param top
+ * @param bottom
+ */
+ void setDisplayed(int top, int bottom) {
+ int itemTop = getLocation().y;
+ int itemBottom = itemTop + getBounds().height;
+ setDisplayed(itemTop <= bottom && itemBottom > top);
+
+ }
+
+ /**
+ * Set whether or not the receiver is being displayed
+ *
+ * @param displayed
+ */
+ private void setDisplayed(boolean displayed) {
+ // See if this element has been turned off
+ boolean refresh = !isShowing && displayed;
+ isShowing = displayed;
+ if (refresh) {
+ refresh();
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListViewer.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListViewer.java
new file mode 100644
index 0000000..7ca81dd
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ControlListViewer.java
@@ -0,0 +1,501 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * Based on {@link org.eclipse.ui.internal.progress.DetailedProgressViewer}.
+ *
+ * @author Steffen Pingel
+ */
+@SuppressWarnings("restriction")
+public abstract class ControlListViewer extends StructuredViewer {
+
+ Composite control;
+
+ private final ScrolledComposite scrolled;
+
+ private final Composite noEntryArea;
+
+ protected boolean hasFocus;
+
+ /**
+ * Create a new instance of the receiver with a control that is a child of parent with style style.
+ *
+ * @param parent
+ * @param style
+ */
+ public ControlListViewer(Composite parent, int style) {
+ scrolled = new ScrolledComposite(parent, style);
+ int height = JFaceResources.getDefaultFont().getFontData()[0].getHeight();
+ scrolled.getVerticalBar().setIncrement(height * 2);
+ scrolled.setExpandHorizontal(true);
+ scrolled.setExpandVertical(true);
+
+ control = new Composite(scrolled, SWT.NONE) {
+ @Override
+ public boolean setFocus() {
+ forceFocus();
+ return true;
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ updateSize(control);
+ }
+ }
+ };
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ layout.horizontalSpacing = 0;
+ layout.verticalSpacing = 1;
+ control.setLayout(layout);
+ control.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+
+ control.addControlListener(new ControlListener() {
+ public void controlMoved(ControlEvent e) {
+ updateVisibleItems();
+
+ }
+
+ public void controlResized(ControlEvent e) {
+ updateVisibleItems();
+ }
+ });
+
+ scrolled.setContent(control);
+ hookControl(control);
+
+ noEntryArea = new Composite(scrolled, SWT.NONE);
+ doCreateNoEntryArea(noEntryArea);
+
+ scrolled.setExpandHorizontal(true);
+ scrolled.setExpandVertical(true);
+ scrolled.addControlListener(new ControlAdapter() {
+ @Override
+ public void controlResized(ControlEvent e) {
+ updateSize(scrolled.getContent());
+ }
+ });
+ control.addTraverseListener(new TraverseListener() {
+ private boolean handleEvent = true;
+
+ public void keyTraversed(TraverseEvent event) {
+ if (!handleEvent) {
+ return;
+ }
+ switch (event.detail) {
+ case SWT.TRAVERSE_ARROW_PREVIOUS: {
+ Control[] children = control.getChildren();
+ if (children.length > 0) {
+ boolean selected = false;
+ for (int i = 0; i < children.length; i++) {
+ ControlListItem item = (ControlListItem) children[i];
+ if (item.isSelected()) {
+ selected = true;
+ if (i > 0) {
+ setSelection(new StructuredSelection(children[i - 1].getData()), true);
+ }
+ break;
+ }
+ }
+ if (!selected) {
+ setSelection(new StructuredSelection(children[children.length - 1].getData()), true);
+ }
+ }
+ break;
+ }
+ case SWT.TRAVERSE_ARROW_NEXT: {
+ Control[] children = control.getChildren();
+ if (children.length > 0) {
+ boolean selected = false;
+ for (int i = 0; i < children.length; i++) {
+ ControlListItem item = (ControlListItem) children[i];
+ if (item.isSelected()) {
+ selected = true;
+ if (i < children.length - 1) {
+ setSelection(new StructuredSelection(children[i + 1].getData()), true);
+ }
+ break;
+ }
+ }
+ if (!selected) {
+ setSelection(new StructuredSelection(children[0].getData()), true);
+ }
+ }
+ break;
+ }
+ default:
+ handleEvent = false;
+ event.doit = true;
+ Control control = ControlListViewer.this.control;
+ Shell shell = control.getShell();
+ while (control != null) {
+ if (control.traverse(event.detail)) {
+ break;
+ }
+ if (!event.doit || control == shell) {
+ break;
+ }
+ control = control.getParent();
+ }
+ handleEvent = true;
+ break;
+ }
+ }
+ });
+ }
+
+ protected void doCreateNoEntryArea(Composite parent) {
+ }
+
+ public void add(Object[] elements) {
+ ViewerComparator sorter = getComparator();
+
+ // Use a Set in case we are getting something added that exists
+ Set<Object> newItems = new HashSet<Object>(elements.length);
+
+ Control[] existingChildren = control.getChildren();
+ for (Control element : existingChildren) {
+ if (element.getData() != null) {
+ newItems.add(element.getData());
+ }
+ }
+
+ for (Object element : elements) {
+ if (element != null) {
+ newItems.add(element);
+ }
+ }
+
+ Object[] infos = new Object[newItems.size()];
+ newItems.toArray(infos);
+
+ if (sorter != null) {
+ sorter.sort(this, infos);
+ }
+
+ // Update with the new elements to prevent flash
+ for (Control element : existingChildren) {
+ ((ControlListItem) element).dispose();
+ }
+
+ for (int i = 0; i < infos.length; i++) {
+ ControlListItem item = createNewItem(infos[i]);
+ item.updateColors(i);
+ }
+
+ control.layout(true);
+ doUpdateContent();
+ }
+
+ private void updateSize(Control control) {
+ if (control == null) {
+ return;
+ }
+ // XXX need a small offset in case the list has a scroll bar
+ Point size = control.computeSize(scrolled.getClientArea().width - 20, SWT.DEFAULT, true);
+ control.setSize(size);
+ scrolled.setMinSize(size);
+ }
+
+ protected void doUpdateContent() {
+ if (control.getChildren().length > 0) {
+ updateSize(control);
+ scrolled.setContent(control);
+ } else {
+ updateSize(noEntryArea);
+ scrolled.setContent(noEntryArea);
+ }
+ }
+
+ /**
+ * Create a new item for info.
+ *
+ * @param element
+ * @return ControlListItem
+ */
+ private ControlListItem createNewItem(Object element) {
+ final ControlListItem item = doCreateItem(control, element);
+// item.getChildren()[0].addPaintListener(new PaintListener() {
+// public void paintControl(PaintEvent e) {
+// if (hasFocus && item.isSelected()) {
+// Point size = item.getSize();
+// e.gc.setForeground(e.gc.getDevice().getSystemColor(SWT.COLOR_DARK_GRAY));
+// e.gc.setLineDash(new int[] { 1, 2 });
+// e.gc.drawRoundRectangle(0, 0, size.x - 1, size.y - 1, 5, 5);
+// }
+// }
+// });
+ item.setIndexListener(new ControlListItem.IndexListener() {
+ public void selectNext() {
+ Control[] children = control.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (item == children[i]) {
+ if (i < children.length - 1) {
+ setSelection(new StructuredSelection(children[i + 1].getData()));
+ }
+ break;
+ }
+ }
+ }
+
+ public void selectPrevious() {
+ Control[] children = control.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (item == children[i]) {
+ if (i > 0) {
+ setSelection(new StructuredSelection(children[i - 1].getData()));
+ }
+ break;
+ }
+ }
+ }
+
+ public void select() {
+ setSelection(new StructuredSelection(item.getData()));
+ setFocus();
+ }
+
+ public void open() {
+ handleOpen();
+ }
+ });
+
+ // Refresh to populate with the current tasks
+ item.refresh();
+ return item;
+ }
+
+ protected abstract ControlListItem doCreateItem(Composite parent, Object element);
+
+ @Override
+ protected ControlListItem doFindInputItem(Object element) {
+ return null;
+ }
+
+ @Override
+ protected ControlListItem doFindItem(Object element) {
+ Control[] children = control.getChildren();
+ for (Control child : children) {
+ if (child.isDisposed() || child.getData() == null) {
+ continue;
+ }
+ if (child.getData().equals(element)) {
+ return (ControlListItem) child;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
+ if (usingElementMap()) {
+ unmapElement(item);
+ }
+ item.dispose();
+ add(new Object[] { element });
+ }
+
+ @Override
+ public ScrolledComposite getControl() {
+ return scrolled;
+ }
+
+ @Override
+ protected List<?> getSelectionFromWidget() {
+ Control[] children = control.getChildren();
+ ArrayList<Object> selection = new ArrayList<Object>(children.length);
+ for (Control child : children) {
+ ControlListItem item = (ControlListItem) child;
+ if (item.isSelected() && item.getData() != null) {
+ selection.add(item.getData());
+ }
+ }
+ return selection;
+ }
+
+ protected void handleOpen() {
+ Control control = getControl();
+ if (control != null && !control.isDisposed()) {
+ ISelection selection = getSelection();
+ fireOpen(new OpenEvent(this, selection));
+ }
+ }
+
+ @Override
+ protected void inputChanged(Object input, Object oldInput) {
+ super.inputChanged(input, oldInput);
+ refreshAll();
+ doUpdateContent();
+ }
+
+ @Override
+ protected void internalRefresh(Object element) {
+ if (element == null) {
+ return;
+ }
+
+ if (element.equals(getRoot())) {
+ refreshAll();
+ return;
+ }
+ Widget widget = findItem(element);
+ if (widget == null) {
+ add(new Object[] { element });
+ return;
+ }
+ ((ControlListItem) widget).refresh();
+
+ updateSize(control);
+ }
+
+ public void remove(Object[] elements) {
+ for (Object element : elements) {
+ Widget item = doFindItem(element);
+ if (item != null) {
+ unmapElement(element);
+ item.dispose();
+ }
+ }
+
+ Control[] existingChildren = control.getChildren();
+ for (int i = 0; i < existingChildren.length; i++) {
+ ControlListItem item = (ControlListItem) existingChildren[i];
+ item.updateColors(i);
+ }
+ control.layout(true);
+ doUpdateContent();
+ }
+
+ @Override
+ public void reveal(Object element) {
+ Control control = doFindItem(element);
+ if (control != null) {
+ revealControl(control);
+ }
+ }
+
+ private void revealControl(Control control) {
+ Rectangle clientArea = scrolled.getClientArea();
+ Point origin = scrolled.getOrigin();
+ Point location = control.getLocation();
+ Point size = control.getSize();
+ if (location.y + size.y > origin.y + clientArea.height) {
+ scrolled.setOrigin(origin.x, location.y + size.y - clientArea.height);
+ }
+ if (location.y < origin.y) {
+ scrolled.setOrigin(origin.x, location.y);
+ }
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ protected void setSelectionToWidget(List list, boolean reveal) {
+ HashSet<Object> elements = new HashSet<Object>(list);
+ Control[] children = control.getChildren();
+ for (Control control : children) {
+ ControlListItem child = (ControlListItem) control;
+ boolean selected = elements.contains(child.getData());
+ if (selected != child.isSelected()) {
+ child.setSelected(selected);
+ }
+ if (reveal && selected) {
+ revealControl(child);
+ reveal = false;
+ }
+ }
+ }
+
+ /**
+ * Set focus on the current selection.
+ */
+ public void setFocus() {
+ Control[] children = control.getChildren();
+ if (children.length > 0) {
+ // causes the item's tool bar to get focus when clicked which is undesirable
+// for (Control element : children) {
+// ControlListItem item = (ControlListItem) element;
+// if (item.isSelected()) {
+// if (item.setFocus()) {
+// return;
+// }
+// }
+// }
+ control.forceFocus();
+ } else {
+ noEntryArea.setFocus();
+ }
+ }
+
+ /**
+ * Refresh everything as the root is being refreshed.
+ */
+ private void refreshAll() {
+ Object[] infos = getSortedChildren(getRoot());
+ Control[] existingChildren = control.getChildren();
+
+ for (Control element : existingChildren) {
+ element.dispose();
+ }
+
+ for (int i = 0; i < infos.length; i++) {
+ ControlListItem item = createNewItem(infos[i]);
+ item.updateColors(i);
+ }
+
+ control.layout(true);
+ doUpdateContent();
+ }
+
+ /**
+ * Set the virtual items to be visible or not depending on the displayed area.
+ */
+ private void updateVisibleItems() {
+ Control[] children = control.getChildren();
+ int top = scrolled.getOrigin().y;
+ int bottom = top + scrolled.getParent().getBounds().height;
+ for (Control element : children) {
+ ControlListItem item = (ControlListItem) element;
+ item.setDisplayed(top, bottom);
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientCanvas.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientCanvas.java
new file mode 100644
index 0000000..afc5dc1
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientCanvas.java
@@ -0,0 +1,351 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Tasktop Technologies - extracted FormHeading implementation for Mylyn
+ *******************************************************************************/
+package org.eclipse.mylyn.commons.ui;
+
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * Based on {@link org.eclipse.ui.internal.forms.widgets.FormHeading}.
+ *
+ * @since 3.7
+ */
+@SuppressWarnings("restriction")
+public class GradientCanvas extends Canvas {
+
+ private static final int SEPARATOR = 1 << 1;
+
+ private static final int BOTTOM_SEPARATOR = 1 << 2;
+
+ private static final int BACKGROUND_IMAGE_TILED = 1 << 3;
+
+ public static final String COLOR_BASE_BG = "baseBg"; //$NON-NLS-1$
+
+ static String PREFIX = "org.eclipse.ui.forms."; //$NON-NLS-1$
+
+ static String H_PREFIX = PREFIX + "H_"; //$NON-NLS-1$
+
+ public static String H_BOTTOM_KEYLINE1 = H_PREFIX + "BOTTOM_KEYLINE1"; //$NON-NLS-1$
+
+ /**
+ * Key for the form header bottom keyline 2 color.
+ */
+ public static String H_BOTTOM_KEYLINE2 = H_PREFIX + "BOTTOM_KEYLINE2"; //$NON-NLS-1$
+
+ private Image backgroundImage;
+
+ private Image gradientImage;
+
+ Map<String, Color> colors = new Hashtable<String, Color>();
+
+ private int flags;
+
+ private GradientInfo gradientInfo;
+
+ private class GradientInfo {
+ Color[] gradientColors;
+
+ int[] percents;
+
+ boolean vertical;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Control#forceFocus()
+ */
+ @Override
+ public boolean forceFocus() {
+ return false;
+ }
+
+ /**
+ * Creates the form content control as a child of the provided parent.
+ *
+ * @param parent
+ * the parent widget
+ */
+ public GradientCanvas(Composite parent, int style) {
+ super(parent, style);
+ setBackgroundMode(SWT.INHERIT_DEFAULT);
+ setSeparatorAlignment(SWT.BOTTOM);
+ addListener(SWT.Paint, new Listener() {
+ public void handleEvent(Event e) {
+ onPaint(e.gc);
+ }
+ });
+ addListener(SWT.Dispose, new Listener() {
+ public void handleEvent(Event e) {
+ if (gradientImage != null) {
+ // XXX FormImages.getInstance().markFinished(gradientImage);
+ gradientImage.dispose();
+ gradientImage = null;
+ }
+ }
+ });
+ addListener(SWT.Resize, new Listener() {
+ public void handleEvent(Event e) {
+ if (gradientInfo != null || (backgroundImage != null && !isBackgroundImageTiled())) {
+ updateGradientImage();
+ }
+ }
+ });
+ }
+
+ /**
+ * Sets the background color of the header.
+ */
+ @Override
+ public void setBackground(Color bg) {
+ super.setBackground(bg);
+ internalSetBackground(bg);
+ }
+
+ private void internalSetBackground(Color bg) {
+ putColor(COLOR_BASE_BG, bg);
+ }
+
+ public void setBackgroundGradient(Color[] gradientColors, int[] percents, boolean vertical) {
+ if (gradientColors != null) {
+ gradientInfo = new GradientInfo();
+ gradientInfo.gradientColors = gradientColors;
+ gradientInfo.percents = percents;
+ gradientInfo.vertical = vertical;
+ setBackground(null);
+ updateGradientImage();
+ } else {
+ // reset
+ gradientInfo = null;
+ if (gradientImage != null) {
+ // XXX FormImages.getInstance().markFinished(gradientImage);
+ gradientImage.dispose();
+ gradientImage = null;
+ setBackgroundImage(null);
+ }
+ }
+ }
+
+ public void setHeadingBackgroundImage(Image image) {
+ this.backgroundImage = image;
+ if (image != null) {
+ setBackground(null);
+ }
+ if (isBackgroundImageTiled()) {
+ setBackgroundImage(image);
+ } else {
+ updateGradientImage();
+ }
+ }
+
+ public Image getHeadingBackgroundImage() {
+ return backgroundImage;
+ }
+
+ public void setBackgroundImageTiled(boolean tiled) {
+ if (tiled) {
+ flags |= BACKGROUND_IMAGE_TILED;
+ } else {
+ flags &= ~BACKGROUND_IMAGE_TILED;
+ }
+ setHeadingBackgroundImage(this.backgroundImage);
+ }
+
+ public boolean isBackgroundImageTiled() {
+ return (flags & BACKGROUND_IMAGE_TILED) != 0;
+ }
+
+ @Override
+ public void setBackgroundImage(Image image) {
+ super.setBackgroundImage(image);
+ if (image != null) {
+ internalSetBackground(null);
+ }
+ }
+
+ private void onPaint(GC gc) {
+ if (!isSeparatorVisible() && getBackgroundImage() == null) {
+ return;
+ }
+ Rectangle carea = getClientArea();
+ Image buffer = new Image(getDisplay(), carea.width, carea.height);
+ buffer.setBackground(getBackground());
+ GC igc = new GC(buffer);
+ igc.setBackground(getBackground());
+ igc.fillRectangle(0, 0, carea.width, carea.height);
+ if (getBackgroundImage() != null) {
+ if (gradientInfo != null) {
+ drawBackground(igc, carea.x, carea.y, carea.width, carea.height);
+ } else {
+ Image bgImage = getBackgroundImage();
+ Rectangle ibounds = bgImage.getBounds();
+ drawBackground(igc, carea.x, carea.y, ibounds.width, ibounds.height);
+ }
+ }
+
+ if (isSeparatorVisible()) {
+ drawSeparator(carea, igc);
+ }
+ igc.dispose();
+ gc.drawImage(buffer, carea.x, carea.y);
+ buffer.dispose();
+ }
+
+ private void drawSeparator(Rectangle carea, GC igc) {
+ // bg separator
+ if (hasColor(H_BOTTOM_KEYLINE1)) {
+ igc.setForeground(getColor(H_BOTTOM_KEYLINE1));
+ } else {
+ igc.setForeground(getBackground());
+ }
+ if (getSeparatorAlignment() == SWT.BOTTOM) {
+ igc.drawLine(carea.x, carea.height - 2, carea.x + carea.width - 1, carea.height - 2);
+ } else {
+ igc.drawLine(carea.x, 1, carea.x + carea.width - 1, 1);
+ }
+ if (hasColor(H_BOTTOM_KEYLINE2)) {
+ igc.setForeground(getColor(H_BOTTOM_KEYLINE2));
+ } else {
+ igc.setForeground(getForeground());
+ }
+ if (getSeparatorAlignment() == SWT.BOTTOM) {
+ igc.drawLine(carea.x, carea.height - 1, carea.x + carea.width - 1, carea.height - 1);
+ } else {
+ igc.drawLine(carea.x, 0, carea.x + carea.width - 1, 0);
+ }
+ }
+
+ private void updateGradientImage() {
+ Rectangle rect = getBounds();
+ if (gradientImage != null) {
+ // XXX FormImages.getInstance().markFinished(gradientImage);
+ gradientImage.dispose();
+ gradientImage = null;
+ }
+ if (gradientInfo != null) {
+ // XXX use FormImages
+// gradientImage = FormImages.getInstance().getGradient(gradientInfo.gradientColors, gradientInfo.percents,
+// gradientInfo.vertical ? rect.height : rect.width, gradientInfo.vertical, getColor(COLOR_BASE_BG));
+ boolean vertical = gradientInfo.vertical;
+ int width = vertical ? 1 : rect.width;
+ int height = vertical ? rect.height : 1;
+ gradientImage = new Image(getDisplay(), Math.max(width, 1), Math.max(height, 1));
+ GC gc = new GC(gradientImage);
+ drawTextGradient(gc, width, height);
+ gc.dispose();
+ } else if (backgroundImage != null && !isBackgroundImageTiled()) {
+ gradientImage = new Image(getDisplay(), Math.max(rect.width, 1), Math.max(rect.height, 1));
+ gradientImage.setBackground(getBackground());
+ GC gc = new GC(gradientImage);
+ gc.drawImage(backgroundImage, 0, 0);
+ gc.dispose();
+ }
+ setBackgroundImage(gradientImage);
+ }
+
+ // XXX remove, use FormImages
+ private void drawTextGradient(GC gc, int width, int height) {
+ final Color oldBackground = gc.getBackground();
+ if (gradientInfo.gradientColors.length == 1) {
+ if (gradientInfo.gradientColors[0] != null) {
+ gc.setBackground(gradientInfo.gradientColors[0]);
+ }
+ gc.fillRectangle(0, 0, width, height);
+ } else {
+ final Color oldForeground = gc.getForeground();
+ Color lastColor = gradientInfo.gradientColors[0];
+ if (lastColor == null) {
+ lastColor = oldBackground;
+ }
+ int pos = 0;
+ for (int i = 0; i < gradientInfo.percents.length; ++i) {
+ gc.setForeground(lastColor);
+ lastColor = gradientInfo.gradientColors[i + 1];
+ if (lastColor == null) {
+ lastColor = oldBackground;
+ }
+ gc.setBackground(lastColor);
+ if (gradientInfo.vertical) {
+ final int gradientHeight = (gradientInfo.percents[i] * height / 100) - pos;
+ gc.fillGradientRectangle(0, pos, width, gradientHeight, true);
+ pos += gradientHeight;
+ } else {
+ final int gradientWidth = (gradientInfo.percents[i] * width / 100) - pos;
+ gc.fillGradientRectangle(pos, 0, gradientWidth, height, false);
+ pos += gradientWidth;
+ }
+ }
+ if (gradientInfo.vertical && pos < height) {
+ gc.setBackground(getColor(COLOR_BASE_BG));
+ gc.fillRectangle(0, pos, width, height - pos);
+ }
+ if (!gradientInfo.vertical && pos < width) {
+ gc.setBackground(getColor(COLOR_BASE_BG));
+ gc.fillRectangle(pos, 0, width - pos, height);
+ }
+
+ if (isSeparatorVisible()) {
+ drawSeparator(getClientArea(), gc);
+ }
+ gc.setForeground(oldForeground);
+ }
+ }
+
+ public boolean isSeparatorVisible() {
+ return (flags & SEPARATOR) != 0;
+ }
+
+ public void setSeparatorVisible(boolean addSeparator) {
+ if (addSeparator) {
+ flags |= SEPARATOR;
+ } else {
+ flags &= ~SEPARATOR;
+ }
+ }
+
+ public void setSeparatorAlignment(int alignment) {
+ if (alignment == SWT.BOTTOM) {
+ flags |= BOTTOM_SEPARATOR;
+ } else {
+ flags &= ~BOTTOM_SEPARATOR;
+ }
+ }
+
+ public int getSeparatorAlignment() {
+ return (flags & BOTTOM_SEPARATOR) != 0 ? SWT.BOTTOM : SWT.TOP;
+ }
+
+ public void putColor(String key, Color color) {
+ if (color == null) {
+ colors.remove(key);
+ } else {
+ colors.put(key, color);
+ }
+ }
+
+ public Color getColor(String key) {
+ return colors.get(key);
+ }
+
+ public boolean hasColor(String key) {
+ return colors.containsKey(key);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientColors.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientColors.java
new file mode 100644
index 0000000..977fdf8
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientColors.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benjamin Pasero - initial API and implementation
+ * Tasktop Technologies - improvements
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.jface.resource.DeviceResourceException;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Based on FormColors of UI Forms.
+ *
+ * @author Benjamin Pasero (initial contribution from RSSOwl, see bug 177974)
+ * @author Mik Kersten
+ */
+public class GradientColors {
+
+ private final Display display;
+
+ private Color titleText;
+
+ private Color gradientBegin;
+
+ private Color gradientEnd;
+
+ private Color border;
+
+ private final ResourceManager resourceManager;
+
+ public GradientColors(Display display, ResourceManager resourceManager) {
+ this.display = display;
+ this.resourceManager = resourceManager;
+
+ createColors();
+ }
+
+ private void createColors() {
+ createBorderColor();
+ createGradientColors();
+ // previously used SWT.COLOR_TITLE_INACTIVE_FOREGROUND, but too light on Windows XP
+ titleText = getColor(resourceManager, getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
+ }
+
+ public Color getGradientBegin() {
+ return gradientBegin;
+ }
+
+ public Color getGradientEnd() {
+ return gradientEnd;
+ }
+
+ public Color getBorder() {
+ return border;
+ }
+
+ public Color getTitleText() {
+ return titleText;
+ }
+
+ private void createBorderColor() {
+ RGB tbBorder = getSystemColor(SWT.COLOR_TITLE_BACKGROUND);
+ RGB bg = getImpliedBackground().getRGB();
+
+ // Group 1
+ // Rule: If at least 2 of the RGB values are equal to or between 180 and
+ // 255, then apply specified opacity for Group 1
+ // Examples: Vista, XP Silver, Wn High Con #2
+ // Keyline = TITLE_BACKGROUND @ 70% Opacity over LIST_BACKGROUND
+ if (testTwoPrimaryColors(tbBorder, 179, 256)) {
+ tbBorder = blend(tbBorder, bg, 70);
+ } else if (testTwoPrimaryColors(tbBorder, 120, 180)) {
+ tbBorder = blend(tbBorder, bg, 50);
+ } else {
+ tbBorder = blend(tbBorder, bg, 30);
+ }
+
+ border = getColor(resourceManager, tbBorder);
+ }
+
+ private void createGradientColors() {
+ RGB titleBg = getSystemColor(SWT.COLOR_TITLE_BACKGROUND);
+ Color bgColor = getImpliedBackground();
+ RGB bg = bgColor.getRGB();
+ RGB bottom, top;
+
+ // Group 1
+ // Rule: If at least 2 of the RGB values are equal to or between 180 and
+ // 255, then apply specified opacity for Group 1
+ // Examples: Vista, XP Silver, Wn High Con #2
+ // Gradient Bottom = TITLE_BACKGROUND @ 30% Opacity over LIST_BACKGROUND
+ // Gradient Top = TITLE BACKGROUND @ 0% Opacity over LIST_BACKGROUND
+ if (testTwoPrimaryColors(titleBg, 179, 256)) {
+ bottom = blend(titleBg, bg, 30);
+ top = bg;
+ }
+
+ // Group 2
+ // Rule: If at least 2 of the RGB values are equal to or between 121 and
+ // 179, then apply specified opacity for Group 2
+ // Examples: XP Olive, OSX Graphite, Linux GTK, Wn High Con Black
+ // Gradient Bottom = TITLE_BACKGROUND @ 20% Opacity over LIST_BACKGROUND
+ // Gradient Top = TITLE BACKGROUND @ 0% Opacity over LIST_BACKGROUND
+ else if (testTwoPrimaryColors(titleBg, 120, 180)) {
+ bottom = blend(titleBg, bg, 20);
+ top = bg;
+ }
+
+ // Group 3
+ // Rule: If at least 2 of the RGB values are equal to or between 0 and
+ // 120, then apply specified opacity for Group 3
+ // Examples: XP Default, Wn Classic Standard, Wn Marine, Wn Plum, OSX
+ // Aqua, Wn High Con White, Wn High Con #1
+ // Gradient Bottom = TITLE_BACKGROUND @ 10% Opacity over LIST_BACKGROUND
+ // Gradient Top = TITLE BACKGROUND @ 0% Opacity over LIST_BACKGROUND
+ else {
+ bottom = blend(titleBg, bg, 10);
+ top = bg;
+ }
+
+ gradientBegin = getColor(resourceManager, top);
+ gradientEnd = getColor(resourceManager, bottom);
+ }
+
+ private RGB blend(RGB c1, RGB c2, int ratio) {
+ int r = blend(c1.red, c2.red, ratio);
+ int g = blend(c1.green, c2.green, ratio);
+ int b = blend(c1.blue, c2.blue, ratio);
+ return new RGB(r, g, b);
+ }
+
+ private int blend(int v1, int v2, int ratio) {
+ int b = (ratio * v1 + (100 - ratio) * v2) / 100;
+ return Math.min(255, b);
+ }
+
+ private boolean testTwoPrimaryColors(RGB rgb, int from, int to) {
+ int total = 0;
+ if (testPrimaryColor(rgb.red, from, to)) {
+ total++;
+ }
+ if (testPrimaryColor(rgb.green, from, to)) {
+ total++;
+ }
+ if (testPrimaryColor(rgb.blue, from, to)) {
+ total++;
+ }
+ return total >= 2;
+ }
+
+ private boolean testPrimaryColor(int value, int from, int to) {
+ return value > from && value < to;
+ }
+
+ private RGB getSystemColor(int code) {
+ return getDisplay().getSystemColor(code).getRGB();
+ }
+
+ private Color getImpliedBackground() {
+ return display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+ }
+
+ private Display getDisplay() {
+ return display;
+ }
+
+ private Color getColor(ResourceManager manager, RGB rgb) {
+ try {
+ return manager.createColor(rgb);
+ } catch (DeviceResourceException e) {
+ return manager.getDevice().getSystemColor(SWT.COLOR_BLACK);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientToolTip.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientToolTip.java
new file mode 100644
index 0000000..1d7c6b9
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/GradientToolTip.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.window.ToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+
+/**
+ * A Custom JFace ToolTip that applies a gradient to the contents
+ *
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public abstract class GradientToolTip extends ToolTip {
+
+ private GradientColors colors;
+
+ private LocalResourceManager resourceManager;
+
+ public GradientToolTip(Control control, int style, boolean manualActivation) {
+ super(control, style, manualActivation);
+ initResources(control);
+ }
+
+ public GradientToolTip(Control control) {
+ super(control);
+ initResources(control);
+ }
+
+ private void initResources(Control control) {
+ resourceManager = new LocalResourceManager(JFaceResources.getResources());
+ colors = new GradientColors(control.getDisplay(), resourceManager);
+ }
+
+ @Override
+ protected final Composite createToolTipContentArea(Event event, final Composite parent) {
+ GradientCanvas gradient = new GradientCanvas(parent, SWT.NONE);
+ gradient.setSeparatorVisible(false);
+ GridLayout headLayout = new GridLayout();
+ headLayout.marginHeight = 0;
+ headLayout.marginWidth = 0;
+ headLayout.horizontalSpacing = 0;
+ headLayout.verticalSpacing = 0;
+ headLayout.numColumns = 1;
+ gradient.setLayout(headLayout);
+
+ gradient.setBackgroundGradient(new Color[] { colors.getGradientBegin(), colors.getGradientEnd() },
+ new int[] { 100 }, true);
+
+ createToolTipArea(event, gradient);
+
+ // force a null background so that the gradient shines through
+ for (Control c : gradient.getChildren()) {
+ setNullBackground(c);
+ }
+
+ return gradient;
+ }
+
+ private void setNullBackground(final Control outerCircle) {
+ outerCircle.setBackground(null);
+ if (outerCircle instanceof Composite) {
+ ((Composite) outerCircle).setBackgroundMode(SWT.INHERIT_FORCE);
+ for (Control c : ((Composite) outerCircle).getChildren()) {
+ setNullBackground(c);
+ }
+ }
+ }
+
+ protected abstract Composite createToolTipArea(Event event, Composite parent);
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java
new file mode 100644
index 0000000..20c9cf3
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/PlatformUiUtil.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ * David Green - fix for bug 247182
+ * Frank Becker - fixes for bug 259877
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.widgets.Display;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Version;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class PlatformUiUtil {
+
+ private static Boolean internalBrowserAvailable;
+
+ private static class Eclipse36Checker {
+ public static final boolean result;
+ static {
+ boolean methodAvailable = false;
+ try {
+ StyledText.class.getMethod("setTabStops", int[].class); //$NON-NLS-1$
+ methodAvailable = true;
+ } catch (NoSuchMethodException e) {
+ }
+ result = methodAvailable;
+ }
+ }
+
+ /**
+ * bug 247182: file import dialog doesn't work on Mac OS X if the file extension has more than one dot.
+ */
+ public static String[] getFilterExtensions(String... extensions) {
+ for (int i = 0; i < extensions.length; i++) {
+ String extension = extensions[i];
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ int j = extension.lastIndexOf('.');
+ if (j != -1) {
+ extension = extension.substring(j);
+ }
+ }
+ extensions[i] = "*" + extension; //$NON-NLS-1$
+ }
+ return extensions;
+ }
+
+ public static int getToolTipXShift() {
+ if ("gtk".equals(SWT.getPlatform()) || "carbon".equals(SWT.getPlatform()) || "cocoa".equals(SWT.getPlatform())) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return -26;
+ } else {
+ return -23;
+ }
+ }
+
+ public static int getTreeImageOffset() {
+ if ("carbon".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ return 16;
+ } else if ("cocoa".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ return 13;
+ } else {
+ return 20;
+ }
+ }
+
+ public static int getIncomingImageOffset() {
+ if ("carbon".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ return 5;
+ } else if ("cocoa".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ return 2;
+ } else {
+ return 6;
+ }
+ }
+
+ public static int getTreeItemSquish() {
+ if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ return 8;
+ } else if (isMac()) {
+ return 3;
+ } else {
+ return 0;
+ }
+ }
+
+ private static boolean isMac() {
+ return "carbon".equals(SWT.getPlatform()) || "cocoa".equals(SWT.getPlatform()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // TODO e3.5: remove, platform has been fixed, see bug 272046
+ public static boolean isPaintItemClippingRequired() {
+ return "gtk".equals(SWT.getPlatform()); //$NON-NLS-1$
+ }
+
+ public static boolean spinnerHasNativeBorder() {
+ return isMac() && !isEclipse36orLater();
+ }
+
+ private static boolean isEclipse36orLater() {
+ return Eclipse36Checker.result;
+ }
+
+ public static boolean hasNarrowToolBar() {
+ return Platform.WS_WIN32.equals(SWT.getPlatform());
+ }
+
+ /**
+ * If a a section does not use a toolbar as its text client the spacing between the section header and client will
+ * be different from other sections. This method returns the value to set as the vertical spacing on those sections
+ * to align the vertical position of section clients.
+ *
+ * @return value for {@link org.eclipse.ui.forms.widgets.Section#clientVerticalSpacing}
+ */
+ public static int getToolbarSectionClientVerticalSpacing() {
+ if (Platform.WS_WIN32.equals(SWT.getPlatform())) {
+ return 5;
+ }
+ return 7;
+ }
+
+ /**
+ * Returns the width of the view menu drop-down button.
+ */
+ public static int getViewMenuWidth() {
+ return 32;
+ }
+
+ /**
+ * Because of bug# 322293 (NPE when select Hyperlink from MultipleHyperlinkPresenter List) for MacOS we enable this
+ * only if running on Eclipse >= "3.7.0.v201101192000"
+ */
+ public static boolean supportsMultipleHyperlinkPresenter() {
+ if (isMac()) {
+ Bundle bundle = Platform.getBundle("org.eclipse.platform"); //$NON-NLS-1$
+ if (bundle != null) {
+ String versionString = (String) bundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
+ Version version = new Version(versionString);
+ return version.compareTo(new Version("3.7.0.v201101192000")) >= 0; //$NON-NLS-1$
+ } else {
+ bundle = Platform.getBundle("org.eclipse.swt"); //$NON-NLS-1$
+ if (bundle != null) {
+ String versionString = (String) bundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
+ Version version = new Version(versionString);
+ return version.compareTo(new Version("3.7.0.v3721")) >= 0; //$NON-NLS-1$
+ } else {
+ //TODO e3.7 change this to true when eclipse 3.6 reach end of live!
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Because of bug#175655: [context] provide an on-hover affordance to supplement Alt+click navigation Tooltips will
+ * show everyone on Linux unless they are balloons.
+ */
+ public static int getSwtTooltipStyle() {
+ if ("gtk".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ return SWT.BALLOON;
+ }
+ return SWT.NONE;
+ }
+
+ public static boolean usesMouseWheelEventsForScrolling() {
+ return "cocoa".equals(SWT.getPlatform()); //$NON-NLS-1$
+ }
+
+ public static boolean hasInternalBrowser() {
+ if (internalBrowserAvailable == null) {
+ try {
+ Browser browser = new Browser(Display.getCurrent().getActiveShell(), SWT.NONE);
+ browser.dispose();
+ internalBrowserAvailable = Boolean.TRUE;
+ } catch (SWTError er) {
+ internalBrowserAvailable = Boolean.FALSE;
+ }
+ }
+ return internalBrowserAvailable.booleanValue();
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ProgressContainer.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ProgressContainer.java
new file mode 100644
index 0000000..31c7e3e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/ProgressContainer.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Chris Gross (schtoo@schtoo.com) - patch for bug 16179
+ * Tasktop Technologies - extracted code for Mylyn
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ProgressMonitorWrapper;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.operation.ModalContext;
+import org.eclipse.jface.wizard.ProgressMonitorPart;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A helper class for running operations in dialogs. Based on {@link WizardDialog}.
+ *
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class ProgressContainer implements IRunnableContext {
+
+ private static final String FOCUS_CONTROL = "focusControl"; //$NON-NLS-1$
+
+ // The number of long running operation executed from the dialog.
+ private long activeRunningOperations = 0;
+
+ private Cursor arrowCursor;
+
+ private Button cancelButton;
+
+ private boolean lockedUI = false;
+
+ // The progress monitor
+ private final ProgressMonitorPart progressMonitorPart;
+
+ private final Shell shell;
+
+ private Cursor waitCursor;
+
+ private boolean useWaitCursor;
+
+ public ProgressContainer(Shell shell, ProgressMonitorPart progressMonitorPart) {
+ Assert.isNotNull(shell);
+ Assert.isNotNull(progressMonitorPart);
+ this.shell = shell;
+ this.progressMonitorPart = progressMonitorPart;
+ init();
+ }
+
+ private void init() {
+ this.shell.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ progressMonitorPart.setCanceled(true);
+ }
+ });
+ }
+
+ public boolean useWaitCursor() {
+ return useWaitCursor;
+ }
+
+ public void setUseWaitCursor(boolean useWaitCursor) {
+ this.useWaitCursor = useWaitCursor;
+ }
+
+ /**
+ * About to start a long running operation triggered through the wizard. Shows the progress monitor and disables the
+ * wizard's buttons and controls.
+ *
+ * @param enableCancelButton
+ * <code>true</code> if the Cancel button should be enabled, and <code>false</code> if it should be
+ * disabled
+ * @return the saved UI state
+ */
+ private Object aboutToStart(boolean enableCancelButton) {
+ Map<Object, Object> savedState = null;
+ if (getShell() != null) {
+ // Save focus control
+ Control focusControl = getShell().getDisplay().getFocusControl();
+ if (focusControl != null && focusControl.getShell() != getShell()) {
+ focusControl = null;
+ }
+ // Set the busy cursor to all shells.
+ Display d = getShell().getDisplay();
+ if (useWaitCursor()) {
+ waitCursor = new Cursor(d, SWT.CURSOR_WAIT);
+ setDisplayCursor(waitCursor);
+ // Set the arrow cursor to the cancel component.
+ arrowCursor = new Cursor(d, SWT.CURSOR_ARROW);
+ if (cancelButton != null) {
+ cancelButton.setCursor(arrowCursor);
+ }
+ }
+ // Deactivate shell
+ savedState = new HashMap<Object, Object>(10);
+ saveUiState(savedState);
+ if (focusControl != null) {
+ savedState.put(FOCUS_CONTROL, focusControl);
+ }
+ // Attach the progress monitor part to the cancel button
+ if (cancelButton != null) {
+ progressMonitorPart.attachToCancelComponent(cancelButton);
+ }
+ progressMonitorPart.setVisible(true);
+ }
+ return savedState;
+ }
+
+ public Button getCancelButton() {
+ return cancelButton;
+ }
+
+ private IProgressMonitor getProgressMonitor() {
+ return new ProgressMonitorWrapper(progressMonitorPart) {
+ @Override
+ public void internalWorked(double work) {
+ if (progressMonitorPart.isDisposed()) {
+ this.setCanceled(true);
+ return;
+ }
+ super.internalWorked(work);
+ }
+ };
+ }
+
+ public Shell getShell() {
+ return shell;
+ }
+
+ public boolean isActive() {
+ return activeRunningOperations > 0;
+ }
+
+ public boolean isLockedUI() {
+ return lockedUI;
+ }
+
+ protected void restoreUiState(Map<Object, Object> state) {
+ // ignore
+
+ }
+
+ /**
+ * This implementation of IRunnableContext#run(boolean, boolean, IRunnableWithProgress) blocks until the runnable
+ * has been run, regardless of the value of <code>fork</code>. It is recommended that <code>fork</code> is set to
+ * true in most cases. If <code>fork</code> is set to <code>false</code>, the runnable will run in the UI thread and
+ * it is the runnable's responsibility to call <code>Display.readAndDispatch()</code> to ensure UI responsiveness.
+ * UI state is saved prior to executing the long-running operation and is restored after the long-running operation
+ * completes executing. Any attempt to change the UI state of the wizard in the long-running operation will be
+ * nullified when original UI state is restored.
+ */
+ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException,
+ InterruptedException {
+ // The operation can only be canceled if it is executed in a separate
+ // thread.
+ // Otherwise the UI is blocked anyway.
+ Object state = null;
+ if (activeRunningOperations == 0) {
+ state = aboutToStart(fork && cancelable);
+ }
+ activeRunningOperations++;
+ try {
+ if (!fork) {
+ lockedUI = true;
+ }
+ ModalContext.run(runnable, fork, getProgressMonitor(), getShell().getDisplay());
+ lockedUI = false;
+ } finally {
+ activeRunningOperations--;
+ // Stop if this is the last one
+ if (state != null) {
+ stopped(state);
+ }
+ }
+ }
+
+ protected void saveUiState(Map<Object, Object> savedState) {
+ // ignore
+
+ }
+
+ public void setCancelButton(Button cancelButton) {
+ this.cancelButton = cancelButton;
+ }
+
+ /**
+ * Sets the given cursor for all shells currently active for this window's display.
+ *
+ * @param c
+ * the cursor
+ */
+ private void setDisplayCursor(Cursor c) {
+ Shell[] shells = getShell().getDisplay().getShells();
+ for (Shell shell2 : shells) {
+ shell2.setCursor(c);
+ }
+ }
+
+ /**
+ * A long running operation triggered through the wizard was stopped either by user input or by normal end. Hides
+ * the progress monitor and restores the enable state wizard's buttons and controls.
+ *
+ * @param savedState
+ * the saved UI state as returned by <code>aboutToStart</code>
+ * @see #aboutToStart
+ */
+ @SuppressWarnings("unchecked")
+ private void stopped(Object savedState) {
+ if (getShell() != null && !getShell().isDisposed()) {
+ progressMonitorPart.setVisible(false);
+ if (cancelButton != null) {
+ progressMonitorPart.removeFromCancelComponent(cancelButton);
+ }
+
+ Map<Object, Object> state = (Map<Object, Object>) savedState;
+ restoreUiState(state);
+ if (waitCursor != null) {
+ setDisplayCursor(null);
+ if (cancelButton != null) {
+ cancelButton.setCursor(null);
+ }
+ waitCursor.dispose();
+ waitCursor = null;
+ arrowCursor.dispose();
+ arrowCursor = null;
+ }
+ Control focusControl = (Control) state.get(FOCUS_CONTROL);
+ if (focusControl != null && !focusControl.isDisposed()) {
+ focusControl.setFocus();
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/SelectionProviderAdapter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/SelectionProviderAdapter.java
new file mode 100644
index 0000000..9d76f51
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/SelectionProviderAdapter.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.core.commands.common.EventManager;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+
+/**
+ * Provides an simple implementation of {@link ISelectionProvider} that propagates selection events to registered
+ * listeners.
+ *
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class SelectionProviderAdapter extends EventManager implements ISelectionProvider, ISelectionChangedListener {
+
+ private ISelection selection;
+
+ /**
+ * Constructs a <code>SelectionProviderAdapter</code> and initializes the selection to <code>selection</code>.
+ *
+ * @param selection
+ * the initial selection
+ * @see #setSelection(ISelection)
+ */
+ public SelectionProviderAdapter(ISelection selection) {
+ setSelection(selection);
+ }
+
+ /**
+ * Constructs a <code>SelectionProviderAdapter</code> with a <code>null</code> selection.
+ */
+ public SelectionProviderAdapter() {
+ }
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ addListenerObject(listener);
+ }
+
+ public ISelection getSelection() {
+ return selection;
+ }
+
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ removeListenerObject(listener);
+ }
+
+ public void selectionChanged(final SelectionChangedEvent event) {
+ this.selection = event.getSelection();
+ Object[] listeners = getListeners();
+ for (Object listener2 : listeners) {
+ final ISelectionChangedListener listener = (ISelectionChangedListener) listener2;
+ SafeRunner.run(new SafeRunnable() {
+ public void run() {
+ listener.selectionChanged(event);
+ }
+ });
+ }
+ }
+
+ public void setSelection(ISelection selection) {
+ selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableSorter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableSorter.java
new file mode 100644
index 0000000..eb02fe5
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableSorter.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.widgets.TableColumn;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public abstract class TableSorter extends AbstractColumnViewerSorter<TableViewer, TableColumn> {
+
+ @Override
+ int getColumnIndex(TableViewer viewer, TableColumn column) {
+ return viewer.getTable().indexOf(column);
+ }
+
+ @Override
+ TableColumn getSortColumn(TableViewer viewer) {
+ return viewer.getTable().getSortColumn();
+ }
+
+ @Override
+ int getSortDirection(TableViewer viewer) {
+ return viewer.getTable().getSortDirection();
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableViewerSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableViewerSupport.java
new file mode 100644
index 0000000..0668a4f
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TableViewerSupport.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ * Tasktop Technologies - improvements
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.io.File;
+
+import org.eclipse.jface.layout.AbstractColumnLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+
+/**
+ * @author Frank Becker
+ * @author Steffen Pingel
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public class TableViewerSupport extends AbstractColumnViewerSupport<TableColumn> {
+
+ private final Table table;
+
+ public TableViewerSupport(TableViewer viewer, File stateFile) {
+ super(viewer, stateFile);
+ this.table = viewer.getTable();
+ initializeViewerSupport();
+ }
+
+ public TableViewerSupport(TableViewer viewer, File stateFile, boolean[] defaultVisibilities) {
+ super(viewer, stateFile, defaultVisibilities);
+ this.table = viewer.getTable();
+ initializeViewerSupport();
+ }
+
+ @Override
+ void addColumnSelectionListener(TableColumn column, SelectionListener selectionListener) {
+ column.addSelectionListener(selectionListener);
+ }
+
+ @Override
+ Rectangle getClientArea() {
+ return table.getClientArea();
+ }
+
+ @Override
+ TableColumn getColumn(int index) {
+ return table.getColumn(index);
+ }
+
+ @Override
+ int getColumnIndexOf(TableColumn column) {
+ return table.indexOf(column);
+ }
+
+ @Override
+ AbstractColumnLayout getColumnLayout() {
+ if (table.getLayout() instanceof AbstractColumnLayout) {
+ return (AbstractColumnLayout) table.getLayout();
+ } else if (table.getParent().getLayout() instanceof AbstractColumnLayout) {
+ return (AbstractColumnLayout) table.getParent().getLayout();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ int[] getColumnOrder() {
+ return table.getColumnOrder();
+ }
+
+ @Override
+ TableColumn[] getColumns() {
+ return table.getColumns();
+ }
+
+ @Override
+ int getColumnWidth(TableColumn column) {
+ return column.getWidth();
+ }
+
+ @Override
+ int getHeaderHeight() {
+ return table.getHeaderHeight();
+ }
+
+ @Override
+ TableColumn getSortColumn() {
+ return table.getSortColumn();
+ }
+
+ @Override
+ int getSortDirection() {
+ return table.getSortDirection();
+ }
+
+ @Override
+ void setColumnOrder(int[] order) {
+ table.setColumnOrder(order);
+ }
+
+ @Override
+ void setColumnResizable(TableColumn column, boolean resizable) {
+ column.setResizable(resizable);
+ }
+
+ @Override
+ void setColumnWidth(TableColumn column, int width) {
+ column.setWidth(width);
+ }
+
+ @Override
+ void setSortColumn(TableColumn column) {
+ table.setSortColumn(column);
+ }
+
+ @Override
+ void setSortDirection(int direction) {
+ table.setSortDirection(direction);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeSorter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeSorter.java
new file mode 100644
index 0000000..98e82ba
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeSorter.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.TreeColumn;
+
+/**
+ * @author Shawn Minto
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public abstract class TreeSorter extends AbstractColumnViewerSorter<TreeViewer, TreeColumn> {
+
+ @Override
+ int getColumnIndex(TreeViewer viewer, TreeColumn column) {
+ return viewer.getTree().indexOf(column);
+ }
+
+ @Override
+ TreeColumn getSortColumn(TreeViewer viewer) {
+ return viewer.getTree().getSortColumn();
+ }
+
+ @Override
+ protected int getSortDirection(TreeViewer viewer) {
+ return viewer.getTree().getSortDirection();
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeViewerSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeViewerSupport.java
new file mode 100644
index 0000000..aaa83c1
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/TreeViewerSupport.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui;
+
+import java.io.File;
+
+import org.eclipse.jface.layout.AbstractColumnLayout;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+/**
+ * @author Shawn Minto
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class TreeViewerSupport extends AbstractColumnViewerSupport<TreeColumn> {
+
+ private final Tree tree;
+
+ public TreeViewerSupport(TreeViewer viewer, File stateFile) {
+ super(viewer, stateFile);
+ this.tree = viewer.getTree();
+ initializeViewerSupport();
+ }
+
+ public TreeViewerSupport(TreeViewer viewer, File stateFile, boolean[] defaultVisibilities) {
+ super(viewer, stateFile, defaultVisibilities);
+ this.tree = viewer.getTree();
+ initializeViewerSupport();
+ }
+
+ @Override
+ void addColumnSelectionListener(TreeColumn column, SelectionListener selectionListener) {
+ column.addSelectionListener(selectionListener);
+ }
+
+ @Override
+ Rectangle getClientArea() {
+ return tree.getClientArea();
+ }
+
+ @Override
+ TreeColumn getColumn(int index) {
+ return tree.getColumn(index);
+ }
+
+ @Override
+ int getColumnIndexOf(TreeColumn column) {
+ return tree.indexOf(column);
+ }
+
+ @Override
+ AbstractColumnLayout getColumnLayout() {
+ if (tree.getLayout() instanceof AbstractColumnLayout) {
+ return (AbstractColumnLayout) tree.getLayout();
+ } else if (tree.getParent().getLayout() instanceof AbstractColumnLayout) {
+ return (AbstractColumnLayout) tree.getParent().getLayout();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ int[] getColumnOrder() {
+ return tree.getColumnOrder();
+ }
+
+ @Override
+ TreeColumn[] getColumns() {
+ return tree.getColumns();
+ }
+
+ @Override
+ int getColumnWidth(TreeColumn column) {
+ return column.getWidth();
+ }
+
+ @Override
+ int getHeaderHeight() {
+ return tree.getHeaderHeight();
+ }
+
+ @Override
+ TreeColumn getSortColumn() {
+ return tree.getSortColumn();
+ }
+
+ @Override
+ int getSortDirection() {
+ return tree.getSortDirection();
+ }
+
+ @Override
+ void setColumnOrder(int[] order) {
+ tree.setColumnOrder(order);
+ }
+
+ @Override
+ void setColumnResizable(TreeColumn column, boolean resizable) {
+ column.setResizable(resizable);
+ }
+
+ @Override
+ void setColumnWidth(TreeColumn column, int width) {
+ column.setWidth(width);
+ }
+
+ @Override
+ void setSortColumn(TreeColumn column) {
+ tree.setSortColumn(column);
+ }
+
+ @Override
+ void setSortDirection(int direction) {
+ tree.setSortDirection(direction);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/CollapseAllAction.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/CollapseAllAction.java
new file mode 100644
index 0000000..33ccad8
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/CollapseAllAction.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.actions;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class CollapseAllAction extends Action {
+
+ private final AbstractTreeViewer viewer;
+
+ public CollapseAllAction(AbstractTreeViewer viewer) {
+ Assert.isNotNull(viewer);
+ this.viewer = viewer;
+ setText(Messages.CollapseAllAction_Label);
+ setToolTipText(Messages.CollapseAllAction_ToolTip);
+ setImageDescriptor(CommonImages.COLLAPSE_ALL);
+ }
+
+ @Override
+ public void run() {
+ viewer.collapseAll();
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/ExpandAllAction.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/ExpandAllAction.java
new file mode 100644
index 0000000..bde9a57
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/actions/ExpandAllAction.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.actions;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class ExpandAllAction extends Action {
+
+ private final AbstractTreeViewer viewer;
+
+ public ExpandAllAction(AbstractTreeViewer viewer) {
+ Assert.isNotNull(viewer);
+ this.viewer = viewer;
+ setText(Messages.ExpandAllAction_Label);
+ setToolTipText(Messages.ExpandAllAction_ToolTip);
+ setImageDescriptor(CommonImages.EXPAND_ALL);
+ }
+
+ @Override
+ public void run() {
+ viewer.expandAll();
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonColors.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonColors.java
new file mode 100644
index 0000000..5d2de94
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonColors.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.compatibility;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Provides common colors. Class must be referenced from the SWT UI thread only.
+ * <p>
+ * NOTE: Use of this class is discouraged. Colors are not theme dependent.
+ * </p>
+ *
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public class CommonColors {
+
+ public static final Color HYPERLINK_WIDGET = new Color(Display.getDefault(), 12, 81, 172);
+
+ public static final Color TEXT_QUOTED = new Color(Display.getDefault(), 38, 86, 145);
+
+ /**
+ * NOTE: disposal of JFaceResources fonts handled by registry.
+ */
+ public static void dispose() {
+ HYPERLINK_WIDGET.dispose();
+ TEXT_QUOTED.dispose();
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonFonts.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonFonts.java
new file mode 100644
index 0000000..b069d7f
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonFonts.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.compatibility;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.jface.resource.FontRegistry;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Provides commons fonts. Fields may by <code>null</code> until initialization is completed.
+ * <p>
+ * NOTE: Use of this class is discouraged. Fonts are static and not updated when system or theme settings change.
+ * </p>
+ *
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public class CommonFonts {
+
+ public static Font BOLD;
+
+ public static Font ITALIC;
+
+ public static Font BOLD_ITALIC;
+
+ public static Font STRIKETHROUGH = null;
+
+ public static boolean HAS_STRIKETHROUGH;
+
+ static {
+ if (Display.getCurrent() != null) {
+ init();
+ } else {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ init();
+ }
+ });
+ }
+ }
+
+ private static void init() {
+ BOLD = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
+ ITALIC = JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);
+ BOLD_ITALIC = new Font(Display.getCurrent(), getModifiedFontData(ITALIC.getFontData(), SWT.BOLD | SWT.ITALIC));
+
+ Font defaultFont = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
+ FontData[] defaultData = defaultFont.getFontData();
+ if (defaultData != null && defaultData.length == 1) {
+ FontData data = new FontData(defaultData[0].getName(), defaultData[0].getHeight(),
+ defaultData[0].getStyle());
+
+ if ("win32".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ // NOTE: Windows only, for: data.data.lfStrikeOut = 1;
+ try {
+ Field dataField = data.getClass().getDeclaredField("data"); //$NON-NLS-1$
+ Object dataObject = dataField.get(data);
+ Class<?> clazz = dataObject.getClass().getSuperclass();
+ Field strikeOutFiled = clazz.getDeclaredField("lfStrikeOut"); //$NON-NLS-1$
+ strikeOutFiled.set(dataObject, (byte) 1);
+ CommonFonts.STRIKETHROUGH = new Font(Display.getCurrent(), data);
+ } catch (Throwable t) {
+ // ignore
+ }
+ }
+ }
+ if (CommonFonts.STRIKETHROUGH == null) {
+ CommonFonts.HAS_STRIKETHROUGH = false;
+ CommonFonts.STRIKETHROUGH = defaultFont;
+ } else {
+ CommonFonts.HAS_STRIKETHROUGH = true;
+ }
+ }
+
+ /**
+ * NOTE: disposal of JFaceResources fonts handled by registry.
+ */
+ public static void dispose() {
+ if (CommonFonts.STRIKETHROUGH != null && !CommonFonts.STRIKETHROUGH.isDisposed()) {
+ CommonFonts.STRIKETHROUGH.dispose();
+ CommonFonts.BOLD_ITALIC.dispose();
+ }
+ }
+
+ /**
+ * Copied from {@link FontRegistry}
+ */
+ private static FontData[] getModifiedFontData(FontData[] baseData, int style) {
+ FontData[] styleData = new FontData[baseData.length];
+ for (int i = 0; i < styleData.length; i++) {
+ FontData base = baseData[i];
+ styleData[i] = new FontData(base.getName(), base.getHeight(), base.getStyle() | style);
+ }
+
+ return styleData;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonThemes.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonThemes.java
new file mode 100644
index 0000000..d71889b
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/compatibility/CommonThemes.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.compatibility;
+
+/**
+ * Provides common theme constants.
+ * <p>
+ * NOTE: Use of this class is discouraged. The specified theme settings depend on components in Mylyn Tasks and may not
+ * be available.
+ * </p>
+ *
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public class CommonThemes {
+
+ public static final String COLOR_INCOMING_BACKGROUND = "org.eclipse.mylyn.tasks.ui.colors.incoming.background"; //$NON-NLS-1$
+
+ public static final String COLOR_SCHEDULED_PAST = "org.eclipse.mylyn.tasks.ui.colors.foreground.past.scheduled"; //$NON-NLS-1$
+
+ public static final String COLOR_OVERDUE = "org.eclipse.mylyn.tasks.ui.colors.foreground.past.due"; //$NON-NLS-1$
+
+ public static final String COLOR_SCHEDULED_THIS_WEEK = "org.eclipse.mylyn.tasks.ui.colors.foreground.thisweek.scheduled"; //$NON-NLS-1$
+
+ public static final String COLOR_COMPLETED = "org.eclipse.mylyn.tasks.ui.colors.foreground.completed"; //$NON-NLS-1$
+
+ public static final String COLOR_SCHEDULED_TODAY = "org.eclipse.mylyn.tasks.ui.colors.foreground.today.scheduled"; //$NON-NLS-1$
+
+ public static final String COLOR_COMPLETED_TODAY = "org.eclipse.mylyn.tasks.ui.colors.foreground.today.completed"; //$NON-NLS-1$
+
+ public static final String COLOR_OVERDUE_FOR_OTHERS = "org.eclipse.mylyn.tasks.ui.colors.foreground.overdue.for.others"; //$NON-NLS-1$
+
+ public static final String COLOR_CATEGORY_GRADIENT_START = "org.eclipse.mylyn.tasks.ui.colors.category.gradient.start"; //$NON-NLS-1$
+
+ public static final String COLOR_CATEGORY_GRADIENT_END = "org.eclipse.mylyn.tasks.ui.colors.category.gradient.end"; //$NON-NLS-1$
+
+ public static final String COLOR_CATEGORY = COLOR_CATEGORY_GRADIENT_END;
+
+ public static final String FONT_EDITOR_COMMENT = "org.eclipse.mylyn.tasks.ui.fonts.task.editor.comment"; //$NON-NLS-1$
+
+ public static final String COLOR_TASK_ACTIVE = "org.eclipse.mylyn.tasks.ui.colors.foreground.task.active"; //$NON-NLS-1$
+
+ public static boolean isCommonTheme(String property) {
+ if (property == null) {
+ return false;
+ } else {
+ return property.equals(COLOR_CATEGORY) || property.equals(COLOR_OVERDUE)
+ || property.equals(COLOR_SCHEDULED_PAST) || property.equals(COLOR_COMPLETED_TODAY)
+ || property.equals(COLOR_SCHEDULED_TODAY) || property.equals(COLOR_SCHEDULED_THIS_WEEK)
+ || property.equals(COLOR_INCOMING_BACKGROUND) || property.equals(COLOR_CATEGORY_GRADIENT_START)
+ || property.equals(COLOR_CATEGORY_GRADIENT_END) || property.equals(COLOR_TASK_ACTIVE);
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractInPlaceDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractInPlaceDialog.java
new file mode 100644
index 0000000..f51612f
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractInPlaceDialog.java
@@ -0,0 +1,311 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.ISafeRunnable;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.window.Window;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Abstract class for an in-place popup dialog that has a cancel button and sends and ok event when the dialog is closed
+ *
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public abstract class AbstractInPlaceDialog extends PopupDialog {
+
+ public static final int ID_CLEAR = IDialogConstants.CLIENT_ID + 1;
+
+ protected static final int MARGIN_SIZE = 3;
+
+ private final int side;
+
+ private final Rectangle controlBounds;
+
+ private Control control;
+
+ private final Set<IInPlaceDialogListener> listeners = new HashSet<IInPlaceDialogListener>();
+
+ private final Control openControl;
+
+ DisposeListener disposeListener = new DisposeListener() {
+
+ public void widgetDisposed(DisposeEvent e) {
+ dispose();
+ }
+ };
+
+ public AbstractInPlaceDialog(Shell parent, int side, Control openControl) {
+ super(parent, PopupDialog.INFOPOPUP_SHELLSTYLE, false, false, false, false, false, null, null);
+ this.side = side;
+ this.openControl = openControl;
+
+ Rectangle bounds;
+ if (openControl == null || openControl.isDisposed()) {
+ bounds = new Rectangle(0, 0, 0, 0);
+ } else {
+ bounds = openControl.getBounds();
+ Point absPosition = openControl.toDisplay(openControl.getLocation());
+ bounds.x = absPosition.x - bounds.x;
+ bounds.y = absPosition.y - bounds.y;
+ }
+ this.controlBounds = bounds;
+ if (openControl != null) {
+ openControl.addDisposeListener(disposeListener);
+ }
+
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ return createDialogArea(parent);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ gl.horizontalSpacing = 0;
+ gl.verticalSpacing = 0;
+ gl.numColumns = 1;
+ composite.setLayout(gl);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
+
+ this.control = createControl(composite);
+
+ Composite buttonComposite = new Composite(parent, SWT.NONE);
+ gl = new GridLayout();
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ gl.marginBottom = MARGIN_SIZE;
+ gl.marginRight = MARGIN_SIZE;
+ gl.horizontalSpacing = 10;
+ gl.verticalSpacing = 0;
+ gl.numColumns = 1;
+ gl.makeColumnsEqualWidth = false;
+ buttonComposite.setLayout(gl);
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.END, SWT.CENTER).applyTo(buttonComposite);
+ createButtons(buttonComposite);
+ Dialog.applyDialogFont(parent);
+
+ parent.pack();
+
+ setBackgroundColor(parent);
+
+ return parent;
+ }
+
+ private void setBackgroundColor(Composite parent) {
+ parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+ for (Control control : parent.getChildren()) {
+ if (control instanceof Composite) {
+ setBackgroundColor((Composite) control);
+ } else {
+ control.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+ }
+ }
+ }
+
+ protected abstract Control createControl(Composite composite);
+
+ protected void createButtons(Composite composite) {
+ createButton(composite, ID_CLEAR, Messages.DateSelectionDialog_Clear, true);
+ }
+
+ protected void dispose() {
+ setReturnCode(Window.CANCEL);
+ close();
+ }
+
+ protected Control createButton(Composite composite, final int returnCode, String text, final boolean shouldClose) {
+ Button button = new Button(composite, SWT.NONE);
+ button.setText(text);
+ button.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ setReturnCode(returnCode);
+ if (shouldClose) {
+ close();
+ } else {
+ notifyButtonPressed(false);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+
+ if (composite.getLayout() instanceof GridLayout) {
+ ((GridLayout) composite.getLayout()).numColumns = composite.getChildren().length;
+ }
+ GridDataFactory.fillDefaults().applyTo(button);
+ return button;
+ }
+
+ @Override
+ public int open() {
+ int result = super.open();
+ getControl().setFocus();
+ setReturnCode(-1);
+ return result;
+ }
+
+ @Override
+ public boolean close() {
+ if (getReturnCode() == -1) {
+ setReturnCode(Window.OK);
+ }
+ notifyButtonPressed(true);
+ if (openControl != null && !openControl.isDisposed()) {
+ openControl.removeDisposeListener(disposeListener);
+ }
+ return super.close();
+ }
+
+ public void addEventListener(IInPlaceDialogListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeCloseListener(IInPlaceDialogListener listener) {
+ listeners.remove(listener);
+ }
+
+ private void notifyButtonPressed(boolean isClosing) {
+ final InPlaceDialogEvent event = new InPlaceDialogEvent(getReturnCode(), isClosing);
+ for (final IInPlaceDialogListener listener : listeners) {
+ SafeRunnable.run(new ISafeRunnable() {
+ public void run() throws Exception {
+ listener.buttonPressed(event);
+ }
+
+ public void handleException(Throwable exception) {
+ // ignore
+ }
+ });
+ }
+ }
+
+ @Override
+ protected void initializeBounds() {
+// Rectangle monitorBounds = PlatformUI.getWorkbench()
+// .getActiveWorkbenchWindow()
+// .getShell()
+// .getMonitor()
+// .getClientArea();
+ Rectangle monitorBounds = getShell().getMonitor().getClientArea();
+ Rectangle bounds = getShell().getBounds();
+ int x = 0;
+ int y = 0;
+
+ switch (side) {
+ case SWT.TOP:
+ x = controlBounds.x;
+ y = controlBounds.y + controlBounds.height;
+ if (x + bounds.width > monitorBounds.x + monitorBounds.width) {
+ x = (controlBounds.x + controlBounds.width) - bounds.width;
+ }
+ break;
+ case SWT.BOTTOM:
+ x = controlBounds.x;
+ y = controlBounds.y - bounds.height;
+ if (x + bounds.width > monitorBounds.x + monitorBounds.width) {
+ x = (controlBounds.x + controlBounds.width) - bounds.width;
+ }
+ break;
+ case SWT.RIGHT:
+ x = (controlBounds.x + controlBounds.width) - bounds.width;
+ y = controlBounds.y + controlBounds.height;
+ break;
+ case SWT.LEFT:
+ x = controlBounds.x;
+ y = controlBounds.y + controlBounds.height;
+ break;
+ }
+ getShell().setBounds(x, y, bounds.width, bounds.height);
+ }
+
+ @Override
+ protected void adjustBounds() {
+ Point tipSize = getShell().getSize();
+ Point location = getShell().getLocation();
+
+ Rectangle bounds;
+ Point rightBounds = new Point(tipSize.x + location.x, tipSize.y + location.y);
+
+ Monitor[] ms = getShell().getDisplay().getMonitors();
+
+ if (ms.length > 1) {
+ bounds = controlBounds;
+ Point p = new Point(location.x, location.y);
+
+ Rectangle tmp;
+ for (Monitor element : ms) {
+ tmp = element.getBounds();
+ if (tmp.contains(p)) {
+ bounds = tmp;
+ break;
+ }
+ }
+
+ } else {
+ bounds = getControl().getDisplay().getBounds();
+ }
+
+ if (!(bounds.contains(location) && bounds.contains(rightBounds))) {
+ if (rightBounds.x > bounds.x + bounds.width) {
+ location.x -= rightBounds.x - (bounds.x + bounds.width);
+ }
+
+ if (rightBounds.y > bounds.y + bounds.height) {
+ location.y -= rightBounds.y - (bounds.y + bounds.height);
+ }
+
+ if (location.x < bounds.x) {
+ location.x = bounds.x;
+ }
+
+ if (location.y < bounds.y) {
+ location.y = bounds.y;
+ }
+ }
+
+ getShell().setLocation(location);
+ }
+
+ public Control getControl() {
+ return control;
+ }
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractNotificationPopup.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractNotificationPopup.java
new file mode 100644
index 0000000..3c3427b
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/AbstractNotificationPopup.java
@@ -0,0 +1,584 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Benjamin Pasero - initial API and implementation
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.jface.window.Window;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.commons.ui.CommonUiUtil;
+import org.eclipse.mylyn.commons.ui.GradientColors;
+import org.eclipse.mylyn.commons.ui.compatibility.CommonFonts;
+import org.eclipse.mylyn.internal.commons.ui.AnimationUtil;
+import org.eclipse.mylyn.internal.commons.ui.AnimationUtil.FadeJob;
+import org.eclipse.mylyn.internal.commons.ui.AnimationUtil.IFadeListener;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A popup window with a title bar and message area for displaying notifications.
+ *
+ * @author Benjamin Pasero
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public abstract class AbstractNotificationPopup extends Window {
+
+ private static final int TITLE_HEIGHT = 24;
+
+ private static final String LABEL_NOTIFICATION = Messages.AbstractNotificationPopup_Notification;
+
+ private static final String LABEL_JOB_CLOSE = Messages.AbstractNotificationPopup_Close_Notification_Job;
+
+ private static final int MAX_WIDTH = 400;
+
+ private static final int MIN_HEIGHT = 100;
+
+ private static final long DEFAULT_DELAY_CLOSE = 8 * 1000;
+
+ private static final int PADDING_EDGE = 5;
+
+ private long delayClose = DEFAULT_DELAY_CLOSE;
+
+ protected LocalResourceManager resources;
+
+ private GradientColors color;
+
+ private final Display display;
+
+ private Shell shell;
+
+ private Region lastUsedRegion;
+
+ private Image lastUsedBgImage;
+
+ private final Job closeJob = new Job(LABEL_JOB_CLOSE) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (!display.isDisposed()) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ Shell shell = AbstractNotificationPopup.this.getShell();
+ if (shell == null || shell.isDisposed()) {
+ return;
+ }
+
+ if (isMouseOver(shell)) {
+ scheduleAutoClose();
+ return;
+ }
+
+ AbstractNotificationPopup.this.closeFade();
+ }
+
+ });
+ }
+ if (monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ }
+
+ return Status.OK_STATUS;
+ }
+ };
+
+ private final boolean respectDisplayBounds = true;
+
+ private final boolean respectMonitorBounds = true;
+
+ private FadeJob fadeJob;
+
+ private boolean fadingEnabled;
+
+ public AbstractNotificationPopup(Display display) {
+ this(display, SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
+ }
+
+ public AbstractNotificationPopup(Display display, int style) {
+ super(new Shell(display));
+ setShellStyle(style);
+
+ this.display = display;
+ resources = new LocalResourceManager(JFaceResources.getResources());
+ initResources();
+
+ closeJob.setSystem(true);
+ }
+
+ public boolean isFadingEnabled() {
+ return fadingEnabled;
+ }
+
+ public void setFadingEnabled(boolean fadingEnabled) {
+ this.fadingEnabled = fadingEnabled;
+ }
+
+ /**
+ * Override to return a customized name. Default is to return the name of the product, specified by the -name (e.g.
+ * "Eclipse SDK") command line parameter that's associated with the product ID (e.g. "org.eclipse.sdk.ide"). Strips
+ * the trailing "SDK" for any name, since this part of the label is considered visual noise.
+ *
+ * @return the name to be used in the title of the popup.
+ */
+ protected String getPopupShellTitle() {
+ String productName = CommonUiUtil.getProductName();
+ if (productName != null) {
+ return productName + " " + LABEL_NOTIFICATION; //$NON-NLS-1$
+ } else {
+ return LABEL_NOTIFICATION;
+ }
+ }
+
+ protected Image getPopupShellImage(int maximumHeight) {
+ return null;
+ }
+
+ /**
+ * Override to populate with notifications.
+ *
+ * @param parent
+ */
+ protected void createContentArea(Composite parent) {
+ // empty by default
+ }
+
+ /**
+ * Override to customize the title bar
+ */
+ protected void createTitleArea(Composite parent) {
+ ((GridData) parent.getLayoutData()).heightHint = TITLE_HEIGHT;
+
+ Label titleImageLabel = new Label(parent, SWT.NONE);
+ titleImageLabel.setImage(getPopupShellImage(TITLE_HEIGHT));
+
+ Label titleTextLabel = new Label(parent, SWT.NONE);
+ titleTextLabel.setText(getPopupShellTitle());
+ titleTextLabel.setFont(CommonFonts.BOLD);
+ titleTextLabel.setForeground(getTitleForeground());
+// titleTextLabel.setForeground(color.getTitleText());
+ titleTextLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+ titleTextLabel.setCursor(parent.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
+
+ final Label button = new Label(parent, SWT.NONE);
+ button.setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CLOSE));
+ button.addMouseTrackListener(new MouseTrackAdapter() {
+ @Override
+ public void mouseEnter(MouseEvent e) {
+ button.setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CLOSE_HOVER));
+ }
+
+ @Override
+ public void mouseExit(MouseEvent e) {
+ button.setImage(CommonImages.getImage(CommonImages.NOTIFICATION_CLOSE));
+ }
+ });
+ button.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ close();
+ setReturnCode(CANCEL);
+ }
+
+ });
+ }
+
+ protected Color getTitleForeground() {
+ return color.getTitleText();
+ }
+
+ private void initResources() {
+ color = new GradientColors(display, resources);
+ }
+
+ @Override
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+
+ shell = newShell;
+ newShell.setBackground(color.getBorder());
+ }
+
+ @Override
+ public void create() {
+ super.create();
+ addRegion(shell);
+ }
+
+ private void addRegion(Shell shell) {
+ Region region = new Region();
+ Point s = shell.getSize();
+
+ /* Add entire Shell */
+ region.add(0, 0, s.x, s.y);
+
+ /* Subtract Top-Left Corner */
+ region.subtract(0, 0, 5, 1);
+ region.subtract(0, 1, 3, 1);
+ region.subtract(0, 2, 2, 1);
+ region.subtract(0, 3, 1, 1);
+ region.subtract(0, 4, 1, 1);
+
+ /* Subtract Top-Right Corner */
+ region.subtract(s.x - 5, 0, 5, 1);
+ region.subtract(s.x - 3, 1, 3, 1);
+ region.subtract(s.x - 2, 2, 2, 1);
+ region.subtract(s.x - 1, 3, 1, 1);
+ region.subtract(s.x - 1, 4, 1, 1);
+
+ /* Subtract Bottom-Left Corner */
+ region.subtract(0, s.y, 5, 1);
+ region.subtract(0, s.y - 1, 3, 1);
+ region.subtract(0, s.y - 2, 2, 1);
+ region.subtract(0, s.y - 3, 1, 1);
+ region.subtract(0, s.y - 4, 1, 1);
+
+ /* Subtract Bottom-Right Corner */
+ region.subtract(s.x - 5, s.y - 0, 5, 1);
+ region.subtract(s.x - 3, s.y - 1, 3, 1);
+ region.subtract(s.x - 2, s.y - 2, 2, 1);
+ region.subtract(s.x - 1, s.y - 3, 1, 1);
+ region.subtract(s.x - 1, s.y - 4, 1, 1);
+
+ /* Dispose old first */
+ if (shell.getRegion() != null) {
+ shell.getRegion().dispose();
+ }
+
+ /* Apply Region */
+ shell.setRegion(region);
+
+ /* Remember to dispose later */
+ lastUsedRegion = region;
+ }
+
+ private boolean isMouseOver(Shell shell) {
+ if (display.isDisposed()) {
+ return false;
+ }
+ return shell.getBounds().contains(display.getCursorLocation());
+ }
+
+ @Override
+ public int open() {
+ if (shell == null || shell.isDisposed()) {
+ shell = null;
+ create();
+ }
+
+ constrainShellSize();
+ shell.setLocation(fixupDisplayBounds(shell.getSize(), shell.getLocation()));
+
+ if (isFadingEnabled()) {
+ shell.setAlpha(0);
+ }
+ shell.setVisible(true);
+ fadeJob = AnimationUtil.fadeIn(shell, new IFadeListener() {
+ public void faded(Shell shell, int alpha) {
+ if (shell.isDisposed()) {
+ return;
+ }
+
+ if (alpha == 255) {
+ scheduleAutoClose();
+ }
+ }
+ });
+
+ return Window.OK;
+ }
+
+ protected void scheduleAutoClose() {
+ if (delayClose > 0) {
+ closeJob.schedule(delayClose);
+ }
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ ((GridLayout) parent.getLayout()).marginWidth = 1;
+ ((GridLayout) parent.getLayout()).marginHeight = 1;
+
+ /* Outer Composite holding the controls */
+ final Composite outerCircle = new Composite(parent, SWT.NO_FOCUS);
+ outerCircle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ outerCircle.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ outerCircle.addControlListener(new ControlAdapter() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ Rectangle clArea = outerCircle.getClientArea();
+ lastUsedBgImage = new Image(outerCircle.getDisplay(), clArea.width, clArea.height);
+ GC gc = new GC(lastUsedBgImage);
+
+ /* Gradient */
+ drawGradient(gc, clArea);
+
+ /* Fix Region Shape */
+ fixRegion(gc, clArea);
+
+ gc.dispose();
+
+ Image oldBGImage = outerCircle.getBackgroundImage();
+ outerCircle.setBackgroundImage(lastUsedBgImage);
+
+ if (oldBGImage != null) {
+ oldBGImage.dispose();
+ }
+ }
+
+ private void drawGradient(GC gc, Rectangle clArea) {
+ gc.setForeground(color.getGradientBegin());
+ gc.setBackground(color.getGradientEnd());
+ gc.fillGradientRectangle(clArea.x, clArea.y, clArea.width, clArea.height, true);
+ }
+
+ private void fixRegion(GC gc, Rectangle clArea) {
+ gc.setForeground(color.getBorder());
+
+ /* Fill Top Left */
+ gc.drawPoint(2, 0);
+ gc.drawPoint(3, 0);
+ gc.drawPoint(1, 1);
+ gc.drawPoint(0, 2);
+ gc.drawPoint(0, 3);
+
+ /* Fill Top Right */
+ gc.drawPoint(clArea.width - 4, 0);
+ gc.drawPoint(clArea.width - 3, 0);
+ gc.drawPoint(clArea.width - 2, 1);
+ gc.drawPoint(clArea.width - 1, 2);
+ gc.drawPoint(clArea.width - 1, 3);
+
+ /* Fill Bottom Left */
+ gc.drawPoint(2, clArea.height - 0);
+ gc.drawPoint(3, clArea.height - 0);
+ gc.drawPoint(1, clArea.height - 1);
+ gc.drawPoint(0, clArea.height - 2);
+ gc.drawPoint(0, clArea.height - 3);
+
+ /* Fill Bottom Right */
+ gc.drawPoint(clArea.width - 4, clArea.height - 0);
+ gc.drawPoint(clArea.width - 3, clArea.height - 0);
+ gc.drawPoint(clArea.width - 2, clArea.height - 1);
+ gc.drawPoint(clArea.width - 1, clArea.height - 2);
+ gc.drawPoint(clArea.width - 1, clArea.height - 3);
+ }
+ });
+
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.verticalSpacing = 0;
+
+ outerCircle.setLayout(layout);
+
+ /* Title area containing label and close button */
+ final Composite titleCircle = new Composite(outerCircle, SWT.NO_FOCUS);
+ titleCircle.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ titleCircle.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ layout = new GridLayout(4, false);
+ layout.marginWidth = 3;
+ layout.marginHeight = 0;
+ layout.verticalSpacing = 5;
+ layout.horizontalSpacing = 3;
+
+ titleCircle.setLayout(layout);
+
+ /* Create Title Area */
+ createTitleArea(titleCircle);
+
+ /* Outer composite to hold content controlls */
+ Composite outerContentCircle = new Composite(outerCircle, SWT.NONE);
+ outerContentCircle.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+
+ outerContentCircle.setLayout(layout);
+ outerContentCircle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ outerContentCircle.setBackground(outerCircle.getBackground());
+
+ /* Middle composite to show a 1px black line around the content controls */
+ Composite middleContentCircle = new Composite(outerContentCircle, SWT.NO_FOCUS);
+ middleContentCircle.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.marginTop = 1;
+
+ middleContentCircle.setLayout(layout);
+ middleContentCircle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ middleContentCircle.setBackground(color.getBorder());
+
+ /* Inner composite containing the content controls */
+ Composite innerContent = new Composite(middleContentCircle, SWT.NO_FOCUS);
+ innerContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ innerContent.setBackgroundMode(SWT.INHERIT_FORCE);
+
+ layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 5;
+ layout.marginLeft = 5;
+ layout.marginRight = 5;
+ innerContent.setLayout(layout);
+
+ innerContent.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+
+ /* Content Area */
+ createContentArea(innerContent);
+
+ setNullBackground(outerCircle);
+
+ return outerCircle;
+ }
+
+ private void setNullBackground(final Composite outerCircle) {
+ for (Control c : outerCircle.getChildren()) {
+ c.setBackground(null);
+ if (c instanceof Composite) {
+ setNullBackground((Composite) c);
+ }
+ }
+ }
+
+ @Override
+ protected void initializeBounds() {
+ Rectangle clArea = getPrimaryClientArea();
+ Point initialSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int height = Math.max(initialSize.y, MIN_HEIGHT);
+ int width = Math.min(initialSize.x, MAX_WIDTH);
+
+ Point size = new Point(width, height);
+ shell.setLocation(clArea.width + clArea.x - size.x - PADDING_EDGE, clArea.height + clArea.y - size.y
+ - PADDING_EDGE);
+ shell.setSize(size);
+ }
+
+ private Rectangle getPrimaryClientArea() {
+ Monitor primaryMonitor = shell.getDisplay().getPrimaryMonitor();
+ return (primaryMonitor != null) ? primaryMonitor.getClientArea() : shell.getDisplay().getClientArea();
+ }
+
+ public void closeFade() {
+ if (fadeJob != null) {
+ fadeJob.cancelAndWait(false);
+ }
+ fadeJob = AnimationUtil.fadeOut(getShell(), new IFadeListener() {
+ public void faded(Shell shell, int alpha) {
+ if (!shell.isDisposed()) {
+ if (alpha == 0) {
+ shell.close();
+ } else if (isMouseOver(shell)) {
+ if (fadeJob != null) {
+ fadeJob.cancelAndWait(false);
+ }
+ fadeJob = AnimationUtil.fastFadeIn(shell, new IFadeListener() {
+ public void faded(Shell shell, int alpha) {
+ if (shell.isDisposed()) {
+ return;
+ }
+
+ if (alpha == 255) {
+ scheduleAutoClose();
+ }
+ }
+ });
+ }
+ }
+ }
+ });
+ }
+
+ @Override
+ public boolean close() {
+ resources.dispose();
+ if (lastUsedRegion != null) {
+ lastUsedRegion.dispose();
+ }
+ if (lastUsedBgImage != null && !lastUsedBgImage.isDisposed()) {
+ lastUsedBgImage.dispose();
+ }
+ return super.close();
+ }
+
+ public long getDelayClose() {
+ return delayClose;
+ }
+
+ public void setDelayClose(long delayClose) {
+ this.delayClose = delayClose;
+ }
+
+ private Point fixupDisplayBounds(Point tipSize, Point location) {
+ if (respectDisplayBounds) {
+ Rectangle bounds;
+ Point rightBounds = new Point(tipSize.x + location.x, tipSize.y + location.y);
+
+ if (respectMonitorBounds) {
+ bounds = shell.getDisplay().getPrimaryMonitor().getBounds();
+ } else {
+ bounds = getPrimaryClientArea();
+ }
+
+ if (!(bounds.contains(location) && bounds.contains(rightBounds))) {
+ if (rightBounds.x > bounds.x + bounds.width) {
+ location.x -= rightBounds.x - (bounds.x + bounds.width);
+ }
+
+ if (rightBounds.y > bounds.y + bounds.height) {
+ location.y -= rightBounds.y - (bounds.y + bounds.height);
+ }
+
+ if (location.x < bounds.x) {
+ location.x = bounds.x;
+ }
+
+ if (location.y < bounds.y) {
+ location.y = bounds.y;
+ }
+ }
+ }
+
+ return location;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/EnhancedWizardDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/EnhancedWizardDialog.java
new file mode 100644
index 0000000..fedd5a9
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/EnhancedWizardDialog.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Frank Becker and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Frank Becker - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Wizard dialog for displaying additional button in the button bar. Based on ValidatableWizardDialog from Helen
+ * Bershadskaya
+ *
+ * @author Helen Bershadskaya
+ * @author Frank Becker
+ * @since 3.7
+ */
+public abstract class EnhancedWizardDialog extends WizardDialog {
+
+ public EnhancedWizardDialog(Shell parentShell, IWizard newWizard) {
+ super(parentShell, newWizard);
+ }
+
+ abstract protected void createExtraButtons(Composite composite);
+
+ abstract protected void updateExtraButtons();
+
+ abstract protected boolean handleExtraButtonPressed(int buttonId);
+
+ abstract protected HashMap<String, Boolean> saveAndSetEnabledStateMylyn();
+
+ abstract protected void restoreEnabledStateMylyn(HashMap<String, Boolean> savedEnabledState);
+
+ /**
+ * Overridden so we can add a validate button to the wizard button bar, if a repository settings page requires it.
+ * Validate button is added left justified at button bar bottom (next to help image).
+ */
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 0; // create
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // create help control if needed
+ if (isHelpAvailable()) {
+ createHelpControl(composite);
+ }
+
+ createExtraButtons(composite);
+ Label filler = new Label(composite, SWT.NONE);
+ filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
+ ((GridLayout) composite.getLayout()).numColumns++;
+
+ super.createButtonsForButtonBar(composite);
+
+ return composite;
+ }
+
+ /**
+ * Overridden so we can react to the validate button being pressed. This could have been done with a straight
+ * selection listener in the creation method above, but this is more consistent with how the other buttons work in
+ * the wizard dialog.
+ *
+ * @since 3.1
+ */
+ @Override
+ protected void buttonPressed(int buttonId) {
+ if (!handleExtraButtonPressed(buttonId)) {
+ super.buttonPressed(buttonId);
+ }
+ }
+
+ @Override
+ public void updateButtons() {
+ updateExtraButtons();
+ super.updateButtons();
+ }
+
+ /**
+ * Overridden to be able to set proper state for our validate button
+ */
+ @Override
+ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException,
+ InterruptedException {
+
+ HashMap<String, Boolean> savedEnabledState = null;
+ try {
+ savedEnabledState = saveAndSetEnabledStateMylyn();
+ super.run(fork, cancelable, runnable);
+ } finally {
+ if (savedEnabledState != null) {
+ restoreEnabledStateMylyn(savedEnabledState);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IInPlaceDialogListener.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IInPlaceDialogListener.java
new file mode 100644
index 0000000..624ac8e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IInPlaceDialogListener.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+/**
+ * Listener interface for close events from an {@link AbstractInPlaceDialog}
+ *
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public interface IInPlaceDialogListener {
+
+ public void buttonPressed(InPlaceDialogEvent event);
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IValidatable.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IValidatable.java
new file mode 100644
index 0000000..a0a28d2
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/IValidatable.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public interface IValidatable {
+
+ public boolean canValidate();
+
+ public boolean needsValidation();
+
+ public void validate();
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/InPlaceDialogEvent.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/InPlaceDialogEvent.java
new file mode 100644
index 0000000..1e6ec23
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/InPlaceDialogEvent.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+/**
+ * Event sent with an {@link IInPlaceDialogListener} that contains information about the close event that occurred
+ *
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public class InPlaceDialogEvent {
+
+ private final int returnCode;
+
+ private final boolean isClosing;
+
+ public InPlaceDialogEvent(int returnCode, boolean isClosing) {
+ this.returnCode = returnCode;
+ this.isClosing = isClosing;
+ }
+
+ public boolean isClosing() {
+ return isClosing;
+ }
+
+ public int getReturnCode() {
+ return returnCode;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/ValidatableWizardDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/ValidatableWizardDialog.java
new file mode 100644
index 0000000..4003b78
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/dialogs/ValidatableWizardDialog.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Helen Bershadskaya and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Helen Bershadskaya - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.dialogs;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Wizard dialog for displaying repository settings page. Necessary so we can add a validate button in the button bar.
+ *
+ * @author Helen Bershadskaya
+ * @since 3.7
+ */
+public class ValidatableWizardDialog extends EnhancedWizardDialog {
+
+ private static final String VALIDATE_BUTTON_KEY = "validate"; //$NON-NLS-1$
+
+ private Button validateServerButton;
+
+ private static final int VALIDATE_BUTTON_ID = 2000;
+
+ /**
+ * @see WizardDialog#WizardDialog(Shell, IWizard)
+ */
+ public ValidatableWizardDialog(Shell parentShell, IWizard newWizard) {
+ super(parentShell, newWizard);
+ setHelpAvailable(false);
+ }
+
+ @Override
+ protected void createExtraButtons(Composite composite) {
+ validateServerButton = createButton(composite, VALIDATE_BUTTON_ID,
+ Messages.ValidatableWizardDialog_Validate_Button_Label, false);
+ validateServerButton.setImage(CommonImages.getImage(CommonImages.VALIDATE));
+ validateServerButton.setVisible(false);
+ setButtonLayoutData(validateServerButton);
+ }
+
+ @Override
+ public void updateExtraButtons() {
+ IValidatable validatable = getValidatablePage();
+ if (validatable != null && validatable.needsValidation()) {
+ if (!validateServerButton.isVisible()) {
+ validateServerButton.setVisible(true);
+ }
+ validateServerButton.setEnabled(validatable.canValidate());
+ } else {
+ if (validateServerButton != null && validateServerButton.isVisible()) {
+ validateServerButton.setVisible(false);
+ }
+ }
+ }
+
+ private IValidatable getValidatablePage() {
+ IValidatable validatable = null;
+ IWizardPage currentPage = getCurrentPage();
+ if (currentPage instanceof IValidatable) {
+ validatable = (IValidatable) currentPage;
+ } else if (currentPage instanceof IAdaptable) {
+ validatable = (IValidatable) ((IAdaptable) currentPage).getAdapter(IValidatable.class);
+ }
+ return validatable;
+ }
+
+ @Override
+ protected boolean handleExtraButtonPressed(int buttonId) {
+ if (buttonId == VALIDATE_BUTTON_ID) {
+ IValidatable validatable = getValidatablePage();
+ if (validatable != null) {
+ validatable.validate();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Modeled after WizardDialog.saveAndSetEnabledState(), but that one is private, so create our own
+ */
+ @Override
+ protected HashMap<String, Boolean> saveAndSetEnabledStateMylyn() {
+ HashMap<String, Boolean> savedEnabledState = null;
+ if (getShell() != null) {
+ savedEnabledState = new HashMap<String, Boolean>();
+ if (validateServerButton != null && validateServerButton.getShell() == getShell()) {
+ savedEnabledState.put(VALIDATE_BUTTON_KEY, validateServerButton.getEnabled());
+ validateServerButton.setEnabled(false);
+ }
+ }
+ return savedEnabledState;
+ }
+
+ /**
+ * Modeled after WizardDialog.restoreEnabledState() and WizardDialog.restoreUIState() -- couldn't override those
+ * since they are private, so create our own. Currently only single button to work with, so don't create two
+ * separate methods
+ */
+ @Override
+ protected void restoreEnabledStateMylyn(HashMap<String, Boolean> savedEnabledState) {
+ if (savedEnabledState != null) {
+ Boolean savedValidateEnabledState = savedEnabledState.get(VALIDATE_BUTTON_KEY);
+ if (validateServerButton != null && savedValidateEnabledState != null) {
+ validateServerButton.setEnabled(savedValidateEnabledState);
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage.java
new file mode 100644
index 0000000..51b40f5
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/commons/ui/wizard/ScreenshotCreationPage.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Balazs Brinkus and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Balazs Brinkus - initial API and implementation
+ * Tasktop Technologies - improvements
+ * Willian Mitsuda - improvements
+ * Hiroyuki Inaba - improvements
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.ui.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.mylyn.commons.ui.screenshots.ScreenshotViewer;
+import org.eclipse.mylyn.internal.commons.ui.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * A wizard page to create a screenshot from the display.
+ * <p>
+ * NOTE: this class exposes a lot of implementation detail and is likely to change.
+ *
+ * @author Balazs Brinkus
+ * @author Willian Mitsuda
+ * @author Mik Kersten
+ * @author Hiroyuki Inaba
+ * @author Benjamin Muskalla
+ * @since 3.7
+ */
+public class ScreenshotCreationPage extends WizardPage {
+
+ private ScreenshotViewer viewer;
+
+ public ScreenshotCreationPage() {
+ super("ScreenShotAttachment"); //$NON-NLS-1$
+ setTitle(Messages.ScreenshotCreationPage_CAPTURE_SCRRENSHOT);
+ setDescription(Messages.ScreenshotCreationPage_After_capturing
+ + Messages.ScreenshotCreationPage_NOTE_THAT_YOU_CONTINUTE);
+ }
+
+ public void createControl(Composite parent) {
+ viewer = new ScreenshotViewer(parent, SWT.BORDER | SWT.FLAT) {
+ @Override
+ protected void stateChanged() {
+ getContainer().updateButtons();
+ }
+ };
+ viewer.setDialogSettings(getDialogSettings());
+ setControl(viewer.getControl());
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ return (viewer != null) && viewer.isComplete();
+ }
+
+ public boolean isImageDirty() {
+ return viewer.isDirty();
+ }
+
+ public Image createImage() {
+ // NOTE: may get invoked from non UI thread
+ return viewer.createImage();
+ }
+
+ public void setImageDirty(boolean imageDirty) {
+ viewer.setDirty(imageDirty);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/AnimationUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/AnimationUtil.java
new file mode 100644
index 0000000..63248be
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/AnimationUtil.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.commons.ui;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ */
+public class AnimationUtil {
+
+ public static final long FADE_RESCHEDULE_DELAY = 80;
+
+ public static final int FADE_IN_INCREMENT = 15;
+
+ public static final int FADE_OUT_INCREMENT = -20;
+
+ public static FadeJob fastFadeIn(Shell shell, IFadeListener listener) {
+ return new FadeJob(shell, 2 * FADE_IN_INCREMENT, FADE_RESCHEDULE_DELAY, listener);
+ }
+
+ public static FadeJob fadeIn(Shell shell, IFadeListener listener) {
+ return new FadeJob(shell, FADE_IN_INCREMENT, FADE_RESCHEDULE_DELAY, listener);
+ }
+
+ public static FadeJob fadeOut(Shell shell, IFadeListener listener) {
+ return new FadeJob(shell, FADE_OUT_INCREMENT, FADE_RESCHEDULE_DELAY, listener);
+ }
+
+ public static class FadeJob extends Job {
+
+ private final Shell shell;
+
+ private final int increment;
+
+ private volatile boolean stopped;
+
+ private volatile int currentAlpha;
+
+ private final long delay;
+
+ private final IFadeListener fadeListener;
+
+ public FadeJob(Shell shell, int increment, long delay, IFadeListener fadeListener) {
+ super(Messages.SwtUtil_Fading);
+ if (increment < -255 || increment == 0 || increment > 255) {
+ throw new IllegalArgumentException("-255 <= increment <= 255 && increment != 0"); //$NON-NLS-1$
+ }
+ if (delay < 1) {
+ throw new IllegalArgumentException("delay must be > 0"); //$NON-NLS-1$
+ }
+ this.currentAlpha = shell.getAlpha();
+ this.shell = shell;
+ this.increment = increment;
+ this.delay = delay;
+ this.fadeListener = fadeListener;
+
+ setSystem(true);
+ schedule(delay);
+ }
+
+ @Override
+ protected void canceling() {
+ stopped = true;
+ }
+
+ private void reschedule() {
+ if (stopped) {
+ return;
+ }
+ schedule(delay);
+ }
+
+ public void cancelAndWait(final boolean setAlpha) {
+ if (stopped) {
+ return;
+ }
+ cancel();
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ if (setAlpha) {
+ shell.setAlpha(getLastAlpha());
+ }
+ }
+ });
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ if (stopped) {
+ return Status.OK_STATUS;
+ }
+
+ currentAlpha += increment;
+ if (currentAlpha <= 0) {
+ currentAlpha = 0;
+ } else if (currentAlpha >= 255) {
+ currentAlpha = 255;
+ }
+
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ if (stopped) {
+ return;
+ }
+
+ if (shell.isDisposed()) {
+ stopped = true;
+ return;
+ }
+
+ shell.setAlpha(currentAlpha);
+
+ if (fadeListener != null) {
+ fadeListener.faded(shell, currentAlpha);
+ }
+ }
+ });
+
+ if (currentAlpha == 0 || currentAlpha == 255) {
+ stopped = true;
+ }
+
+ reschedule();
+ return Status.OK_STATUS;
+ }
+
+ private int getLastAlpha() {
+ return (increment < 0) ? 0 : 255;
+ }
+
+ }
+
+ public static interface IFadeListener {
+
+ public void faded(Shell shell, int alpha);
+
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorCanvas.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorCanvas.java
index de996b0..ab86dbd 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorCanvas.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorCanvas.java
@@ -19,13 +19,16 @@ import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Composite;
/**
* A tiny control just for color display
*
* @author Willian Mitsuda
+ * @deprecated use {@link ColorDialog} instead
*/
+@Deprecated
public class ColorCanvas extends Canvas {
private final Color color;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorSelectionWindow.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorSelectionWindow.java
index 66d0981..d4940b3 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorSelectionWindow.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ColorSelectionWindow.java
@@ -24,6 +24,7 @@ import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
@@ -32,8 +33,8 @@ import org.eclipse.swt.widgets.Shell;
* Popup window for color selection
*
* @author Willian Mitsuda
+ * @deprecated use {@link ColorDialog} instead
*/
-// FIXME 3.5 remove this class
@Deprecated
public class ColorSelectionWindow extends Window {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiConstants.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiConstants.java
new file mode 100644
index 0000000..857964b
--- /dev/null
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiConstants.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.commons.ui;
+
+/**
+ * @author Steffen Pingel
+ */
+public class CommonsUiConstants {
+
+ public static final String ID_PLUGIN = "org.eclipse.mylyn.commons.ui"; //$NON-NLS-1$
+
+}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiPlugin.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiPlugin.java
index 966681c..2013826 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiPlugin.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CommonsUiPlugin.java
@@ -19,7 +19,9 @@ import org.osgi.framework.BundleContext;
/**
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link CommonsUiConstants} instead
*/
+@Deprecated
public class CommonsUiPlugin extends AbstractUIPlugin {
public static final String ID_PLUGIN = "org.eclipse.mylyn.commons.ui"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CompositeSyncImageDescriptor.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CompositeSyncImageDescriptor.java
index 93c1716..0bcc42d 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CompositeSyncImageDescriptor.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/CompositeSyncImageDescriptor.java
@@ -13,7 +13,7 @@ package org.eclipse.mylyn.internal.commons.ui;
import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
+import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListItem.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListItem.java
index 4f21d32..528402f 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListItem.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListItem.java
@@ -21,13 +21,15 @@ import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.swt.widgets.Display;
/**
- * Based on {@link org.eclipse.ui.internal.progress.ProgressInfoItem}.
+ * Based on <code>org.eclipse.ui.internal.progress.ProgressInfoItem</code>.
*
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.ControlListItem} instead
*/
+@Deprecated
public abstract class ControlListItem extends Composite {
static String DARK_COLOR_KEY = "org.eclipse.mylyn.commons.ui.ControlListItem.DARK_COLOR"; //$NON-NLS-1$
@@ -71,7 +73,7 @@ public abstract class ControlListItem extends Composite {
// Mac has different Gamma value
int shift = "carbon".equals(SWT.getPlatform()) ? -25 : -10;//$NON-NLS-1$
- Color lightColor = PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+ Color lightColor = Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
// Determine a dark color by shifting the list color
RGB darkRGB = new RGB(Math.max(0, lightColor.getRed() + shift), Math.max(0, lightColor.getGreen() + shift),
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListViewer.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListViewer.java
index ac7f697..888fab5 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListViewer.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/ControlListViewer.java
@@ -41,7 +41,9 @@ import org.eclipse.swt.widgets.Widget;
* Based on {@link org.eclipse.ui.internal.progress.DetailedProgressViewer}.
*
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.ControlListViewer} instead
*/
+@Deprecated
@SuppressWarnings("restriction")
public abstract class ControlListViewer extends StructuredViewer {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/Messages.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/Messages.java
index 3205703..13e081a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/Messages.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/Messages.java
@@ -57,4 +57,24 @@ public class Messages extends NLS {
public static String ScreenshotCreationPage_NOTE_THAT_YOU_CONTINUTE;
+ public static String AbstractColumnViewerSupport_Restore_defaults;
+
+ public static String DatePickerPanel_Today;
+
+ public static String TextControl_FindToolTip;
+
+ public static String TextControl_AccessibleListenerFindButton;
+
+ public static String CollapseAllAction_Label;
+
+ public static String CollapseAllAction_ToolTip;
+
+ public static String ExpandAllAction_Label;
+
+ public static String ExpandAllAction_ToolTip;
+
+ public static String PropertiesAction_Properties;
+
+ public static String ValidatableWizardDialog_Validate_Button_Label;
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/NotificationPopupColors.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/NotificationPopupColors.java
index ef62382..cf3f579 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/NotificationPopupColors.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/NotificationPopupColors.java
@@ -14,21 +14,20 @@ package org.eclipse.mylyn.internal.commons.ui;
import org.eclipse.jface.resource.DeviceResourceException;
import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup;
+import org.eclipse.mylyn.commons.ui.GradientColors;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
/**
- * Helper Class to create the colors for the {@link AbstractNotificationPopup}.
- * <p>
- * Note: Copied from FormColors of UI Forms.
- * </p>
+ * Based on FormColors of UI Forms.
*
* @author Benjamin Pasero (initial contribution from RSSOwl, see bug 177974)
* @author Mik Kersten
+ * @deprecated use {@link GradientColors} instead
*/
+@Deprecated
public class NotificationPopupColors {
private final Display display;
@@ -186,4 +185,5 @@ public class NotificationPopupColors {
return manager.getDevice().getSystemColor(SWT.COLOR_BLACK);
}
}
+
} \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SectionComposite.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SectionComposite.java
index 39729bc..a8e4d1c 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SectionComposite.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SectionComposite.java
@@ -31,12 +31,14 @@ import org.eclipse.ui.forms.widgets.SharedScrolledComposite;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.SectionComposite} instead
*/
+@Deprecated
public class SectionComposite extends SharedScrolledComposite {
- FormToolkit toolkit;
+ private FormToolkit toolkit;
- public Composite content;
+ private final Composite content;
public SectionComposite(Composite parent, int style) {
super(parent, style | SWT.V_SCROLL);
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SwtUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SwtUtil.java
index 797b3e6..6b5dbdc 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SwtUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/SwtUtil.java
@@ -24,7 +24,9 @@ import org.eclipse.swt.widgets.TreeItem;
/**
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link AnimationUtil} instead
*/
+@Deprecated
public class SwtUtil {
public static final long FADE_RESCHEDULE_DELAY = 80;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/TaskBarManager.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/TaskBarManager.java
index eb50665..17832dd 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/TaskBarManager.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/TaskBarManager.java
@@ -25,7 +25,9 @@ import org.eclipse.ui.PlatformUI;
/**
* @author Shawn Minto
+ * @deprecated use {@link org.eclipse.mylyn.commons.workbench.TaskBarManager} instead
*/
+@Deprecated
public class TaskBarManager {
private static final String TASK_BAR_MENU_MANAGER_KEY = "org.eclipse.mylyn.commons.TaskBarMenuManager.instance"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/WindowUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/WindowUtil.java
index 6742b55..524fed4 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/WindowUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/WindowUtil.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2011 Frank Becker and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Frank Becker - initial API and implementation
+ * IBM Corporation - initial API and implementation
+ * Frank Becker - fixes for Mylyn
*******************************************************************************/
package org.eclipse.mylyn.internal.commons.ui;
@@ -19,12 +20,12 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Monitor;
/**
- * This class copies the code from org.eclipse.jface.window because we can not access the protected method
- * getConstrainedShellBounds. getConstrainedShellBounds has now the window as the first parameter.
+ * Based on {@link org.eclipse.jface.window.Window#getConstrainedShellBounds(Rectangle)}.
*
* @author Frank Becker
*/
public class WindowUtil {
+
/**
* Returns the monitor whose client area contains the given point. If no monitor contains the point, returns the
* monitor that is closest to the point. If this is ever made public, it should be moved into a separate utility
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/messages.properties b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/messages.properties
index 731ed70..3a85441 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/messages.properties
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/commons/ui/messages.properties
@@ -31,3 +31,16 @@ DateSelectionDialog_Date_Selection=Date Selection
ScreenshotCreationPage_After_capturing=After capturing, you can crop the image and make drawings on it. This window will not be captured.
ScreenshotCreationPage_CAPTURE_SCRRENSHOT=Capture Screenshot
ScreenshotCreationPage_NOTE_THAT_YOU_CONTINUTE=Note that you can continue to interact with the workbench in order to set up the screenshot.
+
+AbstractColumnViewerSupport_Restore_defaults=Restore Defaults
+DatePickerPanel_Today=Today
+TextControl_FindToolTip=Find
+TextControl_AccessibleListenerFindButton=Find
+
+CollapseAllAction_Label=Collapse All
+CollapseAllAction_ToolTip=Collapse All
+ExpandAllAction_Label=Expand All
+ExpandAllAction_ToolTip=Expand All
+PropertiesAction_Properties=Properties
+
+ValidatableWizardDialog_Validate_Button_Label=&Validate \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSorter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSorter.java
index 50267bc..fbdca8c 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSorter.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSorter.java
@@ -24,9 +24,15 @@ import org.eclipse.swt.widgets.Item;
/**
* @author Shawn Minto
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.AbstractColumnViewerSorter} instead
*/
+@Deprecated
public abstract class AbstractColumnViewerSorter<V extends ColumnViewer, I extends Item> extends ViewerSorter {
+ /**
+ * @deprecated use {@link org.eclipse.mylyn.commons.core.CoreUtil.compare()} instead
+ */
+ @Deprecated
protected <T> int compare(Comparable<T> key1, T key2) {
if (key1 == null) {
return (key2 != null) ? 1 : 0;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSupport.java
index 57942f4..8281221 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSupport.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractColumnViewerSupport.java
@@ -45,7 +45,9 @@ import org.eclipse.ui.XMLMemento;
/**
* @author Shawn Minto
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.AbstractColumnViewerSupport} instead
*/
+@Deprecated
public abstract class AbstractColumnViewerSupport<T extends Item> {
private static class ColumnState {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractFilteredTree.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractFilteredTree.java
index f884fbb..9a068dc 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractFilteredTree.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractFilteredTree.java
@@ -32,7 +32,9 @@ import org.eclipse.ui.progress.WorkbenchJob;
/**
* @author Mik Kersten
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.AbstractFilteredTree} instead
*/
+@Deprecated
public abstract class AbstractFilteredTree extends EnhancedFilteredTree {
private static final int FILTER_WIDTH_MIN = 60;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotification.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotification.java
index acb6e6e..7c9e59a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotification.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotification.java
@@ -19,7 +19,9 @@ import org.eclipse.swt.graphics.Image;
/**
* @author Rob Elves
* @author Mik Kersten
+ * @deprecated use {@link org.eclipse.mylyn.internal.tasks.ui.notifications.notifications.AbstractNotification} instead
*/
+@Deprecated
public abstract class AbstractNotification implements Comparable<AbstractNotification>, IAdaptable {
public abstract void open();
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java
index d767243..986c372 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AbstractNotificationPopup.java
@@ -19,11 +19,11 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.jface.window.Window;
+import org.eclipse.mylyn.commons.ui.GradientColors;
import org.eclipse.mylyn.internal.commons.ui.Messages;
-import org.eclipse.mylyn.internal.commons.ui.NotificationPopupColors;
-import org.eclipse.mylyn.internal.commons.ui.SwtUtil;
-import org.eclipse.mylyn.internal.commons.ui.SwtUtil.FadeJob;
-import org.eclipse.mylyn.internal.commons.ui.SwtUtil.IFadeListener;
+import org.eclipse.mylyn.internal.commons.ui.AnimationUtil;
+import org.eclipse.mylyn.internal.commons.ui.AnimationUtil.FadeJob;
+import org.eclipse.mylyn.internal.commons.ui.AnimationUtil.IFadeListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
@@ -51,7 +51,9 @@ import org.eclipse.ui.PlatformUI;
* @author Benjamin Pasero
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.AbstractNotificationPopup} instead
*/
+@Deprecated
public abstract class AbstractNotificationPopup extends Window {
private static final int TITLE_HEIGHT = 24;
@@ -72,7 +74,7 @@ public abstract class AbstractNotificationPopup extends Window {
protected LocalResourceManager resources;
- private NotificationPopupColors color;
+ private GradientColors color;
private final Display display;
@@ -246,7 +248,7 @@ public abstract class AbstractNotificationPopup extends Window {
}
private void initResources() {
- color = new NotificationPopupColors(display, resources);
+ color = new GradientColors(display, resources);
}
@Override
@@ -331,7 +333,7 @@ public abstract class AbstractNotificationPopup extends Window {
shell.setAlpha(0);
}
shell.setVisible(true);
- fadeJob = SwtUtil.fadeIn(shell, new IFadeListener() {
+ fadeJob = AnimationUtil.fadeIn(shell, new IFadeListener() {
public void faded(Shell shell, int alpha) {
if (shell.isDisposed()) {
return;
@@ -526,7 +528,7 @@ public abstract class AbstractNotificationPopup extends Window {
if (fadeJob != null) {
fadeJob.cancelAndWait(false);
}
- fadeJob = SwtUtil.fadeOut(getShell(), new IFadeListener() {
+ fadeJob = AnimationUtil.fadeOut(getShell(), new IFadeListener() {
public void faded(Shell shell, int alpha) {
if (!shell.isDisposed()) {
if (alpha == 0) {
@@ -535,7 +537,7 @@ public abstract class AbstractNotificationPopup extends Window {
if (fadeJob != null) {
fadeJob.cancelAndWait(false);
}
- fadeJob = SwtUtil.fastFadeIn(shell, new IFadeListener() {
+ fadeJob = AnimationUtil.fastFadeIn(shell, new IFadeListener() {
public void faded(Shell shell, int alpha) {
if (shell.isDisposed()) {
return;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AdaptiveRefreshPolicy.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AdaptiveRefreshPolicy.java
index b421905..2b57ec1 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AdaptiveRefreshPolicy.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/AdaptiveRefreshPolicy.java
@@ -26,7 +26,9 @@ import org.eclipse.ui.progress.WorkbenchJob;
/**
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.AdaptiveRefreshPolicy} instead
*/
+@Deprecated
public class AdaptiveRefreshPolicy {
private int refreshDelay = 1500;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ClipboardCopier.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ClipboardCopier.java
index 52a9e7b..a36d164 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ClipboardCopier.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ClipboardCopier.java
@@ -23,7 +23,9 @@ import org.eclipse.ui.PlatformUI;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.ClipboardCopier} instead
*/
+@Deprecated
public class ClipboardCopier {
public interface TextProvider {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonColors.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonColors.java
index 175b1d3..1e621d4 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonColors.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonColors.java
@@ -16,8 +16,9 @@ import org.eclipse.swt.widgets.Display;
/**
* @author Mik Kersten
- * @since 3.0
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.compatibility.CommonColors} instead
*/
+@Deprecated
public class CommonColors {
public static final Color HYPERLINK_WIDGET = new Color(Display.getDefault(), 12, 81, 172);
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFonts.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFonts.java
index 3638453..213f785 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFonts.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFonts.java
@@ -22,8 +22,9 @@ import org.eclipse.swt.widgets.Display;
/**
* @author Mik Kersten
- * @since 3.0
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.compatibility.CommonFonts} instead
*/
+@Deprecated
public class CommonFonts {
public static Font BOLD;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFormUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFormUtil.java
index dfe129d..a3d6a63 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFormUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonFormUtil.java
@@ -23,7 +23,9 @@ import org.eclipse.ui.internal.forms.widgets.FormUtil;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.CommonFormUtil} instead
*/
+@Deprecated
public class CommonFormUtil {
public static void disableScrollingOnFocus(ScrolledForm form) {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImageManger.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImageManger.java
index 008d747..5dd16e6 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImageManger.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImageManger.java
@@ -25,7 +25,9 @@ import org.eclipse.ui.internal.WorkbenchImages;
/**
* @author Steffen Pingel
* @author Kevin Sawicki
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.CommonImageManger} instead
*/
+@Deprecated
public class CommonImageManger {
private static final String[] IMAGE_EXTENSIONS = { "jpg", "gif", "png", "tiff", "tif", "bmp" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImages.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImages.java
index 7e96e6a..97b286c 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImages.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonImages.java
@@ -25,8 +25,9 @@ import org.eclipse.swt.graphics.Image;
/**
* @author Mik Kersten
- * @since 3.0
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.CommonImages} instead
*/
+@Deprecated
public class CommonImages {
private static final URL baseURL = CommonsUiPlugin.getDefault().getBundle().getEntry("/icons/"); //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonPropertyTester.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonPropertyTester.java
index cfed151..a7737dc 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonPropertyTester.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonPropertyTester.java
@@ -15,9 +15,15 @@ import org.eclipse.core.expressions.PropertyTester;
/**
* @author Steffen Pingel
+ * @deprecated
*/
+@Deprecated
public abstract class CommonPropertyTester extends PropertyTester {
+ /**
+ * @deprecated use {@link org.eclipse.mylyn.commons.core.CoreUtil#equals()} instead
+ */
+ @Deprecated
protected boolean equals(boolean value, Object expectedValue) {
return (expectedValue == null) ? value == true : new Boolean(value).equals(expectedValue);
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonTextSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonTextSupport.java
index 49438b2..af3ab73 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonTextSupport.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonTextSupport.java
@@ -55,7 +55,9 @@ import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
* {@link SourceViewer} controls.
*
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.editors.CommonTextSupport} instead
*/
+@Deprecated
public class CommonTextSupport {
private class UndoRedoListener implements IOperationHistoryListener {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonThemes.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonThemes.java
index 014d625..a1804f8 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonThemes.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonThemes.java
@@ -14,7 +14,9 @@ package org.eclipse.mylyn.internal.provisional.commons.ui;
/**
* @author Mik Kersten
* @since 3.0
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.compatibility.CommonThemes} instead
*/
+@Deprecated
public class CommonThemes {
public static final String COLOR_INCOMING_BACKGROUND = "org.eclipse.mylyn.tasks.ui.colors.incoming.background"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java
index f89e395..acd0ab3 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/CommonUiUtil.java
@@ -34,7 +34,9 @@ import org.eclipse.ui.PlatformUI;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.CommonUiUtil} instead
*/
+@Deprecated
public class CommonUiUtil {
private static final String KEY_ENABLED = "org.eclipse.mylyn.commons.ui.enabled"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePicker.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePicker.java
index 2a73df5..6fe7f3a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePicker.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePicker.java
@@ -48,8 +48,9 @@ import org.eclipse.ui.forms.widgets.ImageHyperlink;
*
* @author Bahadir Yagan
* @author Mik Kersten
- * @since 1.0
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.DatePicker} instead
*/
+@Deprecated
public class DatePicker extends Composite {
public final static String TITLE_DIALOG = Messages.DatePicker_Choose_Date;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePickerPanel.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePickerPanel.java
index 58c9b65..a16286a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePickerPanel.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DatePickerPanel.java
@@ -43,7 +43,9 @@ import org.eclipse.ui.forms.widgets.Hyperlink;
* @author Bahadir Yagan
* @author Mik Kersten
* @author Rob Elves
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.DatePickerPanel} instead
*/
+@Deprecated
public class DatePickerPanel extends Composite implements KeyListener, ISelectionProvider {
private org.eclipse.swt.widgets.List timeList = null;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DateSelectionDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DateSelectionDialog.java
index 7ae3e9d..f3af41a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DateSelectionDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DateSelectionDialog.java
@@ -30,7 +30,9 @@ import org.eclipse.swt.widgets.Shell;
* @author Ken Sueda
* @author Mik Kersten
* @author Rob Elves
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.DateSelectionDialog} instead
*/
+@Deprecated
public class DateSelectionDialog extends Dialog {
private Date selectedDate = null;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DecoratingPatternStyledCellLabelProvider.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DecoratingPatternStyledCellLabelProvider.java
index ca3bdbc..7e33d73 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DecoratingPatternStyledCellLabelProvider.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DecoratingPatternStyledCellLabelProvider.java
@@ -42,7 +42,9 @@ import org.eclipse.ui.internal.misc.StringMatcher.Position;
*
* @author Kevin Sawicki
* @see DecoratingFileSearchLabelProvider
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.DecoratingPatternStyledCellLabelProvider} instead
*/
+@Deprecated
public class DecoratingPatternStyledCellLabelProvider extends DecoratingStyledCellLabelProvider implements
IPropertyChangeListener, ILabelProvider {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DelayedRefreshJob.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DelayedRefreshJob.java
index a637627..6fd7300 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DelayedRefreshJob.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/DelayedRefreshJob.java
@@ -27,7 +27,9 @@ import org.eclipse.ui.progress.WorkbenchJob;
*
* @author Steffen Pingel
* @author Mik Kersten
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.DelayedRefreshJob} instead
*/
+@Deprecated
public abstract class DelayedRefreshJob extends WorkbenchJob {
static final long REFRESH_DELAY_DEFAULT = 200;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/EnhancedFilteredTree.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/EnhancedFilteredTree.java
index 7d790f4..a39595a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/EnhancedFilteredTree.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/EnhancedFilteredTree.java
@@ -31,8 +31,10 @@ import org.eclipse.ui.dialogs.PatternFilter;
* A {@link FilteredTree} that uses the new look on Eclipse 3.5 and later.
*
* @author Hiroyuki Inaba
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.EnhancedFilteredTree} instead
*/
// TODO e3.5 remove this class and replace with FilteredTree
+@Deprecated
public class EnhancedFilteredTree extends FilteredTree {
protected boolean useNewLook;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientCanvas.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientCanvas.java
index 75cfe78..57acad8 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientCanvas.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientCanvas.java
@@ -26,7 +26,10 @@ import org.eclipse.swt.widgets.Listener;
/**
* Based on {@link org.eclipse.ui.internal.forms.widgets.FormHeading}.
+ *
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.GradientCanvas} instead
*/
+@Deprecated
@SuppressWarnings("restriction")
public class GradientCanvas extends Canvas {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientDrawer.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientDrawer.java
index 7c88aad..4ba7178 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientDrawer.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientDrawer.java
@@ -33,7 +33,9 @@ import org.eclipse.ui.themes.IThemeManager;
/**
* @author Mik Kersten
* @author Frank Becker
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.GradientDrawer} instead
*/
+@Deprecated
public abstract class GradientDrawer {
private final Listener CATEGORY_GRADIENT_DRAWER = new Listener() {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientToolTip.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientToolTip.java
index 748f07e..d97b2e7 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientToolTip.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/GradientToolTip.java
@@ -14,7 +14,7 @@ package org.eclipse.mylyn.internal.provisional.commons.ui;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.jface.window.ToolTip;
-import org.eclipse.mylyn.internal.commons.ui.NotificationPopupColors;
+import org.eclipse.mylyn.commons.ui.GradientColors;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridLayout;
@@ -26,11 +26,12 @@ import org.eclipse.swt.widgets.Event;
* A Custom JFace ToolTip that applies a gradient to the contents
*
* @author Shawn Minto
- * @since 3.2
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.GradientToolTip} instead
*/
+@Deprecated
public abstract class GradientToolTip extends ToolTip {
- private NotificationPopupColors colors;
+ private GradientColors colors;
private LocalResourceManager resourceManager;
@@ -46,7 +47,7 @@ public abstract class GradientToolTip extends ToolTip {
private void initResources(Control control) {
resourceManager = new LocalResourceManager(JFaceResources.getResources());
- colors = new NotificationPopupColors(control.getDisplay(), resourceManager);
+ colors = new GradientColors(control.getDisplay(), resourceManager);
}
@Override
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ICoreRunnable.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ICoreRunnable.java
index f67dfda..04e5924 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ICoreRunnable.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ICoreRunnable.java
@@ -15,7 +15,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.core.ICoreRunnable} instead
*/
+@Deprecated
public interface ICoreRunnable {
public void run(IProgressMonitor monitor) throws CoreException;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/IFilteredTreeListener.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/IFilteredTreeListener.java
index 5f17b30..04219e5 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/IFilteredTreeListener.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/IFilteredTreeListener.java
@@ -13,7 +13,9 @@ package org.eclipse.mylyn.internal.provisional.commons.ui;
/**
* @author Mik Kersten
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.IFilteredTreeListener} instead
*/
+@Deprecated
public interface IFilteredTreeListener {
public void filterTextChanged(String text);
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/PlatformUiUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/PlatformUiUtil.java
index 60bdcf3..f0d3d16 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/PlatformUiUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/PlatformUiUtil.java
@@ -24,7 +24,9 @@ import org.osgi.framework.Version;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.PlatformUiUtil} instead
*/
+@Deprecated
public class PlatformUiUtil {
private static Boolean internalBrowserAvailable;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ProgressContainer.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ProgressContainer.java
index 69285e6..13010ce 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ProgressContainer.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ProgressContainer.java
@@ -38,7 +38,9 @@ import org.eclipse.swt.widgets.Shell;
* A helper class for running operations in dialogs. Based on {@link WizardDialog}.
*
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.ProgressContainer} instead
*/
+@Deprecated
public class ProgressContainer implements IRunnableContext {
private static final String FOCUS_CONTROL = "focusControl"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/RichToolTip.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/RichToolTip.java
index 704eab1..db8b430 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/RichToolTip.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/RichToolTip.java
@@ -35,7 +35,9 @@ import org.eclipse.ui.forms.IFormColors;
* @author Eric Booth
* @author Leo Dos Santos
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.RichToolTip} instead
*/
+@Deprecated
public abstract class RichToolTip extends GradientToolTip {
private final static int X_SHIFT = PlatformUiUtil.getToolTipXShift();
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScalingHyperlink.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScalingHyperlink.java
index 303bb94..d1e04e6 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScalingHyperlink.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScalingHyperlink.java
@@ -26,8 +26,9 @@ import org.eclipse.ui.forms.widgets.ImageHyperlink;
*
* @author Leo Dos Santos
* @author Mik Kersten
- * @since 3.0
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.ScalingHyperlink} instead
*/
+@Deprecated
public class ScalingHyperlink extends ImageHyperlink {
private boolean strikeThrough;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScreenshotCreationPage.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScreenshotCreationPage.java
index 62d97a2..24d0d6f 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScreenshotCreationPage.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ScreenshotCreationPage.java
@@ -33,7 +33,9 @@ import org.eclipse.swt.widgets.Composite;
* @author Mik Kersten
* @author Hiroyuki Inaba
* @author Benjamin Muskalla
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.wizard.ScreenshotCreationPage} instead
*/
+@Deprecated
public class ScreenshotCreationPage extends WizardPage {
private static final String DIALOG_SETTINGS = ScreenshotCreationPage.class.getCanonicalName();
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SearchHistoryPopUpDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SearchHistoryPopUpDialog.java
index 75acc29..a9b2d29 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SearchHistoryPopUpDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SearchHistoryPopUpDialog.java
@@ -52,7 +52,9 @@ import org.eclipse.ui.PlatformUI;
/**
* @author Shawn Minto
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.search.SearchHistoryPopupDialog} instead
*/
+@Deprecated
public class SearchHistoryPopUpDialog extends PopupDialog {
private static final int MAX_HISTORY_NO_FILTER = 3;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SelectionProviderAdapter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SelectionProviderAdapter.java
index 76e7f04..c3aa554 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SelectionProviderAdapter.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SelectionProviderAdapter.java
@@ -24,7 +24,9 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
* listeners.
*
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.SelectionProviderAdapter} instead
*/
+@Deprecated
public class SelectionProviderAdapter extends EventManager implements ISelectionProvider, ISelectionChangedListener {
private ISelection selection;
@@ -61,8 +63,8 @@ public class SelectionProviderAdapter extends EventManager implements ISelection
public void selectionChanged(final SelectionChangedEvent event) {
this.selection = event.getSelection();
Object[] listeners = getListeners();
- for (int i = 0; i < listeners.length; ++i) {
- final ISelectionChangedListener listener = (ISelectionChangedListener) listeners[i];
+ for (Object listener2 : listeners) {
+ final ISelectionChangedListener listener = (ISelectionChangedListener) listener2;
SafeRunner.run(new SafeRunnable() {
public void run() {
listener.selectionChanged(event);
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ServiceMessageControl.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ServiceMessageControl.java
index e6bdccd..c2b0bed 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ServiceMessageControl.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/ServiceMessageControl.java
@@ -43,11 +43,12 @@ import org.eclipse.ui.forms.widgets.TableWrapLayout;
* GUI control designed to display build service messages. These messages may contain links that can be clicked by the
* user.
*
- * @since 3.5
* @author Robert Elves
* @author Steffen Pingel
* @author Torkild Ulvøy Resheim
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.ServiceMessageControl} instead
*/
+@Deprecated
public abstract class ServiceMessageControl {
private static final String NOTIFICATIONS_PREF_PAGE = "org.eclipse.mylyn.commons.notifications.preferencePages.Notifications"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SubstringPatternFilter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SubstringPatternFilter.java
index 809db99..a93b94f 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SubstringPatternFilter.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/SubstringPatternFilter.java
@@ -15,7 +15,9 @@ import org.eclipse.ui.dialogs.PatternFilter;
/**
* @author Mik Kersten
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.SubstringPatternFilter} instead
*/
+@Deprecated
public class SubstringPatternFilter extends PatternFilter {
@Override
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableSorter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableSorter.java
index 0e7e97c..01fcf4d 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableSorter.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableSorter.java
@@ -16,7 +16,9 @@ import org.eclipse.swt.widgets.TableColumn;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.TableSorter} instead
*/
+@Deprecated
public abstract class TableSorter extends AbstractColumnViewerSorter<TableViewer, TableColumn> {
@Override
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableTreePatternFilter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableTreePatternFilter.java
index 42dfaaf..342f66f 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableTreePatternFilter.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableTreePatternFilter.java
@@ -14,6 +14,11 @@ import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.dialogs.PatternFilter;
+/**
+ * @author Shawn Minto
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.TableTreePatternFilter} instead
+ */
+@Deprecated
public class TableTreePatternFilter extends PatternFilter {
@Override
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableViewerSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableViewerSupport.java
index eb31eb1..489d963 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableViewerSupport.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TableViewerSupport.java
@@ -25,7 +25,9 @@ import org.eclipse.swt.widgets.TableColumn;
* @author Frank Becker
* @author Steffen Pingel
* @author Shawn Minto
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.TableViewerSupport} instead
*/
+@Deprecated
public class TableViewerSupport extends AbstractColumnViewerSupport<TableColumn> {
private final Table table;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TextSearchControl.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TextSearchControl.java
index 0ac8df3..224d890 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TextSearchControl.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TextSearchControl.java
@@ -59,7 +59,9 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
* @author Shawn Minto
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.search.TextSearchControl} instead
*/
+@Deprecated
public class TextSearchControl extends Composite {
private static final String FIND_TEXT_MEMENTO_ELEMENT = "text"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeSorter.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeSorter.java
index 64caf4c..8412525 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeSorter.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeSorter.java
@@ -17,7 +17,9 @@ import org.eclipse.swt.widgets.TreeColumn;
/**
* @author Shawn Minto
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.TreeSorter} instead
*/
+@Deprecated
public abstract class TreeSorter extends AbstractColumnViewerSorter<TreeViewer, TreeColumn> {
@Override
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeViewerSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeViewerSupport.java
index 66551cf..f595bea 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeViewerSupport.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/TreeViewerSupport.java
@@ -23,7 +23,9 @@ import org.eclipse.swt.widgets.TreeColumn;
/**
* @author Shawn Minto
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.TreeViewerSupport} instead
*/
+@Deprecated
public class TreeViewerSupport extends AbstractColumnViewerSupport<TreeColumn> {
private final Tree tree;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchActionSupport.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchActionSupport.java
index 3363e43..28215d3 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchActionSupport.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchActionSupport.java
@@ -35,7 +35,9 @@ import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
* @author Mik Kersten
* @author Rob Elves
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.WorkbenchActionSupport} instead
*/
+@Deprecated
@SuppressWarnings("restriction")
public class WorkbenchActionSupport implements ISelectionChangedListener {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchUtil.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchUtil.java
index 9072a26..84f451f 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchUtil.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/WorkbenchUtil.java
@@ -50,7 +50,9 @@ import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
/**
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.WorkbenchUtil} instead
*/
+@Deprecated
public class WorkbenchUtil {
public static final String GROUP_EDIT = "group.edit"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/CollapseAllAction.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/CollapseAllAction.java
index 80e7567..80599eb 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/CollapseAllAction.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/CollapseAllAction.java
@@ -19,7 +19,9 @@ import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
/**
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.actions.CollapseAllAction} instead
*/
+@Deprecated
public class CollapseAllAction extends Action {
private final AbstractTreeViewer viewer;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/ExpandAllAction.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/ExpandAllAction.java
index 6aff05e..5fe4bc3 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/ExpandAllAction.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/ExpandAllAction.java
@@ -19,7 +19,9 @@ import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
/**
* @author Mik Kersten
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.actions.ExpandAllAction} instead
*/
+@Deprecated
public class ExpandAllAction extends Action {
private final AbstractTreeViewer viewer;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/PropertiesAction.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/PropertiesAction.java
index 13634ea..24ceccf 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/PropertiesAction.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/actions/PropertiesAction.java
@@ -17,7 +17,9 @@ import org.eclipse.ui.actions.BaseSelectionListenerAction;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.PropertiesAction} instead
*/
+@Deprecated
public class PropertiesAction extends BaseSelectionListenerAction {
public PropertiesAction() {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractDeleteLineHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractDeleteLineHandler.java
index 2090469..962579f 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractDeleteLineHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractDeleteLineHandler.java
@@ -24,7 +24,9 @@ import org.eclipse.ui.texteditor.TextViewerDeleteLineTarget;
* and copyToClipboard.
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.AbstractDeleteLineHandler} instead
*/
+@Deprecated
public class AbstractDeleteLineHandler extends AbstractTextViewerHandler implements IHandler {
protected final int type;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractTextViewerHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractTextViewerHandler.java
index 14ea072..6177c57 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractTextViewerHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/AbstractTextViewerHandler.java
@@ -23,7 +23,9 @@ import org.eclipse.ui.handlers.HandlerUtil;
* Abstract command handler that can get the current text viewer.
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.AbstractTextViewerHandler} instead
*/
+@Deprecated
public abstract class AbstractTextViewerHandler extends AbstractHandler {
/**
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineHandler.java
index f667ec0..e06e843 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineHandler.java
@@ -17,9 +17,13 @@ import org.eclipse.ui.texteditor.DeleteLineAction;
* Command handler for cut line command (whole)
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.CutLineHandler} instead
*/
+@Deprecated
public class CutLineHandler extends AbstractDeleteLineHandler {
+
public CutLineHandler() {
super(DeleteLineAction.WHOLE, true);
}
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToBeginningHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToBeginningHandler.java
index dfd1f07..61e98f8 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToBeginningHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToBeginningHandler.java
@@ -17,9 +17,13 @@ import org.eclipse.ui.texteditor.DeleteLineAction;
* Command handler for cut line command (to beginning)
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.CutLineToBeginningHandler} instead
*/
+@Deprecated
public class CutLineToBeginningHandler extends AbstractDeleteLineHandler {
+
public CutLineToBeginningHandler() {
super(DeleteLineAction.TO_BEGINNING, true);
}
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToEndHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToEndHandler.java
index e63eb72..0e639d9 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToEndHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/CutLineToEndHandler.java
@@ -17,9 +17,13 @@ import org.eclipse.ui.texteditor.DeleteLineAction;
* Command handler for cut line command (to end)
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.CutLineToEndHandler} instead
*/
+@Deprecated
public class CutLineToEndHandler extends AbstractDeleteLineHandler {
+
public CutLineToEndHandler() {
super(DeleteLineAction.TO_END, true);
}
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineHandler.java
index e7e0deb..65cf7f1 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineHandler.java
@@ -17,9 +17,13 @@ import org.eclipse.ui.texteditor.DeleteLineAction;
* Command handler for delete line command (whole)
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.DeleteLineHandler} instead
*/
+@Deprecated
public class DeleteLineHandler extends AbstractDeleteLineHandler {
+
public DeleteLineHandler() {
super(DeleteLineAction.WHOLE, false);
}
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToBeginningHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToBeginningHandler.java
index 3ba313b..5c1c9ac 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToBeginningHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToBeginningHandler.java
@@ -17,9 +17,13 @@ import org.eclipse.ui.texteditor.DeleteLineAction;
* Command handler for delete line command (to beginning)
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.DeleteLineToBeginningHandler} instead
*/
+@Deprecated
public class DeleteLineToBeginningHandler extends AbstractDeleteLineHandler {
+
public DeleteLineToBeginningHandler() {
super(DeleteLineAction.TO_BEGINNING, false);
}
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToEndHandler.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToEndHandler.java
index c750d71..23fec8a 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToEndHandler.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/commands/DeleteLineToEndHandler.java
@@ -17,9 +17,13 @@ import org.eclipse.ui.texteditor.DeleteLineAction;
* Command handler for delete line command (to end)
*
* @author David Green
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.texteditor.DeleteLineToEndHandler} instead
*/
+@Deprecated
public class DeleteLineToEndHandler extends AbstractDeleteLineHandler {
+
public DeleteLineToEndHandler() {
super(DeleteLineAction.TO_END, false);
}
+
}
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/AbstractInPlaceDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/AbstractInPlaceDialog.java
index 694c0a8..fe6f49e 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/AbstractInPlaceDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/AbstractInPlaceDialog.java
@@ -44,8 +44,9 @@ import org.eclipse.ui.PlatformUI;
* Abstract class for an in-place popup dialog that has a cancel button and sends and ok event when the dialog is closed
*
* @author Shawn Minto
- * @since 3.3
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.dialogs.AbstractInPlaceDialog} instead
*/
+@Deprecated
public abstract class AbstractInPlaceDialog extends PopupDialog {
public static final int ID_CLEAR = IDialogConstants.CLIENT_ID + 1;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/EnhancedWizardDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/EnhancedWizardDialog.java
index bbed912..4105b17 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/EnhancedWizardDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/EnhancedWizardDialog.java
@@ -32,8 +32,9 @@ import org.eclipse.swt.widgets.Shell;
*
* @author Helen Bershadskaya
* @author Frank Becker
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.dialogs.EnhancedWizardDialog} instead
*/
-
+@Deprecated
public abstract class EnhancedWizardDialog extends WizardDialog {
public EnhancedWizardDialog(Shell parentShell, IWizard newWizard) {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IInPlaceDialogListener.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IInPlaceDialogListener.java
index 6564a49..be47a1c 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IInPlaceDialogListener.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IInPlaceDialogListener.java
@@ -15,8 +15,9 @@ package org.eclipse.mylyn.internal.provisional.commons.ui.dialogs;
* Listener interface for close events from an {@link AbstractInPlaceDialog}
*
* @author Shawn Minto
- * @since 3.3
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.dialogs.IInPlaceDialogListener} instead
*/
+@Deprecated
public interface IInPlaceDialogListener {
public void buttonPressed(InPlaceDialogEvent event);
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IValidatable.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IValidatable.java
index 4684de4..9e8e706 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IValidatable.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/IValidatable.java
@@ -13,7 +13,9 @@ package org.eclipse.mylyn.internal.provisional.commons.ui.dialogs;
/**
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.dialogs.IValidatable} instead
*/
+@Deprecated
public interface IValidatable {
public boolean canValidate();
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceCheckBoxTreeDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceCheckBoxTreeDialog.java
index ff27ebf..1af1ea4 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceCheckBoxTreeDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceCheckBoxTreeDialog.java
@@ -38,8 +38,9 @@ import org.eclipse.ui.progress.WorkbenchJob;
/**
* @author Shawn Minto
- * @since 3.3
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.InPlaceCheckBoxTreeDialog} instead
*/
+@Deprecated
public class InPlaceCheckBoxTreeDialog extends AbstractInPlaceDialog {
private final Map<String, String> validValues;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDateSelectionDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDateSelectionDialog.java
index 74cf7e6..8d562f5 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDateSelectionDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDateSelectionDialog.java
@@ -30,8 +30,9 @@ import org.eclipse.swt.widgets.Shell;
* @author Mik Kersten
* @author Rob Elves
* @author Shawn Minto
- * @since 3.3
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.forms.InPlaceDateSelectionDialog} instead
*/
+@Deprecated
public class InPlaceDateSelectionDialog extends AbstractInPlaceDialog {
private Date selectedDate = null;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDialogEvent.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDialogEvent.java
index dd7b08f..784fd3e 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDialogEvent.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/InPlaceDialogEvent.java
@@ -15,8 +15,9 @@ package org.eclipse.mylyn.internal.provisional.commons.ui.dialogs;
* Event sent with an {@link IInPlaceDialogListener} that contains information about the close event that occurred
*
* @author Shawn Minto
- * @since 3.3
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.dialogs.InPlaceDialogEvent} instead
*/
+@Deprecated
public class InPlaceDialogEvent {
private final int returnCode;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/Messages.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/Messages.java
index eafd5ba..41de108 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/Messages.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/Messages.java
@@ -13,9 +13,6 @@ package org.eclipse.mylyn.internal.provisional.commons.ui.dialogs;
import org.eclipse.osgi.util.NLS;
-/**
- * @since 3.3
- */
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.provisional.commons.ui.dialogs.messages"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/ValidatableWizardDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/ValidatableWizardDialog.java
index 600f37b..226d2fb 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/ValidatableWizardDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/ValidatableWizardDialog.java
@@ -26,7 +26,9 @@ import org.eclipse.swt.widgets.Shell;
* Wizard dialog for displaying repository settings page. Necessary so we can add a validate button in the button bar.
*
* @author Helen Bershadskaya
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.dialogs.ValidatableWizardDialog} instead
*/
+@Deprecated
public class ValidatableWizardDialog extends EnhancedWizardDialog {
private static final String VALIDATE_BUTTON_KEY = "validate"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/WebBrowserDialog.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/WebBrowserDialog.java
index 51999a7..a136d3d 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/WebBrowserDialog.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/dialogs/WebBrowserDialog.java
@@ -46,7 +46,9 @@ import org.eclipse.ui.statushandlers.StatusManager;
*
* @author Shawn Minto
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.WebBrowserDialog} instead
*/
+@Deprecated
public class WebBrowserDialog extends MessageDialog {
private String text;
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/EditorBusyIndicator.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/EditorBusyIndicator.java
index 18de4e8..83db3c8 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/EditorBusyIndicator.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/EditorBusyIndicator.java
@@ -24,7 +24,9 @@ import org.eclipse.ui.PlatformUI;
*
* @author Shawn Minto
* @author Steffen Pingel
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.EditorBusyIndicator} instead
*/
+@Deprecated
public class EditorBusyIndicator {
private class Animator implements Runnable {
diff --git a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/IBusyEditor.java b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/IBusyEditor.java
index 3f8c8e7..ec5ad50 100644
--- a/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/IBusyEditor.java
+++ b/org.eclipse.mylyn.commons.ui/src/org/eclipse/mylyn/internal/provisional/commons/ui/editor/IBusyEditor.java
@@ -20,7 +20,9 @@ import org.eclipse.ui.part.WorkbenchPart;
*
* @author Shawn Minto
* @see EditorBusyIndicator
+ * @deprecated use {@link org.eclipse.mylyn.commons.ui.workbench.IBusyEditor} instead
*/
+@Deprecated
public interface IBusyEditor {
/**
diff --git a/org.eclipse.mylyn.commons.workbench/.classpath b/org.eclipse.mylyn.commons.workbench/.classpath
new file mode 100644
index 0000000..e756522
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.classpath
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+ <accessrules>
+ <accessrule kind="accessible" pattern="org/eclipse/ui/internal/forms/widgets/FormUtil"/>
+ <accessrule kind="accessible" pattern="org/eclipse/ui/internal/browser/**"/>
+ </accessrules>
+ </classpathentry>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.mylyn.commons.workbench/.cvsignore b/org.eclipse.mylyn.commons.workbench/.cvsignore
new file mode 100644
index 0000000..d567ba0
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.cvsignore
@@ -0,0 +1,2 @@
+bin
+target
diff --git a/org.eclipse.mylyn.commons.workbench/.project b/org.eclipse.mylyn.commons.workbench/.project
new file mode 100644
index 0000000..d9bdd81
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.mylyn.commons.workbench</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.core.runtime.prefs
new file mode 100644
index 0000000..5a0ad22
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.core.runtime.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..38f9997
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,359 @@
+#Wed Mar 02 16:00:03 PST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.codeComplete.argumentPrefixes=
+org.eclipse.jdt.core.codeComplete.argumentSuffixes=
+org.eclipse.jdt.core.codeComplete.fieldPrefixes=
+org.eclipse.jdt.core.codeComplete.fieldSuffixes=
+org.eclipse.jdt.core.codeComplete.localPrefixes=
+org.eclipse.jdt.core.codeComplete.localSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled
+org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL
+org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=48
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=1
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
+org.eclipse.jdt.core.formatter.comment.format_block_comments=false
+org.eclipse.jdt.core.formatter.comment.format_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=false
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..ee0488e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,65 @@
+#Wed Mar 02 16:00:04 PST 2011
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Mylyn based on Eclipse
+formatter_settings_version=12
+internal.default.compliance=default
+org.eclipse.jdt.ui.exception.name=e
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment"/><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*******************************************************************************\r\n * Copyright (c) ${year} Tasktop Technologies and others.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * Tasktop Technologies - initial API and implementation\r\n *******************************************************************************/\r\n\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ignore\r\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ignore</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=false
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644
index 0000000..5e7f2bd
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.ltk.core.refactoring.prefs
@@ -0,0 +1,3 @@
+#Tue Aug 18 22:42:26 PDT 2009
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.mylyn.tasks.ui.prefs b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.mylyn.tasks.ui.prefs
new file mode 100644
index 0000000..d8c6d26
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.mylyn.tasks.ui.prefs
@@ -0,0 +1,4 @@
+#Mon Jun 25 03:02:37 GMT 2007
+eclipse.preferences.version=1
+project.repository.kind=bugzilla
+project.repository.url=https\://bugs.eclipse.org/bugs
diff --git a/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.pde.prefs b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..e8f2d56
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,18 @@
+#Tue Apr 15 11:07:59 PDT 2008
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=2
+compilers.p.missing-bundle-classpath-entries=1
+compilers.p.missing-packages=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/org.eclipse.mylyn.commons.workbench/META-INF/MANIFEST.MF b/org.eclipse.mylyn.commons.workbench/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f43ad67
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.mylyn.commons.workbench;singleton:=true
+Bundle-Version: 3.7.0.qualifier
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.expressions,
+ org.eclipse.jface,
+ org.eclipse.jface.text,
+ org.eclipse.ui,
+ org.eclipse.ui.browser,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.forms,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.mylyn.commons.core;bundle-version="3.7.0",
+ org.eclipse.mylyn.commons.ui;bundle-version="3.7.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Activator: org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin
+Export-Package: org.eclipse.mylyn.commons.workbench,
+ org.eclipse.mylyn.commons.workbench.browser,
+ org.eclipse.mylyn.commons.workbench.editors,
+ org.eclipse.mylyn.commons.workbench.forms,
+ org.eclipse.mylyn.commons.workbench.search,
+ org.eclipse.mylyn.commons.workbench.texteditor,
+ org.eclipse.mylyn.internal.commons.workbench;x-internal:=true
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Localization: plugin
+
diff --git a/org.eclipse.mylyn.commons.workbench/about.html b/org.eclipse.mylyn.commons.workbench/about.html
new file mode 100644
index 0000000..d774b07
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/about.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 25, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.workbench/build.properties b/org.eclipse.mylyn.commons.workbench/build.properties
new file mode 100644
index 0000000..46dab0f
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ plugin.properties
+src.includes = about.html
diff --git a/org.eclipse.mylyn.commons.workbench/plugin.properties b/org.eclipse.mylyn.commons.workbench/plugin.properties
new file mode 100644
index 0000000..e2c89da
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/plugin.properties
@@ -0,0 +1,13 @@
+###############################################################################
+# Copyright (c) 2009 Tasktop Technologies and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Tasktop Technologies - initial API and implementation
+###############################################################################
+#Properties file for org.eclipse.mylyn.commons.ui
+Bundle-Vendor = Eclipse Mylyn
+Bundle-Name = Mylyn Commons UI
diff --git a/org.eclipse.mylyn.commons.workbench/pom.xml b/org.eclipse.mylyn.commons.workbench/pom.xml
new file mode 100644
index 0000000..55f21bb
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/pom.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.mylyn.commons-parent</artifactId>
+ <groupId>org.eclipse.mylyn.commons</groupId>
+ <version>3.7.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.mylyn.commons.workbench</artifactId>
+ <version>3.7.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java
new file mode 100644
index 0000000..75c4e1b
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java
@@ -0,0 +1,246 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
+import org.eclipse.mylyn.internal.commons.workbench.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.ui.progress.WorkbenchJob;
+
+/**
+ * A filtered tree with additional controls below the filter text field.
+ *
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public abstract class AbstractFilteredTree extends EnhancedFilteredTree {
+
+ private static final int FILTER_WIDTH_MIN = 60;
+
+ private static final int FILTER_WIDTH_MAX = 300;
+
+ private static final float FILTER_WIDTH_RATIO = 0.35f;
+
+ public static final String LABEL_FIND = Messages.AbstractFilteredTree_Find;
+
+ private WorkbenchJob refreshJob;
+
+ private AdaptiveRefreshPolicy refreshPolicy;
+
+ private Composite progressComposite;
+
+ private Composite searchComposite;
+
+ private boolean showProgress = false;
+
+ private String previousFilterText;
+
+ /**
+ * XXX: using reflection to gain access
+ *
+ * @param parent
+ * @param treeStyle
+ * @param filter
+ */
+ public AbstractFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
+ super(parent, treeStyle, filter, true);
+ try {
+ // the super constructor calls doCreateRefreshJob() which assigns refreshJob
+ refreshPolicy = new AdaptiveRefreshPolicy(refreshJob);
+
+ } catch (Exception e) {
+ CommonsWorkbenchPlugin.getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, "Could not get refresh job", e)); //$NON-NLS-1$
+ }
+ setInitialText(LABEL_FIND);
+ }
+
+ @Override
+ protected WorkbenchJob doCreateRefreshJob() {
+ this.refreshJob = super.doCreateRefreshJob();
+ return this.refreshJob;
+ }
+
+ @Override
+ protected void createControl(Composite parent, int treeStyle) {
+ super.createControl(parent, treeStyle);
+
+ // Override superclass layout settings...
+ GridLayout layout = (GridLayout) getLayout();
+ layout.verticalSpacing = 0;
+ layout.horizontalSpacing = 0;
+ }
+
+ @Override
+ protected Control createTreeControl(Composite parent, int style) {
+ progressComposite = createProgressComposite(parent);
+// progressComposite.setVisible(false);
+// ((GridData) progressComposite.getLayoutData()).exclude = true;
+
+ searchComposite = createSearchComposite(parent);
+ if (searchComposite != null) {
+ searchComposite.setVisible(false);
+ ((GridData) searchComposite.getLayoutData()).exclude = true;
+ }
+
+ return super.createTreeControl(parent, style);
+ }
+
+ @Override
+ protected Composite createFilterControls(final Composite parent) {
+ // replace filterComposite by a new composite
+ filterComposite = new Composite(parent.getParent(), SWT.NONE);
+ GridLayout gridLayout = new GridLayout(1, false);
+ gridLayout.marginWidth = 0;
+ gridLayout.marginHeight = 0;
+ gridLayout.marginLeft = 3;
+ gridLayout.marginTop = 5;
+ gridLayout.marginBottom = 3;
+ gridLayout.verticalSpacing = 0;
+ filterComposite.setLayout(gridLayout);
+
+ // let FilteredTree create the find and clear control
+ super.createFilterControls(parent);
+ GridDataFactory.fillDefaults()
+ .align(SWT.BEGINNING, SWT.CENTER)
+ .grab(false, false)
+ .hint(FILTER_WIDTH_MIN, SWT.DEFAULT)
+ .minSize(FILTER_WIDTH_MIN, SWT.DEFAULT)
+ .applyTo(parent);
+ filterComposite.addControlListener(new ControlAdapter() {
+ boolean handlingEvents;
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ if (handlingEvents) {
+ return;
+ }
+ try {
+ handlingEvents = true;
+ Point size = parent.getParent().getSize();
+ int width = Math.max(FILTER_WIDTH_MIN, (int) (size.x * FILTER_WIDTH_RATIO));
+ int offset = 1;
+ if (parent.getParent().getLayoutData() instanceof GridData) {
+ offset = ((GridLayout) parent.getParent().getLayout()).marginWidth
+ + ((GridLayout) parent.getParent().getLayout()).marginLeft
+ + ((GridLayout) parent.getParent().getLayout()).horizontalSpacing;
+ }
+ ((GridData) parent.getLayoutData()).widthHint = Math.min(width, FILTER_WIDTH_MAX) + offset;
+ ((GridData) filterText.getParent().getLayoutData()).widthHint = Math.min(width, FILTER_WIDTH_MAX);
+ parent.getParent().layout();
+ } finally {
+ handlingEvents = false;
+ }
+ }
+ });
+ filterText.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (e.character == SWT.ESC && e.doit) {
+ setFilterText(""); //$NON-NLS-1$
+ }
+ }
+ });
+ ((GridData) filterText.getLayoutData()).verticalAlignment = SWT.CENTER;
+
+ // move original filterComposite on new filterComposite
+ parent.setParent(filterComposite);
+
+ Composite workingSetComposite = createActiveWorkingSetComposite(filterComposite);
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).grab(false, false).applyTo(workingSetComposite);
+
+ Composite activeTaskComposite = createActiveTaskComposite(filterComposite);
+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).grab(true, false).applyTo(activeTaskComposite);
+
+ gridLayout.numColumns = filterComposite.getChildren().length;
+ return parent;
+ }
+
+ protected abstract Composite createProgressComposite(Composite container);
+
+ protected abstract Composite createActiveWorkingSetComposite(Composite container);
+
+ protected abstract Composite createActiveTaskComposite(Composite container);
+
+ protected Composite createSearchComposite(Composite container) {
+ return null;
+ }
+
+ @Override
+ protected void textChanged() {
+ // this call allows the filtered tree to preserve the selection when the clear button is used.
+ // It is necessary to correctly set the private narrowingDown flag in the super class.
+ // Note that the scheduling of the refresh job that is done in the super class will be overridden
+ // by the call to refreshPolicy.textChanged().
+ String text = getFilterString();
+ if (text == null || text.equals(previousFilterText)) {
+ return;
+ }
+ super.textChanged();
+
+ previousFilterText = text;
+
+ if (refreshPolicy != null) {
+ if (LABEL_FIND.equals(text) && !useNewLook) {
+ clearText();
+ refreshPolicy.textChanged(""); //$NON-NLS-1$
+ } else {
+ refreshPolicy.textChanged(text);
+ }
+ }
+ // bug 165353 work-around for premature return at FilteredTree.java:374
+ updateToolbar(true);
+ }
+
+ @Deprecated
+ protected Job getRefreshJob() {
+ return refreshJob;
+ }
+
+ public AdaptiveRefreshPolicy getRefreshPolicy() {
+ return refreshPolicy;
+ }
+
+ public boolean isShowProgress() {
+ return showProgress;
+ }
+
+ public void setShowProgress(boolean showProgress) {
+ this.showProgress = showProgress;
+ progressComposite.setVisible(showProgress);
+ ((GridData) progressComposite.getLayoutData()).exclude = !showProgress;
+ getParent().getParent().layout(true, true);
+ }
+
+ public void setShowSearch(boolean showSearch) {
+ if (searchComposite != null) {
+ searchComposite.setVisible(showSearch);
+ ((GridData) searchComposite.getLayoutData()).exclude = !showSearch;
+ getParent().getParent().layout(true, true);
+ }
+ }
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractWorkbenchNotificationPopup.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractWorkbenchNotificationPopup.java
new file mode 100644
index 0000000..f5a2356
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractWorkbenchNotificationPopup.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.mylyn.commons.ui.dialogs.AbstractNotificationPopup;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * A popup window that uses the workbench shell image in the title.
+ *
+ * @author Steffen Pingel
+ */
+public class AbstractWorkbenchNotificationPopup extends AbstractNotificationPopup {
+
+ public AbstractWorkbenchNotificationPopup(Display display, int style) {
+ super(display, style);
+ }
+
+ public AbstractWorkbenchNotificationPopup(Display display) {
+ super(display);
+ }
+
+ @Override
+ protected Image getPopupShellImage(int maximumHeight) {
+ return WorkbenchUtil.getWorkbenchShellImage(maximumHeight);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AdaptiveRefreshPolicy.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AdaptiveRefreshPolicy.java
new file mode 100644
index 0000000..55bc96b
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AdaptiveRefreshPolicy.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.WorkbenchJob;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class AdaptiveRefreshPolicy {
+
+ public static interface IFilteredTreeListener {
+
+ public void filterTextChanged(String text);
+
+ }
+
+ private int refreshDelay = 1500;
+
+ private final Set<IFilteredTreeListener> listeners = new HashSet<IFilteredTreeListener>();
+
+ private String oldText = ""; //$NON-NLS-1$
+
+ protected Job refreshJob;
+
+ @Deprecated
+ public AdaptiveRefreshPolicy(Job refreshJob, Text filterText) {
+ this(refreshJob);
+ }
+
+ public AdaptiveRefreshPolicy(Job refreshJob) {
+ Assert.isNotNull(refreshJob);
+ this.refreshJob = refreshJob;
+ refreshJob.addJobChangeListener(REFRESH_JOB_LISTENER);
+ }
+
+ public void dispose() {
+ refreshJob.removeJobChangeListener(REFRESH_JOB_LISTENER);
+ }
+
+ protected final IJobChangeListener REFRESH_JOB_LISTENER = new IJobChangeListener() {
+
+ public void aboutToRun(IJobChangeEvent event) {
+ // ignore
+ }
+
+ public void awake(IJobChangeEvent event) {
+ // ignore
+ }
+
+ public void done(IJobChangeEvent event) {
+ if (event.getResult().isOK()) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ for (IFilteredTreeListener listener : listeners) {
+ listener.filterTextChanged(oldText);
+ }
+ }
+ });
+ }
+ }
+
+ public void running(IJobChangeEvent event) {
+ // ignore
+ }
+
+ public void scheduled(IJobChangeEvent event) {
+ // ignore
+ }
+
+ public void sleeping(IJobChangeEvent event) {
+ // ignore
+ }
+ };
+
+ public void textChanged(String text) {
+ if (text == null || text.equals(oldText)) {
+ return;
+ }
+
+ refreshJob.cancel();
+ int delay = 0;
+ int textLength = text.length();
+ if (textLength > 0) {
+ delay = (int) (this.refreshDelay / (textLength * 0.6));
+ }
+ refreshJob.schedule(delay);
+
+ this.oldText = text;
+ }
+
+ /**
+ * the filter has changed in some way (not the text)
+ */
+ public void filterChanged() {
+ refreshJob.cancel();
+ refreshJob.schedule(refreshDelay / 2);
+ }
+
+ /**
+ * for testing purposes only
+ */
+ public void internalForceRefresh() {
+ ((WorkbenchJob) refreshJob).runInUIThread(new NullProgressMonitor());
+ }
+
+ public void addListener(IFilteredTreeListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(IFilteredTreeListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void setRefreshDelay(int refreshDelay) {
+ this.refreshDelay = refreshDelay;
+ }
+
+ public int getRefreshDelay() {
+ return refreshDelay;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/BusyAnimator.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/BusyAnimator.java
new file mode 100644
index 0000000..c7722fc
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/BusyAnimator.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.WorkbenchPart;
+
+/**
+ * Provides a spinner animation for the tab title of an editor.
+ *
+ * @author Shawn Minto
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class BusyAnimator {
+
+ /**
+ * A callback for modifying the title image of an editor. Clients that provide busy animations should implement this
+ * interface and delegate to the respective methods in {@link WorkbenchPart}.
+ *
+ * @author Shawn Minto
+ * @see BusyAnimator
+ * @since 3.7
+ */
+ public interface IBusyClient {
+
+ /**
+ * Updates the title image of the editor to <code>image</code>.
+ *
+ * @param image
+ * the image
+ */
+ public void setImage(Image image);
+
+ /**
+ * Returns the current title image of the editor.
+ */
+ public Image getImage();
+
+ }
+
+ private class Animator implements Runnable {
+
+ int imageDataIndex = 0;
+
+ private final Image[] images;
+
+ private boolean stopped;
+
+ public Animator(Image[] images) {
+ this.images = images;
+ }
+
+ public void run() {
+ if (stopped) {
+ return;
+ }
+
+ try {
+ Image image = images[imageDataIndex];
+ imageDataIndex = (imageDataIndex + 1) % images.length;
+
+ if (updateTitleImage(image)) {
+ PlatformUI.getWorkbench().getDisplay().timerExec(UPDATE_INTERVAL, this);
+ }
+ } catch (Exception e) {
+ CommonsWorkbenchPlugin.getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN,
+ "Failed to update animation", e)); //$NON-NLS-1$
+ }
+ }
+
+ public void stop() {
+ stopped = true;
+ }
+ }
+
+ private static final int UPDATE_INTERVAL = 90;
+
+ private Animator animator;
+
+ private final IBusyClient client;
+
+ private Image[] images;
+
+ private Image oldImage;
+
+ public BusyAnimator(IBusyClient client) {
+ this.client = client;
+ }
+
+ /**
+ * Starts the busy indication.
+ *
+ * @see #stop()
+ */
+ public void start() {
+ if (animator != null) {
+ stop();
+ }
+
+ try {
+ if (images == null) {
+ images = CommonImages.getProgressImages();
+ // if image fails to load do not continue
+ if (images == null) {
+ return;
+ }
+ }
+
+ oldImage = client.getImage();
+
+ if (images.length > 1) {
+ animator = new Animator(images);
+ animator.run();
+ }
+ } catch (SWTException e) {
+ CommonsWorkbenchPlugin.getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, "Failed to start animation", e)); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Stops the animation.
+ *
+ * @see #start()
+ */
+ public void stop() {
+ if (animator != null) {
+ animator.stop();
+ animator = null;
+
+ updateTitleImage(oldImage);
+ oldImage = null;
+ }
+ }
+
+ private boolean updateTitleImage(final Image image) {
+ if (!PlatformUI.getWorkbench().isClosing()) {
+ if (image != null && !image.isDisposed()) {
+ client.setImage(image);
+ return true;
+ } else {
+ if (oldImage != null && !oldImage.isDisposed()) {
+ client.setImage(oldImage);
+ }
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/CommonImageManger.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/CommonImageManger.java
new file mode 100644
index 0000000..113edb2
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/CommonImageManger.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ * Perforce - fixes for bug 343892
+ * GitHub - fixes for bug 350333
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.WorkbenchImages;
+
+/**
+ * @author Steffen Pingel
+ * @author Kevin Sawicki
+ * @since 3.7
+ */
+public class CommonImageManger {
+
+ private static final String[] IMAGE_EXTENSIONS = { "jpg", "gif", "png", "tiff", "tif", "bmp" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+
+ private final LocalResourceManager resourceManager = new LocalResourceManager(JFaceResources.getResources());
+
+ public CommonImageManger() {
+ }
+
+ public void dispose() {
+ resourceManager.dispose();
+ }
+
+ public Image getFileImage(String filename) {
+ if (filename != null) {
+ int dotIndex = filename.lastIndexOf('.');
+ if (dotIndex != -1) {
+ String fileType = filename.substring(dotIndex + 1);
+ for (String element2 : IMAGE_EXTENSIONS) {
+ if (element2.equalsIgnoreCase(fileType)) {
+ return CommonImages.getImage(CommonImages.IMAGE_FILE);
+ }
+ }
+ }
+ String file = new Path(filename).lastSegment();
+ if (file != null) {
+ return getImage(PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor(filename));
+ }
+ }
+ return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE);
+ }
+
+ public Image getImage(ImageDescriptor imageDescriptor) {
+ return (Image) resourceManager.get(imageDescriptor);
+ }
+
+ public LocalResourceManager getResourceManager() {
+ return resourceManager;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DecoratingPatternStyledCellLabelProvider.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DecoratingPatternStyledCellLabelProvider.java
new file mode 100644
index 0000000..ebe84e7
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DecoratingPatternStyledCellLabelProvider.java
@@ -0,0 +1,254 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Perforce - enhancements for bug 319469
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IDecorationContext;
+import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.StyledCellLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.jface.viewers.ViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.misc.StringMatcher;
+import org.eclipse.ui.internal.misc.StringMatcher.Position;
+
+/**
+ * A decorating styled label provider that supports highlighting of substrings that match a pattern. Based on
+ * {@link DecoratingFileSearchLabelProvider}.
+ *
+ * @author Kevin Sawicki
+ * @see DecoratingFileSearchLabelProvider
+ * @since 3.7
+ */
+public class DecoratingPatternStyledCellLabelProvider extends DecoratingStyledCellLabelProvider implements
+ IPropertyChangeListener, ILabelProvider {
+
+ /**
+ * Color to use to decorate matches.
+ */
+ static final String HIGHLIGHT_BG_COLOR_NAME = "org.eclipse.jdt.ui.ColoredLabels.match_highlight"; //$NON-NLS-1$
+
+ static final Styler HIGHLIGHT_STYLE = StyledString.createColorRegistryStyler(null, HIGHLIGHT_BG_COLOR_NAME);
+
+ private static class PatternStyledLabelProvider extends StyledCellLabelProvider implements IStyledLabelProvider,
+ IColorProvider, IFontProvider {
+
+ private final ILabelProvider labelProvider;
+
+ private StringMatcher matcher = null;
+
+ public PatternStyledLabelProvider(ILabelProvider provider) {
+ this.labelProvider = provider;
+ }
+
+ /**
+ * Set the pattern to highlight
+ *
+ * @param pattern
+ */
+ public void setPattern(String pattern) {
+ if (pattern != null && pattern.length() > 0) {
+ this.matcher = new StringMatcher(pattern, true, false);
+ } else {
+ this.matcher = null;
+ }
+ }
+
+ public StyledString getStyledText(Object element) {
+ StyledString styled = null;
+ String label = this.labelProvider.getText(element);
+ if (matcher == null || label.length() == 0) {
+ styled = new StyledString(label);
+ } else {
+ styled = new StyledString();
+ int start = 0;
+ int end = 0;
+ int length = label.length();
+ Position position = matcher.find(label, start, length);
+ while (position != null) {
+ end = position.getStart();
+ styled.append(label.substring(start, end));
+ start = position.getEnd();
+ styled.append(label.substring(end, start), HIGHLIGHT_STYLE);
+ position = matcher.find(label, start, length);
+ }
+ if (start > 0 && start < length) {
+ styled.append(label.substring(start));
+ }
+ }
+ return styled;
+ }
+
+ public Image getImage(Object element) {
+ return this.labelProvider.getImage(element);
+ }
+
+ public Font getFont(Object element) {
+ if (labelProvider instanceof IFontProvider) {
+ return ((IFontProvider) this.labelProvider).getFont(element);
+ }
+ return null;
+ }
+
+ public Color getForeground(Object element) {
+ if (labelProvider instanceof IColorProvider) {
+ return ((IColorProvider) this.labelProvider).getForeground(element);
+ }
+ return null;
+ }
+
+ public Color getBackground(Object element) {
+ if (labelProvider instanceof IColorProvider) {
+ return ((IColorProvider) this.labelProvider).getBackground(element);
+ }
+ return null;
+ }
+
+ }
+
+ private final ILabelProvider labelProvider;
+
+ /**
+ * Create a new repository search styled label provider that wraps an {@link ILabelProvider}
+ *
+ * @param labelProvider
+ * @param decorator
+ * @param decorationContext
+ */
+ public DecoratingPatternStyledCellLabelProvider(ILabelProvider labelProvider, ILabelDecorator decorator,
+ IDecorationContext decorationContext) {
+ super(new PatternStyledLabelProvider(labelProvider), decorator, decorationContext);
+ this.labelProvider = labelProvider;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.StyledCellLabelProvider#initialize(org.eclipse.jface.viewers.ColumnViewer,
+ * org.eclipse.jface.viewers.ViewerColumn)
+ */
+ @Override
+ public void initialize(ColumnViewer viewer, ViewerColumn column) {
+ PlatformUI.getPreferenceStore().addPropertyChangeListener(this);
+ JFaceResources.getColorRegistry().addListener(this);
+
+ setOwnerDrawEnabled(PlatformUI.getPreferenceStore()
+ .getBoolean(IWorkbenchPreferenceConstants.USE_COLORED_LABELS));
+
+ super.initialize(viewer, column);
+ }
+
+ /**
+ * Get underyling label provider
+ *
+ * @return label provider
+ */
+ public ILabelProvider getLabelProvider() {
+ return this.labelProvider;
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ PlatformUI.getPreferenceStore().removePropertyChangeListener(this);
+ JFaceResources.getColorRegistry().removeListener(this);
+ this.labelProvider.dispose();
+ super.dispose();
+ }
+
+ /**
+ * Set the pattern to highlight
+ *
+ * @param pattern
+ */
+ public void setPattern(String pattern) {
+ ((PatternStyledLabelProvider) getStyledStringProvider()).setPattern(pattern);
+ }
+
+ /**
+ * Refresh the labels on viewer associated with this label provider. This method must be called on the UI-thread.
+ */
+ protected void refresh() {
+ ColumnViewer viewer = getViewer();
+ if (viewer != null) {
+ boolean coloredLabels = PlatformUI.getPreferenceStore().getBoolean(
+ IWorkbenchPreferenceConstants.USE_COLORED_LABELS);
+ if (coloredLabels || coloredLabels != isOwnerDrawEnabled()) {
+ setOwnerDrawEnabled(coloredLabels);
+ viewer.refresh();
+ }
+ }
+ }
+
+ /**
+ * Schedule a refresh of this label provider. This method can be called from any thread.
+ */
+ protected void scheduleRefresh() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ refresh();
+ }
+ });
+ }
+
+ /**
+ * @param event
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if (IWorkbenchPreferenceConstants.USE_COLORED_LABELS.equals(property)
+ || HIGHLIGHT_BG_COLOR_NAME.equals(property)) {
+ scheduleRefresh();
+ }
+ }
+
+ /**
+ * Get text of element from underyling label provider
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ return this.labelProvider.getText(element);
+ }
+
+ /**
+ * Override preparation of style range to add border dot about highlight regions that don't have colors applied
+ *
+ * @see org.eclipse.jface.viewers.StyledCellLabelProvider#prepareStyleRange(org.eclipse.swt.custom.StyleRange,
+ * boolean)
+ */
+ @Override
+ protected StyleRange prepareStyleRange(StyleRange styleRange, boolean applyColors) {
+ boolean addBorder = !applyColors && styleRange.background != null;
+ styleRange = super.prepareStyleRange(styleRange, applyColors);
+ if (addBorder) {
+ styleRange.borderStyle = SWT.BORDER_DOT;
+ }
+ return styleRange;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DelayedRefreshJob.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DelayedRefreshJob.java
new file mode 100644
index 0000000..46f4de8
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/DelayedRefreshJob.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.ui.progress.WorkbenchJob;
+
+/**
+ * TODO use extensible deltas instead of Objects for refresh
+ *
+ * @author Steffen Pingel
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public abstract class DelayedRefreshJob extends WorkbenchJob {
+
+ static final long REFRESH_DELAY_DEFAULT = 200;
+
+ static final long REFRESH_DELAY_MAX = REFRESH_DELAY_DEFAULT * 2;
+
+ // FIXME make private
+ protected final StructuredViewer viewer;
+
+ private static final int NOT_SCHEDULED = -1;
+
+ private final LinkedHashSet<Object> queue = new LinkedHashSet<Object>();
+
+ private long scheduleTime = NOT_SCHEDULED;
+
+ public DelayedRefreshJob(StructuredViewer viewer, String name) {
+ super(name);
+ Assert.isNotNull(viewer);
+ this.viewer = viewer;
+ setSystem(true);
+ }
+
+ // XXX needs to be called from UI thread
+ public void refreshNow() {
+ queue.add(null);
+ runInUIThread(new NullProgressMonitor());
+ }
+
+ public synchronized void refresh() {
+ refreshElement(null);
+ }
+
+ public synchronized void refreshElements(Object[] elements) {
+ queue.addAll(Arrays.asList(elements));
+ if (scheduleTime == NOT_SCHEDULED) {
+ scheduleTime = System.currentTimeMillis();
+ schedule(REFRESH_DELAY_DEFAULT);
+ } else if (System.currentTimeMillis() - scheduleTime < REFRESH_DELAY_MAX - REFRESH_DELAY_DEFAULT) {
+ // reschedule to aggregate more refreshes
+ cancel();
+ schedule(REFRESH_DELAY_DEFAULT);
+ }
+ }
+
+ public synchronized void refreshElement(Object element) {
+ refreshElements(new Object[] { element });
+ }
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ if (viewer.getControl() == null || viewer.getControl().isDisposed()) {
+ return Status.CANCEL_STATUS;
+ }
+
+ final Object[] items;
+ synchronized (this) {
+ if (queue.contains(null)) {
+ items = null;
+ } else {
+ items = queue.toArray(new Object[0]);
+ }
+ queue.clear();
+ scheduleTime = NOT_SCHEDULED;
+ }
+
+ doRefresh(items);
+
+ return Status.OK_STATUS;
+ }
+
+ protected abstract void doRefresh(final Object[] items);
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/EnhancedFilteredTree.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/EnhancedFilteredTree.java
new file mode 100644
index 0000000..69feb8c
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/EnhancedFilteredTree.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Hiroyuki Inaba and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Hiroyuki Inaba - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.mylyn.commons.workbench.search.SearchHistoryPopupDialog;
+import org.eclipse.mylyn.commons.workbench.search.TextSearchControl;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * A {@link FilteredTree} that uses the new look on Eclipse 3.5 and later.
+ *
+ * @author Hiroyuki Inaba
+ * @since 3.7
+ */
+// TODO e3.5 remove this class and replace with FilteredTree
+public class EnhancedFilteredTree extends FilteredTree {
+
+ protected boolean useNewLook;
+
+ private TextSearchControl searchControl;
+
+ public EnhancedFilteredTree(Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook) {
+ super(parent, treeStyle, filter);
+ }
+
+ public EnhancedFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
+ super(parent, treeStyle, filter);
+ }
+
+ public EnhancedFilteredTree(Composite parent) {
+ super(parent);
+ }
+
+ @Override
+ protected void createControl(Composite parent, int treeStyle) {
+ super.createControl(parent, treeStyle);
+
+ // set this after so that there isn't a double border created around the search
+ useNewLook = setNewLook(this);
+ }
+
+ @Override
+ protected Composite createFilterControls(Composite parent) {
+ createFilterText(parent);
+ return parent;
+ }
+
+ public static boolean setNewLook(FilteredTree tree) {
+ try {
+ Field newStyleField = FilteredTree.class.getDeclaredField("useNewLook"); //$NON-NLS-1$
+ newStyleField.setAccessible(true);
+ newStyleField.setBoolean(tree, true);
+ return newStyleField.getBoolean(tree);
+ } catch (Exception e) {
+ // ignore
+ }
+ return false;
+ }
+
+ @Override
+ protected void createFilterText(Composite parent) {
+ super.createFilterText(parent);
+
+ // This code is here to make it so that the key listener for the down arrow listens to the KeyEvent.doit
+ // flag so that the history popup dialog can be keyboard accessible and the down arrow works to select items
+ // from the history
+ if (searchControl != null && searchControl.hasHistorySupport()) {
+ Text textControl = searchControl.getTextControl();
+ KeyListener downArrowListener = null;
+ Listener[] listeners = textControl.getListeners(SWT.KeyDown);
+ if (listeners != null && listeners.length > 0) {
+ for (Listener listener : listeners) {
+ if (listener instanceof TypedListener
+ && ((TypedListener) listener).getEventListener()
+ .getClass()
+ .getName()
+ .startsWith("org.eclipse.ui.dialogs.FilteredTree$") //$NON-NLS-1$
+ && ((TypedListener) listener).getEventListener() instanceof KeyListener) {
+ downArrowListener = (KeyListener) ((TypedListener) listener).getEventListener();
+ break;
+ }
+ }
+ }
+ if (downArrowListener != null) {
+ final KeyListener oldKeyListener = downArrowListener;
+ textControl.removeKeyListener(downArrowListener);
+ textControl.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (e.doit) {
+ oldKeyListener.keyPressed(e);
+ }
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.doit) {
+ oldKeyListener.keyReleased(e);
+ }
+ }
+ });
+ }
+ }
+
+ }
+
+ @Override
+ protected Text doCreateFilterText(Composite parent) {
+ searchControl = new TextSearchControl(parent, true, getHistoryPopupDialog());
+
+ searchControl.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ if (e.detail == TextSearchControl.ICON_CANCEL) {
+ clearText();
+ }
+ if (e.detail == TextSearchControl.ICON_SEARCH) {
+ textChanged();
+ }
+ }
+ });
+ searchControl.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
+ return searchControl.getTextControl();
+ }
+
+ public TextSearchControl getTextSearchControl() {
+ return searchControl;
+ }
+
+ protected SearchHistoryPopupDialog getHistoryPopupDialog() {
+ return new SearchHistoryPopupDialog(getShell(), SWT.TOP);
+ }
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/GradientDrawer.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/GradientDrawer.java
new file mode 100644
index 0000000..9fafd6e
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/GradientDrawer.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ * Frank Becker - improvements
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.mylyn.commons.ui.compatibility.CommonThemes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Scrollable;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.themes.IThemeManager;
+
+/**
+ * @author Mik Kersten
+ * @author Frank Becker
+ * @since 3.7
+ */
+public abstract class GradientDrawer {
+
+ private final Listener CATEGORY_GRADIENT_DRAWER = new Listener() {
+ public void handleEvent(Event event) {
+ if (shouldApplyGradient(event)) {
+ Scrollable scrollable = (Scrollable) event.widget;
+ GC gc = event.gc;
+
+ Rectangle area = scrollable.getClientArea();
+ Rectangle rect = event.getBounds();
+
+ /* Paint the selection beyond the end of last column */
+ expandRegion(event, scrollable, gc, area);
+
+ /* Draw Gradient Rectangle */
+ Color oldForeground = gc.getForeground();
+ Color oldBackground = gc.getBackground();
+
+ gc.setForeground(categoryGradientEnd);
+ gc.drawLine(0, rect.y, area.width, rect.y);
+
+ gc.setForeground(categoryGradientStart);
+ gc.setBackground(categoryGradientEnd);
+
+ // gc.setForeground(categoryGradientStart);
+ // gc.setBackground(categoryGradientEnd);
+ // gc.setForeground(new Clr(Display.getCurrent(), 255, 0, 0));
+
+ gc.fillGradientRectangle(0, rect.y + 1, area.width, rect.height, true);
+
+ /* Bottom Line */
+ // gc.setForeground();
+ gc.setForeground(categoryGradientEnd);
+ gc.drawLine(0, rect.y + rect.height - 1, area.width, rect.y + rect.height - 1);
+
+ gc.setForeground(oldForeground);
+ gc.setBackground(oldBackground);
+ /* Mark as Background being handled */
+ event.detail &= ~SWT.BACKGROUND;
+ }
+ }
+
+ private void expandRegion(Event event, Scrollable scrollable, GC gc, Rectangle area) {
+ int columnCount;
+ if (scrollable instanceof Table) {
+ columnCount = ((Table) scrollable).getColumnCount();
+ } else {
+ columnCount = ((Tree) scrollable).getColumnCount();
+ }
+
+ if (event.index == columnCount - 1 || columnCount == 0) {
+ int width = area.x + area.width - event.x;
+ if (width > 0) {
+ Region region = new Region();
+ gc.getClipping(region);
+ region.add(event.x, event.y, width, event.height);
+ gc.setClipping(region);
+ region.dispose();
+ }
+ }
+ }
+ };
+
+ protected abstract boolean shouldApplyGradient(Event event);
+
+ private final IPropertyChangeListener THEME_CHANGE_LISTENER = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(IThemeManager.CHANGE_CURRENT_THEME)
+ || event.getProperty().equals(CommonThemes.COLOR_SCHEDULED_PAST)
+ || event.getProperty().equals(CommonThemes.COLOR_COMPLETED_TODAY)
+ || event.getProperty().equals(CommonThemes.COLOR_COMPLETED)
+ || event.getProperty().equals(CommonThemes.COLOR_OVERDUE)
+ || event.getProperty().equals(CommonThemes.COLOR_SCHEDULED_TODAY)
+ || event.getProperty().equals(CommonThemes.COLOR_SCHEDULED_PAST)
+ || event.getProperty().equals(CommonThemes.COLOR_SCHEDULED_TODAY)
+ || event.getProperty().equals(CommonThemes.COLOR_SCHEDULED_THIS_WEEK)
+ || event.getProperty().equals(CommonThemes.COLOR_TASK_ACTIVE)
+ || CommonThemes.isCommonTheme(event.getProperty())) {
+ configureGradientColors();
+ }
+ }
+ };
+
+ private boolean gradientListenerAdded = false;
+
+ private final IThemeManager themeManager;
+
+ private Color categoryGradientStart;
+
+ private Color categoryGradientEnd;
+
+ private final TreeViewer treeViewer;
+
+ public GradientDrawer(IThemeManager theThemeManager, TreeViewer treeViewer) {
+ this.themeManager = theThemeManager;
+ this.treeViewer = treeViewer;
+ treeViewer.getControl().addDisposeListener(new DisposeListener() {
+
+ public void widgetDisposed(DisposeEvent e) {
+ if (themeManager != null) {
+ themeManager.removePropertyChangeListener(THEME_CHANGE_LISTENER);
+ }
+ }
+ });
+ configureGradientColors();
+ themeManager.addPropertyChangeListener(THEME_CHANGE_LISTENER);
+ }
+
+ private void configureGradientColors() {
+ categoryGradientStart = themeManager.getCurrentTheme()
+ .getColorRegistry()
+ .get(CommonThemes.COLOR_CATEGORY_GRADIENT_START);
+ categoryGradientEnd = themeManager.getCurrentTheme()
+ .getColorRegistry()
+ .get(CommonThemes.COLOR_CATEGORY_GRADIENT_END);
+
+ boolean customized = true;
+ if (categoryGradientStart != null && categoryGradientStart.getRed() == 240
+ && categoryGradientStart.getGreen() == 240 && categoryGradientStart.getBlue() == 240
+ && categoryGradientEnd != null && categoryGradientEnd.getRed() == 220
+ && categoryGradientEnd.getGreen() == 220 && categoryGradientEnd.getBlue() == 220) {
+ customized = false;
+ }
+
+ if (gradientListenerAdded == false && categoryGradientStart != null
+ && !categoryGradientStart.equals(categoryGradientEnd)) {
+ getViewer().getTree().addListener(SWT.EraseItem, CATEGORY_GRADIENT_DRAWER);
+ gradientListenerAdded = true;
+ if (!customized) {
+ // Set parent-based colors
+ Color parentBackground = getViewer().getTree().getParent().getBackground();
+ double GRADIENT_TOP;// = 1.05;// 1.02;
+ double GRADIENT_BOTTOM;// = .995;// 1.035;
+
+ // Constants to darken or lighten the default gradients
+ if ("Windows 7".equals(System.getProperty("os.name"))) { //$NON-NLS-1$//$NON-NLS-2$
+ GRADIENT_TOP = 1.05;
+ GRADIENT_BOTTOM = 1.09;
+ } else {
+ GRADIENT_TOP = 1.05;
+ GRADIENT_BOTTOM = .995;
+ }
+
+ int red = Math.max(0, Math.min(255, (int) (parentBackground.getRed() * GRADIENT_TOP)));
+ int green = Math.max(0, Math.min(255, (int) (parentBackground.getGreen() * GRADIENT_TOP)));
+ int blue = Math.max(0, Math.min(255, (int) (parentBackground.getBlue() * GRADIENT_TOP)));
+
+ try {
+ categoryGradientStart = new Color(Display.getDefault(), red, green, blue);
+ } catch (Exception e) {
+ categoryGradientStart = getViewer().getTree().getParent().getBackground();
+// StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not set color: " + red //$NON-NLS-1$
+// + ", " + green + ", " + blue, e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ red = Math.min(255, Math.max(0, (int) (parentBackground.getRed() / GRADIENT_BOTTOM)));
+ green = Math.min(255, Math.max(0, (int) (parentBackground.getGreen() / GRADIENT_BOTTOM)));
+ blue = Math.min(255, Math.max(0, (int) (parentBackground.getBlue() / GRADIENT_BOTTOM)));
+
+ try {
+ categoryGradientEnd = new Color(Display.getDefault(), red, green, blue);
+ } catch (Exception e) {
+ categoryGradientStart = getViewer().getTree().getParent().getBackground();
+// StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not set color: " + red //$NON-NLS-1$
+// + ", " + green + ", " + blue, e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ } else if (categoryGradientStart != null && categoryGradientStart.equals(categoryGradientEnd)) {
+ getViewer().getTree().removeListener(SWT.EraseItem, CATEGORY_GRADIENT_DRAWER);
+ gradientListenerAdded = false;
+ }
+ }
+
+ public TreeViewer getViewer() {
+ return treeViewer;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/InPlaceCheckBoxTreeDialog.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/InPlaceCheckBoxTreeDialog.java
new file mode 100644
index 0000000..986118d
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/InPlaceCheckBoxTreeDialog.java
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.commons.workbench;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.mylyn.commons.ui.dialogs.AbstractInPlaceDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.PatternFilter;
+import org.eclipse.ui.progress.WorkbenchJob;
+
+/**
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public class InPlaceCheckBoxTreeDialog extends AbstractInPlaceDialog {
+
+ private final Map<String, String> validValues;
+
+ private CheckboxFilteredTree valueTree;
+
+ private final Set<String> selectedValues;
+
+ private final String dialogLabel;
+
+ private class CheckboxFilteredTree extends EnhancedFilteredTree {
+
+ public CheckboxFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
+ super(parent, treeStyle, filter);
+ }
+
+ @Override
+ protected WorkbenchJob doCreateRefreshJob() {
+ WorkbenchJob job = super.doCreateRefreshJob();
+ job.addJobChangeListener(new JobChangeAdapter() {
+ @Override
+ public void done(IJobChangeEvent event) {
+ if (event.getResult() != null && event.getResult().isOK() && !getViewer().getTree().isDisposed()) {
+ getViewer().setCheckedElements(selectedValues.toArray());
+ }
+ }
+ });
+ return job;
+ }
+
+ @Override
+ protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
+ return new CheckboxTreeViewer(parent, style);
+ }
+
+ @Override
+ public CheckboxTreeViewer getViewer() {
+ return (CheckboxTreeViewer) super.getViewer();
+ }
+
+ }
+
+ public InPlaceCheckBoxTreeDialog(Shell shell, Control openControl, List<String> values,
+ Map<String, String> validValues, String dialogLabel) {
+ super(shell, SWT.RIGHT, openControl);
+ Assert.isNotNull(values);
+ Assert.isNotNull(validValues);
+ Assert.isNotNull(dialogLabel);
+ this.selectedValues = new HashSet<String>(values);
+ this.validValues = validValues;
+ this.dialogLabel = dialogLabel;
+ setShellStyle(getShellStyle());
+ }
+
+ @Override
+ protected Control createControl(Composite parent) {
+ getShell().setText(dialogLabel);
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = MARGIN_SIZE;
+ layout.marginWidth = MARGIN_SIZE;
+ layout.horizontalSpacing = 0;
+ layout.verticalSpacing = 0;
+ composite.setLayout(layout);
+ GridData gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
+ composite.setLayoutData(gd);
+
+ valueTree = new CheckboxFilteredTree(composite, SWT.CHECK | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL
+ | SWT.BORDER, new SubstringPatternFilter());
+ gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
+ gd.heightHint = 175;
+ gd.widthHint = 160;
+ CheckboxTreeViewer viewer = valueTree.getViewer();
+ viewer.getControl().setLayoutData(gd);
+
+ if (validValues != null) {
+
+ viewer.setContentProvider(new ITreeContentProvider() {
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Map<?, ?>) {
+ return ((Map<?, ?>) parentElement).keySet().toArray();
+ }
+ return null;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ });
+
+ //viewer.setSorter(new ViewerSorter());
+ viewer.setLabelProvider(new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof String) {
+ return validValues.get(element);
+ }
+ return super.getText(element);
+ }
+ });
+ viewer.setInput(validValues);
+
+ Set<String> invalidValues = new HashSet<String>();
+
+ // Remove any currently entered invalid values
+ for (String value : selectedValues) {
+ if (!validValues.containsKey(value)) {
+ invalidValues.add(value);
+ }
+ }
+
+ // Remove any unselected values
+ for (String value : validValues.keySet()) {
+ if (!viewer.setChecked(value, true)) {
+ invalidValues.add(value);
+ }
+ }
+
+ selectedValues.removeAll(invalidValues);
+
+ viewer.setCheckedElements(selectedValues.toArray());
+
+ }
+
+ viewer.addCheckStateListener(new ICheckStateListener() {
+
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getChecked()) {
+ selectedValues.add((String) event.getElement());
+ } else {
+ selectedValues.remove(event.getElement());
+ }
+ }
+
+ });
+
+ return valueTree;
+ }
+
+ public Set<String> getSelectedValues() {
+ return new HashSet<String>(selectedValues);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/PropertiesAction.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/PropertiesAction.java
new file mode 100644
index 0000000..ff56c79
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/PropertiesAction.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.mylyn.internal.commons.workbench.Messages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
+
+/**
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class PropertiesAction extends BaseSelectionListenerAction {
+
+ public PropertiesAction() {
+ super(Messages.PropertiesAction_Properties);
+ }
+
+ @Override
+ public void run() {
+ WorkbenchUtil.openProperties(PlatformUI.getWorkbench());
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/SubstringPatternFilter.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/SubstringPatternFilter.java
new file mode 100644
index 0000000..b9f307f
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/SubstringPatternFilter.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * @author Mik Kersten
+ * @since 3.7
+ */
+public class SubstringPatternFilter extends PatternFilter {
+
+ @Override
+ public void setPattern(String patternString) {
+ if (patternString == null || patternString.startsWith("*")) { //$NON-NLS-1$
+ super.setPattern(patternString);
+ } else {
+ super.setPattern("*" + patternString); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TableTreePatternFilter.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TableTreePatternFilter.java
new file mode 100644
index 0000000..4547f80
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TableTreePatternFilter.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.jface.viewers.AbstractTreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public class TableTreePatternFilter extends PatternFilter {
+
+ @Override
+ protected boolean isParentMatch(Viewer viewer, Object element) {
+ if (viewer instanceof AbstractTreeViewer) {
+ return super.isParentMatch(viewer, element);
+ }
+ return false;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TaskBarManager.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TaskBarManager.java
new file mode 100644
index 0000000..705ae1f
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/TaskBarManager.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import java.lang.reflect.Method;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Provides access to the system task bar.
+ *
+ * @author Shawn Minto
+ * @since 3.7
+ */
+public class TaskBarManager {
+
+ private static final String TASK_BAR_MENU_MANAGER_KEY = "org.eclipse.mylyn.commons.TaskBarMenuManager.instance"; //$NON-NLS-1$
+
+ /**
+ * Returns a menu manger for the task bar if available.
+ *
+ * @return the system menu manager; null, if the task bar is not available
+ */
+ public static MenuManager getTaskBarMenuManager() {
+ Widget /* TaskItem */taskItem = getApplicationTaskItem();
+ if (taskItem != null) {
+ MenuManager taskBarMenuManager = getTaskBarMenuManager(taskItem);
+ return taskBarMenuManager;
+ }
+ return null;
+ }
+
+ private static Widget /* TaskItem */getApplicationTaskItem() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ if (workbench != null && workbench.getDisplay() != null && !workbench.isClosing()) {
+
+ try {
+ Class<?> taskBarClass = Class.forName("org.eclipse.swt.widgets.TaskBar"); //$NON-NLS-1$
+ Method getSystemTaskBarMethod = Display.class.getMethod("getSystemTaskBar"); //$NON-NLS-1$
+ Object systemTaskBar = getSystemTaskBarMethod.invoke(workbench.getDisplay());
+ if (systemTaskBar != null && systemTaskBar.getClass().equals(taskBarClass)) {
+
+ Method getItemMethod = taskBarClass.getMethod("getItem", Shell.class); //$NON-NLS-1$
+ Object taskItem = getItemMethod.invoke(systemTaskBar, new Object[] { null });
+ if (taskItem instanceof Widget) {
+ return (Widget) taskItem;
+ }
+ }
+ } catch (Throwable t) {
+ // ignore since class probably doesn't exist
+ }
+
+ }
+ return null;
+ }
+
+ private static TaskBarMenuManager getTaskBarMenuManager(Widget /* TaskItem */taskItem) {
+ Assert.isNotNull(taskItem);
+ TaskBarMenuManager taskBarMenuManager;
+ Object data = taskItem.getData(TASK_BAR_MENU_MANAGER_KEY);
+ if (data instanceof TaskBarMenuManager) {
+ taskBarMenuManager = (TaskBarMenuManager) data;
+ } else {
+ taskBarMenuManager = new TaskBarMenuManager(taskItem);
+ taskItem.setData(TASK_BAR_MENU_MANAGER_KEY, taskBarMenuManager);
+ }
+ return taskBarMenuManager;
+ }
+
+ private static final class TaskBarMenuManager extends MenuManager {
+
+ private final Widget taskItem;
+
+ public TaskBarMenuManager(Widget taskItem) {
+ this.taskItem = taskItem;
+ }
+
+ @Override
+ protected void update(boolean force, boolean recursive) {
+ // force Menu creation
+ Menu menu = getMenu();
+ if (menu == null) {
+ Shell shell = getShell();
+ if (shell != null) {
+ menu = createContextMenu(shell);
+ }
+ }
+ super.update(force, recursive);
+ if (menu != null && menu.getItemCount() == 0) {
+ // clear the menu on the TaskItem if there are no items
+ menu = null;
+ }
+ if (taskItem != null && !taskItem.isDisposed()) {
+ setMenuOnTaskItem(taskItem, menu);
+ }
+ }
+
+ private void setMenuOnTaskItem(Widget taskItem, Menu menu) {
+ try {
+ Class<?> taskItemClass = Class.forName("org.eclipse.swt.widgets.TaskItem"); //$NON-NLS-1$
+ if (taskItem.getClass().equals(taskItemClass)) {
+ Method setMenuMethod = taskItemClass.getMethod("setMenu", Menu.class); //$NON-NLS-1$
+ setMenuMethod.invoke(taskItem, menu);
+ }
+ } catch (Throwable t) {
+ // ignore since class probably doesn't exist
+ }
+ }
+
+ /**
+ * Based on {@link WorkbenchUtil#getNonModalShell()}
+ * <p>
+ * Get the active non modal shell. If there isn't one return null.
+ * <p>
+ * <b>Note: Applied from patch on bug 99472.</b>
+ *
+ * @return Shell
+ */
+ private static Shell getShell() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ if (windows.length > 0) {
+ return windows[0].getShell();
+ }
+ } else {
+ return window.getShell();
+ }
+
+ return null;
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchActionSupport.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchActionSupport.java
new file mode 100644
index 0000000..4bfccb7
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchActionSupport.java
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.mylyn.commons.ui.CommonImages;
+import org.eclipse.mylyn.commons.workbench.editors.CommonTextSupport;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.internal.WorkbenchImages;
+import org.eclipse.ui.internal.WorkbenchMessages;
+import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
+
+/**
+ * Manages commons workbench actions for editing text.
+ *
+ * @author Mik Kersten
+ * @author Rob Elves
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+@SuppressWarnings("restriction")
+public class WorkbenchActionSupport implements ISelectionChangedListener {
+
+ private class GlobalAction extends Action {
+
+ private final String actionId;
+
+ public GlobalAction(String actionId) {
+ this.actionId = actionId;
+ }
+
+ @Override
+ public void run() {
+ if (callback != null) {
+ callback.doAction(actionId, callback.getFocusControl());
+ updateActions(callback.getSelection());
+ }
+ }
+
+ public void selectionChanged(ISelection selection) {
+ if (callback != null) {
+ setEnabled(callback.canPerformAction(actionId, callback.getFocusControl()));
+ } else {
+ setEnabled(false);
+ }
+ }
+ }
+
+ public static class WorkbenchActionCallback {
+
+ public boolean canPerformAction(String actionId, Control control) {
+ return CommonTextSupport.canPerformAction(actionId, control);
+ }
+
+ public void doAction(String actionId, Control control) {
+ CommonTextSupport.doAction(actionId, control);
+ }
+
+ public Control getFocusControl() {
+ return Display.getDefault().getFocusControl();
+ }
+
+ public ISelection getSelection() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null && window.getSelectionService() != null) {
+ return window.getSelectionService().getSelection();
+ }
+ return null;
+ }
+
+ }
+
+ private WorkbenchActionCallback callback;
+
+ private final GlobalAction copyAction;
+
+ private final GlobalAction cutAction;
+
+ private final GlobalAction findAction;
+
+ private final GlobalAction pasteAction;
+
+ private final GlobalAction redoAction;
+
+ private final GlobalAction selectAllAction;
+
+ private final GlobalAction undoAction;
+
+ public WorkbenchActionSupport() {
+ cutAction = new GlobalAction(ActionFactory.CUT.getId());
+ cutAction.setText(WorkbenchMessages.Workbench_cut);
+ cutAction.setToolTipText(WorkbenchMessages.Workbench_cutToolTip);
+ cutAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
+ cutAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
+ cutAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
+ cutAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.CUT);
+
+ pasteAction = new GlobalAction(ActionFactory.PASTE.getId());
+ pasteAction.setText(WorkbenchMessages.Workbench_paste);
+ pasteAction.setToolTipText(WorkbenchMessages.Workbench_pasteToolTip);
+ pasteAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
+ pasteAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
+ pasteAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
+ pasteAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
+
+ copyAction = new GlobalAction(ActionFactory.COPY.getId());
+ copyAction.setText(WorkbenchMessages.Workbench_copy);
+ copyAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
+ copyAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
+ copyAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
+ copyAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.COPY);
+
+ undoAction = new GlobalAction(ActionFactory.UNDO.getId());
+ undoAction.setText(WorkbenchMessages.Workbench_undo);
+ undoAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
+ undoAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
+ undoAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED));
+ undoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.UNDO);
+
+ redoAction = new GlobalAction(ActionFactory.REDO.getId());
+ redoAction.setText(WorkbenchMessages.Workbench_redo);
+ redoAction.setImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+ redoAction.setHoverImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+ redoAction.setDisabledImageDescriptor(WorkbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED));
+ redoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.REDO);
+
+ selectAllAction = new GlobalAction(ActionFactory.SELECT_ALL.getId());
+ selectAllAction.setText(WorkbenchMessages.Workbench_selectAll);
+ selectAllAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.SELECT_ALL);
+ selectAllAction.setEnabled(true);
+
+ findAction = new GlobalAction(ActionFactory.FIND.getId());
+ findAction.setText(WorkbenchMessages.Workbench_findReplace);
+ findAction.setImageDescriptor(CommonImages.FIND);
+ findAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_REPLACE);
+ }
+
+ public void contributeActions(IMenuManager manager) {
+ manager.add(undoAction);
+ manager.add(redoAction);
+ manager.add(new Separator());
+ manager.add(cutAction);
+ manager.add(copyAction);
+ manager.add(pasteAction);
+ manager.add(selectAllAction);
+ manager.add(new Separator());
+ }
+
+ public void forceEditActionsEnabled() {
+ cutAction.setEnabled(true);
+ copyAction.setEnabled(true);
+ pasteAction.setEnabled(true);
+ selectAllAction.setEnabled(true);
+ undoAction.setEnabled(false);
+ redoAction.setEnabled(false);
+ }
+
+ public WorkbenchActionCallback getCallback() {
+ return callback;
+ }
+
+ public Action getCopyAction() {
+ return copyAction;
+ }
+
+ public Action getCutAction() {
+ return cutAction;
+ }
+
+ public Action getFindAction() {
+ return findAction;
+ }
+
+ public Action getPasteAction() {
+ return pasteAction;
+ }
+
+ public Action getRedoAction() {
+ return redoAction;
+ }
+
+ public Action getSelectAllAction() {
+ return selectAllAction;
+ }
+
+ public Action getUndoAction() {
+ return undoAction;
+ }
+
+ public void install(IActionBars bars) {
+ bars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
+ bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
+ bars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
+ bars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
+ bars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
+ bars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAllAction);
+ bars.setGlobalActionHandler(ActionFactory.FIND.getId(), findAction);
+ bars.updateActionBars();
+ }
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof TextSelection) {
+ // only update global actions
+ updateActions(event.getSelection());
+ } else if (selection.isEmpty()) {
+ // XXX a styled text widget has lost focus, re-enable all edit actions
+ forceEditActionsEnabled();
+ }
+ }
+
+ public void setCallback(WorkbenchActionCallback callback) {
+ this.callback = callback;
+ }
+
+ public void uninstall(IActionBars bars) {
+ bars.setGlobalActionHandler(ActionFactory.CUT.getId(), null);
+ bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), null);
+ bars.setGlobalActionHandler(ActionFactory.COPY.getId(), null);
+ bars.setGlobalActionHandler(ActionFactory.UNDO.getId(), null);
+ bars.setGlobalActionHandler(ActionFactory.REDO.getId(), null);
+ bars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), null);
+ bars.setGlobalActionHandler(ActionFactory.FIND.getId(), null);
+ bars.updateActionBars();
+ }
+
+ public void updateActions(ISelection selection) {
+ cutAction.selectionChanged(selection);
+ copyAction.selectionChanged(selection);
+ pasteAction.selectionChanged(selection);
+ undoAction.selectionChanged(selection);
+ redoAction.selectionChanged(selection);
+ selectAllAction.selectionChanged(selection);
+ findAction.selectionChanged(selection);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchUtil.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchUtil.java
new file mode 100644
index 0000000..3d29194
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/WorkbenchUtil.java
@@ -0,0 +1,334 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ * IBM Corporation - helper methods from
+ * org.eclipse.wst.common.frameworks.internal.ui.WTPActivityHelper
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.mylyn.commons.core.ICoreRunnable;
+import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IPluginContribution;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.activities.IIdentifier;
+import org.eclipse.ui.activities.IWorkbenchActivitySupport;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.services.IServiceLocator;
+import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
+
+/**
+ * @author Mik Kersten
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class WorkbenchUtil {
+
+ public static final String GROUP_EDIT = "group.edit"; //$NON-NLS-1$
+
+ public static final String GROUP_FILE = "group.file"; //$NON-NLS-1$
+
+ public static final String GROUP_REFRESH = "group.refresh"; //$NON-NLS-1$
+
+ public static final String GROUP_FILTER = "group.filter"; //$NON-NLS-1$
+
+ public static final String GROUP_NAVIGATE = "group.navigate"; //$NON-NLS-1$
+
+ public static final String GROUP_NEW = "group.new"; //$NON-NLS-1$
+
+ public static final String GROUP_OPEN = "group.open"; //$NON-NLS-1$
+
+ public static final String GROUP_PREFERENCES = "group.preferences"; //$NON-NLS-1$
+
+ public static final String GROUP_PROPERTIES = "group.properties"; //$NON-NLS-1$
+
+ public static final String GROUP_RUN = "group.run"; //$NON-NLS-1$
+
+ // TODO e3.6 IProgressConstants2#SHOW_IN_TASKBAR_ICON_PROPERTY
+ public static final QualifiedName SHOW_IN_TASKBAR_ICON_PROPERTY = new QualifiedName(
+ "org.eclipse.ui.workbench.progress", "inTaskBarIcon"); //$NON-NLS-1$//$NON-NLS-2$
+
+// public static IViewPart getFromActivePerspective(String viewId) {
+// if (PlatformUI.isWorkbenchRunning()) {
+// IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+// if (activePage != null) {
+// return activePage.findView(viewId);
+// }
+// }
+// return null;
+// }
+
+ public static IViewPart showViewInActiveWindow(String viewId) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ IWorkbenchPage page = window.getActivePage();
+ if (page != null) {
+ try {
+ return page.showView(viewId);
+ } catch (PartInitException e) {
+ // ignore
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return the modal shell that is currently open. If there isn't one then return null.
+ * <p>
+ * <b>Note: Applied from patch on bug 99472.</b>
+ *
+ * @param shell
+ * A shell to exclude from the search. May be <code>null</code>.
+ * @return Shell or <code>null</code>.
+ */
+ private static Shell getModalShellExcluding(Shell shell) {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ Shell[] shells = workbench.getDisplay().getShells();
+ int modal = SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL | SWT.PRIMARY_MODAL;
+ for (Shell shell2 : shells) {
+ if (shell2.equals(shell)) {
+ break;
+ }
+ // Do not worry about shells that will not block the user.
+ if (shell2.isVisible()) {
+ int style = shell2.getStyle();
+ if ((style & modal) != 0) {
+ return shell2;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Utility method to get the best parenting possible for a dialog. If there is a modal shell create it so as to
+ * avoid two modal dialogs. If not then return the shell of the active workbench window. If neither can be found
+ * return null.
+ * <p>
+ * <b>Note: Applied from patch on bug 99472.</b>
+ *
+ * @return Shell or <code>null</code>
+ */
+ public static Shell getShell() {
+ if (!PlatformUI.isWorkbenchRunning() || PlatformUI.getWorkbench().isClosing()) {
+ return null;
+ }
+ Shell modal = getModalShellExcluding(null);
+ if (modal != null) {
+ return modal;
+ }
+ return getNonModalShell();
+ }
+
+ /**
+ * Get the active non modal shell. If there isn't one return null.
+ * <p>
+ * <b>Note: Applied from patch on bug 99472.</b>
+ *
+ * @return Shell
+ */
+ private static Shell getNonModalShell() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null) {
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ if (windows.length > 0) {
+ return windows[0].getShell();
+ }
+ } else {
+ return window.getShell();
+ }
+
+ return null;
+ }
+
+ /**
+ * @return whether the UI is set up to filter contributions (has defined activity categories).
+ */
+ public static final boolean isFiltering() {
+ return !PlatformUI.getWorkbench().getActivitySupport().getActivityManager().getDefinedActivityIds().isEmpty();
+ }
+
+ public static boolean allowUseOf(Object object) {
+ if (!isFiltering()) {
+ return true;
+ }
+ if (object instanceof IPluginContribution) {
+ IPluginContribution contribution = (IPluginContribution) object;
+ if (contribution.getPluginId() != null) {
+ IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
+ IIdentifier identifier = workbenchActivitySupport.getActivityManager().getIdentifier(
+ createUnifiedId(contribution));
+ return identifier.isEnabled();
+ }
+ }
+ if (object instanceof String) {
+ IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
+ IIdentifier identifier = workbenchActivitySupport.getActivityManager().getIdentifier((String) object);
+ return identifier.isEnabled();
+ }
+ return true;
+ }
+
+ private static final String createUnifiedId(IPluginContribution contribution) {
+ if (contribution.getPluginId() != null) {
+ return contribution.getPluginId() + '/' + contribution.getLocalId();
+ }
+ return contribution.getLocalId();
+ }
+
+ public static void addDefaultGroups(IMenuManager menuManager) {
+ menuManager.add(new Separator(GROUP_NEW));
+ menuManager.add(new Separator(GROUP_OPEN));
+ menuManager.add(new Separator(GROUP_EDIT));
+ menuManager.add(new Separator(GROUP_FILE));
+ menuManager.add(new Separator(GROUP_RUN));
+ menuManager.add(new Separator(GROUP_NAVIGATE));
+ menuManager.add(new Separator(GROUP_REFRESH));
+ menuManager.add(new Separator(GROUP_FILTER));
+ menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menuManager.add(new Separator(GROUP_PROPERTIES));
+ }
+
+ public static Object openProperties(IServiceLocator serviceLocator) {
+ IHandlerService service = (IHandlerService) serviceLocator.getService(IHandlerService.class);
+ if (service != null) {
+ try {
+ return service.executeCommand(IWorkbenchActionDefinitionIds.PROPERTIES, null);
+ } catch (NotEnabledException e) {
+ // ignore
+ } catch (Exception e) {
+ CommonsWorkbenchPlugin.getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN,
+ "Opening repository properties failed", e)); //$NON-NLS-1$
+ }
+ }
+ return IStatus.CANCEL;
+ }
+
+ public static void busyCursorWhile(final ICoreRunnable runnable) throws OperationCanceledException, CoreException {
+ try {
+ IRunnableWithProgress runner = new IRunnableWithProgress() {
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ runnable.run(monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } catch (OperationCanceledException e) {
+ throw new InterruptedException();
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runner);
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof CoreException) {
+ throw (CoreException) e.getCause();
+ } else {
+ CommonsWorkbenchPlugin.getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, "Unexpected exception", e)); //$NON-NLS-1$
+ }
+ } catch (InterruptedException e) {
+ throw new OperationCanceledException();
+ }
+ }
+
+ public static void runInUi(ICoreRunnable runnable, ISchedulingRule rule) throws CoreException {
+ WorkbenchUtil.runInUi(PlatformUI.getWorkbench().getProgressService(), runnable, rule);
+ }
+
+ public static void runInUi(IRunnableContext context, final ICoreRunnable runnable, ISchedulingRule rule)
+ throws CoreException {
+ try {
+ IRunnableWithProgress runner = new IRunnableWithProgress() {
+ public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ runnable.run(monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } catch (OperationCanceledException e) {
+ throw new InterruptedException();
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ PlatformUI.getWorkbench().getProgressService().runInUI(context, runner, rule);
+ } catch (InvocationTargetException e) {
+ if (e.getCause() instanceof CoreException) {
+ throw (CoreException) e.getCause();
+ } else {
+ CommonsWorkbenchPlugin.getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, "Unexpected exception", e)); //$NON-NLS-1$
+ }
+ } catch (InterruptedException e) {
+ throw new OperationCanceledException();
+ }
+ }
+
+ public static Image getWorkbenchShellImage(int maximumHeight) {
+ // always use the launching workbench window
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ if (windows != null && windows.length > 0) {
+ IWorkbenchWindow workbenchWindow = windows[0];
+ if (workbenchWindow != null && !workbenchWindow.getShell().isDisposed()) {
+ Image image = getShell().getImage();
+ int diff = Integer.MAX_VALUE;
+ if (image != null && image.getBounds().height <= maximumHeight) {
+ diff = maximumHeight - image.getBounds().height;
+ } else {
+ image = null;
+ }
+
+ Image[] images = getShell().getImages();
+ if (images != null && images.length > 0) {
+ // find the icon that is closest in size, but not larger than maximumHeight
+ for (Image image2 : images) {
+ int newDiff = maximumHeight - image2.getBounds().height;
+ if (newDiff >= 0 && newDiff <= diff) {
+ diff = newDiff;
+ image = image2;
+ }
+ }
+ }
+
+ return image;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/BrowserUtil.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/BrowserUtil.java
new file mode 100644
index 0000000..fd26202
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/BrowserUtil.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench.browser;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Calendar;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.mylyn.commons.core.CoreUtil;
+import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
+import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
+import org.eclipse.mylyn.internal.commons.workbench.Messages;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.internal.browser.WebBrowserPreference;
+import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
+
+/**
+ * Provides a utilities for opening locations in a browser.
+ *
+ * @author Steffen Pingel
+ */
+public class BrowserUtil {
+
+ /**
+ * Opens <code>location</code> in a web-browser according to the Eclipse workbench preferences.
+ *
+ * @param location
+ * the url to open
+ * @see #openUrl(String, int)
+ */
+ public static void openUrl(String location) {
+ openUrl(location, SWT.NONE);
+ }
+
+ /**
+ * Opens <code>location</code> in a web-browser according to the Eclipse workbench preferences.
+ *
+ * @param location
+ * the url to open
+ * @param customFlags
+ * additional flags that are passed to {@link IWorkbenchBrowserSupport}, pass
+ * {@link IWorkbenchBrowserSupport#AS_EXTERNAL} to force opening external browser
+ */
+ public static void openUrl(String location, int customFlags) {
+ try {
+ URL url = null;
+ if (location != null) {
+ url = new URL(location);
+ }
+ if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL
+ || (customFlags & IWorkbenchBrowserSupport.AS_EXTERNAL) != 0) {
+ try {
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
+ support.getExternalBrowser().openURL(url);
+ } catch (PartInitException e) {
+ Status status = new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN,
+ Messages.WorkbenchUtil_Browser_Initialization_Failed);
+ CommonsWorkbenchPlugin.getDefault().getLog().log(status);
+ if (!CoreUtil.TEST_MODE) {
+ MessageDialog.openError(WorkbenchUtil.getShell(), Messages.WorkbenchUtil_Open_Location_Title,
+ status.getMessage());
+ }
+ }
+ } else {
+ IWebBrowser browser = null;
+ int flags = customFlags;
+ if (WorkbenchBrowserSupport.getInstance().isInternalWebBrowserAvailable()) {
+ flags |= IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.LOCATION_BAR
+ | IWorkbenchBrowserSupport.NAVIGATION_BAR;
+ } else {
+ flags |= IWorkbenchBrowserSupport.AS_EXTERNAL | IWorkbenchBrowserSupport.LOCATION_BAR
+ | IWorkbenchBrowserSupport.NAVIGATION_BAR;
+ }
+
+ String generatedId = "org.eclipse.mylyn.web.browser-" + Calendar.getInstance().getTimeInMillis(); //$NON-NLS-1$
+ browser = WorkbenchBrowserSupport.getInstance().createBrowser(flags, generatedId, null, null);
+ browser.openURL(url);
+ }
+ } catch (PartInitException e) {
+ Status status = new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN,
+ Messages.WorkbenchUtil_Browser_Initialization_Failed, e);
+ CommonsWorkbenchPlugin.getDefault().getLog().log(status);
+ if (!CoreUtil.TEST_MODE) {
+ MessageDialog.openError(WorkbenchUtil.getShell(), Messages.WorkbenchUtil_Open_Location_Title,
+ status.getMessage());
+ }
+ } catch (MalformedURLException e) {
+ if (location != null && location.trim().equals("")) { //$NON-NLS-1$
+ Status status = new Status(IStatus.WARNING, CommonsWorkbenchPlugin.ID_PLUGIN,
+ Messages.WorkbenchUtil_No_URL_Error, e);
+ if (!CoreUtil.TEST_MODE) {
+ MessageDialog.openWarning(WorkbenchUtil.getShell(), Messages.WorkbenchUtil_Open_Location_Title,
+ status.getMessage());
+ } else {
+ CommonsWorkbenchPlugin.getDefault().getLog().log(status);
+ }
+ } else {
+ Status status = new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, NLS.bind(
+ Messages.WorkbenchUtil_Invalid_URL_Error, location), e);
+ if (!CoreUtil.TEST_MODE) {
+ MessageDialog.openError(WorkbenchUtil.getShell(), Messages.WorkbenchUtil_Open_Location_Title,
+ status.getMessage());
+ } else {
+ CommonsWorkbenchPlugin.getDefault().getLog().log(status);
+ }
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/WebBrowserDialog.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/WebBrowserDialog.java
new file mode 100644
index 0000000..61627ff
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/browser/WebBrowserDialog.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench.browser;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.window.Window;
+import org.eclipse.mylyn.commons.ui.PlatformUiUtil;
+import org.eclipse.mylyn.internal.commons.workbench.CommonsWorkbenchPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.StatusTextEvent;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.eclipse.ui.statushandlers.StatusManager;
+
+/**
+ * Dialog that show the contents of an HTML page or the content of a URL in a dialog.
+ *
+ * @author Shawn Minto
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class WebBrowserDialog extends MessageDialog {
+
+ private String text;
+
+ private Browser browser;
+
+ private Label statusLabel;
+
+ public WebBrowserDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage,
+ int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
+ super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels,
+ defaultIndex);
+ this.setShellStyle(SWT.SHELL_TRIM | SWT.RESIZE);
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ if (browser != null) {
+ browser.setText(text);
+ }
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public boolean setUrl(String url, String postData, String[] headers) {
+ // TODO e3.6 replace reflection with call to setUrl(...)
+ Method method;
+ try {
+ method = Browser.class.getDeclaredMethod("setUrl", String.class, String.class, //$NON-NLS-1$
+ String[].class);
+ return (Boolean) method.invoke(getBrowser(), url, postData, headers);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public static int openText(Shell parent, String title, String message, String text) {
+ if (PlatformUiUtil.hasInternalBrowser()) {
+ WebBrowserDialog dialog = new WebBrowserDialog(parent, title, null, message, NONE,
+ new String[] { IDialogConstants.OK_LABEL }, 0);
+ dialog.setText(text);
+ return dialog.open();
+ } else {
+ File file = null;
+ try {
+ file = File.createTempFile("temp", ".html"); //$NON-NLS-1$ //$NON-NLS-2$
+ file.deleteOnExit();
+ BufferedWriter writer = new BufferedWriter(new FileWriter(file));
+ try {
+ writer.write(message);
+ } finally {
+ writer.close();
+ }
+ } catch (IOException e) {
+ if (file != null) {
+ file.delete();
+ }
+ StatusManager.getManager().handle(
+ new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN,
+ "Unexpected error while displaying page", e), StatusManager.LOG); //$NON-NLS-1$
+ return Window.CANCEL;
+ }
+ BrowserUtil.openUrl(file.toURI().toString(), IWorkbenchBrowserSupport.AS_EXTERNAL);
+ return Window.OK;
+ }
+ }
+
+ @Override
+ public Control createCustomArea(Composite parent) {
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ parent.setLayout(layout);
+
+ browser = new Browser(parent, SWT.BORDER);
+ GridDataFactory.fillDefaults().grab(true, true).applyTo(browser);
+
+ statusLabel = new Label(parent, SWT.NONE);
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(statusLabel);
+
+ browser.addStatusTextListener(new StatusTextListener() {
+ public void changed(StatusTextEvent event) {
+ statusLabel.setText((event.text != null) ? event.text : ""); //$NON-NLS-1$
+ }
+ });
+ if (text != null) {
+ browser.setText(text);
+ }
+
+ Dialog.applyDialogFont(parent);
+ return parent;
+ }
+
+ public Browser getBrowser() {
+ return browser;
+ }
+
+ @Override
+ protected Point getInitialSize() {
+ return new Point(500, 500);
+ }
+
+}
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/editors/CommonTextSupport.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/editors/CommonTextSupport.java
new file mode 100644
index 0000000..c8ea547
--- /dev/null
+++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/editors/CommonTextSupport.java
@@ -0,0 +1,333 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.commons.workbench.editors;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.operations.IOperationHistoryListener;
+import org.eclipse.core.commands.operations.OperationHistoryEvent;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.commands.ActionHandler;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.TextViewer;
+import org.eclipse.jface.text.source.AnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationAccess;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.ui.ActiveShellExpression;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.editors.text.EditorsUI;
+import org.eclipse.ui.handlers.IHandlerActivation;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.texteditor.AnnotationPreference;
+import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
+import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
+
+/**
+ * Utility class that enables edit actions, content assist and quick fixing for {@link TextViewer} and
+ * {@link SourceViewer} controls.
+ *
+ * @author Steffen Pingel
+ * @since 3.7
+ */
+public class CommonTextSupport {
+
+ private class UndoRedoListener implements IOperationHistoryListener {
+
+ private TextViewer viewer;
+
+ public void historyNotification(OperationHistoryEvent event) {
+ if (viewer != null && selectionChangedListener != null && Display.getCurrent() != null) {
+ selectionChangedListener.selectionChanged(new SelectionChangedEvent(viewer, viewer.getSelection()));
+ }
+ }
+
+ public void setViewer(TextViewer viewer) {
+ this.viewer = viewer;
+ }
+
+ }
+
+ private class TextViewerFocusListener implements FocusListener {
+
+ private final boolean spellCheck;
+
+ private final TextViewer viewer;
+
+ public TextViewerFocusListener(TextViewer viewer, boolean spellCheck) {
+ this.viewer = viewer;
+ this.spellCheck = spellCheck;
+ }
+
+ public void focusGained(FocusEvent e) {
+ if (selectionChangedListener != null) {
+ selectionChangedListener.selectionChanged(new SelectionChangedEvent(viewer, viewer.getSelection()));
+ }
+ activateHandlers(viewer, spellCheck);
+ }
+
+ public void focusLost(FocusEvent e) {
+ deactivateHandlers();
+ if (selectionChangedListener != null) {
+ // make sure selection no text is selected when control looses focus
+ StyledText st = (StyledText) e.widget;
+ st.setSelectionRange(st.getCaretOffset(), 0);
+ // update action enablement
+ selectionChangedListener.selectionChanged(new SelectionChangedEvent(viewer, StructuredSelection.EMPTY));
+ }
+ }
+ }
+
+ private static final String KEY_TEXT_VIEWER = "textViewer"; //$NON-NLS-1$
+
+ private static boolean canDoGlobalAction(String actionId, TextViewer textViewer) {
+ if (actionId.equals(ActionFactory.CUT.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.CUT);
+ } else if (actionId.equals(ActionFactory.COPY.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.COPY);
+ } else if (actionId.equals(ActionFactory.PASTE.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.PASTE);
+ } else if (actionId.equals(ActionFactory.DELETE.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.DELETE);
+ } else if (actionId.equals(ActionFactory.UNDO.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.UNDO);
+ } else if (actionId.equals(ActionFactory.REDO.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.REDO);
+ } else if (actionId.equals(ActionFactory.SELECT_ALL.getId())) {
+ return textViewer.canDoOperation(ITextOperationTarget.SELECT_ALL);
+ }
+ return false;
+ }
+
+ public static boolean canPerformAction(String actionId, Control focusControl) {
+ TextViewer viewer = getTextViewer(focusControl);
+ if (viewer != null) {
+ return canDoGlobalAction(actionId, viewer);
+ }
+ if (actionId.equals(ActionFactory.UNDO.getId()) || actionId.equals(ActionFactory.REDO.getId())) {
+ return false;
+ }
+ return true;
+ }
+
+ private static boolean canPerformDirectly(String id, Control control) {
+ if (control instanceof Text) {
+ Text text = (Text) control;
+ if (id.equals(ActionFactory.CUT.getId())) {
+ text.cut();
+ return true;
+ }
+ if (id.equals(ActionFactory.COPY.getId())) {
+ text.copy();
+ return true;
+ }
+ if (id.equals(ActionFactory.PASTE.getId())) {
+ text.paste();
+ return true;
+ }
+ if (id.equals(ActionFactory.SELECT_ALL.getId())) {
+ text.selectAll();
+ return true;
+ }
+ if (id.equals(ActionFactory.DELETE.getId())) {
+ int count = text.getSelectionCount();
+ if (count == 0) {
+ int caretPos = text.getCaretPosition();
+ text.setSelection(caretPos, caretPos + 1);
+ }
+ text.insert(""); //$NON-NLS-1$
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static void doAction(String actionId, Control focusControl) {
+ if (canPerformDirectly(actionId, focusControl)) {
+ return;
+ }
+ TextViewer viewer = getTextViewer(focusControl);
+ if (viewer != null) {
+ doGlobalAction(actionId, viewer);
+ }
+ }
+
+ private static boolean doGlobalAction(String actionId, TextViewer textViewer) {
+ if (actionId.equals(ActionFactory.CUT.getId())) {
+ textViewer.doOperation(ITextOperationTarget.CUT);
+ return true;
+ } else if (actionId.equals(ActionFactory.COPY.getId())) {
+ textViewer.doOperation(ITextOperationTarget.COPY);
+ return true;
+ } else if (actionId.equals(ActionFactory.PASTE.getId())) {
+ textViewer.doOperation(ITextOperationTarget.PASTE);
+ return true;
+ } else if (actionId.equals(ActionFactory.DELETE.getId())) {
+ textViewer.doOperation(ITextOperationTarget.DELETE);
+ return true;
+ } else if (actionId.equals(ActionFactory.UNDO.getId())) {
+ textViewer.doOperation(ITextOperationTarget.UNDO);
+ return true;
+ } else if (actionId.equals(ActionFactory.REDO.getId())) {
+ textViewer.doOperation(ITextOperationTarget.REDO);
+ return true;
+ } else if (actionId.equals(ActionFactory.SELECT_ALL.getId())) {
+ textViewer.doOperation(ITextOperationTarget.SELECT_ALL);
+ return true;
+ }
+ return false;
+ }
+
+ public static TextViewer getTextViewer(Widget widget) {
+ if (widget instanceof StyledText) {
+ Object data = widget.getData(KEY_TEXT_VIEWER);
+ if (data instanceof TextViewer) {
+ return (TextViewer) data;
+ }
+ }
+ return null;
+ }
+
+ public static void setTextViewer(Widget widget, TextViewer textViewer) {
+ widget.setData(KEY_TEXT_VIEWER, textViewer);
+ }
+
+ public IHandlerActivation contentAssistHandlerActivation;
+
+ private final IHandlerService handlerService;
+
+ private IHandlerActivation quickAssistHandlerActivation;
+
+ private ISelectionChangedListener selectionChangedListener;
+
+ private final UndoRedoListener undoRedoListener;
+
+ public CommonTextSupport(IHandlerService handlerService) {
+ Assert.isNotNull(handlerService);
+ this.handlerService = handlerService;
+ this.undoRedoListener = new UndoRedoListener();
+ }
+
+ private IHandlerActivation activateHandler(TextViewer viewer, int operation, String actionDefinitionId) {
+ IHandler handler = createActionHandler(viewer, operation, actionDefinitionId);
+ return handlerService.activateHandler(actionDefinitionId, handler, //
+ new ActiveShellExpression(viewer.getTextWidget().getShell()));
+ }
+
+ private void activateHandlers(TextViewer viewer, boolean spellCheck) {
+ deactivateHandlers();
+ if (spellCheck) {
+ quickAssistHandlerActivation = activateHandler(viewer, ISourceViewer.QUICK_ASSIST,
+ ITextEditorActionDefinitionIds.QUICK_ASSIST);
+ }
+ contentAssistHandlerActivation = activateHandler(viewer, ISourceViewer.CONTENTASSIST_PROPOSALS,
+ ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+
+ undoRedoListener.setViewer(viewer);
+ OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(undoRedoListener);
+ }
+
+ public void configure(final TextViewer viewer, Document document, boolean spellCheck) {
+ if (spellCheck && viewer instanceof ISourceViewer) {
+ configureAsEditor((ISourceViewer) viewer, document);
+ } else {
+ viewer.setDocument(document);
+ }
+ install(viewer, spellCheck);
+ }
+
+ /** Configures annotation model for spell checking. */
+ private void configureAsEditor(ISourceViewer viewer, Document document) {
+ IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess();
+ final SourceViewerDecorationSupport support = new SourceViewerDecorationSupport(viewer, null, annotationAccess,
+ EditorsUI.getSharedTextColors());
+ Iterator<?> e = new MarkerAnnotationPreferences().getAnnotationPreferences().iterator();
+ while (e.hasNext()) {
+ support.setAnnotationPreference((AnnotationPreference) e.next());
+ }
+ support.install(EditorsUI.getPreferenceStore());
+ viewer.getTextWidget().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ support.uninstall();
+ }
+ });
+ AnnotationModel annotationModel = new AnnotationModel();
+ viewer.setDocument(document, annotationModel);
+ }
+
+ private IHandler createActionHandler(final ITextOperationTarget viewer, final int operation,
+ String actionDefinitionId) {
+ Action action = new Action() {
+ @Override
+ public void run() {
+ if (viewer.canDoOperation(operation)) {
+ viewer.doOperation(operation);
+ }
+ }
+ };
+ action.setActionDefinitionId(actionDefinitionId);
+ return new ActionHandler(action);
+ }
+
+ private void deactivateHandlers() {
+ if (quickAssistHandlerActivation != null) {
+ handlerService.deactivateHandler(quickAssistHandlerActivation);
+ quickAssistHandlerActivation = null;
+ }
+ if (contentAssistHandlerActivation != null) {
+ handlerService.deactivateHandler(contentAssistHand