1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 00:35:49 +02:00

small update to change logging to use the launch plugins plus use its own pixelconverter

This commit is contained in:
David Inglis 2005-06-14 15:55:15 +00:00
parent 4118b748e8
commit ebffc66e0d
4 changed files with 70 additions and 7 deletions

View file

@ -22,7 +22,6 @@ import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration; import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.launch.AbstractCLaunchDelegate; import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
import org.eclipse.cdt.launch.internal.ui.LaunchMessages; import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
@ -103,7 +102,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
} }
} }
} catch (CoreException e) { } catch (CoreException e) {
CDebugUIPlugin.log(e); LaunchUIPlugin.log(e);
} }
// If there are no existing configs associated with the IBinary, create one. // If there are no existing configs associated with the IBinary, create one.
@ -170,7 +169,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID()); wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID());
config = wc.doSave(); config = wc.doSave();
} catch (CoreException ce) { } catch (CoreException ce) {
CDebugUIPlugin.log(ce); LaunchUIPlugin.log(ce);
} }
return config; return config;
} }
@ -191,7 +190,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut {
* Convenience method to get the window that owns this action's Shell. * Convenience method to get the window that owns this action's Shell.
*/ */
protected Shell getShell() { protected Shell getShell() {
return CDebugUIPlugin.getActiveWorkbenchShell(); return LaunchUIPlugin.getActiveWorkbenchShell();
} }
/** /**

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.launch.internal.ui;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.jface.resource.ImageRegistry;
@ -74,7 +73,7 @@ public class LaunchImages {
try { try {
return new URL(fgIconBaseURL, buffer.toString()); return new URL(fgIconBaseURL, buffer.toString());
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
CUIPlugin.getDefault().log(e); LaunchUIPlugin.log(e);
return null; return null;
} }
} }

View file

@ -0,0 +1,65 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.launch.internal.ui;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Control;
public class PixelConverter {
private FontMetrics fFontMetrics;
public PixelConverter( Control control ) {
GC gc = new GC( control );
gc.setFont( control.getFont() );
setFontMetrics( gc.getFontMetrics() );
gc.dispose();
}
/**
* @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
*/
public int convertHeightInCharsToPixels( int chars ) {
return Dialog.convertHeightInCharsToPixels( getFontMetrics(), chars );
}
/**
* @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int)
*/
public int convertHorizontalDLUsToPixels( int dlus ) {
return Dialog.convertHorizontalDLUsToPixels( getFontMetrics(), dlus );
}
/**
* @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int)
*/
public int convertVerticalDLUsToPixels( int dlus ) {
return Dialog.convertVerticalDLUsToPixels( getFontMetrics(), dlus );
}
/**
* @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
*/
public int convertWidthInCharsToPixels( int chars ) {
return Dialog.convertWidthInCharsToPixels( getFontMetrics(), chars );
}
private FontMetrics getFontMetrics() {
return this.fFontMetrics;
}
private void setFontMetrics( FontMetrics fontMetrics ) {
this.fFontMetrics = fontMetrics;
}
}

View file

@ -26,10 +26,10 @@ import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConfiguration; import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.internal.ui.PixelConverter;
import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab; import org.eclipse.cdt.launch.internal.ui.AbstractCDebuggerTab;
import org.eclipse.cdt.launch.internal.ui.LaunchMessages; import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin; import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.cdt.launch.internal.ui.PixelConverter;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;