mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 16:05:25 +02:00
Performed some cleanup to get rid of unneeded warnings.
No functional change to the code. There is no specific bugzilla entry for this. Randy
This commit is contained in:
parent
86041e3f39
commit
d3a1c826ed
9 changed files with 54 additions and 31 deletions
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.debug.ui.memory.search;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.internal.ui.DebugUIPlugin;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
public class MemorySearchPlugin extends AbstractUIPlugin
|
||||
|
|
|
@ -25,9 +25,9 @@ public class MemorySearchResult implements ISearchResult
|
|||
private ISearchQuery fQuery;
|
||||
private String fLabel;
|
||||
|
||||
private Vector listeners = new Vector();
|
||||
private Vector<ISearchResultListener> listeners = new Vector<ISearchResultListener>();
|
||||
|
||||
private Vector fMatches = new Vector();
|
||||
private Vector<MemoryMatch> fMatches = new Vector<MemoryMatch>();
|
||||
|
||||
public MemorySearchResult(ISearchQuery query, String label)
|
||||
{
|
||||
|
@ -69,9 +69,13 @@ public class MemorySearchResult implements ISearchResult
|
|||
|
||||
private void fireChange()
|
||||
{
|
||||
Enumeration en = listeners.elements();
|
||||
while(en.hasMoreElements())
|
||||
((ISearchResultListener) en.nextElement()).searchResultChanged(new SearchResultEvent(this) {} );
|
||||
Enumeration<ISearchResultListener> en = listeners.elements();
|
||||
while(en.hasMoreElements()) {
|
||||
((ISearchResultListener) en.nextElement()).searchResultChanged(new SearchResultEvent(this) {
|
||||
private static final long serialVersionUID = -1435449002760145835L;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public void addListener(ISearchResultListener l) {
|
||||
|
|
|
@ -45,12 +45,10 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.IMemento;
|
||||
import org.eclipse.ui.part.Page;
|
||||
import org.eclipse.ui.part.PageBook;
|
||||
|
||||
public class MemorySearchResultsPage extends Page implements ISearchResultPage, IQueryListener {
|
||||
|
||||
private TreeViewer fTreeViewer;
|
||||
private PageBook fPagebook;
|
||||
private Composite fViewerContainer;
|
||||
private IQueryListener fQueryListener;
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import java.math.BigInteger;
|
|||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.MemoryByte;
|
||||
import org.eclipse.swt.events.PaintEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.debug.ui.memory.traditional;
|
|||
import java.math.BigInteger;
|
||||
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.MemoryByte;
|
||||
|
||||
public interface IViewportCache {
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
|
|||
import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
|
||||
import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressComposite;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
|
@ -501,7 +500,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
Status status = new Status(IStatus.ERROR, fParent.getRenderingId(),
|
||||
DebugException.INTERNAL_ERROR, message, e);
|
||||
|
||||
DebugUIPlugin.getDefault().getLog().log(status);
|
||||
TraditionalRenderingPlugin.getDefault().getLog().log(status);
|
||||
}
|
||||
|
||||
public void handleFontPreferenceChange(Font font)
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
package org.eclipse.cdt.debug.ui.memory.traditional;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigInteger;
|
||||
|
||||
|
@ -149,7 +148,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
});
|
||||
|
||||
|
||||
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(
|
||||
TraditionalRenderingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(
|
||||
new IPropertyChangeListener()
|
||||
{
|
||||
public void propertyChange(PropertyChangeEvent event)
|
||||
|
@ -1219,7 +1218,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
public void update()
|
||||
{
|
||||
// update UI asynchronously
|
||||
Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay();
|
||||
Display display = TraditionalRenderingPlugin.getDefault().getWorkbench().getDisplay();
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
try
|
||||
|
@ -1358,21 +1357,17 @@ class CopyAction extends Action
|
|||
final int radix = fRendering.getRadix();
|
||||
final int bytesPerColumn = fRendering.getBytesPerColumn();
|
||||
final boolean isLittleEndian = fRendering.isTargetLittleEndian();
|
||||
final int bytesPerCharacter = fRendering.getBytesPerCharacter();
|
||||
|
||||
final int addressWidth = fRendering.getAddressString(start)
|
||||
.length();
|
||||
// final int binaryCellWidth = fRendering.getRadixCharacterCount(
|
||||
// radix, bytesPerColumn) + 1;
|
||||
//
|
||||
// final int asciiCellWidth = fRendering.getBytesPerColumn()
|
||||
// / fRendering.getBytesPerCharacter();
|
||||
|
||||
final int binaryCellWidth = fRendering.getRadixCharacterCount(
|
||||
radix, bytesPerColumn) + 1;
|
||||
|
||||
final int asciiCellWidth = fRendering.getBytesPerColumn()
|
||||
/ fRendering.getBytesPerCharacter();
|
||||
|
||||
final int combindCellWidths = (fRendering
|
||||
.getPaneVisible(Rendering.PANE_BINARY) ? binaryCellWidth : 0)
|
||||
+ (fRendering.getPaneVisible(Rendering.PANE_TEXT) ? asciiCellWidth
|
||||
: 0);
|
||||
// final int combindCellWidths = (fRendering
|
||||
// .getPaneVisible(Rendering.PANE_BINARY) ? binaryCellWidth : 0)
|
||||
// + (fRendering.getPaneVisible(Rendering.PANE_TEXT) ? asciiCellWidth
|
||||
// : 0);
|
||||
|
||||
final int columns = fRendering.getColumnCount();
|
||||
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
package org.eclipse.cdt.debug.ui.memory.traditional;
|
||||
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
public class TraditionalRenderingPlugin extends AbstractUIPlugin
|
||||
|
@ -38,4 +42,31 @@ public class TraditionalRenderingPlugin extends AbstractUIPlugin
|
|||
public static String getUniqueIdentifier() {
|
||||
return PLUGIN_ID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the workbench's display.
|
||||
*/
|
||||
public static Display getStandardDisplay() {
|
||||
return PlatformUI.getWorkbench().getDisplay();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently active workbench window shell or <code>null</code>
|
||||
* if none.
|
||||
*
|
||||
* @return the currently active workbench window shell or <code>null</code>
|
||||
*/
|
||||
public static Shell getShell() {
|
||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||
if (window == null) {
|
||||
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
|
||||
if (windows.length > 0) {
|
||||
return windows[0].getShell();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return window.getShell();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
package org.eclipse.cdt.debug.ui.memory.traditional;
|
||||
|
||||
|
||||
import org.eclipse.debug.internal.ui.DebugUIPlugin;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.preference.IPreferenceNode;
|
||||
import org.eclipse.jface.preference.IPreferencePage;
|
||||
|
@ -46,9 +45,9 @@ public class TraditionalRenderingPreferenceAction extends ActionDelegate impleme
|
|||
|
||||
PreferenceManager manager = new PreferenceManager();
|
||||
manager.addToRoot(targetNode);
|
||||
final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager);
|
||||
final PreferenceDialog dialog = new PreferenceDialog(TraditionalRenderingPlugin.getShell(), manager);
|
||||
final boolean [] result = new boolean[] { false };
|
||||
BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
|
||||
BusyIndicator.showWhile(TraditionalRenderingPlugin.getStandardDisplay(), new Runnable() {
|
||||
public void run() {
|
||||
dialog.create();
|
||||
dialog.setMessage(targetNode.getLabelText());
|
||||
|
|
Loading…
Add table
Reference in a new issue