Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 126590 Details for
Bug 262266
[breadcrumb] In the Debug view breadcrumb drop-down add a mode to show only selected element's siblings.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch with the auto-expand option.
20090224_262266_auto_expand.patch (text/plain), 19.13 KB, created by
Pawel Piech
on 2009-02-24 14:10:10 EST
(
hide
)
Description:
Patch with the auto-expand option.
Filename:
MIME Type:
Creator:
Pawel Piech
Created:
2009-02-24 14:10:10 EST
Size:
19.13 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.debug.ui >Index: ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java,v >retrieving revision 1.80 >diff -u -r1.80 IDebugHelpContextIds.java >--- ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java 13 Feb 2009 21:33:49 -0000 1.80 >+++ ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java 24 Feb 2009 19:06:44 -0000 >@@ -76,6 +76,7 @@ > public static final String DEBUG_VIEW_MODE_COMPACT_ACTION = PREFIX + "debug_view_mode_compact_action_context"; //$NON-NLS-1$ > public static final String NEXT_THREAD_NAVIGATE_ACTION = PREFIX + "next_thread_navigate_action_context"; //$NON-NLS-1$ > public static final String PREVIOUS_THREAD_NAVIGATE_ACTION = PREFIX + "previous_thread_navigate_action_context"; //$NON-NLS-1$ >+ public static final String DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION = PREFIX + "debug_view_drop_down_autoexpand_action_context"; //$NON-NLS-1$ > > // Views > public static final String DEBUG_VIEW = PREFIX + "debug_view_context"; //$NON-NLS-1$ >Index: ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java,v >retrieving revision 1.2 >diff -u -r1.2 LaunchViewMessages.java >--- ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java 11 Feb 2009 21:42:30 -0000 1.2 >+++ ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java 24 Feb 2009 19:06:46 -0000 >@@ -30,7 +30,11 @@ > public static String DebugViewModeAction_Compact_label; > public static String DebugViewModeAction_Compact_tooltip; > public static String DebugViewModeAction_Compact_description; >- >+ >+ public static String BreadcrumbDropDownAutoExpandAction_label; >+ public static String BreadcrumbDropDownAutoExpandAction_tooltip; >+ public static String BreadcrumbDropDownAutoExpandAction_description; >+ > static { > // load message values from bundle file > NLS.initializeMessages(BUNDLE_NAME, LaunchViewMessages.class); >Index: ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties,v >retrieving revision 1.2 >diff -u -r1.2 LaunchViewMessages.properties >--- ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties 11 Feb 2009 21:42:30 -0000 1.2 >+++ ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties 24 Feb 2009 19:06:46 -0000 >@@ -24,3 +24,7 @@ > DebugViewModeAction_Compact_label=Compact > DebugViewModeAction_Compact_tooltip=Compact > DebugViewModeAction_Compact_description=Always show the compact viewer >+ >+BreadcrumbDropDownAutoExpandAction_label=Auto-Expand Compact Selector >+BreadcrumbDropDownAutoExpandAction_tooltip=Auto-Expand Compact Selector >+BreadcrumbDropDownAutoExpandAction_description=In the compact mode selection viewer, automatically expand elements to reveal full selection in view. >Index: ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java,v >retrieving revision 1.3 >diff -u -r1.3 LaunchViewBreadcrumb.java >--- ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java 24 Feb 2009 05:38:26 -0000 1.3 >+++ ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java 24 Feb 2009 19:06:46 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.debug.internal.ui.views.launch; > >+import java.util.ArrayList; >+ > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; >@@ -370,6 +372,47 @@ > > ModelDelta delta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE); > fTreeViewer.saveElementState(TreePath.EMPTY, delta); >+ >+ // If we do not want to expand the elements in the drop-down. >+ // Prune the delta to only select the element in the >+ // top-most list. >+ if (!fView.getBreadcrumbDropDownAutoExpand()) { >+ final ModelDelta prunedDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE); >+ delta.accept(new IModelDeltaVisitor() { >+ ModelDelta copy = prunedDelta; >+ public boolean visit(IModelDelta delta, int depth) { >+ TreePath deltaPath = getViewerTreePath(delta); >+ if (deltaPath.getSegmentCount() == 0) { >+ // skip copying the root element, only copy it's child count >+ copy.setChildCount(delta.getChildCount()); >+ return true; >+ } else if (deltaPath.getSegmentCount() != 0 && path.startsWith(deltaPath, null) ) { >+ copy = copy.addNode( >+ delta.getElement(), delta.getIndex(), delta.getFlags(), delta.getChildCount()); >+ return true; >+ } else if (deltaPath.startsWith(path, null)) { >+ if ( (delta.getFlags() & IModelDelta.SELECT) != 0) { >+ copy.setFlags(IModelDelta.SELECT); >+ return false; >+ } >+ } >+ return true; >+ } >+ >+ private TreePath getViewerTreePath(IModelDelta node) { >+ ArrayList list = new ArrayList(); >+ IModelDelta parentDelta = node.getParentDelta(); >+ while (parentDelta != null) { >+ list.add(0, node.getElement()); >+ node = parentDelta; >+ parentDelta = node.getParentDelta(); >+ } >+ return new TreePath(list.toArray()); >+ } >+ }); >+ delta = prunedDelta; >+ } >+ > fDropDownViewer.updateViewer(delta); > > fDropDownViewer.addLabelUpdateListener(new ILabelUpdateListener() { >@@ -429,8 +472,15 @@ > return true; > } > }); >+ >+ // If elements in the drop-down were auto-expanded, then collapse the drop-down's sub tree in the >+ // full viewer. After the drop-down's full expansion state is saved out to the tree viewer, the >+ // tree viewer will accurately reflect the state changes made by the user. >+ if (fView.getBreadcrumbDropDownAutoExpand()) { >+ fTreeViewer.collapseToLevel(rootPath, TreeViewer.ALL_LEVELS); >+ } > >- // Save the state of the drop-down into the tree viewer. >+ // Save the state of the drop-down out into the tree viewer. > fTreeViewer.updateViewer(rootDelta); > fViewer.setSelection(StructuredSelection.EMPTY); > site.close(); >Index: ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java,v >retrieving revision 1.189 >diff -u -r1.189 LaunchView.java >--- ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java 13 Feb 2009 21:33:48 -0000 1.189 >+++ ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java 24 Feb 2009 19:06:46 -0000 >@@ -13,6 +13,11 @@ > package org.eclipse.debug.internal.ui.views.launch; > > >+import java.io.ByteArrayInputStream; >+import java.io.ByteArrayOutputStream; >+import java.io.IOException; >+import java.io.InputStreamReader; >+import java.io.OutputStreamWriter; > import java.util.ArrayList; > import java.util.Iterator; > >@@ -109,6 +114,8 @@ > import org.eclipse.ui.IWorkbenchPartReference; > import org.eclipse.ui.IWorkbenchWindow; > import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.WorkbenchException; >+import org.eclipse.ui.XMLMemento; > import org.eclipse.ui.actions.ActionFactory; > import org.eclipse.ui.actions.SelectionListenerAction; > import org.eclipse.ui.dialogs.PropertyDialogAction; >@@ -183,10 +190,41 @@ > */ > private DebugViewModeAction[] fDebugViewModeActions; > >+ /** >+ * Action that controls the breadcrumb drop-down auto-expand behavior. >+ * >+ * @since 3.5 >+ */ >+ private BreadcrumbDropDownAutoExpandAction fBreadcrumbDropDownAutoExpandAction; >+ >+ /** >+ * Preference name for the view's memento. >+ * >+ * @since 3.5 >+ */ >+ private String PREF_STATE_MEMENTO = "pref_state_memento."; //$NON-NLS-1$ > >+ /** >+ * Key for a view preference for whether the elements in breadcrumb's >+ * drop-down viewer should be automatically expanded. >+ * >+ * @since 3.5 >+ */ >+ private static final String BREADCRUMB_DROPDOWN_AUTO_EXPAND = DebugUIPlugin.getUniqueIdentifier() + ".BREADCRUMB_DROPDOWN_AUTO_EXPAND"; //$NON-NLS-1$ >+ >+ /** >+ * Preference for whether the elements in breadcrumb's >+ * drop-down viewer should be automatically expanded. >+ * >+ * @since 3.5 >+ */ >+ private boolean fBreadcrumbDropDownAutoExpand = false; >+ > /** > * Page-book page for the breadcrumb viewer. This page is activated in > * Debug view when the height of the view is reduced to just one line. >+ * >+ * @since 3.5 > */ > private class BreadcrumbPage extends Page { > >@@ -621,12 +659,15 @@ > fDebugViewModeActions[0] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO, parent); > fDebugViewModeActions[1] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL, parent); > fDebugViewModeActions[2] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT, parent); >+ fBreadcrumbDropDownAutoExpandAction = new BreadcrumbDropDownAutoExpandAction(this); >+ > viewMenu.add(new Separator()); > final MenuManager modeSubmenu = new MenuManager(LaunchViewMessages.LaunchView_ViewModeMenu_label); > modeSubmenu.setRemoveAllWhenShown(true); > modeSubmenu.add(fDebugViewModeActions[0]); > modeSubmenu.add(fDebugViewModeActions[1]); > modeSubmenu.add(fDebugViewModeActions[2]); >+ modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction); > viewMenu.add(modeSubmenu); > viewMenu.add(new Separator()); > >@@ -635,8 +676,10 @@ > modeSubmenu.add(fDebugViewModeActions[0]); > modeSubmenu.add(fDebugViewModeActions[1]); > modeSubmenu.add(fDebugViewModeActions[2]); >+ modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction); > } > }); >+ > } > > >@@ -825,12 +868,41 @@ > site.getWorkbenchWindow().addPerspectiveListener(this); > } > >+ private void preferenceInit(IViewSite site) { >+ PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId(); >+ IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); >+ String string = store.getString(PREF_STATE_MEMENTO); >+ if(string.length() > 0) { >+ ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes()); >+ InputStreamReader reader = new InputStreamReader(bin); >+ try { >+ XMLMemento stateMemento = XMLMemento.createReadRoot(reader); >+ setMemento(stateMemento); >+ } catch (WorkbenchException e) { >+ } finally { >+ try { >+ reader.close(); >+ bin.close(); >+ } catch (IOException e){} >+ } >+ } >+ IMemento mem = getMemento(); >+ >+ if (mem != null) { >+ Boolean auto = mem.getBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND); >+ if(auto != null) { >+ setBreadcrumbDropDownAutoExpand(auto.booleanValue()); >+ } >+ } >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite) > */ > public void init(IViewSite site) throws PartInitException { > super.init(site); > commonInit(site); >+ preferenceInit(site); > } > > /* (non-Javadoc) >@@ -839,8 +911,46 @@ > public void init(IViewSite site, IMemento memento) throws PartInitException { > super.init(site, memento); > commonInit(site); >+ preferenceInit(site); > } >- >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart) >+ */ >+ public void partDeactivated(IWorkbenchPart part) { >+ String id = part.getSite().getId(); >+ if (id.equals(getSite().getId())) { >+ ByteArrayOutputStream bout = new ByteArrayOutputStream(); >+ OutputStreamWriter writer = new OutputStreamWriter(bout); >+ >+ try { >+ XMLMemento memento = XMLMemento.createWriteRoot("DebugViewMemento"); //$NON-NLS-1$ >+ saveViewerState(memento); >+ memento.save(writer); >+ >+ IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore(); >+ String xmlString = bout.toString(); >+ store.putValue(PREF_STATE_MEMENTO, xmlString); >+ } catch (IOException e) { >+ } finally { >+ try { >+ writer.close(); >+ bout.close(); >+ } catch (IOException e) { >+ } >+ } >+ } >+ super.partDeactivated(part); >+ } >+ >+ /** >+ * Saves the current state of the viewer >+ * @param memento the memento to write the viewer state into >+ */ >+ public void saveViewerState(IMemento memento) { >+ memento.putBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND, getBreadcrumbDropDownAutoExpand()); >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager) > */ >@@ -1260,4 +1370,25 @@ > boolean isBreadcrumbVisible() { > return fBreadcrumbPage.equals(getCurrentPage()); > } >+ >+ /** >+ * Returns whether the elements in breadcrumb's drop-down viewer should be >+ * automatically expanded. >+ * >+ * @since 3.5 >+ */ >+ boolean getBreadcrumbDropDownAutoExpand() { >+ return fBreadcrumbDropDownAutoExpand; >+ } >+ >+ /** >+ * Sets whether the elements in breadcrumb's drop-down viewer should be >+ * automatically expanded. >+ * >+ * @since 3.5 >+ */ >+ void setBreadcrumbDropDownAutoExpand(boolean expand) { >+ fBreadcrumbDropDownAutoExpand = expand; >+ } >+ > } >Index: ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java,v >retrieving revision 1.55 >diff -u -r1.55 IDebugPreferenceConstants.java >--- ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java 11 Feb 2009 21:42:30 -0000 1.55 >+++ ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java 24 Feb 2009 19:06:44 -0000 >@@ -272,11 +272,20 @@ > > /** > * The layout mode in Debug view. >+ * >+ * @since 3.5 > */ > public static final String DEBUG_VIEW_MODE = "org.eclispe.debug.ui.Debug_view.mode"; //$NON-NLS-1$ > public static final String DEBUG_VIEW_MODE_AUTO = "Debug_view.mode.auto"; //$NON-NLS-1$ > public static final String DEBUG_VIEW_MODE_COMPACT = "Debug_view.mode.compact"; //$NON-NLS-1$ > public static final String DEBUG_VIEW_MODE_FULL = "Debug_view.mode.full"; //$NON-NLS-1$ >+ >+ /** >+ * Preference whether to auto-expand in the breadcrumb drop-down viewers. >+ * >+ * @since 3.5 >+ */ >+ public static final String DEBUG_VIEW_BREADCRUMB_AUTO_EXPAND_DROP_DOWN = "org.eclispe.debug.ui.Debug_view.Breadcrumb.dropDownAutoexpand"; //$NON-NLS-1$ > } > > >Index: ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java >diff -N ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,55 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 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.debug.internal.ui.views.launch; >+ >+import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; >+import org.eclipse.debug.internal.ui.IDebugHelpContextIds; >+import org.eclipse.jface.action.Action; >+import org.eclipse.ui.PlatformUI; >+ >+/** >+ * Action that controls the preference for whether elements should be >+ * automatically expanded in the breadcrumb drop down viewers. >+ * >+ * @since 3.5 >+ */ >+class BreadcrumbDropDownAutoExpandAction extends Action { >+ >+ private final LaunchView fLaunchView; >+ >+ /** >+ * Creates a new action to set the debug view mode. >+ * >+ * @param view Reference to the debug view. >+ * @param mode The mode to be set by this action. >+ * @param parent The view's parent control used to calculate view size >+ * in auto mode. >+ */ >+ public BreadcrumbDropDownAutoExpandAction(LaunchView view) { >+ super(IInternalDebugCoreConstants.EMPTY_STRING, AS_CHECK_BOX); >+ fLaunchView = view; >+ >+ setText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_label); >+ setToolTipText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_tooltip); >+ setDescription(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_description); >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION); >+ >+ setChecked(fLaunchView.getBreadcrumbDropDownAutoExpand()); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.action.IAction#run() >+ */ >+ public void run() { >+ fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked()); >+ } >+} >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262266
:
125925
|
126516
| 126590