Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Rohrbach2008-05-07 13:25:48 +0000
committerRandy Rohrbach2008-05-07 13:25:48 +0000
commitae03beb86a8223c7b6131b1741e05d0b50cbd7dd (patch)
tree70cd90ed296f2557933ae822bc3462ced9c61d82 /plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel
parent3d4405ffaf8eadbe32e8ca4d8a2003552e6232a6 (diff)
downloadorg.eclipse.cdt-ae03beb86a8223c7b6131b1741e05d0b50cbd7dd.tar.gz
org.eclipse.cdt-ae03beb86a8223c7b6131b1741e05d0b50cbd7dd.tar.xz
org.eclipse.cdt-ae03beb86a8223c7b6131b1741e05d0b50cbd7dd.zip
Bugzilla 215063
Also performed some minor cleanup of warnings. ( no API changes ). Randy
Diffstat (limited to 'plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel')
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMProvider.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModuleDetailPane.java (renamed from plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModuleDetailPane.java)110
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java (renamed from plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModuleDetailPaneFactory.java)2
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java172
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.java37
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.properties25
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/AbstractSetFormatStyle.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatBinary.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatDecimal.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatHex.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatNatural.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatOctal.java1
-rw-r--r--plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java2
15 files changed, 276 insertions, 81 deletions
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java
index 3071973199e..9602ba9a2e4 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Ericsson AB - Modules view for DSF implementation
*******************************************************************************/
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules;
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMProvider.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMProvider.java
index 30ec06400ea..f16e51f87e7 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMProvider.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMProvider.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * Ericsson AB - Modules view for DSF implementation
*******************************************************************************/
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules;
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModuleDetailPane.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModuleDetailPane.java
index da36a7a58f9..2e62da1f0b2 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModuleDetailPane.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModuleDetailPane.java
@@ -11,12 +11,11 @@
* Wind River Systems - adopted to use with Modules view
* Ericsson AB - Modules view for DSF implementation
*******************************************************************************/
-package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules;
+package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.detail;
import java.util.concurrent.ExecutionException;
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModulesMessages;
import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -29,20 +28,15 @@ import org.eclipse.dd.dsf.concurrent.Query;
import org.eclipse.dd.dsf.datamodel.DMContexts;
import org.eclipse.dd.dsf.datamodel.IDMContext;
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
-import org.eclipse.dd.dsf.debug.internal.ui.viewmodel.numberformat.detail.TextViewerAction;
+import org.eclipse.dd.dsf.debug.internal.ui.viewmodel.detailsupport.MessagesForDetailPane;
+import org.eclipse.dd.dsf.debug.internal.ui.viewmodel.detailsupport.TextViewerAction;
import org.eclipse.dd.dsf.debug.service.IModules;
import org.eclipse.dd.dsf.debug.service.IModules.IModuleDMContext;
import org.eclipse.dd.dsf.debug.service.IModules.IModuleDMData;
+import org.eclipse.dd.dsf.debug.ui.IDsfDebugUIConstants;
import org.eclipse.dd.dsf.service.DsfServicesTracker;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.IDMVMContext;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.variables.details.AbstractDetailPane;
-import org.eclipse.debug.internal.ui.views.variables.details.DetailMessages;
import org.eclipse.debug.ui.IDebugView;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -78,7 +72,7 @@ import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
/**
*
*/
-public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable, IPropertyChangeListener {
+public class ModuleDetailPane extends ModulesAbstractDetailPane implements IAdaptable, IPropertyChangeListener {
/**
* These are the IDs for the actions in the context menu
@@ -106,7 +100,7 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
if (isInView()){
createViewSpecificComponents();
createActions();
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
+ DsfDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
JFaceResources.getFontRegistry().addListener(this);
}
return fSourceViewer.getControl();
@@ -128,11 +122,6 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
return;
}
- Object firstElement = selection.getFirstElement();
- if (firstElement != null && firstElement instanceof IDebugElement) {
- String modelID = ((IDebugElement)firstElement).getModelIdentifier();
- }
-
synchronized (this) {
if (fDetailJob != null) {
fDetailJob.cancel();
@@ -150,17 +139,18 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
if (fDetailJob != null) {
fDetailJob.cancel();
}
- fDetailDocument.set("");
+ fDetailDocument.set(""); //$NON-NLS-1$
fSourceViewer.setEditable(false);
}
+ @Override
public void dispose() {
super.dispose();
if (fDetailJob != null) fDetailJob.cancel();
if (fSourceViewer != null && fSourceViewer.getControl() != null) fSourceViewer.getControl().dispose();
if (isInView()){
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
+ DsfDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
JFaceResources.getFontRegistry().removeListener(this);
}
@@ -182,6 +172,8 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
}
return false;
}
+
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if (ITextViewer.class.equals(adapter)) {
return fSourceViewer;
@@ -191,8 +183,8 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
public void propertyChange(PropertyChangeEvent event) {
String propertyName= event.getProperty();
- if (propertyName.equals(IInternalDebugUIConstants.DETAIL_PANE_FONT)) {
- fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(IInternalDebugUIConstants.DETAIL_PANE_FONT));
+ if (propertyName.equals(IDsfDebugUIConstants.DETAIL_PANE_FONT)) {
+ fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(IDsfDebugUIConstants.DETAIL_PANE_FONT));
}
}
@@ -207,10 +199,10 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
// Create & configure a SourceViewer
fSourceViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL);
fSourceViewer.setDocument(getDetailDocument());
- fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(IInternalDebugUIConstants.DETAIL_PANE_FONT));
- fSourceViewer.getTextWidget().setWordWrap(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP));
+ fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(IDsfDebugUIConstants.DETAIL_PANE_FONT));
+ fSourceViewer.getTextWidget().setWordWrap(DsfDebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDsfDebugUIConstants.PREF_DETAIL_PANE_WORD_WRAP));
fSourceViewer.setEditable(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fSourceViewer.getTextWidget(), IDebugHelpContextIds.DETAIL_PANE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fSourceViewer.getTextWidget(), IDsfDebugUIConstants.DETAIL_PANE);
Control control = fSourceViewer.getControl();
GridData gd = new GridData(GridData.FILL_BOTH);
control.setLayoutData(gd);
@@ -254,7 +246,8 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
// Add a focus listener to update actions when details area gains focus
fSourceViewer.getControl().addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
+ @Override
+ public void focusGained(FocusEvent e) {
getViewSite().setSelectionProvider(fSourceViewer.getSelectionProvider());
@@ -264,7 +257,8 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
getViewSite().getActionBars().updateActionBars();
}
- public void focusLost(FocusEvent e) {
+ @Override
+ public void focusLost(FocusEvent e) {
getViewSite().setSelectionProvider(null);
@@ -320,15 +314,15 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
*/
private void createActions() {
TextViewerAction textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.SELECT_ALL);
- textAction.configureAction(DetailMessages.DefaultDetailPane_Select__All_5, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ textAction.configureAction(MessagesForDetailPane.DetailPane_Select_All, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
textAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.SELECT_ALL);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_SELECT_ALL_ACTION);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDsfDebugUIConstants.DETAIL_PANE_SELECT_ALL_ACTION);
setAction(DETAIL_SELECT_ALL_ACTION, textAction);
textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.COPY);
- textAction.configureAction(DetailMessages.DefaultDetailPane__Copy_8, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ textAction.configureAction(MessagesForDetailPane.DetailPane_Copy, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
textAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.COPY);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_COPY_ACTION);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDsfDebugUIConstants.DETAIL_PANE_COPY_ACTION);
setAction(DETAIL_COPY_ACTION, textAction);
setSelectionDependantAction(DETAIL_COPY_ACTION);
@@ -361,33 +355,6 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
/*
* Make sure this is an element we want to deal with.
*/
-// if ( fElement instanceof DMVMContext) {
-// IModules service = null;
-// IModuleDMContext dmc = null ;
-//
-// IModuleDMContext modDmc = DMContexts.getAncestorOfType(((DMVMContext) fElement).getDMC(), IModuleDMContext.class);
-// DsfServicesTracker tracker = new DsfServicesTracker(DsfDebugUIPlugin.getBundleContext(), ((DMVMContext) fElement).getDMC().getSessionId());
-//
-// if ( modDmc != null ) {
-// dmc = modDmc ;
-// service = tracker.getService(IModules.class);
-// }
-//
-// /*
-// * If the desired Data Model Context is null then we are not going to
-// * process this data.
-// */
-// if ( dmc == null ) return Status.OK_STATUS;
-//
-// final DataRequestMonitor<IModuleDMData> modData =
-// new DataRequestMonitor<IModuleDMData>(service.getSession().getExecutor(), null) {
-// @Override
-// protected void handleSuccess() {
-// detailComputed(getModuleDetail(getData()));
-// }
-// };
-// service.getModuleData(modDmc, modData);
-// }
IModuleDMContext dmc = null;
if (fElement instanceof IDMVMContext) {
IDMContext vmcdmc = ((IDMVMContext)fElement).getDMContext();
@@ -400,7 +367,7 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
/*
* Create the query to write the value to the service. Note: no need to
- * guard agains RejectedExecutionException, because
+ * guard against RejectedExecutionException, because
* DsfSession.getSession() above would only return an active session.
*/
GetModuleDetailsQuery query = new GetModuleDetailsQuery(dmc);
@@ -456,40 +423,39 @@ public class ModuleDetailPane extends AbstractDetailPane implements IAdaptable,
String type = null;
// switch( module.getType() ) {
// case ICModule.EXECUTABLE:
-// type = ModulesMessages.getString( "ModulesView.1" ); //$NON-NLS-1$
+// type = ModulesMessages.getString( "ModulesView.Executable" ); //$NON-NLS-1$
// break;
// case ICModule.SHARED_LIBRARY:
-// type = ModulesMessages.getString( "ModulesView.2" ); //$NON-NLS-1$
+// type = ModulesMessages.getString( "ModulesView.SharedLibrary" ); //$NON-NLS-1$
// break;
// }
- type = ModulesMessages.getString( "ModulesView.2" ); //$NON-NLS-1$
+ type = ModulesMessages.getString( "ModulesView.SharedLibrary" ); //$NON-NLS-1$
if ( type != null ) {
- sb.append( ModulesMessages.getString( "ModulesView.3" ) ); //$NON-NLS-1$
+ sb.append( ModulesMessages.getString( "ModulesView.Type" ) ); //$NON-NLS-1$
sb.append( type );
sb.append( '\n' );
}
// Symbols flag
- sb.append( ModulesMessages.getString( "ModulesView.4" ) ); //$NON-NLS-1$
- sb.append( ( module.isSymbolsLoaded()) ? ModulesMessages.getString( "ModulesView.5" ) : ModulesMessages.getString( "ModulesView.6" ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ sb.append( ModulesMessages.getString( "ModulesView.Symbols" ) ); //$NON-NLS-1$
+ sb.append( ( module.isSymbolsLoaded()) ? ModulesMessages.getString( "ModulesView.Loaded" ) : ModulesMessages.getString( "ModulesView.NotLoaded" ) ); //$NON-NLS-1$ //$NON-NLS-2$
sb.append( '\n' );
// Symbols file
- sb.append( ModulesMessages.getString( "ModulesView.7" ) ); //$NON-NLS-1$
+ sb.append( ModulesMessages.getString( "ModulesView.SymbolsFile" ) ); //$NON-NLS-1$
sb.append( module.getFile());
sb.append( '\n' );
+
// Base address
String baseAddress = module.getBaseAddress();
- sb.append( ModulesMessages.getString( "ModulesView.9" ) ); //$NON-NLS-1$
- sb.append( baseAddress );
-// sb.append( baseAddress.toHexAddressString() );
- sb.append( '\n' );
-// }
-//
+ sb.append( ModulesMessages.getString( "ModulesView.BaseAddress" ) ); //$NON-NLS-1$
+ sb.append( baseAddress );
+ sb.append( '\n' );
+
// Size
long size = module.getSize();
if ( size > 0 ) {
- sb.append( ModulesMessages.getString( "ModulesView.10" ) ); //$NON-NLS-1$
+ sb.append( ModulesMessages.getString( "ModulesView.Size" ) ); //$NON-NLS-1$
sb.append( size );
sb.append( '\n' );
}
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModuleDetailPaneFactory.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java
index 480561c9f6a..fb455bfa4ae 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModuleDetailPaneFactory.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java
@@ -8,7 +8,7 @@
* Contributors:
* Ericsson AB - Modules view for DSF implementation
*******************************************************************************/
-package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules;
+package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.detail;
import java.util.HashSet;
import java.util.Set;
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java
new file mode 100644
index 00000000000..2b7494b6da6
--- /dev/null
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Wind River Systems - adopted to use with Modules view
+ *******************************************************************************/
+package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.detail;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.debug.ui.IDetailPane;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.texteditor.IUpdate;
+
+/**
+ * Abstract class that holds common methods used by implementors of IDetailPane.
+ */
+public abstract class ModulesAbstractDetailPane implements IDetailPane {
+
+ /**
+ * The <code>IWorkbenchPartSite</code> that the details area (and the
+ * variables view) belongs to.
+ */
+ private IWorkbenchPartSite fWorkbenchPartSite;
+
+ /**
+ * Map of actions. Keys are strings, values
+ * are <code>IAction</code>.
+ */
+ private Map<String,IAction> fActionMap = new HashMap<String,IAction>();
+
+ /**
+ * Collection to track actions that should be updated when selection occurs.
+ */
+ private List<String> fSelectionActions = new ArrayList<String>();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite)
+ */
+ public void init(IWorkbenchPartSite workbench) {
+ fWorkbenchPartSite = workbench;
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.IDetailPane#dispose()
+ */
+ public void dispose() {
+ fActionMap.clear();
+ fSelectionActions.clear();
+ }
+
+ /**
+ * Adds an action to the Map storing actions. Removes it if action is null.
+ *
+ * @param actionID The ID of the action, used as the key in the Map
+ * @param action The action associated with the ID
+ */
+ protected void setAction(String actionID, IAction action) {
+ if (action == null) {
+ fActionMap.remove(actionID);
+ } else {
+ fActionMap.put(actionID, action);
+ }
+ }
+
+ /**
+ * Adds the given action to the global action handler for the ViewSite.
+ * A call to <code>updateActionBars()</code> must be called after changes
+ * to propagate changes through the workbench.
+ *
+ * @param actionID The ID of the action
+ * @param action The action to be set globally
+ */
+ protected void setGlobalAction(String actionID, IAction action){
+ getViewSite().getActionBars().setGlobalActionHandler(actionID, action);
+ }
+
+ /**
+ * Adds the given action to the list of actions that will be updated when
+ * <code>updateSelectionDependentActions()</code> is called. If the string
+ * is null it will not be added to the list.
+ *
+ * @param actionID The ID of the action which should be updated
+ */
+ protected void setSelectionDependantAction(String actionID){
+ if (actionID != null) fSelectionActions.add(actionID);
+ }
+
+ /**
+ * Gets the action out of the map, casts it to an <code>IAction</code>
+ *
+ * @param actionID The ID of the action to find
+ * @return The action associated with the ID or null if none is found.
+ */
+ protected IAction getAction(String actionID) {
+ return fActionMap.get(actionID);
+ }
+
+ /**
+ * Calls the update method of the action with the given action ID.
+ * The action must exist in the action map and must be an instance of
+ * </code>IUpdate</code>
+ *
+ * @param actionId The ID of the action to update
+ */
+ protected void updateAction(String actionId) {
+ IAction action= getAction(actionId);
+ if (action instanceof IUpdate) {
+ ((IUpdate) action).update();
+ }
+ }
+
+ /**
+ * Iterates through the list of selection dependent actions and
+ * updates them. Use <code>setSelectionDependentAction(String actionID)</code>
+ * to add an action to the list. The action must have been added to the known
+ * actions map by calling <code>setAction(String actionID, IAction action)</code>
+ * before it can be updated by this method.
+ */
+ protected void updateSelectionDependentActions() {
+ Iterator<String> iterator= fSelectionActions.iterator();
+ while (iterator.hasNext()) {
+ updateAction(iterator.next());
+ }
+ }
+
+ /**
+ * Gets the view site for this view. May be null if this detail pane
+ * is not part of a view.
+ *
+ * @return The site for this view or <code>null</code>
+ */
+ protected IViewSite getViewSite(){
+ if (fWorkbenchPartSite == null){
+ return null;
+ } else {
+ return (IViewSite) fWorkbenchPartSite.getPart().getSite();
+ }
+ }
+
+ /**
+ * Gets the workbench part site for this view. May be null if this detail pane
+ * is not part of a view.
+ *
+ * @return The workbench part site or <code>null</code>
+ */
+ protected IWorkbenchPartSite getWorkbenchPartSite() {
+ return fWorkbenchPartSite;
+ }
+
+ /**
+ * Returns whether this detail pane is being displayed in a view with a workbench part site.
+ *
+ * @return whether this detail pane is being displayed in a view with a workbench part site.
+ */
+ protected boolean isInView(){
+ return fWorkbenchPartSite != null;
+ }
+
+}
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.java
new file mode 100644
index 00000000000..577379877ef
--- /dev/null
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 QNX Software Systems 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:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems, Inc. - extended implementation
+ *******************************************************************************/
+package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.detail;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * Comment for .
+ */
+public class ModulesMessages {
+
+ private static final String BUNDLE_NAME = "org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.detail.ModulesMessages";//$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
+
+ private ModulesMessages() {
+ }
+
+ public static String getString( String key ) {
+ try {
+ return RESOURCE_BUNDLE.getString( key );
+ }
+ catch( MissingResourceException e ) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.properties b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.properties
new file mode 100644
index 00000000000..09881cbfcd6
--- /dev/null
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/detail/ModulesMessages.properties
@@ -0,0 +1,25 @@
+###############################################################################
+# Copyright (c) 2005 QNX Software Systems 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:
+# QNX Software Systems - initial API and implementation
+# Wind River Systems - adapted to work with platform Modules view (bug 210558)
+###############################################################################
+ModulesView.Executable=executable
+ModulesView.SharedLibrary=shared library
+ModulesView.Type=Type:
+ModulesView.Symbols=Symbols:
+ModulesView.Loaded=loaded
+ModulesView.NotLoaded=not loaded
+ModulesView.SymbolsFile=Symbols file:
+ModulesView.CPU=CPU:
+ModulesView.BaseAddress=Base address:
+ModulesView.Size=Size:
+ModulesView.SymbolsLoaded=\ (symbols loaded)
+ModulesView.SymbolsNotLoaded=(symbols not loaded)
+ModulesView.SelectAll=Select &All
+ModulesView.Copy=&Copy
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/AbstractSetFormatStyle.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/AbstractSetFormatStyle.java
index a804c176099..324d5c730e1 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/AbstractSetFormatStyle.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/AbstractSetFormatStyle.java
@@ -98,7 +98,6 @@ public class AbstractSetFormatStyle implements IViewActionDelegate, IDebugContex
* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- @SuppressWarnings("restriction")
public void run(IAction action) {
/*
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java
index 5cddbb80660..bb512c6d6f4 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java
@@ -29,7 +29,6 @@ public class FormattedValuePreferenceStore implements IFormattedValuePreferenceS
return fgSingletonReference;
}
- @SuppressWarnings("restriction")
public String getCurrentNumericFormat( IPresentationContext context ) {
Object prop = context.getProperty( IDebugVMConstants.CURRENT_FORMAT_STORAGE );
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatBinary.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatBinary.java
index 5e5c2e31c80..713e5c60be0 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatBinary.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatBinary.java
@@ -13,7 +13,6 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle;
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
-@SuppressWarnings("restriction")
public class SetDefaultFormatBinary extends AbstractSetFormatStyle {
@Override
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatDecimal.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatDecimal.java
index a7b7bba785b..2e0c5e89b05 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatDecimal.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatDecimal.java
@@ -13,7 +13,6 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle;
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
-@SuppressWarnings("restriction")
public class SetDefaultFormatDecimal extends AbstractSetFormatStyle {
@Override
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatHex.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatHex.java
index 919b7938e89..0451678c3eb 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatHex.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatHex.java
@@ -13,7 +13,6 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle;
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
-@SuppressWarnings("restriction")
public class SetDefaultFormatHex extends AbstractSetFormatStyle {
@Override
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatNatural.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatNatural.java
index a03f03793e3..8f1e87b6d87 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatNatural.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatNatural.java
@@ -13,7 +13,6 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle;
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
-@SuppressWarnings("restriction")
public class SetDefaultFormatNatural extends AbstractSetFormatStyle {
@Override
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatOctal.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatOctal.java
index cf257035286..8ab1a56fa59 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatOctal.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatOctal.java
@@ -13,7 +13,6 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle;
import org.eclipse.dd.dsf.debug.service.IFormattedValues;
-@SuppressWarnings("restriction")
public class SetDefaultFormatOctal extends AbstractSetFormatStyle {
@Override
diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java
index 9002546ff66..9e5edc2bcf8 100644
--- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java
+++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java
@@ -29,7 +29,7 @@ public class BreakpointHitUpdatePolicy extends ManualUpdatePolicy {
@Override
public String getName() {
- return "Breakpoint Hit";
+ return "Breakpoint Hit"; //$NON-NLS-1$
}
@Override

Back to the top