Author: bfitzpat
Date: 2009-12-07 18:16:10 -0500 (Mon, 07 Dec 2009)
New Revision: 19087
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
Log:
OPEN - issue JBIDE-5279: Add "Run As" support for smooks configs
https://jira.jboss.org/jira/browse/JBIDE-5279
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties 2009-12-07 22:25:47
UTC (rev 19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.properties 2009-12-07 23:16:10
UTC (rev 19087)
@@ -94,3 +94,4 @@
_UI_XslEditor_label = Xsl Model Editor
_UI_XslEditorFilenameDefaultBase = My
_UI_XslEditorFilenameExtensions = xsl
+launch.shortcut.text=Smooks Run Configuration
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-12-07 22:25:47 UTC (rev
19086)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-12-07 23:16:10 UTC (rev
19087)
@@ -217,5 +217,29 @@
id="org.jboss.tools.smooks.ui.launchConfigurationTabGroup.smooksLauncher">
</launchConfigurationTabGroup>
</extension>
+ <extension
+ point="org.eclipse.debug.ui.launchShortcuts">
+ <shortcut
+ class="org.jboss.tools.smooks.launch.SmooksLaunchShortcut"
+ icon="icons/smooks-sm.gif"
+ id="org.jboss.tools.smooks.ui.launch.shortcut"
+ label="%launch.shortcut.text"
+ modes="run">
+ <configurationType
+ id="org.jboss.tools.smooks.ui.smooksLauncher">
+ </configurationType>
+ <contextualLaunch>
+ <enablement>
+ <with variable="selection">
+ <count value="1"/>
+ <iterate>
+ <test property="org.eclipse.debug.ui.matchesPattern"
value="*.xml"/>
+ </iterate>
+ </with>
+ </enablement>
+ </contextualLaunch>
+ </shortcut>
+
+ </extension>
</plugin>
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java 2009-12-07
22:25:47 UTC (rev 19086)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConfigurationActivator.java 2009-12-07
23:16:10 UTC (rev 19087)
@@ -1,8 +1,12 @@
package org.jboss.tools.smooks.configuration;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.osgi.framework.BundleContext;
@@ -57,8 +61,8 @@
return plugin;
}
- public void log(Throwable e) {
- getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.ERROR,
Messages.SmooksConfigurationActivator_Smooks_ErrorDialog_Title, e));
+ public static void log(Throwable e) {
+ log(new Status(Status.ERROR, PLUGIN_ID, Status.ERROR,
Messages.SmooksConfigurationActivator_Smooks_ErrorDialog_Title, e));
}
@Override
@@ -177,4 +181,25 @@
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow workBenchWindow= getActiveWorkbenchWindow();
+ if (workBenchWindow == null)
+ return null;
+ return workBenchWindow.getShell();
+ }
+
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ if (plugin == null)
+ return null;
+ IWorkbench workBench= plugin.getWorkbench();
+ if (workBench == null)
+ return null;
+ return workBench.getActiveWorkbenchWindow();
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
}
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java 2009-12-07
23:16:10 UTC (rev 19087)
@@ -0,0 +1,124 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2009, JBoss Inc.
+*
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ */
+package org.jboss.tools.smooks.launch;
+
+import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+
+/**
+ * The default exception handler shows an error dialog when one of its handle methods
+ * is called. If the passed exception is a <code>CoreException</code> an
error dialog
+ * pops up showing the exception's status information. For a
<code>InvocationTargetException</code>
+ * a normal message dialog pops up showing the exception's message. Additionally the
exception
+ * is written to the platform log.
+ *
+ * TO DO: this class is duplicated from org.eclipse.jdt.ui
+ */
+public class ExceptionHandler {
+
+ private static ExceptionHandler fgInstance= new ExceptionHandler();
+
+ /**
+ * Handles the given <code>CoreException</code>. The workbench shell is used
as a parent
+ * for the dialog window.
+ *
+ * @param e the <code>CoreException</code> to be handled
+ * @param title the dialog window's window title
+ * @param message message to be displayed by the dialog window
+ */
+ public static void handle(CoreException e, String title, String message) {
+ handle(e, SmooksConfigurationActivator.getActiveWorkbenchShell(), title, message);
+ }
+
+ /**
+ * Handles the given <code>CoreException</code>.
+ *
+ * @param e the <code>CoreException</code> to be handled
+ * @param parent the dialog window's parent shell or <code>null</code>
+ * @param title the dialog window's window title
+ * @param message message to be displayed by the dialog window
+ */
+ public static void handle(CoreException e, Shell parent, String title, String message)
{
+ fgInstance.perform(e, parent, title, message);
+ }
+
+ /**
+ * Handles the given <code>InvocationTargetException</code>.
+ *
+ * @param e the <code>InvocationTargetException</code> to be handled
+ * @param parent the dialog window's parent shell or <code>null</code>
+ * @param title the dialog window's window title
+ * @param message message to be displayed by the dialog window
+ */
+ public static void handle(InvocationTargetException e, Shell parent, String title,
String message) {
+ fgInstance.perform(e, parent, title, message);
+ }
+
+ //---- Hooks for subclasses to control exception handling
------------------------------------
+
+ protected void perform(CoreException e, Shell shell, String title, String message) {
+ SmooksConfigurationActivator.log(e);
+ IStatus status= e.getStatus();
+ if (status != null) {
+ ErrorDialog.openError(shell, title, message, status);
+ } else {
+ displayMessageDialog(e.getMessage(), shell, title, message);
+ }
+ }
+
+ protected void perform(InvocationTargetException e, Shell shell, String title, String
message) {
+ Throwable target= e.getTargetException();
+ if (target instanceof CoreException) {
+ perform((CoreException)target, shell, title, message);
+ } else {
+ SmooksConfigurationActivator.log(e);
+ if (e.getMessage() != null && e.getMessage().length() > 0) {
+ displayMessageDialog(e.getMessage(), shell, title, message);
+ } else {
+ displayMessageDialog(target.getMessage(), shell, title, message);
+ }
+ }
+ }
+
+ private void displayMessageDialog(String exceptionMessage, Shell shell, String title,
String message) {
+ StringWriter msg= new StringWriter();
+ if (message != null) {
+ msg.write(message);
+ msg.write("\n\n"); //$NON-NLS-1$
+ }
+ if (exceptionMessage == null || exceptionMessage.length() == 0)
+ msg.write("An exception has occurred. Please check the log for details.");
+ else
+ msg.write(exceptionMessage);
+ MessageDialog.openError(shell, title, msg.toString());
+ }
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java 2009-12-07
23:16:10 UTC (rev 19087)
@@ -0,0 +1,183 @@
+package org.jboss.tools.smooks.launch;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugModelPresentation;
+import org.eclipse.jdt.junit.launcher.JUnitLaunchShortcut;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+
+public class SmooksLaunchShortcut extends JUnitLaunchShortcut {
+
+ private static final String EMPTY_STRING= ""; //$NON-NLS-1$
+
+ private Shell getShell() {
+ return SmooksConfigurationActivator.getActiveWorkbenchShell();
+ }
+
+ private ILaunchManager getLaunchManager() {
+ return DebugPlugin.getDefault().getLaunchManager();
+ }
+
+ private List<ILaunchConfiguration>
findExistingLaunchConfigurations(ILaunchConfigurationWorkingCopy temporary) throws
CoreException {
+ ILaunchConfigurationType configType= temporary.getType();
+
+ ILaunchConfiguration[] configs=
getLaunchManager().getLaunchConfigurations(configType);
+ String[] attributeToCompare= getAttributeNamesToCompare();
+
+ ArrayList<ILaunchConfiguration> candidateConfigs= new
ArrayList<ILaunchConfiguration>(configs.length);
+ for (int i= 0; i < configs.length; i++) {
+ ILaunchConfiguration config= configs[i];
+ if (hasSameAttributes(config, temporary, attributeToCompare)) {
+ candidateConfigs.add(config);
+ }
+ }
+ return candidateConfigs;
+ }
+
+ private static boolean hasSameAttributes(ILaunchConfiguration config1,
ILaunchConfiguration config2, String[] attributeToCompare) {
+ try {
+ for (int i= 0; i < attributeToCompare.length; i++) {
+ String val1= config1.getAttribute(attributeToCompare[i], EMPTY_STRING);
+ String val2= config2.getAttribute(attributeToCompare[i], EMPTY_STRING);
+ if (!val1.equals(val2)) {
+ return false;
+ }
+ }
+ return true;
+ } catch (CoreException e) {
+ // ignore access problems here, return false
+ }
+ return false;
+ }
+
+ public void launch(ISelection selection, String mode) {
+ if (selection instanceof IStructuredSelection) {
+ launch(((IStructuredSelection) selection).toArray(), mode);
+ }
+ }
+
+ public void launch(IEditorPart editor, String mode) {
+ if (editor.getEditorInput() != null && editor.getEditorInput() instanceof
IFileEditorInput) {
+ IFile file= ((IFileEditorInput)editor.getEditorInput()).getFile();
+ if (file != null) {
+ launch(new Object[] { file }, mode);
+ }
+ }
+ }
+
+ private void launch(Object[] elements, String mode) {
+ try {
+ IFile elementToLaunch= null;
+
+ if (elements.length == 1) {
+ Object selected= elements[0];
+ if (!(selected instanceof IFile) && selected instanceof IAdaptable) {
+ selected= ((IAdaptable) selected).getAdapter(IFile.class);
+ }
+ if (selected instanceof IFile) {
+ elementToLaunch = (IFile) selected;
+ }
+ }
+ performLaunch(elementToLaunch, mode);
+ } catch (InterruptedException e) {
+ // OK, silently move on
+ } catch (CoreException e) {
+ ExceptionHandler.handle(e, getShell(),
+ "Launch Failed",
+ "An exception occurred while testing the Smooks Configuration.");
+ }
+ }
+
+ private void performLaunch(IFile file, String mode) throws InterruptedException,
CoreException {
+ ILaunchConfigurationWorkingCopy temparary= createLaunchConfiguration(file);
+ ILaunchConfiguration config= findExistingLaunchConfiguration(temparary, mode);
+ if (config == null) {
+ // no existing found: create a new one
+ config= temparary.doSave();
+ }
+ DebugUITools.launch(config, mode);
+ }
+
+ private ILaunchConfiguration
findExistingLaunchConfiguration(ILaunchConfigurationWorkingCopy temporary, String mode)
throws InterruptedException, CoreException {
+ List<?> candidateConfigs= findExistingLaunchConfigurations(temporary);
+
+ // If there are no existing configs associated with the IType, create
+ // one.
+ // If there is exactly one config associated with the IType, return it.
+ // Otherwise, if there is more than one config associated with the
+ // IType, prompt the
+ // user to choose one.
+ int candidateCount= candidateConfigs.size();
+ if (candidateCount == 0) {
+ return null;
+ } else if (candidateCount == 1) {
+ return (ILaunchConfiguration) candidateConfigs.get(0);
+ } else {
+ // Prompt the user to choose a config. A null result means the user
+ // cancelled the dialog, in which case this method returns null,
+ // since cancelling the dialog should also cancel launching
+ // anything.
+ ILaunchConfiguration config= chooseConfiguration(candidateConfigs, mode);
+ if (config != null) {
+ return config;
+ }
+ }
+ return null;
+ }
+
+ private ILaunchConfiguration chooseConfiguration(List<?> configList, String mode)
throws InterruptedException {
+ IDebugModelPresentation labelProvider= DebugUITools.newDebugModelPresentation();
+ ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(),
labelProvider);
+ dialog.setElements(configList.toArray());
+ dialog.setTitle("Select Runtime Configuration");
+ if (mode.equals(ILaunchManager.RUN_MODE)) {
+ dialog.setMessage("Select from the available Smooks Runtime
Configurations.");
+ }
+ dialog.setMultipleSelection(false);
+ int result= dialog.open();
+ if (result == Window.OK) {
+ return (ILaunchConfiguration) dialog.getFirstResult();
+ }
+ throw new InterruptedException(); // cancelled by user
+ }
+
+ protected String getLaunchConfigurationTypeId() {
+ return "org.jboss.tools.smooks.ui.smooksLauncher";
+ }
+
+ protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IFile file) throws
CoreException {
+ if (file != null) {
+
+ ILaunchConfigurationType configType=
getLaunchManager().getLaunchConfigurationType(getLaunchConfigurationTypeId());
+ ILaunchConfigurationWorkingCopy wc= configType.newInstance(null,
getLaunchManager().generateUniqueLaunchConfigurationNameFrom(file.getName()));
+
+ IProject project = (IProject) file.getProject();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
project.getName());
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
file.getProjectRelativePath().toPortableString());
+
+ return wc;
+ }
+
+ return null;
+
+ }
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2009-12-07
22:25:47 UTC (rev 19086)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2009-12-07
23:16:10 UTC (rev 19087)
@@ -1,6 +1,6 @@
-/*
+/**
* JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * Copyright 2009, JBoss Inc., and others contributors as indicated
* by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
@@ -15,7 +15,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
- * (C) 2005-2006, JBoss Inc.
+ * (C) 2009, JBoss Inc.
*/
package org.jboss.tools.smooks.launch;
@@ -24,12 +24,10 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.StringReader;
-import java.io.StringWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.Map.Entry;
-import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.jboss.tools.smooks.configuration.ProcessNodeType;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-07
22:25:47 UTC (rev 19086)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2009-12-07
23:16:10 UTC (rev 19087)
@@ -19,17 +19,27 @@
*/
package org.jboss.tools.smooks.launch;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
-
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -41,11 +51,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
@@ -55,21 +60,6 @@
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.part.FileEditorInput;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
import org.jboss.tools.smooks.configuration.RuntimeMetadata;
import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
@@ -86,8 +76,6 @@
private Button fSearchButton;
private RuntimeMetadata launchMetaData = new RuntimeMetadata();
- private ILaunchConfiguration fLaunchConfiguration;
-
/* (non-Javadoc)
* @see
org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
@@ -105,12 +93,12 @@
validatePage();
}
- private void createSpacer(Composite comp) {
- Label label= new Label(comp, SWT.NONE);
- GridData gd= new GridData();
- gd.horizontalSpan= 3;
- label.setLayoutData(gd);
- }
+// private void createSpacer(Composite comp) {
+// Label label= new Label(comp, SWT.NONE);
+// GridData gd= new GridData();
+// gd.horizontalSpan= 3;
+// label.setLayoutData(gd);
+// }
private void createFormElements(Composite comp) {
GridData gd = new GridData();
@@ -199,7 +187,6 @@
* @see
org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
public void initializeFrom(ILaunchConfiguration config) {
- fLaunchConfiguration = config;
try {
fProjText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
"")); //$NON-NLS-1$
fConfigurationText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
"")); //$NON-NLS-1$
@@ -353,7 +340,7 @@
setErrorMessage("Unknown project name '" + projectName +
"'.");
return;
}
- IJavaProject javaProject= JavaCore.create(project);
+// IJavaProject javaProject= JavaCore.create(project);
String configName= fConfigurationText.getText().trim();
try {