diff options
author | Christian W. Damus | 2016-03-04 20:23:52 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-03-04 23:01:16 +0000 |
commit | c6734af6f9c1838204786417a9a4bb2a0d6013a8 (patch) | |
tree | 47dc84349d2202ccdf83e65537bcf3b74e3278b3 /plugins/infra/ui/org.eclipse.papyrus.infra.ui | |
parent | 83589c974a08255d10cde9fdb51d3527139f4889 (diff) | |
download | org.eclipse.papyrus-c6734af6f9c1838204786417a9a4bb2a0d6013a8.tar.gz org.eclipse.papyrus-c6734af6f9c1838204786417a9a4bb2a0d6013a8.tar.xz org.eclipse.papyrus-c6734af6f9c1838204786417a9a4bb2a0d6013a8.zip |
Bug 488965: Trying to select a default hyperlink without selecting one first result in hanged application
https://bugs.eclipse.org/bugs/show_bug.cgi?id=488965
Overhaul the hyperlink management UI:
* use proper JFace dialogs instead of VE-generated shells
* don't implement a flat property-sheet-like white look (instead
a more native look-and-feel, especially for tabs on Mac)
* stack modal dialogs properly instead of all on the workbench window
* implement enablement of buttons to reflect availability of
up/down/left/right and modify/delete actions
* implement intuitive response to double-click to cut down on number of
gestures required to complete an edit
* implement proper action listeners on buttons (not mouse-down)
* fix deletion of existing hyperlink when canceling an edit (web and
document hyperlinks)
* disable modify button for specific-object hyperlinks, which don't
support editing
Change-Id: I16a27a4e978bcc2204eeac2991edd1a1fbb445ca
Diffstat (limited to 'plugins/infra/ui/org.eclipse.papyrus.infra.ui')
-rw-r--r-- | plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorHelper.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorHelper.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorHelper.java index 4835ae0e764..446f7f1c756 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorHelper.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorHelper.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2012 CEA LIST. + * Copyright (c) 2012, 2016 CEA LIST, Christian W. Damus, and others. * * * All rights reserved. This program and the accompanying materials @@ -9,10 +9,13 @@ * * Contributors: * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * Christian W. Damus - bug 488965 * *****************************************************************************/ package org.eclipse.papyrus.infra.ui.util; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; @@ -33,6 +36,33 @@ public class EditorHelper { // nothing to do } + + /** + * + * @return + * the current workbench window or <code>null</code> if not found + */ + public static final Shell getActiveShell() { + final IWorkbench workbench = PlatformUI.getWorkbench(); + if (workbench != null) { + return workbench.getActiveWorkbenchWindow().getShell(); + } + return Display.getCurrent().getActiveShell(); + } + + /** + * + * @return + * the current workbench window or <code>null</code> if not found + */ + public static final IWorkbenchWindow getActiveWindow() { + final IWorkbench workbench = PlatformUI.getWorkbench(); + if (workbench != null) { + return workbench.getActiveWorkbenchWindow(); + } + return null; + } + /** * * @return |