diff options
author | Francis Upton IV | 2010-04-21 10:38:17 +0000 |
---|---|---|
committer | Francis Upton IV | 2010-04-21 10:38:17 +0000 |
commit | b9147304cab9454ef74b00b01b52f37c47b06b2d (patch) | |
tree | 955adad2cf7d41bde67c1f070ef4d1aa7aec5324 /bundles/org.eclipse.ui.navigator | |
parent | 1b2354f11fd7f2e8aca8175934f06f52d33ec09e (diff) | |
download | eclipse.platform.ui-b9147304cab9454ef74b00b01b52f37c47b06b2d.tar.gz eclipse.platform.ui-b9147304cab9454ef74b00b01b52f37c47b06b2d.tar.xz eclipse.platform.ui-b9147304cab9454ef74b00b01b52f37c47b06b2d.zip |
bug 213448 [CommonNavigator] Linking open editors with content in Project Explorer not working on restart
Diffstat (limited to 'bundles/org.eclipse.ui.navigator')
3 files changed, 17 insertions, 10 deletions
diff --git a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPlugin.java b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPlugin.java index 7e2579a3d5b..e02c14a6931 100644 --- a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPlugin.java +++ b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/NavigatorPlugin.java @@ -44,6 +44,18 @@ public class NavigatorPlugin extends AbstractUIPlugin { private static final int LOG_DELAY = 100; + /** + * The delay before updating the action bars. Must be shorter than the + * LINK_HELPER_DELAY to make sure the linking works after the boot. + */ + public static final int ACTION_BAR_DELAY = 100; + + /** + * The delay before responding to a selection/activation event in processing + * for linking with the editor. + */ + public static final int LINK_HELPER_DELAY = ACTION_BAR_DELAY + 20; + private static class LogJob extends Job { diff --git a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/LinkEditorAction.java b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/LinkEditorAction.java index afb8b7c5b9a..8ced217c3dd 100644 --- a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/LinkEditorAction.java +++ b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/LinkEditorAction.java @@ -47,8 +47,6 @@ import org.eclipse.ui.progress.UIJob; public class LinkEditorAction extends Action implements ISelectionChangedListener, IPropertyListener { - private static final long BRIEF_DELAY = 100; - private IPartListener partListener; private final CommonNavigator commonNavigator; @@ -164,13 +162,13 @@ public class LinkEditorAction extends Action implements public void partActivated(IWorkbenchPart part) { if (part instanceof IEditorPart && !ignoreEditorActivation) { - updateSelectionJob.schedule(BRIEF_DELAY); + updateSelectionJob.schedule(NavigatorPlugin.LINK_HELPER_DELAY); } } public void partBroughtToTop(IWorkbenchPart part) { if (part instanceof IEditorPart && !ignoreEditorActivation) { - updateSelectionJob.schedule(BRIEF_DELAY); + updateSelectionJob.schedule(NavigatorPlugin.LINK_HELPER_DELAY); } } @@ -235,7 +233,7 @@ public class LinkEditorAction extends Action implements * Create and schedule a UI Job to activate the editor in a valid * Display thread */ - activateEditorJob.schedule(BRIEF_DELAY); + activateEditorJob.schedule(NavigatorPlugin.LINK_HELPER_DELAY); } } @@ -260,7 +258,7 @@ public class LinkEditorAction extends Action implements if (toEnableLinking) { - updateSelectionJob.schedule(BRIEF_DELAY); + updateSelectionJob.schedule(NavigatorPlugin.LINK_HELPER_DELAY); commonViewer.addPostSelectionChangedListener(this); commonNavigator.getSite().getPage().addPartListener(partListener); diff --git a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java index 12f7f69c6f9..13e6996ecaf 100644 --- a/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java +++ b/bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/navigator/CommonNavigatorManager.java @@ -54,9 +54,6 @@ import org.eclipse.ui.progress.UIJob; */ public final class CommonNavigatorManager implements ISelectionChangedListener { - // delay for updating the action bars (in ms) - private static final long DELAY = 200; - private final CommonNavigator commonNavigator; private final INavigatorContentService contentService; @@ -309,7 +306,7 @@ public final class CommonNavigatorManager implements ISelectionChangedListener { viewMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS + "-end"));//$NON-NLS-1$ - updateActionBars.schedule(DELAY); + updateActionBars.schedule(NavigatorPlugin.ACTION_BAR_DELAY); } |