Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamantha Chan2008-04-02 11:31:54 -0400
committerSamantha Chan2008-04-02 11:31:54 -0400
commit61f9c28abe7d784c944029d21c7672f667b652c9 (patch)
tree4df3651ba7d945e4fd135bef45556352061d7bf6
parentbab2c67b5e2970ae7ad66878121b7002c64d5963 (diff)
downloadeclipse.platform.debug-61f9c28abe7d784c944029d21c7672f667b652c9.tar.gz
eclipse.platform.debug-61f9c28abe7d784c944029d21c7672f667b652c9.tar.xz
eclipse.platform.debug-61f9c28abe7d784c944029d21c7672f667b652c9.zip
Bug 215432 - [Memory View] Memory View: real estate & new/remove rendering workflow
-rw-r--r--org.eclipse.debug.ui/plugin.properties5
-rw-r--r--org.eclipse.debug.ui/plugin.xml20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java271
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java27
12 files changed, 277 insertions, 250 deletions
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index 76c116860..7bd0e3543 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -9,6 +9,7 @@
# IBM Corporation - initial API and implementation
# QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
# Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
+# Wind River Systems - Ted Williams -[Memory View] Memory View: Workflow Enhancements (bug 215432)
###############################################################################
pluginName=Debug UI
@@ -374,6 +375,10 @@ toggleMemoryMonitorsPane.label = Toggle Memory Monitors Pane
toggleMemoryMonitorsPane.description = Toggle visibility of the Memory Monitors Pane
nextMemoryBlockCommand.label = Next Memory Monitor
nextMemoryBlockCommand.description = Show renderings from next memory monitor.
+newRenderingCommand.label = New Rendering
+newRenderingCommand.description = Add a new rendering.
+closeRenderingCommand.label = Close Rendering
+closeRenderingCommand.description = Close the selected rendering.
memoryViewPrefAction.label = &Preferences...
resetMemoryMonitorAction.label = &Reset
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index 910b8a79d..a672a8795 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -1655,6 +1655,16 @@ M4 = Platform-specific fourth key
name="%nextMemoryBlockCommand.label"/>
<command
categoryId="org.eclipse.debug.ui.category.run"
+ description="%newRenderingCommand.description"
+ id="org.eclipse.debug.ui.commands.newRendering"
+ name="%newRenderingCommand.label"/>
+ <command
+ categoryId="org.eclipse.debug.ui.category.run"
+ description="%closeRenderingCommand.description"
+ id="org.eclipse.debug.ui.commands.closeRendering"
+ name="%closeRenderingCommand.label"/>
+ <command
+ categoryId="org.eclipse.debug.ui.category.run"
description="%command.description.0"
id="org.eclipse.debug.ui.command.gotoaddress"
name="%command.name.0"/>
@@ -1810,6 +1820,16 @@ M4 = Platform-specific fourth key
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="M1+M3+N"/>
<key
+ commandId="org.eclipse.debug.ui.commands.newRendering"
+ contextId="org.eclipse.debug.ui.memoryview"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+N"/>
+ <key
+ commandId="org.eclipse.debug.ui.commands.closeRendering"
+ contextId="org.eclipse.debug.ui.memoryview"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+W"/>
+ <key
commandId="org.eclipse.debug.ui.command.gotoaddress"
contextId="org.eclipse.debug.ui.memory.abstractasynctablerendering"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
index e6a428bdc..2ff0be002 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui;
@@ -128,6 +129,9 @@ public class DebugUIMessages extends NLS {
public static String CreateRenderingTab_0;
public static String CreateRenderingTab_1;
public static String CreateRenderingTab_2;
+
+ public static String CreateRenderingTab_label;
+
public static String CreateRendering_0;
public static String CreateRendering_1;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
index 029393e6b..a1ca18d1f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2007 IBM Corporation 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
@@ -7,6 +7,7 @@
#
# Contributors:
# IBM Corporation - initial API and implementation
+# Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
###############################################################################
DebugUIPlugin_23=Build in Progress
@@ -134,6 +135,7 @@ MemoryViewContentProvider_Unable_to_retrieve_content = Unable to retrieve conten
RemoveMemoryRenderingAction_Remove_rendering=Remove Rendering
EmptyViewTab_Unable_to_create=Unable to create
CreateRenderingTab_Memory_monitor=Memory Monitor:
+CreateRenderingTab_label=New Renderings...
CreateRenderingTab_Select_renderings_to_create=Select rendering(s) to create:
CreateRenderingTab_Add_renderings=Add Rendering(s)
CreateRenderingTab_0=No rendering is selected.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
index e949e28ee..a1420a8bd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
@@ -103,6 +103,28 @@ public class MemoryRetrievalProxy extends AbstractModelProxy implements IMemoryB
super.init(context);
DebugPlugin.getDefault().getMemoryBlockManager().addListener(this);
}
+
+ public void installed(Viewer viewer) {
+ super.installed(viewer);
+
+ setInitialSelection();
+ }
+
+ /**
+ * Set the initial memory block selection when the proxy is installed.
+ * This is done to ensure that when the memory view is opened, there is an initial
+ * selection. Otherwise, the Rendering Pane will show up as blank.
+ * @since 3.4
+ */
+ protected void setInitialSelection() {
+ IMemoryBlock[] allMB = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
+ if (allMB.length > 0)
+ {
+ ModelDelta delta = new ModelDelta(fRetrieval, 0, IModelDelta.NO_CHANGE, allMB.length);
+ delta.addNode(allMB[0], 0, IModelDelta.SELECT, 0);
+ fireModelChanged(delta);
+ }
+ }
public synchronized void dispose() {
super.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
index 6b28317d9..63f2a241e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
@@ -27,14 +28,14 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.SelectionListener;
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.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPart;
@@ -47,7 +48,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
protected Composite fViewPaneCanvas;
protected StackLayout fStackLayout;
protected ViewTabEnablementManager fViewTabEnablementManager;
- protected TabFolder fEmptyTabFolder;
+ protected CTabFolder fEmptyTabFolder;
protected Hashtable fTabFolderForDebugView = new Hashtable();
protected boolean fVisible;
protected Hashtable fRenderingInfoTable;
@@ -103,7 +104,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
fViewTabEnablementManager = new ViewTabEnablementManager();
- fEmptyTabFolder = new TabFolder(fViewPaneCanvas, SWT.NULL);
+ fEmptyTabFolder = new CTabFolder(fViewPaneCanvas, SWT.NULL);
setTabFolder(fEmptyTabFolder);
addListeners();
@@ -136,7 +137,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
if (fStackLayout.topControl != null)
{
- TabFolder old = (TabFolder)fStackLayout.topControl;
+ CTabFolder old = (CTabFolder)fStackLayout.topControl;
if (!old.isDisposed())
{
@@ -146,11 +147,11 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
}
}
- protected void setTabFolder(TabFolder folder)
+ protected void setTabFolder(CTabFolder folder)
{
if (fStackLayout.topControl != null)
{
- TabFolder old = (TabFolder)fStackLayout.topControl;
+ CTabFolder old = (CTabFolder)fStackLayout.topControl;
if (!old.isDisposed())
{
@@ -163,9 +164,9 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
if (folder.getItemCount() > 0)
{
- TabItem[] selectedItem = folder.getSelection();
+ CTabItem selectedItem = folder.getSelection();
- if (selectedItem.length > 0)
+ if (selectedItem != null)
{
Object selected = getCurrentSelection();
if (selected != null)
@@ -192,27 +193,27 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
{
//if we've got a tabfolder to go with the IMemoryBlockRetrieval, display it
if (fTabFolderForDebugView.containsKey(memRetrieval)) {
- if (fStackLayout.topControl != (TabFolder)fTabFolderForDebugView.get(memRetrieval)) {
- setTabFolder((TabFolder)fTabFolderForDebugView.get(memRetrieval));
+ if (fStackLayout.topControl != (CTabFolder)fTabFolderForDebugView.get(memRetrieval)) {
+ setTabFolder((CTabFolder)fTabFolderForDebugView.get(memRetrieval));
fViewPaneCanvas.layout();
}
} else { //otherwise, add a new one
- fTabFolderForDebugView.put(memRetrieval, new TabFolder(fViewPaneCanvas, SWT.NULL));
- setTabFolder((TabFolder)fTabFolderForDebugView.get(memRetrieval));
+ fTabFolderForDebugView.put(memRetrieval, new CTabFolder(fViewPaneCanvas, SWT.NULL));
+ setTabFolder((CTabFolder)fTabFolderForDebugView.get(memRetrieval));
fViewPaneCanvas.layout();
}
}
public IMemoryViewTab getTopMemoryTab() {
- if (fStackLayout.topControl instanceof TabFolder)
+ if (fStackLayout.topControl instanceof CTabFolder)
{
- TabFolder folder = (TabFolder)fStackLayout.topControl;
+ CTabFolder folder = (CTabFolder)fStackLayout.topControl;
if (!folder.isDisposed())
{
int index = folder.getSelectionIndex();
if (index >= 0) {
- TabItem tab = folder.getItem(index);
+ CTabItem tab = folder.getItem(index);
return (IMemoryViewTab)tab.getData();
}
}
@@ -220,7 +221,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
return null;
}
- protected void disposeTab(TabItem tabItem)
+ protected void disposeTab(CTabItem tabItem)
{
if (tabItem == null)
return;
@@ -277,13 +278,13 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
while (enumeration.hasMoreElements())
{
- TabFolder tabFolder = (TabFolder)enumeration.nextElement();
+ CTabFolder tabFolder = (CTabFolder)enumeration.nextElement();
if (tabFolder.isDisposed())
continue;
// if tab folder is not empty, dipose view tabs
- TabItem[] tabs = tabFolder.getItems();
+ CTabItem[] tabs = tabFolder.getItems();
for (int i=0; i<tabs.length; i++)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
index e33e67f8e..ab9fe9825 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -9,17 +9,13 @@
* IBM Corporation - initial API and implementation
* WindRiver - Bug 192028 [Memory View] Memory view does not
* display memory blocks that do not reference IDebugTarget
+ * Ted Williams - WindRiver - Bug 215432 - [Memory View] Memory View: Workflow Enhancements
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
/**
@@ -41,40 +37,8 @@ public class AddMemoryRenderingAction extends AddMemoryBlockAction {
* @see org.eclipse.jface.action.IAction#run()
*/
public void run() {
-
- // pop up dialog and ask what renderings to create
- Shell shell = DebugUIPlugin.getShell();
-
- AddMemoryRenderingDialog dialog = new AddMemoryRenderingDialog(shell, fSite);
- dialog.open();
-
- // get a list of renderings to create
- Object[] renderings = dialog.getResult();
-
- IMemoryBlock blk = dialog.getMemoryBlock();
-
- if (blk == null)
- return;
-
- // ask for debug target and memory block retrieval
-
- // add memory renderings to Memory Rendering Manager
- for (int i=0; i<renderings.length; i++)
- {
- if (renderings[i] instanceof IMemoryRenderingType)
- {
- try {
- IMemoryRendering rendering = ((IMemoryRenderingType)renderings[i]).createRendering();
- if (rendering != null)
- {
- rendering.init(fContainer, blk);
- fContainer.addMemoryRendering(rendering);
- }
- } catch (CoreException e) {
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryRenderingAction_Add_rendering_failed, DebugUIMessages.AddMemoryRenderingAction_Unable_to_add_selected_renderings, e);
- }
- }
- }
+ if (fContainer instanceof RenderingViewPane)
+ ((RenderingViewPane) fContainer).showCreateRenderingTab();
}
-
}
+
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
index 9cd1de210..d1f11c339 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
@@ -25,6 +26,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
@@ -85,6 +87,8 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite {
private static final String ID_ADD_MEMORY_BLOCK_COMMAND = "org.eclipse.debug.ui.commands.addMemoryMonitor"; //$NON-NLS-1$
private static final String ID_TOGGLE_MEMORY_MONITORS_PANE_COMMAND = "org.eclipse.debug.ui.commands.toggleMemoryMonitorsPane"; //$NON-NLS-1$
private static final String ID_NEXT_MEMORY_BLOCK_COMMAND = "org.eclipse.debug.ui.commands.nextMemoryBlock"; //$NON-NLS-1$
+ private static final String ID_NEW_RENDERING_COMMAND = "org.eclipse.debug.ui.commands.newRendering"; //$NON-NLS-1$
+ private static final String ID_CLOSE_RENDERING_COMMAND = "org.eclipse.debug.ui.commands.closeRendering"; //$NON-NLS-1$
public static final String VIEW_PANE_ORIENTATION_PREF = IDebugUIConstants.ID_MEMORY_VIEW+".orientation"; //$NON-NLS-1$
public static final int HORIZONTAL_VIEW_ORIENTATION = 0;
@@ -102,6 +106,8 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite {
private AbstractHandler fAddHandler;
private AbstractHandler fToggleMonitorsHandler;
private AbstractHandler fNextMemoryBlockHandler;
+ private AbstractHandler fNewRenderingHandler;
+ private AbstractHandler fCloseRenderingHandler;
private ViewPaneOrientationAction[] fOrientationActions;
private int fViewOrientation = HORIZONTAL_VIEW_ORIENTATION;
@@ -381,6 +387,38 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite {
}
};
handlerService.activateHandler(ID_NEXT_MEMORY_BLOCK_COMMAND, fNextMemoryBlockHandler);
+
+ fCloseRenderingHandler = new AbstractHandler() {
+
+ public Object execute(ExecutionEvent event)
+ throws ExecutionException {
+
+ IMemoryRenderingContainer container = getContainer(fActivePaneId);
+ IMemoryRendering activeRendering = container.getActiveRendering();
+ if (activeRendering != null)
+ {
+ container.removeMemoryRendering(activeRendering);
+ }
+
+ return null;
+ }
+ };
+ handlerService.activateHandler(ID_CLOSE_RENDERING_COMMAND, fCloseRenderingHandler);
+
+ fNewRenderingHandler = new AbstractHandler() {
+
+ public Object execute(ExecutionEvent event)
+ throws ExecutionException {
+
+ IMemoryRenderingContainer container = getContainer(fActivePaneId);
+ if (container != null && container instanceof RenderingViewPane)
+ {
+ ((RenderingViewPane)container).showCreateRenderingTab();
+ }
+ return null;
+ }
+ };
+ handlerService.activateHandler(ID_NEW_RENDERING_COMMAND, fNewRenderingHandler);
}
}
@@ -466,20 +504,6 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite {
PlatformUI.getWorkbench().getHelpSystem().setHelp(renderingControl, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); //$NON-NLS-1$
renderingViewForm.setContent(renderingControl);
- ToolBarManager renderingViewMgr = new ToolBarManager(SWT.FLAT);
- IAction[] renderingActions = renderingPane.getActions();
- for (int i=0; i<renderingActions.length; i++)
- {
- renderingViewMgr.add(renderingActions[i]);
- }
-
- ToolBar renderingToolbar = renderingViewMgr.createControl(renderingViewForm);
- renderingViewForm.setTopRight(renderingToolbar);
-
- Label renderingLabel = new Label(renderingViewForm, SWT.NONE);
- renderingLabel.setText(renderingPane.getLabel());
- renderingViewForm.setTopLeft(renderingLabel);
-
Listener renderingActivateListener = createActivateListener(renderingPane);
renderingControl.addListener(SWT.Activate, renderingActivateListener);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
index 850a3eea2..b39cd4f10 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
@@ -21,13 +22,13 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.progress.WorkbenchJob;
/**
@@ -38,7 +39,7 @@ import org.eclipse.ui.progress.WorkbenchJob;
public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, Listener {
private IMemoryRendering fRendering;
- private TabItem fTabItem;
+ private CTabItem fTabItem;
private DisposeListener fDisposeListener;
private boolean fEnabled;
private boolean fIsDisposed = false;
@@ -46,7 +47,7 @@ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, L
private RenderingViewPane fContainer;
- public MemoryViewTab(TabItem tabItem, IMemoryRendering rendering, RenderingViewPane container)
+ public MemoryViewTab(CTabItem tabItem, IMemoryRendering rendering, RenderingViewPane container)
{
fTabItem = tabItem;
fRendering = rendering;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
index 417109411..3c049689a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
@@ -12,10 +12,10 @@
* ARM - Bug 192028 [Memory View] Memory view does not
* display memory blocks that do not reference IDebugTarget
* WindRiver - Bug 216509 [Memory View] typo, s/isMeomryBlockRemoved/isMemoryBlockRemoved
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
-import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
@@ -27,7 +27,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
@@ -41,19 +40,25 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabFolder2Adapter;
+import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
@@ -72,9 +77,6 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
private Hashtable fTabFolderForMemoryBlock = new Hashtable();
private Hashtable fMemoryBlockFromTabFolder = new Hashtable();
- private AddMemoryRenderingAction fAddMemoryRenderingAction;
-
- private IAction fRemoveMemoryRenderingAction;
private ViewPaneRenderingMgr fRenderingMgr;
private IMemoryRenderingSite fRenderingSite;
@@ -106,7 +108,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
else
{
DebugUIPlugin.logErrorMessage("Parent for the rendering view pane is invalid."); //$NON-NLS-1$
- }
+ }
}
/* (non-Javadoc)
@@ -160,8 +162,8 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
// remove a the tab folder if the memory block is removed
- TabFolder tabFolder =
- (TabFolder) fTabFolderForMemoryBlock.get(mbRemoved);
+ CTabFolder tabFolder =
+ (CTabFolder) fTabFolderForMemoryBlock.get(mbRemoved);
if (tabFolder == null)
continue;
@@ -179,7 +181,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
if (!tabFolder.isDisposed()) {
// dispose all view tabs belonging to the tab folder
- TabItem[] items = tabFolder.getItems();
+ CTabItem[] items = tabFolder.getItems();
for (int i=0; i<items.length; i++)
{
@@ -339,7 +341,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// Therefore, we will never try to set a selection to a memory block whose target is terminated
// check current memory block
- TabFolder currentFolder = (TabFolder) fStackLayout.topControl;
+ CTabFolder currentFolder = (CTabFolder) fStackLayout.topControl;
if (currentFolder != null && !currentFolder.isDisposed()) {
IMemoryBlock currentBlk = (IMemoryBlock) fMemoryBlockFromTabFolder.get(currentFolder);
if (currentBlk != null) {
@@ -357,25 +359,28 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// if we've got a tabfolder to go with the IMemoryBlock, display
// it
if (fTabFolderForMemoryBlock.containsKey(memBlock)) {
- if (fStackLayout.topControl != (TabFolder) fTabFolderForMemoryBlock.get(memBlock)) {
- setTabFolder((TabFolder) fTabFolderForMemoryBlock.get(memBlock));
+ if (fStackLayout.topControl != (CTabFolder) fTabFolderForMemoryBlock.get(memBlock)) {
+ setTabFolder((CTabFolder) fTabFolderForMemoryBlock.get(memBlock));
fViewPaneCanvas.layout();
}
} else { // otherwise, add a new one
- TabFolder folder = new TabFolder(fViewPaneCanvas, SWT.NULL);
-
+ CTabFolder folder = createTabFolder(fViewPaneCanvas);
+
fTabFolderForMemoryBlock.put(memBlock, folder);
fMemoryBlockFromTabFolder.put(folder, memBlock);
- setTabFolder((TabFolder) fTabFolderForMemoryBlock.get(memBlock));
+ setTabFolder((CTabFolder) fTabFolderForMemoryBlock.get(memBlock));
fViewPaneCanvas.layout();
fAddedMemoryBlocks.add(memBlock);
+
+ newCreateRenderingForFolder(memBlock, folder);
}
// restore view tabs
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memBlock);
- TabFolder toDisplay = (TabFolder) fStackLayout.topControl;
-
- if (toDisplay.getItemCount() == 0) {
+ CTabFolder toDisplay = (CTabFolder) fStackLayout.topControl;
+
+ // if only CreateRendering is present, restore renderings
+ if (toDisplay.getItemCount() == 1 && getTopMemoryTab().getRendering() instanceof CreateRendering) {
restoreViewTabs(renderings);
}
@@ -400,23 +405,22 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
if (viewTab != null)
setRenderingSelection(viewTab.getRendering());
- if (viewTab == null && renderings.length == 0) {
- // do not ever want to put it on the empty folder
- if (toDisplay != fEmptyTabFolder) {
- TabItem newItem = new TabItem(toDisplay, SWT.NULL);
- CreateRendering rendering = new CreateRendering(getInstance());
- rendering.init(getInstance(), memBlock);
- MemoryViewTab createTab = new MemoryViewTab(newItem,rendering, getInstance());
- setRenderingSelection(createTab.getRendering());
- }
- }
-
//set toolbar actions enabled/disabled
updateToolBarActionsEnablement();
}
+
+ private int getIndexOfCreateRenderingTab(CTabFolder folder)
+ {
+ for(int i = 0; i < folder.getItemCount(); i++)
+ if(folder.getItem(i).getData() instanceof MemoryViewTab &&
+ ((MemoryViewTab) folder.getItem(i).getData()).getRendering() instanceof CreateRendering)
+ return i;
+
+ return -1;
+ }
public void memoryBlockRenderingAdded(final IMemoryRendering rendering) {
-
+
Display.getDefault().asyncExec(new Runnable() {
public void run() {
@@ -428,27 +432,12 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
IMemoryBlock memoryblk = rendering.getMemoryBlock();
- TabFolder tabFolder = (TabFolder) fTabFolderForMemoryBlock.get(memoryblk);
+ CTabFolder tabFolder = (CTabFolder) fTabFolderForMemoryBlock.get(memoryblk);
if (tabFolder == null)
{
tabFolder = createFolderForMemoryBlock(memoryblk);
}
-
- if (tabFolder.getItemCount() >= 1) {
- TabItem[] items = tabFolder.getItems();
- for (int i=0; i<items.length; i++)
- {
- // remove "Create rendering tab"
- TabItem item = items[i];
- if (item.getData() instanceof MemoryViewTab) {
- MemoryViewTab viewTab = (MemoryViewTab) item.getData();
- if (viewTab.getRendering() instanceof CreateRendering) {
- disposeTab(item);
- }
- }
- }
- }
if (tabFolder == fStackLayout.topControl)
{
@@ -459,8 +448,12 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
}
fAddedRenderings.add(rendering);
- TabItem tab = new TabItem(tabFolder, SWT.NULL);
-
+
+ int index = getIndexOfCreateRenderingTab(tabFolder);
+ if (index < 0)
+ index = 0;
+ CTabItem tab = new CTabItem(tabFolder, SWT.CLOSE, index);
+
MemoryViewTab viewTab = new MemoryViewTab(tab, rendering,getInstance());
tabFolder.setSelection(tabFolder.indexOf(tab));
@@ -500,12 +493,12 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
fAddedRenderings.remove(rendering);
- TabFolder tabFolder = (TabFolder) fStackLayout.topControl;
+ CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
if (tabFolder.isDisposed())
return;
-
- TabItem[] tabs = tabFolder.getItems();
+
+ CTabItem[] tabs = tabFolder.getItems();
boolean foundTab = false;
for (int i = 0; i < tabs.length; i++)
{
@@ -535,7 +528,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
Enumeration enumeration = fTabFolderForMemoryBlock.elements();
while (enumeration.hasMoreElements())
{
- TabFolder otherTabFolder = (TabFolder) enumeration.nextElement();
+ CTabFolder otherTabFolder = (CTabFolder) enumeration.nextElement();
tabs = otherTabFolder.getItems();
IMemoryViewTab viewTab = null;
for (int i = 0; i < tabs.length; i++)
@@ -558,26 +551,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// update selection
if (top != null)
setRenderingSelection(top.getRendering());
- else
- {
- if (tabFolder != fEmptyTabFolder)
- {
- IDebugTarget target = memory.getDebugTarget();
-
- // do not create if the target is already terminated or if the memory block is removed
- if (target != null && !target.isDisconnected() && !target.isTerminated() && !isMemoryBlockRemoved(memory))
- {
- TabItem newItem = new TabItem(tabFolder, SWT.NULL);
- CreateRendering createRendering = new CreateRendering(getInstance());
- createRendering.init(getInstance(), memory);
-
- MemoryViewTab viewTab = new MemoryViewTab(newItem, createRendering, getInstance());
- tabFolder.setSelection(0);
- setRenderingSelection(viewTab.getRendering());
- }
- }
- }
-
+
updateToolBarActionsEnablement();
}
});
@@ -631,7 +605,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
IMemoryBlockRetrieval currentRetrieve = null;
// get tab folder
- TabFolder tabFolder = (TabFolder) fStackLayout.topControl;
+ CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
// get memory block
IMemoryBlock currentBlock = (IMemoryBlock)fMemoryBlockFromTabFolder.get(tabFolder);
@@ -654,7 +628,7 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// switch to that tab folder
if (retrieve != null && retrieve != currentRetrieve)
{
- TabFolder folder = (TabFolder)fTabFolderForDebugView.get(retrieve);
+ CTabFolder folder = (CTabFolder)fTabFolderForDebugView.get(retrieve);
if (folder != null)
{
@@ -758,8 +732,8 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
public IMemoryViewTab[] getAllViewTabs() {
// otherwise, find the view tab to display
- TabFolder folder = (TabFolder) fStackLayout.topControl;
- TabItem[] items = folder.getItems();
+ CTabFolder folder = (CTabFolder) fStackLayout.topControl;
+ CTabItem[] items = folder.getItems();
IMemoryViewTab[] viewTabs = new IMemoryViewTab[folder.getItemCount()];
@@ -781,8 +755,8 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
return;
// otherwise, find the view tab to display
- TabFolder folder = (TabFolder) fStackLayout.topControl;
- TabItem[] items = folder.getItems();
+ CTabFolder folder = (CTabFolder) fStackLayout.topControl;
+ CTabItem[] items = folder.getItems();
for (int i = 0; i < items.length; i++) {
IMemoryViewTab tab =
@@ -802,6 +776,29 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
}
}
+
+ private CTabFolder createTabFolder(Composite parent)
+ {
+ CTabFolder folder = new CTabFolder(parent, SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.FLAT);
+
+ ColorRegistry reg = JFaceResources.getColorRegistry();
+ Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$
+ c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$
+ folder.setSelectionBackground(new Color[] {c1, c2}, new int[] {100}, true);
+ folder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$
+ folder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
+ folder.setBorderVisible(true);
+ folder.setFont(fViewPaneCanvas.getFont());
+
+ folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
+ public void close(CTabFolderEvent event) {
+ if(event.item.getData() instanceof MemoryViewTab)
+ RenderingViewPane.this.removeMemoryRendering(((MemoryViewTab) event.item.getData()).getRendering());
+ event.doit = false;
+ }
+ });
+ return folder;
+ }
public void restoreViewPane() {
@@ -856,11 +853,11 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
{
// create tab folder if a tab folder does not already exist
// for the memory block
- TabFolder folder = new TabFolder(fViewPaneCanvas, SWT.NULL);
+ CTabFolder folder = createTabFolder(fViewPaneCanvas);
fTabFolderForMemoryBlock.put(memoryBlock, folder);
fMemoryBlockFromTabFolder.put(folder, memoryBlock);
- setTabFolder((TabFolder)fTabFolderForMemoryBlock.get(memoryBlock));
+ setTabFolder((CTabFolder)fTabFolderForMemoryBlock.get(memoryBlock));
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memoryBlock);
if (retrieval != null)
fTabFolderForDebugView.put(retrieval, fTabFolderForMemoryBlock.get(memoryBlock));
@@ -869,11 +866,14 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
fViewPaneCanvas.layout();
fAddedMemoryBlocks.add(memoryBlock);
+
+ // every time we create a folder, we have to create a CreateRendering
+ newCreateRenderingForFolder(memoryBlock, folder);
}
if (fTabFolderForMemoryBlock.containsKey(memoryBlock))
{
- TabFolder toDisplay = (TabFolder)fTabFolderForMemoryBlock.get(memoryBlock);
+ CTabFolder toDisplay = (CTabFolder)fTabFolderForMemoryBlock.get(memoryBlock);
if (toDisplay != null)
{
@@ -890,7 +890,8 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// restore view tabs
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memoryBlock);
- if (toDisplay.getItemCount() == 0 || (getTopMemoryTab().getRendering() instanceof CreateRendering))
+ // if only CreateRendering is present, restore renderings
+ if (toDisplay.getItemCount() == 1 && getTopMemoryTab().getRendering() instanceof CreateRendering)
{
restoreViewTabs(renderings);
}
@@ -902,29 +903,14 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
IMemoryViewTab top = getTopMemoryTab();
if (top != null)
- {
top.setEnabled(fVisible);
- }
- else
- {
- TabFolder folder = (TabFolder)fStackLayout.topControl;
- if (folder != fEmptyTabFolder)
- {
- TabItem newItem = new TabItem(folder, SWT.NULL);
- CreateRendering rendering = new CreateRendering(this);
- rendering.init(getInstance(), memoryBlock);
- new MemoryViewTab(newItem, rendering, this);
- folder.setSelection(0);
- setRenderingSelection(rendering);
- }
- }
}
}
public void dispose() {
fIsDisposed = true;
+
super.dispose();
- fAddMemoryRenderingAction.dispose();
fTabFolderForMemoryBlock.clear();
fTabFolderForMemoryBlock = null;
@@ -947,45 +933,12 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
public IAction[] getActions() {
- ArrayList actions = new ArrayList();
-
- if (fAddMemoryRenderingAction == null)
- fAddMemoryRenderingAction = new AddMemoryRenderingAction(this);
- actions.add(fAddMemoryRenderingAction);
-
- if (fRemoveMemoryRenderingAction == null)
- fRemoveMemoryRenderingAction = new RemoveMemoryRenderingAction(this);
-
- fRemoveMemoryRenderingAction.setEnabled(false);
- actions.add(fRemoveMemoryRenderingAction);
-
- return (IAction[])actions.toArray(new IAction[actions.size()]);
+ return new IAction[0];
}
// enable/disable toolbar action
protected void updateToolBarActionsEnablement()
- {
- Object context = DebugUITools.getDebugContext();
- if (context != null)
- {
- ISelection selection = fSelectionProvider.getSelection();
- if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection)
- {
- Object sel = ((IStructuredSelection)selection).getFirstElement();
- if (sel instanceof CreateRendering)
- fRemoveMemoryRenderingAction.setEnabled(false);
- else
- fRemoveMemoryRenderingAction.setEnabled(true);
- }
- else
- {
- fRemoveMemoryRenderingAction.setEnabled(false);
- }
- }
- else
- {
- fRemoveMemoryRenderingAction.setEnabled(false);
- }
+ {
}
/* (non-Javadoc)
@@ -1176,6 +1129,28 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
{
return fIsDisposed;
}
+
+ public void showCreateRenderingTab()
+ {
+ IMemoryRendering activeRendering = RenderingViewPane.this.getActiveRendering();
+ if(activeRendering == null)
+ return;
+
+ IMemoryBlock memoryblk = activeRendering.getMemoryBlock();
+
+ final CTabFolder tabFolder = (CTabFolder) fTabFolderForMemoryBlock.get(memoryblk);
+ if (tabFolder != null)
+ {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run()
+ {
+ int index = getIndexOfCreateRenderingTab(tabFolder);
+ if (index >= 0)
+ tabFolder.setSelection(index);
+ }
+ });
+ }
+ }
public void contextActivated(final ISelection selection) {
@@ -1217,10 +1192,8 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
/**
* @param memory
*/
- private TabFolder createFolderForMemoryBlock(IMemoryBlock memory) {
-
-
- TabFolder folder = new TabFolder(fViewPaneCanvas, SWT.NULL);
+ private CTabFolder createFolderForMemoryBlock(IMemoryBlock memory) {
+ CTabFolder folder = createTabFolder(fViewPaneCanvas);
fTabFolderForMemoryBlock.put(memory, folder);
fMemoryBlockFromTabFolder.put(folder, memory);
@@ -1234,20 +1207,20 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
DebugUIPlugin.logErrorMessage("Memory block retrieval for memory block is null"); //$NON-NLS-1$
}
- // check renderings, only create if there is no rendering
- IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memory);
- if (renderings.length == 0)
- {
- TabItem newItem = new TabItem(folder, SWT.NULL);
- CreateRendering rendering = new CreateRendering(getInstance());
- rendering.init(getInstance(), memory);
- new MemoryViewTab(newItem, rendering, getInstance());
- folder.setSelection(0);
- }
+ newCreateRenderingForFolder(memory, folder);
return folder;
}
+ private void newCreateRenderingForFolder(IMemoryBlock memory,
+ CTabFolder folder) {
+ CTabItem newItem = new CTabItem(folder, SWT.NONE);
+ CreateRendering rendering = new CreateRendering(getInstance());
+ rendering.init(getInstance(), memory);
+ new MemoryViewTab(newItem, rendering, getInstance());
+ folder.setSelection(0);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
index e50136372..13631cd25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -7,14 +7,15 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
/**
* Controls view tab enablement based on tab folder selection
@@ -27,7 +28,7 @@ public class ViewTabEnablementManager implements SelectionListener {
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected(SelectionEvent e) {
- if (e.getSource() instanceof TabFolder)
+ if (e.getSource() instanceof CTabFolder)
{
handleTabFolderSelection(e);
}
@@ -43,17 +44,14 @@ public class ViewTabEnablementManager implements SelectionListener {
private void handleTabFolderSelection(SelectionEvent event)
{
- TabFolder folder = (TabFolder)event.getSource();
+ CTabFolder folder = (CTabFolder)event.getSource();
- TabItem[] selectedItems = folder.getSelection();
- TabItem selectedItem;
+ CTabItem selectedItem = folder.getSelection();
IMemoryViewTab selectedViewTab;
// get selected view tab
- if (selectedItems.length > 0)
- {
- selectedItem = selectedItems[0];
-
+ if (selectedItem != null)
+ {
Object obj = selectedItem.getData();
if (obj instanceof IMemoryViewTab)
@@ -71,7 +69,7 @@ public class ViewTabEnablementManager implements SelectionListener {
}
// get all tabs
- TabItem[] allTabs = folder.getItems();
+ CTabItem[] allTabs = folder.getItems();
// check all tabs to make sure they are enabled/disabled properly
for (int i=0; i<allTabs.length; i++)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
index 5059ed6e8..de33d7576 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 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
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* WindRiver - Bug 192028 [Memory View] Memory view does not
* display memory blocks that do not reference IDebugTarget
+ * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory.renderings;
@@ -20,8 +21,10 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
+import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
@@ -64,6 +67,8 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
private Composite fCanvas;
private String fLabel;
+ private String fTabLabel;
+
public CreateRendering(IMemoryRenderingContainer container)
{
super("org.eclipse.debug.internal.ui.views.createrendering"); //$NON-NLS-1$
@@ -77,7 +82,8 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
public Image getImage(Object element) {
- return null;
+ return DebugUIPlugin.getImageDescriptorRegistry().get(
+ DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
}
/* (non-Javadoc)
@@ -295,13 +301,18 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
}
public String getLabel() {
- if (fLabel == null)
+ if (fTabLabel == null)
{
- fLabel = DebugUIMessages.CreateRendering_2;
+ fTabLabel = DebugUIMessages.CreateRendering_2;
updateRenderingLabel();
}
- return fLabel;
+ return fTabLabel;
+ }
+
+ public Image getImage() {
+ return DebugUIPlugin.getImageDescriptorRegistry().get(
+ DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
}
public void becomesVisible() {
@@ -318,14 +329,16 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
protected IStatus run(IProgressMonitor monitor) {
fLabel = CreateRendering.super.getLabel();
- firePropertyChangedEvent(new PropertyChangeEvent(CreateRendering.this, IBasicPropertyConstants.P_TEXT, null, fLabel));
+ fTabLabel = DebugUIMessages.CreateRenderingTab_label ;
+
+ firePropertyChangedEvent(new PropertyChangeEvent(CreateRendering.this, IBasicPropertyConstants.P_TEXT, null, fTabLabel));
WorkbenchJob wbJob = new WorkbenchJob("Create Rendering Update Label"){ //$NON-NLS-1$
public IStatus runInUIThread(IProgressMonitor wbMonitor) {
if (fMemoryBlockLabel != null)
{
- fMemoryBlockLabel.setText(" " + DebugUIMessages.CreateRenderingTab_Memory_monitor + fLabel + " "); //$NON-NLS-1$//$NON-NLS-2$
+ fMemoryBlockLabel.setText(DebugUIMessages.CreateRenderingTab_Memory_monitor + " " + fLabel ); //$NON-NLS-1$
fMemoryBlockLabel.getParent().layout();
}
return Status.OK_STATUS;

Back to the top