diff options
author | Steffen Pingel | 2012-03-22 16:05:53 +0000 |
---|---|---|
committer | Steffen Pingel | 2012-04-09 06:17:46 +0000 |
commit | 45dbc520f0787595ace2bbccc8f5389248e9311b (patch) | |
tree | 1228a6311271ff7980a5288a3c7e60c2af2ba777 /stubs | |
parent | 7dde261997b43157d70e4c047e64e916ecbaecb1 (diff) | |
download | org.eclipse.mylyn.commons-45dbc520f0787595ace2bbccc8f5389248e9311b.tar.gz org.eclipse.mylyn.commons-45dbc520f0787595ace2bbccc8f5389248e9311b.tar.xz org.eclipse.mylyn.commons-45dbc520f0787595ace2bbccc8f5389248e9311b.zip |
NEW - bug 374506: remove deprecated internal provisional classes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374506
Change-Id: I02477f892f8689d91659136d866f7aca38ae36bd
Diffstat (limited to 'stubs')
6 files changed, 23 insertions, 259 deletions
diff --git a/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java b/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java index 82d4e54e..c987a6ba 100644 --- a/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java +++ b/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/NotificationsPreferencesPage.java @@ -20,7 +20,6 @@ import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.ICheckStateListener; @@ -35,12 +34,9 @@ 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.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -52,6 +48,7 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; /** * @author Steffen Pingel @@ -162,25 +159,6 @@ public class NotificationsPreferencesPage extends PreferencePage implements IWor return super.getText(element); } - @Override - public Image getImage(Object element) { - if (element instanceof NotificationEvent) { - NotificationEvent item = (NotificationEvent) element; - if (model.isSelected(item)) { - return CommonImages.getImage(CommonImages.CHECKED); - } else { - return null; - } - } - if (element instanceof NotificationElement) { - NotificationElement item = (NotificationElement) element; - ImageDescriptor imageDescriptor = item.getImageDescriptor(); - if (imageDescriptor != null) { - return CommonImages.getImage(imageDescriptor); - } - } - return super.getImage(element); - } } private TreeViewer eventsViewer; @@ -228,7 +206,7 @@ public class NotificationsPreferencesPage extends PreferencePage implements IWor label = new Label(composite, SWT.NONE); label.setText(Messages.NotificationsPreferencesPage_Notifiers_Label); // Create the tree showing all the various notification types - FilteredTree tree = new FilteredTree(composite, SWT.BORDER, new SubstringPatternFilter(), true); + FilteredTree tree = new FilteredTree(composite, SWT.BORDER, new PatternFilter(), true); eventsViewer = tree.getViewer(); GridDataFactory.fillDefaults().span(1, 2).grab(false, true).applyTo(tree); eventsViewer.setComparer(new NotificationEventComparer()); diff --git a/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java b/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java deleted file mode 100644 index b16d44bd..00000000 --- a/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/NotificationPopup.java +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* - * 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.internal.commons.ui.notifications.popup; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.layout.GridDataFactory; -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.CommonUiUtil; -import org.eclipse.mylyn.internal.provisional.commons.ui.ScalingHyperlink; -import org.eclipse.osgi.util.NLS; -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.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.forms.IFormColors; -import org.eclipse.ui.forms.events.HyperlinkAdapter; -import org.eclipse.ui.forms.events.HyperlinkEvent; - -/** - * @author Rob Elves - * @author Mik Kersten - */ -public class NotificationPopup extends AbstractNotificationPopup { - - private static final int NUM_NOTIFICATIONS_TO_DISPLAY = 4; - - private List<AbstractNotification> notifications; - - public NotificationPopup(Shell parent) { - super(parent.getDisplay()); - } - - @Override - protected void createContentArea(Composite parent) { - int count = 0; - for (final AbstractNotification notification : notifications) { - Composite notificationComposite = new Composite(parent, SWT.NO_FOCUS); - GridLayout gridLayout = new GridLayout(2, false); - GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.TOP).applyTo(notificationComposite); - notificationComposite.setLayout(gridLayout); - notificationComposite.setBackground(parent.getBackground()); - - if (count < NUM_NOTIFICATIONS_TO_DISPLAY) { - final Label notificationLabelIcon = new Label(notificationComposite, SWT.NO_FOCUS); - notificationLabelIcon.setBackground(parent.getBackground()); - notificationLabelIcon.setImage(notification.getNotificationKindImage()); - // FIXME -// if (!(notification instanceof TaskListNotificationReminder)) { -// final AbstractTask task = (AbstractTask) notification.getAdapter(AbstractTask.class); -// if (task != null) { -// notificationLabelIcon.addMouseListener(new MouseAdapter() { -// @Override -// public void mouseUp(MouseEvent e) { -// TasksUiPlugin.getTaskDataManager().setTaskRead(task, true); -// notificationLabelIcon.setImage(null); -// notificationLabelIcon.setToolTipText(null); -// } -// }); -// notificationLabelIcon.setToolTipText(Messages.TaskListNotificationPopup_Mark_Task_Read); -// } -// } - - // FIXME -// final TaskScalingHyperlink itemLink = new TaskScalingHyperlink(notificationComposite, SWT.BEGINNING -// | SWT.NO_FOCUS); - - final ScalingHyperlink itemLink = new ScalingHyperlink(notificationComposite, SWT.BEGINNING - | SWT.NO_FOCUS); - GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.TOP).applyTo(itemLink); - itemLink.setForeground(CommonColors.HYPERLINK_WIDGET); - itemLink.registerMouseTrackListener(); - itemLink.setText(CommonUiUtil.toLabel(notification.getLabel())); - itemLink.setImage(notification.getNotificationImage()); - itemLink.setBackground(parent.getBackground()); - itemLink.addHyperlinkListener(new HyperlinkAdapter() { - @Override - public void linkActivated(HyperlinkEvent e) { - notification.open(); - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window != null) { - Shell windowShell = window.getShell(); - if (windowShell != null) { - if (windowShell.getMinimized()) { - windowShell.setMinimized(false); - } - - windowShell.open(); - windowShell.forceActive(); - } - } - } - }); - - String descriptionText = null; - if (notification.getDescription() != null) { - descriptionText = notification.getDescription(); - } - if (descriptionText != null && !descriptionText.trim().equals("")) { //$NON-NLS-1$ - Label descriptionLabel = new Label(notificationComposite, SWT.NO_FOCUS); - descriptionLabel.setText(CommonUiUtil.toLabel(descriptionText)); - descriptionLabel.setBackground(parent.getBackground()); - GridDataFactory.fillDefaults() - .span(2, SWT.DEFAULT) - .grab(true, false) - .align(SWT.FILL, SWT.TOP) - .applyTo(descriptionLabel); - } - } else { - int numNotificationsRemain = notifications.size() - count; - ScalingHyperlink remainingLink = new ScalingHyperlink(notificationComposite, SWT.NO_FOCUS); - remainingLink.setForeground(CommonColors.HYPERLINK_WIDGET); - remainingLink.registerMouseTrackListener(); - remainingLink.setBackground(parent.getBackground()); - - remainingLink.setText(NLS.bind("{0} more", numNotificationsRemain)); //$NON-NLS-1$ - GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(remainingLink); - remainingLink.addHyperlinkListener(new HyperlinkAdapter() { - @Override - public void linkActivated(HyperlinkEvent e) { - // FIXME - // TasksUiUtil.openTasksViewInActivePerspective().setFocus(); - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window != null) { - Shell windowShell = window.getShell(); - if (windowShell != null) { - windowShell.setMaximized(true); - windowShell.open(); - } - } - } - }); - break; - } - count++; - } - } - - @Override - protected void createTitleArea(Composite parent) { - super.createTitleArea(parent); - } - - public List<AbstractNotification> getNotifications() { - return new ArrayList<AbstractNotification>(notifications); - } - - @Override - protected Color getTitleForeground() { - return CommonsUiPlugin.getDefault().getFormColors(Display.getDefault()).getColor(IFormColors.TITLE); - - } - - public void setContents(List<AbstractNotification> notifications) { - this.notifications = notifications; - } - -} diff --git a/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink.java b/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink.java index 785ba85d..6ccef62d 100644 --- a/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink.java +++ b/stubs/org.eclipse.mylyn.commons.notifications/src/org/eclipse/mylyn/internal/commons/ui/notifications/popup/PopupNotificationSink.java @@ -25,11 +25,9 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.window.Window; import org.eclipse.mylyn.commons.ui.notifications.AbstractNotification; import org.eclipse.mylyn.commons.ui.notifications.NotificationSink; import org.eclipse.mylyn.commons.ui.notifications.NotificationSinkEvent; -import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchPreferenceConstants; import org.eclipse.ui.PlatformUI; @@ -52,45 +50,29 @@ public class PopupNotificationSink extends NotificationSink { private final Job openJob = new Job(Messages.PopupNotificationSink_Popup_Noifier_Job_Label) { @Override protected IStatus run(IProgressMonitor monitor) { - try { - if (Platform.isRunning() && PlatformUI.getWorkbench() != null - && PlatformUI.getWorkbench().getDisplay() != null - && !PlatformUI.getWorkbench().getDisplay().isDisposed()) { - PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { - - public void run() { - collectNotifications(); - - if (popup != null && popup.getReturnCode() == Window.CANCEL) { - List<AbstractNotification> notifications = popup.getNotifications(); - for (AbstractNotification notification : notifications) { - if (notification.getToken() != null) { - cancelledTokens.put(notification.getToken(), null); - } - } - } - - for (Iterator<AbstractNotification> it = currentlyNotifying.iterator(); it.hasNext();) { - AbstractNotification notification = it.next(); - if (notification.getToken() != null - && cancelledTokens.containsKey(notification.getToken())) { - it.remove(); - } + if (Platform.isRunning() && PlatformUI.getWorkbench() != null + && PlatformUI.getWorkbench().getDisplay() != null + && !PlatformUI.getWorkbench().getDisplay().isDisposed()) { + PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { + + public void run() { + collectNotifications(); + + for (Iterator<AbstractNotification> it = currentlyNotifying.iterator(); it.hasNext();) { + AbstractNotification notification = it.next(); + if (notification.getToken() != null && cancelledTokens.containsKey(notification.getToken())) { + it.remove(); } + } - synchronized (PopupNotificationSink.class) { - if (currentlyNotifying.size() > 0) { + synchronized (PopupNotificationSink.class) { + if (currentlyNotifying.size() > 0) { // popup.close(); - showPopup(); - } + showPopup(); } } - }); - } - } finally { - if (popup != null) { - schedule(popup.getDelayClose() / 2); - } + } + }); } if (monitor.isCanceled()) { @@ -102,8 +84,6 @@ public class PopupNotificationSink extends NotificationSink { }; - private NotificationPopup popup; - public PopupNotificationSink() { } @@ -145,19 +125,9 @@ public class PopupNotificationSink extends NotificationSink { } public void showPopup() { - if (popup != null) { - popup.close(); - } - - Shell shell = new Shell(PlatformUI.getWorkbench().getDisplay()); - popup = new NotificationPopup(shell); - popup.setFadingEnabled(isAnimationsEnabled()); List<AbstractNotification> toDisplay = new ArrayList<AbstractNotification>(currentlyNotifying); Collections.sort(toDisplay); - popup.setContents(toDisplay); cleanNotified(); - popup.setBlockOnOpen(false); - popup.open(); } } diff --git a/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java b/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java index 572cdb91..3cd83ee6 100644 --- a/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryUi.java +++ b/stubs/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.jface.wizard.WizardDialog; 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; @@ -83,7 +83,7 @@ public final class RepositoryUi { wizard.setForcePreviousAndNextButtons(true); Shell parent = workbenchWindow.getShell(); - ValidatableWizardDialog dialog = new ValidatableWizardDialog(parent, wizard); + WizardDialog dialog = new WizardDialog(parent, wizard); dialog.create(); dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT); //PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IWorkbenchHelpContextIds.NEW_WIZARD); diff --git a/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java b/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java index f2845ae4..a4aa2ed2 100644 --- a/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java +++ b/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/commons/ui/team/RepositoryWizardPage.java @@ -19,13 +19,12 @@ 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.swt.widgets.Composite; /** * @author Steffen Pingel */ -public class RepositoryWizardPage extends WizardPage implements IPartContainer, IAdaptable, IValidatable { +public class RepositoryWizardPage extends WizardPage implements IPartContainer, IAdaptable { private IAdaptable element; diff --git a/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java b/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java index 94152ad7..170b2e60 100644 --- a/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java +++ b/stubs/org.eclipse.mylyn.commons.team/src/org/eclipse/mylyn/internal/commons/ui/team/RepositoriesView.java @@ -12,7 +12,6 @@ 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.swt.widgets.Composite; import org.eclipse.ui.navigator.CommonNavigator; import org.eclipse.ui.navigator.CommonViewer; @@ -45,12 +44,6 @@ public class RepositoriesView extends CommonNavigator { protected CommonViewer createCommonViewer(Composite aParent) { CommonViewer viewer = super.createCommonViewer(aParent); IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager(); - new GradientDrawer(themeManager, viewer) { - @Override - protected boolean shouldApplyGradient(org.eclipse.swt.widgets.Event event) { - return event.item.getData() instanceof RepositoryCategory; - } - }; return viewer; } |