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 93999 Details for
Bug 140650
[PII] Missing shortcut keys in TPTP profiling context menu
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.
Proposed Patch
140650patch5.txt (text/plain), 115.79 KB, created by
Ritwik Lodhiya
on 2008-03-28 12:33:42 EDT
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Ritwik Lodhiya
Created:
2008-03-28 12:33:42 EDT
Size:
115.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.instrumentation.ui >Index: src/org/eclipse/tptp/platform/instrumentation/ui/internal/control/provider/application/AgentControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.instrumentation.ui/src/org/eclipse/tptp/platform/instrumentation/ui/internal/control/provider/application/AgentControlProvider.java,v >retrieving revision 1.1 >diff -u -r1.1 AgentControlProvider.java >--- src/org/eclipse/tptp/platform/instrumentation/ui/internal/control/provider/application/AgentControlProvider.java 26 Apr 2007 14:59:24 -0000 1.1 >+++ src/org/eclipse/tptp/platform/instrumentation/ui/internal/control/provider/application/AgentControlProvider.java 28 Mar 2008 16:23:08 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2007 IBM Corporation and others. >+ * Copyright (c) 2007, 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 >@@ -11,26 +11,25 @@ > ***********************************************************************/ > package org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.application; > >-import java.util.Iterator; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.hyades.trace.ui.ProfileEvent; >-import org.eclipse.hyades.trace.ui.UIPlugin; >+import org.eclipse.core.commands.IHandler; > import org.eclipse.hyades.trace.ui.internal.actions.DeleteAction; > import org.eclipse.hyades.trace.ui.internal.actions.SaveAction; >-import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.hyades.ui.extension.INavigatorContribution; >-import org.eclipse.jface.resource.ImageDescriptor; >-import org.eclipse.jface.viewers.StructuredSelection; >-import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; > import org.eclipse.tptp.trace.ui.internal.control.provider.TraceControlItemManager; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >-import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; > import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractControlProvider; >-import org.eclipse.tptp.trace.ui.provisional.control.provider.ControlItem; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IAgentStateModifier; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IControlItem; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IProcessStateModifier; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItem; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItemHandler; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshOption; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshOptionHandler; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshView; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshViewHandler; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItem; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItemHandler; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.TerminateAction; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.TerminateControlItemHandler; > import org.eclipse.tptp.trace.ui.provisional.control.provider.ProcessControlProvider.ProcessStateModifier; > > /** >@@ -40,14 +39,6 @@ > */ > public class AgentControlProvider extends AbstractControlProvider { > >- /* The id of the contributed items */ >- private static final String REFRESH_ITEM = "org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.refreshViews"; >- private static final String REFRESH_OPTION = "org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.refreshOption"; >- private static final String TERMINATE_ITEM = "org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.terminateAction"; >- public static final String START_MONITORING = "org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.startMonitoring"; >- public static final String PAUSE_MONITORING = "org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.stopMonitoring"; >- >- > /* The delete item */ > private IControlItem delete; > >@@ -74,7 +65,9 @@ > > /* The agent state modifier */ > private IAgentStateModifier agentStateModifier; >- >+ >+ /* The handler for the actions */ >+ private IHandler handler; > /** > * Default constructor. > */ >@@ -136,27 +129,10 @@ > protected IControlItem createRefreshViewsControlItem() { > if (refresh != null) > return refresh; >- >- class RefreshView extends ControlItem >- { >- public RefreshView() >- { >- super (REFRESH_ITEM, CommonUITraceConstants.PROFILE_REFRESH_GROUP, ControlMessages.CONTROL_ITEM_REFRESH_VIEWS, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_REFRESH_VIEWS)); >- } >- >- public void run() >- { >- if (input == null) >- return; >- >- for (Iterator sources = input.iterator(); sources.hasNext();) >- { >- ProfileEvent event = UIPlugin.getDefault().getRefreshViewEvent(sources.next()); >- UIPlugin.getDefault().notifyProfileEventListener(event); >- } >- } >- } >+ > refresh = new RefreshView(); >+ handler = new RefreshViewHandler(refresh); >+ refresh.setHandler(handler); > return refresh; > } > >@@ -168,29 +144,10 @@ > protected IControlItem createRefreshOptionControlItem() { > if (refreshOption != null) > return refreshOption; >- >- class RefreshOption extends ControlItem >- { >- public RefreshOption() >- { >- super (REFRESH_OPTION, CommonUITraceConstants.PROFILE_REFRESH_GROUP, ControlMessages.CONTROL_ITEM_REFRESH_OPTION, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_REFRESH_OPTIONS)); >- } >- >- /* This method is invoked when ever user clicks the 'Change Refresh Options' button. >- * It simply invokes the 'handleProfileEvent' method of PDProjectExplorer */ >- public void run() >- { >- if (input == null) >- return; >- >- for (Iterator sources = input.iterator(); sources.hasNext();) >- { >- ProfileEvent event = UIPlugin.getDefault().getRefreshOptionEvent(sources.next()); >- UIPlugin.getDefault().notifyProfileEventListener(event); >- } >- } >- } >+ > refreshOption = new RefreshOption(); >+ handler = new RefreshOptionHandler(refreshOption); >+ refreshOption.setHandler(handler); > return refreshOption; > } > >@@ -199,75 +156,19 @@ > if (resumeItem != null) > return resumeItem; > >- class ResumeControlItem extends AgentControlItem >- { >- public ResumeControlItem() >- { >- super(getAgentStateModifier(), START_MONITORING, CommonUITraceConstants.PROFILE_MONITOR_GROUP, ControlMessages.CONTROL_ITEM_RESUME, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_RESUME)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_RESUME)); >- } >- >- public void run() >- { >- IAgentStateModifier agentStateModifier = getAgentStateModifier(); >- >- try >- { >- /* Resume the agent */ >- agentStateModifier.startMonitoring(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getAgentStateModifier().canResume(); >- } >- } >- >- >- resumeItem = new ResumeControlItem(); >+ resumeItem = new ResumeControlItem(getAgentStateModifier()); >+ handler = new ResumeControlItemHandler(resumeItem); >+ resumeItem.setHandler(handler); > return resumeItem; > } > > protected IControlItem createPauseMonitoringControlItem() { > if (pauseItem != null) >- return pauseItem; >- >- class PauseControlItem extends AgentControlItem >- { >- public PauseControlItem() >- { >- super(getAgentStateModifier(), PAUSE_MONITORING, CommonUITraceConstants.PROFILE_MONITOR_GROUP, ControlMessages.CONTROL_ITEM_PAUSE, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_PAUSE)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_PAUSE)); >- } >- >- public void run() >- { >- IAgentStateModifier agentStateModifier = getAgentStateModifier(); >- >- try >- { >- /* Pause the agent */ >- agentStateModifier.pauseMonitoring(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getAgentStateModifier().canPause(); >- } >- } >+ return pauseItem; > >- >- pauseItem = new PauseControlItem(); >+ pauseItem = new PauseControlItem(getAgentStateModifier()); >+ handler = new PauseControlItemHandler(pauseItem); >+ pauseItem.setHandler(handler); > return pauseItem; > } > >@@ -281,88 +182,12 @@ > protected IControlItem createTerminateControlItem() { > if (terminateItem != null) > return terminateItem; >- >- class TerminateAction extends ControlItem >- { >- public TerminateAction() >- { >- super (TERMINATE_ITEM, CommonUITraceConstants.PROFILE_TERMINATE_GROUP, ControlMessages.CONTROL_ITEM_TERMINATE, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_TERMINATE)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_TERMINATE)); >- } >- >- public void run() >- { >- IProcessStateModifier processStateModifier = getProcessStateModifier(); >- >- try >- { >- /* Terminate the process */ >- processStateModifier.terminate(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getProcessStateModifier().canTerminate(); >- } >- >- public void setInput(StructuredSelection input) >- { >- getProcessStateModifier().setInput(input); >- } >- >- public IProcessStateModifier getStateModifier() >- { >- return getProcessStateModifier(); >- } >- >- public boolean equals (Object o) >- { >- if (!(o instanceof TerminateAction)) >- return false; >- >- return getProcessStateModifier() == ((TerminateAction)o).getStateModifier() && super.equals(o); >- } >- >- } >- >- >- terminateItem = new TerminateAction(); >+ >+ terminateItem = new TerminateAction(getProcessStateModifier()); >+ handler = new TerminateControlItemHandler(terminateItem); >+ terminateItem.setHandler(handler); > return terminateItem; > } >- >- private static class AgentControlItem extends ControlItem { >- private IAgentStateModifier stateModifier; >- >- public AgentControlItem (IAgentStateModifier stateModifier, String itemId, String groupName, String text, ImageDescriptor imageDescriptor) >- { >- super(itemId, groupName, text, imageDescriptor); >- this.stateModifier = stateModifier; >- } >- >- public void setInput(StructuredSelection input) >- { >- stateModifier.setInput(input); >- } >- >- >- public IAgentStateModifier getStateModifier() >- { >- return stateModifier; >- } >- >- public boolean equals (Object o) >- { >- if (!(o instanceof AgentControlItem)) >- return false; >- >- return stateModifier == ((AgentControlItem)o).getStateModifier() && super.equals(o); >- } >- >- } >+ > > } >#P org.eclipse.hyades.trace.ui >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentControlProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractAgentControlProvider.java >--- src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentControlProvider.java 15 Sep 2006 19:36:28 -0000 1.4 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentControlProvider.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -10,14 +10,9 @@ > **********************************************************************/ > package org.eclipse.tptp.trace.ui.provisional.control.provider; > >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.core.commands.IHandler; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.viewers.StructuredSelection; >-import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >-import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >- > > > /** >@@ -38,24 +33,20 @@ > */ > public abstract class AbstractAgentControlProvider extends ProcessControlProvider > { >- /** The id of the control items contributed */ >- public static final String ATTACH_ITEM = "org.eclipse.hyades.trace.ui.internal.popupMenu.AttachAction"; >- public static final String DETACH_ITEM = "org.eclipse.hyades.trace.ui.internal.popupMenu.DetachAction"; >- public static final String START_MONITORING = "org.eclipse.hyades.trace.ui.internal.monitorsview.popupMenu.startMonitoring"; >- public static final String PAUSE_MONITORING = "org.eclipse.hyades.trace.ui.internal.popupMenu.stopMonitoring"; >- >- > /** The attach control item */ >- private IControlItem attachItem; >+ protected IControlItem attachItem; > > /** The detach control item */ >- private IControlItem detachItem; >+ protected IControlItem detachItem; > > /** The resume control item */ >- private IControlItem resumeItem; >+ protected IControlItem resumeItem; > > /** The pause control item */ >- private IControlItem pauseItem; >+ protected IControlItem pauseItem; >+ >+ /** The handler for action items */ >+ private IHandler handler; > > /** > * @see org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractLogicalItem.initializeControlItems() >@@ -90,37 +81,9 @@ > if (attachItem != null) > return attachItem; > >- class AttachControlItem extends AgentControlItem >- { >- public AttachControlItem() >- { >- super(getAgentStateModifier(), ATTACH_ITEM, CommonUITraceConstants.PROFILE_ATTACH_GROUP, ControlMessages.CONTROL_ITEM_ATTACH, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_DETACH_AGENT)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_ATTACH_AGENT)); >- } >- >- public void run() >- { >- IAgentStateModifier agentStateModifier = getAgentStateModifier(); >- >- try >- { >- /* attach to the agent */ >- agentStateModifier.attach(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getAgentStateModifier().canAttach(); >- } >- } >- >- >- attachItem = new AttachControlItem(); >+ attachItem = new AttachControlItem(getAgentStateModifier()); >+ handler = new AttachControlItemHandler(attachItem); >+ attachItem.setHandler(handler); > return attachItem; > } > >@@ -129,37 +92,9 @@ > if (detachItem != null) > return detachItem; > >- class DetachControlItem extends AgentControlItem >- { >- public DetachControlItem() >- { >- super(getAgentStateModifier(), DETACH_ITEM, CommonUITraceConstants.PROFILE_ATTACH_GROUP, ControlMessages.CONTROL_ITEM_DETACH, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_DETACH_AGENT)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_DETACH_AGENT)); >- } >- >- public void run() >- { >- IAgentStateModifier agentStateModifier = getAgentStateModifier(); >- >- try >- { >- /* detach the agent */ >- agentStateModifier.detach(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getAgentStateModifier().canDetach(); >- } >- } >- >- >- detachItem = new DetachControlItem(); >+ detachItem = new DetachControlItem(getAgentStateModifier()); >+ handler = new DetachControlItemHandler(detachItem); >+ detachItem.setHandler(handler); > return detachItem; > } > >@@ -168,37 +103,9 @@ > if (resumeItem != null) > return resumeItem; > >- class ResumeControlItem extends AgentControlItem >- { >- public ResumeControlItem() >- { >- super(getAgentStateModifier(), START_MONITORING, CommonUITraceConstants.PROFILE_MONITOR_GROUP, ControlMessages.CONTROL_ITEM_RESUME, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_RESUME)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_RESUME)); >- } >- >- public void run() >- { >- IAgentStateModifier agentStateModifier = getAgentStateModifier(); >- >- try >- { >- /* Resume the agent */ >- agentStateModifier.startMonitoring(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getAgentStateModifier().canResume(); >- } >- } >- >- >- resumeItem = new ResumeControlItem(); >+ resumeItem = new ResumeControlItem(getAgentStateModifier()); >+ handler = AbstractAgentToolbarProvider.startMonitoring.getHandler(); >+ resumeItem.setHandler(handler); > return resumeItem; > } > >@@ -207,42 +114,13 @@ > if (pauseItem != null) > return pauseItem; > >- class PauseControlItem extends AgentControlItem >- { >- public PauseControlItem() >- { >- super(getAgentStateModifier(), PAUSE_MONITORING, CommonUITraceConstants.PROFILE_MONITOR_GROUP, ControlMessages.CONTROL_ITEM_PAUSE, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_PAUSE)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_PAUSE)); >- } >- >- public void run() >- { >- IAgentStateModifier agentStateModifier = getAgentStateModifier(); >- >- try >- { >- /* Pause the agent */ >- agentStateModifier.pauseMonitoring(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getAgentStateModifier().canPause(); >- } >- } >- >- >- pauseItem = new PauseControlItem(); >+ pauseItem = new PauseControlItem(getAgentStateModifier()); >+ handler = AbstractAgentToolbarProvider.pauseMonitoring.getHandler(); >+ pauseItem.setHandler(handler); > return pauseItem; > } > >- >- private static class AgentControlItem extends ControlItem >+ protected static class AgentControlItem extends ControlItem > { > private IAgentStateModifier stateModifier; > >@@ -272,5 +150,4 @@ > } > > } >- > } >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/ControlItem.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/provisional/control/provider/ControlItem.java,v >retrieving revision 1.2 >diff -u -r1.2 ControlItem.java >--- src/org/eclipse/tptp/trace/ui/provisional/control/provider/ControlItem.java 7 Sep 2006 23:16:57 -0000 1.2 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/ControlItem.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -11,6 +11,7 @@ > > package org.eclipse.tptp.trace.ui.provisional.control.provider; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.viewers.StructuredSelection; >@@ -27,18 +28,32 @@ > > private String groupName, text; > protected StructuredSelection input; >+ protected IHandler handler; > > public ControlItem() > { > > } >- >+ >+ public IHandler getHandler() { >+ return handler; >+ } >+ >+ public void setHandler(IHandler actionHandler){ >+ handler = actionHandler; >+ } >+ >+ public String getCommandID() { >+ return super.getActionDefinitionId(); >+ } >+ > public ControlItem(String itemId, String groupName, String text, ImageDescriptor imageDescriptor) > { > this.groupName = groupName; > this.text = text; > super.setImageDescriptor(imageDescriptor); > super.setId(itemId); >+ super.setActionDefinitionId(itemId); > } > > >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/IControlItem.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/provisional/control/provider/IControlItem.java,v >retrieving revision 1.1 >diff -u -r1.1 IControlItem.java >--- src/org/eclipse/tptp/trace/ui/provisional/control/provider/IControlItem.java 8 Mar 2006 19:03:09 -0000 1.1 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/IControlItem.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006 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 >@@ -11,6 +11,7 @@ > > package org.eclipse.tptp.trace.ui.provisional.control.provider; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.viewers.StructuredSelection; > >@@ -47,4 +48,30 @@ > * @param input The input of this control item. > */ > public void setInput (StructuredSelection input); >+ >+ /** >+ * Sets the handler for this control item. The handler should be of the >+ * corresponding type as the action that is declared. (ex. PauseControlItem >+ * has PauseControlItemHandler) >+ * >+ * @param Handler for the IControlItem action. >+ */ >+ public void setHandler(IHandler actionHandler); >+ >+ /** >+ * Returns the handler for this control item. The handler should be declared >+ * ahead of time, or a <code>null</code> will be returned. >+ * >+ * @return Handler for the IControlItem action. >+ */ >+ public IHandler getHandler(); >+ >+ /** >+ * Returns the Action Definition ID (aka Command ID) for this control item. The >+ * default action definition id is null unless set previously using >+ * "setActionDefinitionID(String id)." >+ * >+ * @return actionDefinitionID of type String >+ */ >+ public String getCommandID(); > } >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResourceItemControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResourceItemControlProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 ResourceItemControlProvider.java >--- src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResourceItemControlProvider.java 3 Oct 2006 19:13:55 -0000 1.4 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResourceItemControlProvider.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -10,24 +10,18 @@ > **********************************************************************/ > package org.eclipse.tptp.trace.ui.provisional.control.provider; > >-import java.util.Iterator; >- >+import org.eclipse.core.commands.IHandler; > import org.eclipse.hyades.trace.internal.ui.PDProjectExplorer; >-import org.eclipse.hyades.trace.ui.ProfileEvent; > import org.eclipse.hyades.trace.ui.UIPlugin; > import org.eclipse.hyades.trace.ui.internal.actions.DeleteAction; > import org.eclipse.hyades.trace.ui.internal.actions.OpenWizardAction; > import org.eclipse.hyades.trace.ui.internal.actions.SaveAction; >-import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.hyades.trace.ui.internal.util.TraceMessages; > import org.eclipse.hyades.trace.ui.internal.wizard.OpenProcessWizard; > import org.eclipse.hyades.trace.ui.internal.wizard.OpenProfAgentWizard; > import org.eclipse.hyades.ui.extension.INavigatorContribution; >-import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; > import org.eclipse.tptp.trace.ui.internal.control.provider.ControlProviderManager; > import org.eclipse.tptp.trace.ui.internal.control.provider.TraceControlItemManager; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >- > > > /** >@@ -43,10 +37,6 @@ > */ > public class ResourceItemControlProvider extends LogicalItemControlProvider > { >- /** The id of the contributed items */ >- private static final String REFRESH_ITEM = "org.eclipse.hyades.trace.ui.internal.monitorsview.popupMenu.refreshViews"; >- private static final String REFRESH_OPTION = "org.eclipse.hyades.trace.ui.internal.monitorsview.popupMenu.refreshOption"; >- > /** The delete item */ > private IControlItem delete; > >@@ -54,16 +44,18 @@ > private IControlItem save; > > /** The refresh view item */ >- private IControlItem refresh; >+ protected static IControlItem refresh; > > /** The refresh option item */ >- private IControlItem refreshOption; >+ protected static IControlItem refreshOption; > > /** The properties item */ > private IControlItem properties; > > /** The entity that this provider is affiliated to */ > private String entity; >+ >+ private IHandler handler; > > public void initialize (String entity) > { >@@ -88,8 +80,7 @@ > { > if (delete != null && !isContextDifferent) > return delete; >- >- >+ > delete = new ControlItemAdapter(INavigatorContribution.GROUP_DELETE, new DeleteAction(TraceControlItemManager.getNavigator())); > return delete; > } >@@ -100,7 +91,6 @@ > if (save != null && !isContextDifferent) > return save; > >- > save = new ControlItemAdapter(INavigatorContribution.GROUP_SAVE, new SaveAction(TraceControlItemManager.getNavigator())); > return save; > } >@@ -110,27 +100,10 @@ > { > if (refresh != null) > return refresh; >- >- class RefreshView extends ControlItem >- { >- public RefreshView() >- { >- super (REFRESH_ITEM, CommonUITraceConstants.PROFILE_REFRESH_GROUP, ControlMessages.CONTROL_ITEM_REFRESH_VIEWS, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_REFRESH_VIEWS)); >- } >- >- public void run() >- { >- if (input == null) >- return; >- >- for (Iterator sources = input.iterator(); sources.hasNext();) >- { >- ProfileEvent event = UIPlugin.getDefault().getRefreshViewEvent(sources.next()); >- UIPlugin.getDefault().notifyProfileEventListener(event); >- } >- } >- } >+ > refresh = new RefreshView(); >+ handler = new RefreshViewHandler(refresh); >+ refresh.setHandler(handler); > return refresh; > } > >@@ -143,30 +116,11 @@ > protected IControlItem createRefreshOptionControlItem() > { > if (refreshOption != null) >- return refreshOption; >- >- class RefreshOption extends ControlItem >- { >- public RefreshOption() >- { >- super (REFRESH_OPTION, CommonUITraceConstants.PROFILE_REFRESH_GROUP, ControlMessages.CONTROL_ITEM_REFRESH_OPTION, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_REFRESH_OPTIONS)); >- } >- >- /* This method is invoked when ever user clicks the 'Change Refresh Options' button. >- * It simply invokes the 'handleProfileEvent' method of PDProjectExplorer */ >- public void run() >- { >- if (input == null) >- return; >- >- for (Iterator sources = input.iterator(); sources.hasNext();) >- { >- ProfileEvent event = UIPlugin.getDefault().getRefreshOptionEvent(sources.next()); >- UIPlugin.getDefault().notifyProfileEventListener(event); >- } >- } >- } >+ return refreshOption; >+ > refreshOption = new RefreshOption(); >+ handler = new RefreshOptionHandler(refreshOption); >+ refreshOption.setHandler(handler); > return refreshOption; > } > >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractProcessControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractProcessControlProvider.java,v >retrieving revision 1.3 >diff -u -r1.3 AbstractProcessControlProvider.java >--- src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractProcessControlProvider.java 22 Aug 2006 22:27:34 -0000 1.3 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractProcessControlProvider.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -10,14 +10,7 @@ > **********************************************************************/ > package org.eclipse.tptp.trace.ui.provisional.control.provider; > >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >-import org.eclipse.jface.viewers.StructuredSelection; >-import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >-import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >- >+import org.eclipse.core.commands.IHandler; > > /** > * Provides an abstract control provider for a process. Subclasses are >@@ -28,11 +21,10 @@ > */ > public abstract class AbstractProcessControlProvider extends ResourceItemControlProvider > { >- /** The id of the contributed items */ >- private static final String TERMINATE_ITEM = "org.eclipse.hyades.trace.ui.internal.popupMenu.TerminateAction"; >- > /** The terminate item */ >- private IControlItem terminateItem; >+ protected static IControlItem terminateItem; >+ >+ private IHandler handler; > > /** > * Subclasses are expected to provide a process state modifier that >@@ -61,63 +53,16 @@ > * Overwrite this method to modify the terminate control > * item. > * >- * @return Ther terminate control item >+ * @return The terminate control item > */ > protected IControlItem createTerminateControlItem() > { > if (terminateItem != null) > return terminateItem; >- >- class TerminateAction extends ControlItem >- { >- public TerminateAction() >- { >- super (TERMINATE_ITEM, CommonUITraceConstants.PROFILE_TERMINATE_GROUP, ControlMessages.CONTROL_ITEM_TERMINATE, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_TERMINATE)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_TERMINATE)); >- } >- >- public void run() >- { >- IProcessStateModifier processStateModifier = getProcessStateModifier(); >- >- try >- { >- /* Terminate the process */ >- processStateModifier.terminate(); >- } catch (CoreException e) >- { >- /* Display status */ >- LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >- } >- } >- >- public boolean isEnabled() >- { >- return getProcessStateModifier().canTerminate(); >- } >- >- public void setInput(StructuredSelection input) >- { >- getProcessStateModifier().setInput(input); >- } >- >- public IProcessStateModifier getStateModifier() >- { >- return getProcessStateModifier(); >- } >- >- public boolean equals (Object o) >- { >- if (!(o instanceof TerminateAction)) >- return false; >- >- return getProcessStateModifier() == ((TerminateAction)o).getStateModifier() && super.equals(o); >- } >- >- } >- > >- terminateItem = new TerminateAction(); >+ terminateItem = new TerminateAction(getProcessStateModifier()); >+ handler = new TerminateControlItemHandler(terminateItem); >+ terminateItem.setHandler(handler); > return terminateItem; > } > } >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentToolbarProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentToolbarProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractAgentToolbarProvider.java >--- src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentToolbarProvider.java 3 Oct 2006 19:13:55 -0000 1.4 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/AbstractAgentToolbarProvider.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -10,6 +10,7 @@ > **********************************************************************/ > package org.eclipse.tptp.trace.ui.provisional.control.provider; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.hyades.trace.ui.UIPlugin; > import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.jface.resource.ImageDescriptor; >@@ -24,17 +25,17 @@ > public abstract class AbstractAgentToolbarProvider extends AbstractAgentControlProvider > { > /** The id of the contributed items */ >- public static final String START_TOOLBAR_ITEM = "org.eclipse.hyades.trace.ui.internal.monitorsview.toolbar.startMonitoring"; >- public static final String PAUSE_TOOLBAR_ITEM = "org.eclipse.hyades.trace.ui.internal.monitorsview.toolbar.stopMonitoring"; >+ public static final String START_TOOLBAR_ITEM = "org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItem"; >+ public static final String PAUSE_TOOLBAR_ITEM = "org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItem"; > public static final String TERMINATE_TOOLBAR_ITEM = "org.eclipse.hyades.trace.ui.internal.monitorsview.toolbar.terminate"; > public static final String REFRESH_VIEW_TOOLBAR_ITEM = "org.eclipse.hyades.trace.ui.internal.monitorsview.toolbar.refreshViews"; > public static final String REFRESH_OPTIONS = "org.eclipse.hyades.trace.ui.internal.monitorsview.toolbar.refreshOptions"; > > /** The start monitoring toolbar item */ >- private IControlItem startMonitoring; >+ protected static IControlItem startMonitoring; > > /** The pause monitoring toolbar item */ >- private IControlItem pauseMonitoring; >+ protected static IControlItem pauseMonitoring; > > /** The terminate toolbar item */ > private IControlItem terminate; >@@ -45,6 +46,9 @@ > /** The automatic refresh control item. Used */ > private IControlItem automaticRefresh; > >+ /** hander for the action items */ >+ private IHandler handler; >+ > /** > * @see AbstractControlProvider#initializeControlItems() > */ >@@ -69,7 +73,9 @@ > if (startMonitoring != null) > return startMonitoring; > >- startMonitoring = makeToolbarReady(super.createStartMonitoringControlItem(), START_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_MONITOR_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_RESUME)); >+ startMonitoring = makeToolbarReady(new ResumeControlItem(getAgentStateModifier()), START_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_MONITOR_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_RESUME)); >+ handler = new ResumeControlItemHandler(startMonitoring); >+ startMonitoring.setHandler(handler); > return startMonitoring; > } > >@@ -84,8 +90,9 @@ > { > if (pauseMonitoring != null) > return pauseMonitoring; >- pauseMonitoring = makeToolbarReady(super.createPauseMonitoringControlItem(), PAUSE_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_MONITOR_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_PAUSE)); >- >+ pauseMonitoring = makeToolbarReady(new PauseControlItem(getAgentStateModifier()), PAUSE_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_MONITOR_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_PAUSE)); >+ handler = new PauseControlItemHandler(pauseMonitoring); >+ pauseMonitoring.setHandler(handler); > return pauseMonitoring; > } > >@@ -102,6 +109,8 @@ > return terminate; > > terminate = makeToolbarReady(super.createTerminateControlItem(), TERMINATE_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_MONITOR_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_TERMINATE)); >+ handler = terminateItem.getHandler(); >+ terminate.setHandler(handler); > return terminate; > } > >@@ -118,6 +127,8 @@ > return refreshView; > > refreshView = makeToolbarReady(super.createRefreshViewsControlItem(), REFRESH_VIEW_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_REFRESH_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_REFRESH_VIEWS)); >+ handler = refresh.getHandler(); >+ refreshView.setHandler(handler); > return refreshView; > } > >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.29 >diff -u -r1.29 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 Nov 2007 02:34:06 -0000 1.29 >+++ META-INF/MANIFEST.MF 28 Mar 2008 16:23:12 -0000 >@@ -53,6 +53,7 @@ > org.eclipse.tptp.platform.common;bundle-version="[4.3.0,5.0.0)";visibility:=reexport, > org.eclipse.tptp.platform.common.ui;bundle-version="[4.3.0,5.0.0)";visibility:=reexport, > org.eclipse.tptp.platform.common.ui.trace;bundle-version="[4.3.0,5.0.0)";visibility:=reexport, >- org.eclipse.tptp.platform.execution;bundle-version="[4.3.0,5.0.0)" >+ org.eclipse.tptp.platform.execution;bundle-version="[4.3.0,5.0.0)", >+ org.eclipse.core.expressions;bundle-version="3.4.0" > Eclipse-LazyStart: true > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentToolbarProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentToolbarProvider.java,v >retrieving revision 1.2 >diff -u -r1.2 PIAgentToolbarProvider.java >--- src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentToolbarProvider.java 23 Aug 2006 16:25:25 -0000 1.2 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentToolbarProvider.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -10,10 +10,9 @@ > **********************************************************************/ > package org.eclipse.tptp.trace.ui.internal.control.provider.application; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.PIAgentControlProvider.GCControlItem; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.PIAgentControlProvider.HeapDumpControlItem; > import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentToolbarProvider; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IAgentStateModifier; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IControlItem; >@@ -33,10 +32,12 @@ > private IAgentStateModifier agentStateModifier; > > /** The collect object reference control item */ >- private IControlItem dumpHeapControlItem; >+ protected static IControlItem dumpHeapControlItem; > > /** The garbage collection control item */ >- private IControlItem garbageCollectionControlItem; >+ protected static IControlItem garbageCollectionControlItem; >+ >+ private IHandler handler; > > > public PIAgentToolbarProvider() >@@ -63,6 +64,8 @@ > return garbageCollectionControlItem; > > garbageCollectionControlItem = makeToolbarReady(new GCControlItem(), GC_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_GC)); >+ handler = new GCControlItemHandler(garbageCollectionControlItem); >+ garbageCollectionControlItem.setHandler(handler); > return garbageCollectionControlItem; > } > >@@ -72,6 +75,8 @@ > return dumpHeapControlItem; > > dumpHeapControlItem = makeToolbarReady(new HeapDumpControlItem(), HEAP_DUMP_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_DUMP)); >+ handler = new HeapDumpControlItemHandler(dumpHeapControlItem); >+ dumpHeapControlItem.setHandler(handler); > return dumpHeapControlItem; > } > >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentControlProvider.java,v >retrieving revision 1.5 >diff -u -r1.5 PIAgentControlProvider.java >--- src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentControlProvider.java 23 Aug 2006 16:25:25 -0000 1.5 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/PIAgentControlProvider.java 28 Mar 2008 16:23:13 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -13,11 +13,9 @@ > > import java.util.Iterator; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.hyades.trace.ui.internal.actions.CollectObjRefAction; > import org.eclipse.hyades.trace.ui.internal.actions.NewSnapshotAction; >-import org.eclipse.hyades.trace.ui.internal.actions.RunGCAction; >-import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; > import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; > import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentControlProvider; >@@ -35,20 +33,20 @@ > { > /** The id of the contributed items */ > private static final String RESET_ITEM = "org.eclipse.hyades.trace.ui.internal.popupMenu.NewSnapshot"; >- private static final String HEAP_DUMP_ITEM = "org.eclipse.hyades.trace.ui.monitorsview.popupMenu.ObjRef"; >- private static final String GC_ITEM = "org.eclipse.hyades.trace.ui.monitorsview.popupMenu.GC"; > > /** The agent state modifier */ > private IAgentStateModifier agentStateModifier; > > /** The collect object reference control item */ >- private IControlItem dumpHeapControlItem; >+ protected static IControlItem _dumpHeapControlItem; > > /** The garbage collection control item */ >- private IControlItem garbageCollectionControlItem; >+ protected static IControlItem _garbageCollectionControlItem; > > /** The restart control item */ > private IControlItem restartControlItem; >+ >+ private IHandler handler; > > > public PIAgentControlProvider() >@@ -78,11 +76,13 @@ > */ > protected IControlItem createHeapDumpControlItem() > { >- if (dumpHeapControlItem != null) >- return dumpHeapControlItem; >+ if (_dumpHeapControlItem != null) >+ return _dumpHeapControlItem; > >- dumpHeapControlItem = new HeapDumpControlItem(); >- return dumpHeapControlItem; >+ _dumpHeapControlItem = new HeapDumpControlItem(); >+ handler = PIAgentToolbarProvider.dumpHeapControlItem.getHandler(); >+ _dumpHeapControlItem.setHandler(handler); >+ return _dumpHeapControlItem; > } > > >@@ -93,11 +93,13 @@ > */ > protected IControlItem createGCControlItem() > { >- if (garbageCollectionControlItem != null) >- return garbageCollectionControlItem; >+ if (_garbageCollectionControlItem != null) >+ return _garbageCollectionControlItem; > >- garbageCollectionControlItem = new GCControlItem(); >- return garbageCollectionControlItem; >+ _garbageCollectionControlItem = new GCControlItem(); >+ handler = PIAgentToolbarProvider.garbageCollectionControlItem.getHandler(); >+ _garbageCollectionControlItem.setHandler(handler); >+ return _garbageCollectionControlItem; > } > > >@@ -148,79 +150,4 @@ > return restartControlItem; > } > >- >- public static class HeapDumpControlItem extends ControlItem >- { >- CollectObjRefAction collectObjRef; >- public HeapDumpControlItem() >- { >- super(HEAP_DUMP_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, ControlMessages.CONTROL_ITEM_DUMP, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_DUMP)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_DUMP)); >- collectObjRef = new CollectObjRefAction(); >- } >- >- public void run() >- { >- try >- { >- for (Iterator agents = input.iterator(); agents.hasNext();) >- collectObjRef.doAction(agents.next()); >- } >- catch (Exception e) >- { >- LauncherUtility.openMessageWithDetail(IStatus.ERROR, "", e.getMessage(), e); >- } >- } >- >- >- public boolean isEnabled() >- { >- if (input == null || input.size() == 0) >- return false; >- >- boolean isEnable = true; >- for (Iterator agents = input.iterator(); isEnable && agents.hasNext();) >- isEnable = isEnable && collectObjRef.isEnabledFor(agents.next()); >- return isEnable; >- } >- >- } >- >- >- public static class GCControlItem extends ControlItem >- { >- private RunGCAction gcAction; >- public GCControlItem() >- { >- super(GC_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, ControlMessages.CONTROL_ITEM_GC_ACTION, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_GC)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_GC)); >- gcAction = new RunGCAction(); >- } >- >- public void run() >- { >- try >- { >- for (Iterator agents = input.iterator(); agents.hasNext();) >- gcAction.doAction(agents.next()); >- } >- catch (Exception e) >- { >- LauncherUtility.openMessageWithDetail(IStatus.ERROR, "", e.getMessage(), e); >- } >- } >- >- >- public boolean isEnabled() >- { >- if (input == null || input.size() == 0) >- return false; >- >- boolean isEnable = true; >- for (Iterator agents = input.iterator(); isEnable && agents.hasNext();) >- isEnable = isEnable && gcAction.isEnabledFor(agents.next()); >- return isEnable; >- } >- >- } > } >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/internal/control/provider/application/messages.properties,v >retrieving revision 1.4 >diff -u -r1.4 messages.properties >--- src/org/eclipse/tptp/trace/ui/internal/control/provider/application/messages.properties 22 Mar 2008 18:20:20 -0000 1.4 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/messages.properties 28 Mar 2008 16:23:13 -0000 >@@ -14,15 +14,15 @@ > # NLS_ENCODING=UTF-8 > > CONTROL_ITEM_TERMINATE = Terminate >-CONTROL_ITEM_REFRESH_VIEWS = Refresh &Views >-CONTROL_ITEM_REFRESH_OPTION = Change Refresh &Options >-CONTROL_ITEM_ATTACH = A&ttach to Agent >-CONTROL_ITEM_DETACH = Detach &from Agent >+CONTROL_ITEM_REFRESH_VIEWS = Refresh Views >+CONTROL_ITEM_REFRESH_OPTION = Change Refresh Options >+CONTROL_ITEM_ATTACH = Attach to Agent >+CONTROL_ITEM_DETACH = Detach from Agent > CONTROL_ITEM_RESUME = Start Monitoring > CONTROL_ITEM_PAUSE = Pause Monitoring >-CONTROL_ITEM_DUMP = &Collect Object References >-CONTROL_ITEM_GC_ACTION = &Run Garbage Collection >-CONTROL_ITEM_NEW_SNAPSHOT = Reset &Data >+CONTROL_ITEM_DUMP = Collect Object References >+CONTROL_ITEM_GC_ACTION = Run Garbage Collection >+CONTROL_ITEM_NEW_SNAPSHOT = Reset Data > > ERROR_PROCESS_TERMINATE = An error occurred while attempting to terminate process: {0} > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/plugin.xml,v >retrieving revision 1.57 >diff -u -r1.57 plugin.xml >--- plugin.xml 28 Feb 2008 23:09:57 -0000 1.57 >+++ plugin.xml 28 Mar 2008 16:23:12 -0000 >@@ -1035,6 +1035,140 @@ > > <entity type = "toolbar" > class = "org.eclipse.tptp.trace.ui.internal.control.provider.application.AgentDiscovererToolbarProvider"/> >- </control> >+ </control> > </extension> >+ <extension >+ point="org.eclipse.ui.contexts"> >+ <context >+ id="org.eclipse.ui.TPTPMonitorContext" >+ name="%_ProfileContext"> >+ </context> >+ </extension> >+ >+ <extension >+ point="org.eclipse.ui.commands"> >+ <category >+ description="%_D1" >+ id="org.eclipse.hyades.trace.ui.ProfileActions" >+ name="%TRC_ITEMS"> >+ </category> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItemHandler" >+ description="%_PauseD" >+ id="org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItem" >+ name="%_PAUSE"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItemHandler" >+ description="%_ResumeD" >+ id="org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItem" >+ name="%_RESUME"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.AttachControlItemHandler" >+ description="%_AttachD" >+ id="org.eclipse.tptp.trace.ui.provisional.control.provider.AttachControlItem" >+ name="%_ATTACH"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.DetachControlItemHandler" >+ description="%_DetachD" >+ id="org.eclipse.tptp.trace.ui.provisional.control.provider.DetachControlItem" >+ name="%_DETACH"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.TerminateControlItemHandler" >+ description="%_TerminateD" >+ id="org.eclipse.tptp.trace.ui.provisional.control.provider.TerminateAction" >+ name="%_TERMINATE"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshOptionHandler" >+ id="org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.application.RefreshOption" >+ name="%_RefreshOpD"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshViewHandler" >+ description="%_RefreshD" >+ id="org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshView" >+ name="%_REFRESH"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItemHandler" >+ description="%_RunGC" >+ id="org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItem" >+ name="%_RunGCD"> >+ </command> >+ <command >+ categoryId="org.eclipse.hyades.trace.ui.ProfileActions" >+ defaultHandler="org.eclipse.tptp.trace.ui.internal.control.provider.application.HeapDumpControlItemHandler" >+ description="%_HeapDD" >+ id="org.eclipse.tptp.trace.ui.internal.control.provider.application.HeapDumpControlItem" >+ name="%_HeapD"> >+ </command> >+ </extension> >+ <extension point="org.eclipse.ui.bindings"> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItem" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+P"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItem" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+S"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.provisional.control.provider.AttachControlItem" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+A"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.provisional.control.provider.DetachControlItem" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+D"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.provisional.control.provider.TerminateAction" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+T"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.application.RefreshOption" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+O"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshView" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+R"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItem" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+M2+G"> >+ </key> >+ <key >+ commandId="org.eclipse.tptp.trace.ui.internal.control.provider.application.HeapDumpControlItem" >+ contextId="org.eclipse.ui.TPTPMonitorContext" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+M3+M2+O"> >+ </key> >+ </extension> > </plugin> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/plugin.properties,v >retrieving revision 1.81 >diff -u -r1.81 plugin.properties >--- plugin.properties 19 May 2007 00:42:35 -0000 1.81 >+++ plugin.properties 28 Mar 2008 16:23:12 -0000 >@@ -120,4 +120,24 @@ > ANALYSIS_TYPE_METHOD_COVERAGE = Analyze the application Method Coverage. See what methods were executed. > > EDIT_PROF_OPT = Edit Profiling Options >-EDIT_AGENT_DIS_TITLE = Edit Agent Discoverer Options >\ No newline at end of file >+EDIT_AGENT_DIS_TITLE = Edit Agent Discoverer Options >+_ProfileContext = TPTP Profiling View Context >+TRC_ITEMS = Trace Action Items >+_PAUSE = Pause Monitoring >+_RESUME = Start Monitoring >+_ATTACH = Attach to Agent >+_DETACH = Detach from Agent >+_TERMINATE = Terminate Monitoring Process >+_REFRESH = Refresh Views >+_D1 = Action Items available in Profiling View >+_PauseD = Stop Monitoring without detaching from Agent >+_ResumeD = Start Monitoring >+_AttachD = Attach running process to Agent >+_DetachD = Detach process from Agent >+_TerminateD = Terminate process >+_RefreshOpD = Refresh Option >+_RefreshD = Refresh available views >+_RunGC = Run Garbage Collection >+_RunGCD = Run Garbage Collection >+_HeapDD = Perform heap dump >+_HeapD = Heap Dump >\ No newline at end of file >Index: src/org/eclipse/hyades/trace/internal/ui/PDProjectExplorer.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/hyades/trace/internal/ui/PDProjectExplorer.java,v >retrieving revision 1.27 >diff -u -r1.27 PDProjectExplorer.java >--- src/org/eclipse/hyades/trace/internal/ui/PDProjectExplorer.java 5 Jul 2007 01:35:05 -0000 1.27 >+++ src/org/eclipse/hyades/trace/internal/ui/PDProjectExplorer.java 28 Mar 2008 16:23:12 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 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 >@@ -76,6 +76,7 @@ > import org.eclipse.ui.IViewPart; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.actions.ActionContext; >+import org.eclipse.ui.contexts.IContextService; > import org.eclipse.ui.plugin.AbstractUIPlugin; > > public class PDProjectExplorer extends Navigator implements IProfileEventListener >@@ -250,6 +251,7 @@ > super(ID); > > traceControlItemManager = new TraceControlItemManager(this); >+// traceControlItemManager.setSite(getSite()); > > /* set project explorer to resource helper such that it can be notified dirty for save */ > Object ue = HierarchyResourceSetImpl.getInstance().getUnresolvedException(); >@@ -273,8 +275,19 @@ > UIPlugin.getDefault().addSelectionProvider(getViewer(), this); > UIPlugin.getDefault().addProfileEventListener(this); > >+ activateContext(); >+ > (new RefreshUI()).start(); > } >+ >+ /* >+ * Defines the context of the profiling view as "org.eclipse.ui.TPTPMonitorContext". >+ * Is used for Keybinding. >+ */ >+ private void activateContext() { >+ IContextService contextService = (IContextService) getSite().getService(IContextService.class); >+ contextService.activateContext("org.eclipse.ui.TPTPMonitorContext"); >+ } > > /** > * Updates the action bar actions. >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/TraceControlItemManager.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.trace.ui/src/org/eclipse/tptp/trace/ui/internal/control/provider/TraceControlItemManager.java,v >retrieving revision 1.3 >diff -u -r1.3 TraceControlItemManager.java >--- src/org/eclipse/tptp/trace/ui/internal/control/provider/TraceControlItemManager.java 26 Apr 2006 00:21:30 -0000 1.3 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/TraceControlItemManager.java 28 Mar 2008 16:23:12 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 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 >@@ -17,16 +17,20 @@ > import org.eclipse.emf.common.util.EList; > import org.eclipse.hyades.models.hierarchy.TRCAgentProxy; > import org.eclipse.hyades.models.hierarchy.TRCProcessProxy; >+import org.eclipse.hyades.trace.internal.ui.PDProjectExplorer; > import org.eclipse.hyades.trace.internal.ui.PDProjectViewer; > import org.eclipse.hyades.trace.ui.internal.navigator.ProfileDetailItem; > import org.eclipse.hyades.ui.extension.INavigatorItem; > import org.eclipse.hyades.ui.internal.navigator.INavigator; >+import org.eclipse.jface.commands.ActionHandler; > import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.swt.widgets.Tree; > import org.eclipse.swt.widgets.TreeItem; > import org.eclipse.tptp.trace.ui.internal.launcher.core.AgentDeclarationManager; > import org.eclipse.tptp.trace.ui.internal.launcher.core.AnalysisType; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.ControlItem; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IControlItem; >+import org.eclipse.ui.handlers.IHandlerService; > > > /** >@@ -47,10 +51,12 @@ > /** The tree of the profiling monitor view */ > private Tree profilingMonitorTree; > >+ > public TraceControlItemManager (INavigator navigator) > { > TraceControlItemManager.navigator = navigator; > } >+ > > private IControlItem[] getContributedItems(byte containerType) > { >@@ -86,8 +92,17 @@ > if (orderedList != null) > { > controlItems = new IControlItem[orderedList.size()]; >- for (int i = 0; i < controlItems.length; i++) >- controlItems[i] = (IControlItem)controlSubset.get(orderedList.get(i)); >+ for (int i = 0; i < controlItems.length; i++) { >+ controlItems[i] = (IControlItem)controlSubset.get(orderedList.get(i)); >+ >+ /* Activates the handlers for all the action items */ >+ if (controlItems[i] instanceof ControlItem && >+ ((ControlItem)controlItems[i]).getCommandID()!=null && >+ ((ControlItem)controlItems[i]).getHandler()!=null ) { >+ IHandlerService handlerService = (IHandlerService) (((PDProjectExplorer)navigator).getSite().getService(IHandlerService.class)); >+ handlerService.activateHandler(((ControlItem)controlItems[i]).getCommandID(),((ControlItem)controlItems[i]).getHandler()); >+ } >+ } > } > > return controlItems; >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItem.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItem.java >diff -N src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,59 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.internal.control.provider.application; >+ >+import java.util.Iterator; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.hyades.trace.ui.internal.actions.CollectObjRefAction; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.ControlItem; >+ >+public class HeapDumpControlItem extends ControlItem >+{ >+ CollectObjRefAction collectObjRef; >+ private static final String HEAP_DUMP_ITEM = "org.eclipse.tptp.trace.ui.internal.control.provider.application.HeapDumpControlItem"; >+ >+ public HeapDumpControlItem() >+ { >+ super(HEAP_DUMP_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, ControlMessages.CONTROL_ITEM_DUMP, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_DUMP)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_DUMP)); >+ collectObjRef = new CollectObjRefAction(); >+ } >+ >+ public void run() >+ { >+ try >+ { >+ for (Iterator agents = input.iterator(); agents.hasNext();) >+ collectObjRef.doAction(agents.next()); >+ } >+ catch (Exception e) >+ { >+ LauncherUtility.openMessageWithDetail(IStatus.ERROR, "", e.getMessage(), e); >+ } >+ } >+ >+ >+ public boolean isEnabled() >+ { >+ if (input == null || input.size() == 0) >+ return false; >+ >+ boolean isEnable = true; >+ for (Iterator agents = input.iterator(); isEnable && agents.hasNext();) >+ isEnable = isEnable && collectObjRef.isEnabledFor(agents.next()); >+ return isEnable; >+ } >+ >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshViewHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshViewHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshViewHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshViewHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class RefreshViewHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public RefreshViewHandler(IAction refreshView) { >+ super(); >+ this.action = refreshView; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOption.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOption.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOption.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOption.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import java.util.Iterator; >+ >+import org.eclipse.hyades.trace.ui.ProfileEvent; >+import org.eclipse.hyades.trace.ui.UIPlugin; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.ControlItem; >+ >+public class RefreshOption extends ControlItem { >+ >+ private static final String REFRESH_OPTION = "org.eclipse.tptp.platform.instrumentation.ui.internal.control.provider.application.RefreshOption"; >+ >+ public RefreshOption() >+ { >+ super (REFRESH_OPTION, CommonUITraceConstants.PROFILE_REFRESH_GROUP, ControlMessages.CONTROL_ITEM_REFRESH_OPTION, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_REFRESH_OPTIONS)); >+ } >+ >+ /* This method is invoked when ever user clicks the 'Change Refresh Options' button. >+ * It simply invokes the 'handleProfileEvent' method of PDProjectExplorer */ >+ public void run() >+ { >+ if (input == null) >+ return; >+ >+ for (Iterator sources = input.iterator(); sources.hasNext();) >+ { >+ ProfileEvent event = UIPlugin.getDefault().getRefreshOptionEvent(sources.next()); >+ UIPlugin.getDefault().notifyProfileEventListener(event); >+ } >+ } >+} >+ >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItem.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItem.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentControlProvider.AgentControlItem; >+ >+public class PauseControlItem extends AgentControlItem { >+ >+ private static final String PAUSE_MONITORING = "org.eclipse.tptp.trace.ui.provisional.control.provider.PauseControlItem"; >+ private static IAgentStateModifier _agentStateModifier; >+ >+ public PauseControlItem(IAgentStateModifier agentStateModifier) >+ { >+ super(agentStateModifier, PAUSE_MONITORING, CommonUITraceConstants.PROFILE_MONITOR_GROUP, ControlMessages.CONTROL_ITEM_PAUSE, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_PAUSE)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_PAUSE)); >+ _agentStateModifier = agentStateModifier; >+ } >+ >+ public void run() >+ { >+ IAgentStateModifier agentStateModifier = _agentStateModifier; >+ >+ try >+ { >+ /* Pause the agent */ >+ if(isEnabled()) >+ agentStateModifier.pauseMonitoring(); >+ } catch (CoreException e) >+ { >+ /* Display status */ >+ LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >+ } >+ } >+ >+ public boolean isEnabled() >+ { >+ return _agentStateModifier.canPause(); >+ } >+ >+} >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.internal.control.provider.application; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class GCControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public GCControlItemHandler(IAction gC) { >+ super(); >+ this.action = gC; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/HeapDumpControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.internal.control.provider.application; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class HeapDumpControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public HeapDumpControlItemHandler(IAction heapDump) { >+ super(); >+ this.action = heapDump; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class AttachControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public AttachControlItemHandler(IAction attachAction) { >+ super(); >+ this.action = attachAction; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItem.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItem.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/AttachControlItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,52 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentControlProvider.AgentControlItem; >+ >+public class AttachControlItem extends AgentControlItem { >+ >+ private static final String ATTACH_ITEM = "org.eclipse.tptp.trace.ui.provisional.control.provider.AttachControlItem"; >+ private IAgentStateModifier _agentStateModifier; >+ >+ public AttachControlItem(IAgentStateModifier agentStateModifier) >+ { >+ super(agentStateModifier, ATTACH_ITEM, CommonUITraceConstants.PROFILE_ATTACH_GROUP, ControlMessages.CONTROL_ITEM_ATTACH, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_DETACH_AGENT)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_ATTACH_AGENT)); >+ _agentStateModifier = agentStateModifier; >+ } >+ >+ public void run() >+ { >+ IAgentStateModifier agentStateModifier = _agentStateModifier; >+ >+ try >+ { >+ /* attach to the agent */ >+ if (isEnabled()) >+ agentStateModifier.attach(); >+ } catch (CoreException e) >+ { >+ /* Display status */ >+ LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >+ } >+ } >+ >+ public boolean isEnabled() >+ { >+ return _agentStateModifier.canAttach(); >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItem.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItem.java >diff -N src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/internal/control/provider/application/GCControlItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,58 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.internal.control.provider.application; >+ >+import java.util.Iterator; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.hyades.trace.ui.internal.actions.RunGCAction; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.ControlItem; >+ >+public class GCControlItem extends ControlItem { >+ >+ private RunGCAction gcAction; >+ public static final String GC_ITEM = "org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItem"; >+ >+ public GCControlItem() >+ { >+ super(GC_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, ControlMessages.CONTROL_ITEM_GC_ACTION, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_GC)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_GC)); >+ gcAction = new RunGCAction(); >+ } >+ >+ public void run() >+ { >+ try >+ { >+ for (Iterator agents = input.iterator(); agents.hasNext();) >+ gcAction.doAction(agents.next()); >+ } >+ catch (Exception e) >+ { >+ LauncherUtility.openMessageWithDetail(IStatus.ERROR, "", e.getMessage(), e); >+ } >+ } >+ >+ >+ public boolean isEnabled() >+ { >+ if (input == null || input.size() == 0) >+ return false; >+ >+ boolean isEnable = true; >+ for (Iterator agents = input.iterator(); isEnable && agents.hasNext();) >+ isEnable = isEnable && gcAction.isEnabledFor(agents.next()); >+ return isEnable; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateAction.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateAction.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,71 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.jface.viewers.StructuredSelection; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+ >+public class TerminateAction extends ControlItem { >+ >+ private IProcessStateModifier _processStateModifier; >+ private static final String TERMINATE_ITEM = "org.eclipse.tptp.trace.ui.provisional.control.provider.TerminateAction"; >+ >+ public TerminateAction(IProcessStateModifier processStateModifier) >+ { >+ super (TERMINATE_ITEM, CommonUITraceConstants.PROFILE_TERMINATE_GROUP, ControlMessages.CONTROL_ITEM_TERMINATE, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_TERMINATE)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_TERMINATE)); >+ _processStateModifier = processStateModifier; >+ } >+ >+ public void run() >+ { >+ >+ try >+ { >+ /* Terminate the process */ >+ if(isEnabled()) >+ _processStateModifier.terminate(); >+ } catch (CoreException e) >+ { >+ /* Display status */ >+ LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >+ } >+ } >+ >+ public boolean isEnabled() >+ { >+ return _processStateModifier.canTerminate(); >+ } >+ >+ public void setInput(StructuredSelection input) >+ { >+ _processStateModifier.setInput(input); >+ } >+ >+ public IProcessStateModifier getStateModifier() >+ { >+ return _processStateModifier; >+ } >+ >+ public boolean equals (Object o) >+ { >+ if (!(o instanceof TerminateAction)) >+ return false; >+ >+ return _processStateModifier == ((TerminateAction)o).getStateModifier() && super.equals(o); >+ } >+ >+ >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class DetachControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public DetachControlItemHandler(IAction detachAction) { >+ super(); >+ this.action = detachAction; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/TerminateControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class TerminateControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public TerminateControlItemHandler(IAction terminateAction) { >+ super(); >+ this.action = terminateAction; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOptionHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOptionHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOptionHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshOptionHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class RefreshOptionHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public RefreshOptionHandler(IAction pauseAction) { >+ super(); >+ this.action = pauseAction; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+ >+public class ResumeControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public ResumeControlItemHandler(IAction resumeAction) { >+ super(); >+ this.action = resumeAction; >+ >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItem.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItem.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/ResumeControlItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentControlProvider.AgentControlItem; >+ >+public class ResumeControlItem extends AgentControlItem { >+ >+ private static String START_MONITORING = "org.eclipse.tptp.trace.ui.provisional.control.provider.ResumeControlItem"; >+ private IAgentStateModifier _agentStateModifier; >+ >+ public ResumeControlItem(IAgentStateModifier agentStateModifier) >+ { >+ super(agentStateModifier, START_MONITORING, CommonUITraceConstants.PROFILE_MONITOR_GROUP, ControlMessages.CONTROL_ITEM_RESUME, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_RESUME)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_RESUME)); >+ _agentStateModifier = agentStateModifier; >+ } >+ >+ public void run() >+ { >+ IAgentStateModifier agentStateModifier = _agentStateModifier; >+ >+ try >+ { >+ /* Resume the agent */ >+ if(isEnabled()) >+ agentStateModifier.startMonitoring(); >+ } catch (CoreException e) >+ { >+ /* Display status */ >+ LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >+ } >+ } >+ >+ public boolean isEnabled() >+ { >+ return _agentStateModifier.canResume(); >+ } >+ >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshView.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshView.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshView.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/RefreshView.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,41 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import java.util.Iterator; >+ >+import org.eclipse.hyades.trace.ui.ProfileEvent; >+import org.eclipse.hyades.trace.ui.UIPlugin; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+ >+public class RefreshView extends ControlItem { >+ >+ private static final String REFRESH_ITEM = "org.eclipse.tptp.trace.ui.provisional.control.provider.RefreshView"; >+ >+ public RefreshView() >+ { >+ super (REFRESH_ITEM, CommonUITraceConstants.PROFILE_REFRESH_GROUP, ControlMessages.CONTROL_ITEM_REFRESH_VIEWS, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_REFRESH_VIEWS)); >+ } >+ >+ public void run() >+ { >+ if (input == null) >+ return; >+ >+ for (Iterator sources = input.iterator(); sources.hasNext();) >+ { >+ ProfileEvent event = UIPlugin.getDefault().getRefreshViewEvent(sources.next()); >+ UIPlugin.getDefault().notifyProfileEventListener(event); >+ } >+ } >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItem.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItem.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItem.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/DetachControlItem.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; >+import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; >+import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentControlProvider.AgentControlItem; >+ >+public class DetachControlItem extends AgentControlItem { >+ >+ public static final String DETACH_ITEM = "org.eclipse.tptp.trace.ui.provisional.control.provider.DetachControlItem"; >+ private IAgentStateModifier _agentStateModifier; >+ >+ public DetachControlItem(IAgentStateModifier agentStateModifier) >+ { >+ super(agentStateModifier, DETACH_ITEM, CommonUITraceConstants.PROFILE_ATTACH_GROUP, ControlMessages.CONTROL_ITEM_DETACH, TraceUIImages.INSTANCE.getImageDescriptor("c", TraceUIImages.IMG_DETACH_AGENT)); >+ setDisabledImageDescriptor(TraceUIImages.INSTANCE.getImageDescriptor("d", TraceUIImages.IMG_DETACH_AGENT)); >+ _agentStateModifier = agentStateModifier; >+ } >+ >+ public void run() >+ { >+ IAgentStateModifier agentStateModifier = _agentStateModifier; >+ >+ try >+ { >+ /* detach the agent */ >+ if (isEnabled()) >+ agentStateModifier.detach(); >+ } catch (CoreException e) >+ { >+ /* Display status */ >+ LauncherUtility.openMessageWithDetail(e.getStatus().getSeverity(), "", e.getMessage(), e); >+ } >+ } >+ >+ public boolean isEnabled() >+ { >+ return _agentStateModifier.canDetach(); >+ } >+ >+ >+} >Index: src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItemHandler.java >=================================================================== >RCS file: src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItemHandler.java >diff -N src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItemHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/tptp/trace/ui/provisional/control/provider/PauseControlItemHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,43 @@ >+/********************************************************************** >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.tptp.trace.ui.provisional.control.provider; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.swt.widgets.Event; >+ >+ >+public class PauseControlItemHandler extends AbstractHandler { >+ >+ private IAction action; >+ >+ public PauseControlItemHandler(IAction refreshOptions) { >+ super(); >+ this.action = refreshOptions; >+ } >+ >+ public Object execute(ExecutionEvent arg0) throws ExecutionException { >+ if ((action.getStyle() == IAction.AS_CHECK_BOX) >+ || (action.getStyle() == IAction.AS_RADIO_BUTTON)) { >+ action.setChecked(!action.isChecked()); >+ } >+ try { >+ action.runWithEvent(new Event()); >+ } catch (Exception e) { >+ throw new ExecutionException("", e); //$NON-NLS-1$ >+ } >+ >+ return null; >+ } >+} >#P org.eclipse.tptp.platform.jvmti.client >Index: src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.jvmti.client/src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentControlProvider.java,v >retrieving revision 1.9 >diff -u -r1.9 TIAgentControlProvider.java >--- src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentControlProvider.java 22 Aug 2007 04:40:19 -0000 1.9 >+++ src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentControlProvider.java 28 Mar 2008 16:23:17 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2007 IBM Corporation, Intel Corporation. >+ * Copyright (c) 2007 2008 IBM Corporation, Intel Corporation. > * 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 >@@ -12,6 +12,7 @@ > > import java.util.Iterator; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; >@@ -21,31 +22,27 @@ > import org.eclipse.hyades.models.hierarchy.TRCAgentProxy; > import org.eclipse.hyades.models.hierarchy.TRCNode; > import org.eclipse.hyades.trace.ui.ProfileEvent; >-import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.osgi.util.NLS; >-import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; > import org.eclipse.tptp.platform.execution.client.agent.ICollector; > import org.eclipse.tptp.platform.execution.client.core.IAgentController; > import org.eclipse.tptp.platform.execution.exceptions.InactiveAgentException; > import org.eclipse.tptp.platform.jvmti.client.internal.TIMessages; > import org.eclipse.tptp.platform.jvmti.client.internal.TIPlugin; > import org.eclipse.tptp.platform.jvmti.client.internal.TIUtility; >-import org.eclipse.tptp.platform.jvmti.client.internal.actions.RunGCActionDelegate; > import org.eclipse.tptp.platform.jvmti.client.internal.controlproviders.TIProcessControlProvider.TIProcessStateModifier; > import org.eclipse.tptp.platform.jvmti.client.internal.launcher.TIDelegateHelper; > import org.eclipse.tptp.platform.jvmti.client.internal.launcher.util.AgentControllerDelegate; >-import org.eclipse.tptp.trace.ui.internal.control.provider.application.ControlMessages; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItem; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItemHandler; > import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherMessages; > import org.eclipse.tptp.trace.ui.internal.launcher.core.LauncherUtility; > import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentControlProvider; >-import org.eclipse.tptp.trace.ui.provisional.control.provider.ControlItem; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IAgentStateModifier; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IControlItem; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IProcessStateModifier; > >- > /** > * This is the TI agent control provider. Its purpose is to modify the states that the TI agent > * can be in (e.g. Pause/Resume/Detach/Attach). >@@ -54,12 +51,9 @@ > */ > public class TIAgentControlProvider extends AbstractAgentControlProvider > { >- >- /** The id of the contributed items */ >- private static final String RUNGC_ITEM = "org.eclipse.tptp.trace.jvmti.client.internal.popupMenu.RunGCAction"; >- > /** The runGC item */ >- private IControlItem runGCControlItem; >+ protected static IControlItem runGCControlItem; >+ private IHandler handler; > > > protected void initializeControlItems() { >@@ -79,46 +73,11 @@ > if (runGCControlItem != null) > return runGCControlItem; > >- runGCControlItem = new RunGCControlItem(); >+ runGCControlItem = new GCControlItem(); >+ handler = TIAgentToolbarControlProvider.garbageCollectionControlItem.getHandler(); >+ runGCControlItem.setHandler(handler); > return runGCControlItem; > } >- >- static class RunGCControlItem extends ControlItem { >- >- private RunGCActionDelegate gcAction; >- >- public RunGCControlItem() { >- super(RUNGC_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, >- ControlMessages.CONTROL_ITEM_GC_ACTION, >- TraceUIImages.INSTANCE.getImageDescriptor("c", >- TraceUIImages.IMG_GC)); >- setDisabledImageDescriptor(TraceUIImages.INSTANCE >- .getImageDescriptor("d", TraceUIImages.IMG_GC)); >- gcAction = new RunGCActionDelegate(); >- } >- >- public void run() { >- try { >- for (Iterator agents = input.iterator(); agents.hasNext();) >- gcAction.doAction(agents.next()); >- >- } catch (Exception e) { >- LauncherUtility.openMessageWithDetail(IStatus.ERROR, "", e >- .getMessage(), e); >- } >- } >- >- public boolean isEnabled() { >- if (input == null || input.size() == 0) >- return false; >- >- boolean isEnable = true; >- for (Iterator agents = input.iterator(); isEnable >- && agents.hasNext();) >- isEnable = isEnable && gcAction.isEnabledFor(agents.next()); >- return isEnable; >- } >- } > > public IAgentStateModifier getAgentStateModifier() > { >Index: src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentToolbarControlProvider.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.jvmti.client/src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentToolbarControlProvider.java,v >retrieving revision 1.3 >diff -u -r1.3 TIAgentToolbarControlProvider.java >--- src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentToolbarControlProvider.java 23 Mar 2007 12:49:22 -0000 1.3 >+++ src/org/eclipse/tptp/platform/jvmti/client/internal/controlproviders/TIAgentToolbarControlProvider.java 28 Mar 2008 16:23:17 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006,2007 IBM Corporation, Intel Corporation. >+ * Copyright (c) 2006, 2008 IBM Corporation, Intel Corporation. > * 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 >@@ -10,11 +10,13 @@ > **********************************************************************/ > package org.eclipse.tptp.platform.jvmti.client.internal.controlproviders; > >+import org.eclipse.core.commands.IHandler; > import org.eclipse.hyades.trace.ui.internal.core.TraceUIImages; > import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants; > import org.eclipse.tptp.platform.jvmti.client.internal.controlproviders.TIAgentControlProvider.TIAgentStateModifier; >-import org.eclipse.tptp.platform.jvmti.client.internal.controlproviders.TIAgentControlProvider.RunGCControlItem; > import org.eclipse.tptp.platform.jvmti.client.internal.controlproviders.TIProcessControlProvider.TIProcessStateModifier; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItem; >+import org.eclipse.tptp.trace.ui.internal.control.provider.application.GCControlItemHandler; > import org.eclipse.tptp.trace.ui.provisional.control.provider.AbstractAgentToolbarProvider; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IAgentStateModifier; > import org.eclipse.tptp.trace.ui.provisional.control.provider.IControlItem; >@@ -30,8 +32,9 @@ > { > public static final String GC_TOOLBAR_ITEM = "org.eclipse.tptp.trace.jvmti.client.internal.monitorsview.toolbar.runGC"; > >- private IControlItem garbageCollectionControlItem; >+ protected static IControlItem garbageCollectionControlItem; > >+ private IHandler handler; > > public IProcessStateModifier getProcessStateModifier() > { >@@ -52,10 +55,12 @@ > if (garbageCollectionControlItem != null) > return garbageCollectionControlItem; > >- garbageCollectionControlItem = makeToolbarReady(new RunGCControlItem(), >+ garbageCollectionControlItem = makeToolbarReady(new GCControlItem(), > GC_TOOLBAR_ITEM, CommonUITraceConstants.PROFILE_GC_GROUP, > TraceUIImages.INSTANCE.getImageDescriptor("d", > TraceUIImages.IMG_GC)); >+ handler = new GCControlItemHandler(garbageCollectionControlItem); >+ garbageCollectionControlItem.setHandler(handler); > return garbageCollectionControlItem; > } > }
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 Raw
Actions:
View
Attachments on
bug 140650
:
93626
|
93897
|
93999
|
94264
|
95401