1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

new mi ui plugin

This commit is contained in:
David Inglis 2002-08-28 19:09:25 +00:00
parent 40af4ef33b
commit c8f9368b0b
8 changed files with 269 additions and 0 deletions

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/"/>
<classpathentry kind="src" path="/org.eclipse.core.resources"/>
<classpathentry kind="src" path="/org.eclipse.ui"/>
<classpathentry kind="src" path="/org.eclipse.cdt.debug.mi.core"/>
<classpathentry kind="src" path="/org.eclipse.cdt.debug.ui"/>
<classpathentry kind="src" path="/org.eclipse.cdt.debug.core"/>
<classpathentry kind="src" path="/org.eclipse.cdt.launch"/>
<classpathentry kind="src" path="/org.eclipse.cdt.ui"/>
<classpathentry kind="src" path="/org.eclipse.debug.core"/>
<classpathentry kind="src" path="/org.eclipse.debug.ui"/>
<classpathentry kind="src" path="/org.eclipse.core.runtime"/>
<classpathentry kind="src" path="/org.eclipse.core.boot"/>
<classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1 @@
bin

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.debug.mi.ui</name>
<comment></comment>
<projects>
<project>org.eclipse.cdt.debug.core</project>
<project>org.eclipse.cdt.debug.mi.core</project>
<project>org.eclipse.cdt.debug.ui</project>
<project>org.eclipse.cdt.launch</project>
<project>org.eclipse.cdt.ui</project>
<project>org.eclipse.core.boot</project>
<project>org.eclipse.core.resources</project>
<project>org.eclipse.core.runtime</project>
<project>org.eclipse.debug.core</project>
<project>org.eclipse.debug.ui</project>
<project>org.eclipse.ui</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1 @@
source.miui.jar = src/

View file

@ -0,0 +1,2 @@
pluginName=GDB/MI CDI Debugger UI
providerName=Eclipse.org

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin
id="org.eclipse.cdt.debug.mi.ui"
name="%pluginName"
version="1.0.0"
provider-name="%providerName"
class="org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin">
<runtime>
<library name="miui.jar">
<export name="*"/>
</library>
</runtime>
<requires>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.cdt.debug.mi.core"/>
<import plugin="org.eclipse.cdt.debug.ui"/>
<import plugin="org.eclipse.cdt.debug.core"/>
<import plugin="org.eclipse.cdt.launch"/>
<import plugin="org.eclipse.cdt.ui"/>
<import plugin="org.eclipse.debug.core"/>
<import plugin="org.eclipse.debug.ui"/>
</requires>
<extension
point="org.eclipse.cdt.debug.ui.CDebuggerPage">
<debugPage
class="org.eclipse.cdt.debug.mi.internal.ui.CDebuggerPage"
id="org.eclipse.cdt.debug.mi.CDebuggerPage"
debuggerID="org.eclipse.cdt.debug.mi.core.CDebugger">
</debugPage>
</extension>
</plugin>

View file

@ -0,0 +1,110 @@
/*
* (c) Copyright QNX Software System Ltd. 2002.
* All Rights Reserved.
*/
package org.eclipse.cdt.debug.mi.internal.ui;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.launch.ICDTLaunchConfigurationConstants;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class CDebuggerPage extends AbstractLaunchConfigurationTab {
protected Text fDebuggerCommandText;
protected static final Map EMPTY_MAP = new HashMap(1);
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
comp.setLayoutData(gd);
createVerticalSpacer(comp, 2);
Label debugCommandLabel= new Label(comp, SWT.NONE);
debugCommandLabel.setText("Debugger executable:");
fDebuggerCommandText= new Text(comp, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
fDebuggerCommandText.setLayoutData(gd);
fDebuggerCommandText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog();
}
});
fDebuggerCommandText.setText(getCommand());
setControl(comp);
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
Map attributeMap = new HashMap(1);
// attributeMap.put(ATTR_DEBUGGER_COMMAND, getCommand());
configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, attributeMap);
}
private String getCommand() {
return "gdb";
}
/**
* @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
*/
public boolean isValid(ILaunchConfiguration launchConfig) {
boolean valid= fDebuggerCommandText.getText().length() != 0;
if (valid) {
setErrorMessage(null);
setMessage(null);
} else {
setErrorMessage("Debugger executable must be specified");
setMessage(null);
}
return valid;
}
public void initializeFrom(ILaunchConfiguration configuration) {
String debuggerCommand= null;
try {
Map attributeMap = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, EMPTY_MAP);
if (attributeMap != null) {
// debuggerCommand = (String) attributeMap.get(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND);
if (debuggerCommand == null) {
debuggerCommand = getCommand();
}
}
} catch(CoreException ce) {
// JDIDebugUIPlugin.log(ce);
}
fDebuggerCommandText.setText(debuggerCommand);
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String debuggerCommand = fDebuggerCommandText.getText();
Map attributeMap = new HashMap(1);
// attributeMap.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAPVA_COMMAND, debuggerCommand);
configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, attributeMap);
}
public String getName() {
return "GDB/MI Debugger Options";
}
}

View file

@ -0,0 +1,63 @@
package org.eclipse.cdt.debug.mi.internal.ui;
import org.eclipse.ui.plugin.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.resources.*;
import java.util.*;
/**
* The main plugin class to be used in the desktop.
*/
public class MIUIPlugin extends AbstractUIPlugin {
//The shared instance.
private static MIUIPlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
/**
* The constructor.
*/
public MIUIPlugin(IPluginDescriptor descriptor) {
super(descriptor);
plugin = this;
try {
resourceBundle= ResourceBundle.getBundle("org.eclipse.cdt.debug.mi.ui.UiPluginResources");
} catch (MissingResourceException x) {
resourceBundle = null;
}
}
/**
* Returns the shared instance.
*/
public static MIUIPlugin getDefault() {
return plugin;
}
/**
* Returns the workspace instance.
*/
public static IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String getResourceString(String key) {
ResourceBundle bundle= MIUIPlugin.getDefault().getResourceBundle();
try {
return bundle.getString(key);
} catch (MissingResourceException e) {
return key;
}
}
/**
* Returns the plugin's resource bundle,
*/
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
}