Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal')
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/filters/JavaFilter.java77
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java129
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties66
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JET2TransformationTabGroup.java48
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java125
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java311
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java402
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java70
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/popup/actions/UnloadAction.java91
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java313
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java70
-rw-r--r--plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java84
12 files changed, 0 insertions, 1786 deletions
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/filters/JavaFilter.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/filters/JavaFilter.java
deleted file mode 100644
index 160acc0..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/filters/JavaFilter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.ui.filters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * Filter Java elements from the Package Explorer view for JET2 projects.
- *
- */
-public class JavaFilter extends ViewerFilter {
-
- /**
- *
- */
- public JavaFilter() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- final boolean isJET2Project = isJET2Project(parentElement);
- // Note: ClassPathContainer is a JDT internal class - it doesn't implement
- // any useful public interfacts (IAdapter and IWorkspaceAdapter only). To
- // avoid a direct internal dependency, we check the class name instead of
- // doing an instanceof. The risk is that JDT will refactor, and we will loose
- // this feature.
- if (element.getClass().getName().endsWith(".ClassPathContainer") && isJET2Project) { //$NON-NLS-1$
- return false;
- }
- if(element instanceof IPackageFragmentRoot && isJET2Project) {
- return false;
- }
- return true;
- }
-
- /**
- * @param element
- * @return
- * @throws CoreException
- */
- private boolean isJET2Project(Object element) {
- if(element instanceof IJavaProject) {
- IJavaProject jp = (IJavaProject)element;
- try {
- return jp.getProject().hasNature(JET2Platform.JET2_NATURE_ID);
- } catch (CoreException e) {
- // No action required:
- // only happens if the project doesn't exist. But we won't get here unless the project does
- }
- }
- return false;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
deleted file mode 100644
index 2a40b37..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/Messages.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 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
- *******************************************************************************/
-package org.eclipse.jet.internal.ui.l10n;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jet.internal.ui.l10n.messages"; //$NON-NLS-1$
-
- private Messages() {
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String CompilePreferencePage_BaseLocationsLabel;
-
- public static String CompilePreferencePage_CompileBaseTemplates;
-
- public static String CompilePreferencePage_DependenciesGroupLabel;
-
- public static String CompilePreferencePage_DeriveJavaFiles;
-
- public static String CompilePreferencePage_Description;
-
- public static String CompilePreferencePage_EnableProjectSettings;
-
- public static String CompilePreferencePage_FileExtensions;
-
- public static String CompilePreferencePage_InvalidBaseLocations;
-
- public static String CompilePreferencePage_JavaGenerationGroupLabel;
-
- public static String CompilePreferencePage_JavaPackage;
-
- public static String CompilePreferencePage_JET1_OPTION;
-
- public static String CompilePreferencePage_JET1OptionsGroupLabel;
-
- public static String CompilePreferencePage_JET2_Option;
-
- public static String CompilePreferencePage_JET2_OPTIONS_GROUP_LABEL;
-
- public static String CompilePreferencePage_JETComformanceGroupLabel;
-
- public static String CompilePreferencePage_OverrideTemplatesOption;
-
- public static String CompilePreferencePage_SourceFolder;
-
- public static String CompilePreferencePage_TemplatesDirLabel;
-
- public static String CompilePreferencePage_use_java5;
-
- public static String ExtensionListEditor_AddDialogErrorMsg;
-
- public static String ExtensionListEditor_AddDialogPrompt;
-
- public static String ExtensionListEditor_AddDialogTitle;
-
- public static String JETPreferencePage_Description;
-
- public static String JETPreferencePage_LocationsAddDialogTitle;
-
- public static String JETPreferencePage_LocationsLabel;
-
- public static String JETTransformMainTab_BrowseButtonLabel;
-
- public static String JETTransformMainTab_DebugSeverity;
-
- public static String JETTransformMainTab_DescriptionLabel;
-
- public static String JETTransformMainTab_DisplayMessage_Gropu;
-
- public static String JETTransformMainTab_ErrorSeverity;
-
- public static String JETTransformMainTab_IdLabel;
-
- public static String JETTransformMainTab_InformationSeverity;
-
- public static String JETTransformMainTab_NameLabel;
-
- public static String JETTransformMainTab_SelectResourceDialogTitle;
-
- public static String JETTransformMainTab_SeverityLabel;
-
- public static String JETTransformMainTab_TraceSeverity;
-
- public static String JETTransformMainTab_TransformGroupLabel;
-
- public static String JETTransformMainTab_TransformInputGroup;
-
- public static String JETTransformMainTab_WarningSeverity;
-
- public static String LaunchShortcut_DefaultLaunchName;
-
- public static String NewProjectWizard_WindowTitle;
-
- public static String NewProjectWizard_ErrorCreatingProject;
-
- public static String NewProjectWizard_MainPageTabText;
-
- public static String NewProjectWizard_MainPageTitle;
-
- public static String NewProjectWizard_MainPageDescription;
-
- public static String LaunchWizard_MainTab_Name;
-
- public static String JET2TemplateAccess_ErrorLoadingTemplateStore;
-
- public static String UnloadAction_DialogTitle;
-
- public static String UnloadAction_UnloadSuccessful;
-
- public static String UnloadAction_UnloadFailed;
-
- public static String UnloadAction_NotLoaded;
-
- public static String NewProjectWizard_ErrorInJETTransform;
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
deleted file mode 100644
index db65712..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/l10n/messages.properties
+++ /dev/null
@@ -1,66 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 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
-###############################################################################
-NewProjectWizard_WindowTitle=New JET Transformation Project
-NewProjectWizard_ErrorCreatingProject=Error attempting to create project
-NewProjectWizard_ErrorInJETTransform=The JET transformation that creates the new project had execution errors
-NewProjectWizard_MainPageTabText=Main
-NewProjectWizard_MainPageTitle=JET Transformation Project
-NewProjectWizard_MainPageDescription=Create a JET Transformation Project in the workspace.
-
-LaunchShortcut_DefaultLaunchName=JET Transformation
-LaunchWizard_MainTab_Name=&Main
-
-JET2TemplateAccess_ErrorLoadingTemplateStore=Error loading editor template store.
-JETTransformMainTab_SelectResourceDialogTitle=Select resource
-
-UnloadAction_DialogTitle=Unload JET Transformation
-UnloadAction_UnloadSuccessful=Unloaded "{0}". Refresh the Plugins View to confirm success.
-UnloadAction_UnloadFailed=Failed to unloaded "{0}". Reason: {1}.
-UnloadAction_NotLoaded=Bundle is not loaded "{0}". No action was taken.
-
-JETTransformMainTab_TransformGroupLabel=Transformation
-JETTransformMainTab_DescriptionLabel=Description:
-JETTransformMainTab_SeverityLabel=&Severity (at or above):
-JETTransformMainTab_ErrorSeverity=error
-JETTransformMainTab_WarningSeverity=warning
-JETTransformMainTab_DebugSeverity=debug
-JETTransformMainTab_NameLabel=Name:
-JETPreferencePage_Description=JET General options
-JETTransformMainTab_IdLabel=&ID:
-JETTransformMainTab_TransformInputGroup=&Transformation Input
-JETTransformMainTab_DisplayMessage_Gropu=Display Messages
-JETTransformMainTab_InformationSeverity=information
-JETTransformMainTab_TraceSeverity=trace
-JETTransformMainTab_BrowseButtonLabel=&Browse...
-CompilePreferencePage_Description=JET Compiler options
-CompilePreferencePage_EnableProjectSettings=&Enable Project specific settings
-CompilePreferencePage_JETComformanceGroupLabel=Generate Method Conformance
-CompilePreferencePage_JET2_OPTIONS_GROUP_LABEL=JET2 Options
-CompilePreferencePage_JET1OptionsGroupLabel=JET1 Options
-CompilePreferencePage_JavaGenerationGroupLabel=Java Generation Options
-CompilePreferencePage_InvalidBaseLocations=Base locations must be a comma seperated lists of URIs
-CompilePreferencePage_DependenciesGroupLabel=Dependencies (JET1 only)
-CompilePreferencePage_OverrideTemplatesOption=&Override templates from a base plug-in
-CompilePreferencePage_CompileBaseTemplates=&Compile all base templates to Java classes in this project
-CompilePreferencePage_JavaPackage=Default Java &Package:
-CompilePreferencePage_JET1_OPTION=JET&1 - String generate(Object argument)
-CompilePreferencePage_JET2_Option=JET&2 - void generate(JET2Context context, JET2Writer out)
-CompilePreferencePage_use_java5=Use &Java 5 language features
-CompilePreferencePage_FileExtensions=&File extensions for templates:
-CompilePreferencePage_SourceFolder=Java &Source folder:
-CompilePreferencePage_DeriveJavaFiles=&Hide compiled Java from Team system (mark .java files derived)
-CompilePreferencePage_BaseLocationsLabel=&Base Location URIs (comma separated):
-CompilePreferencePage_TemplatesDirLabel=Templates directory
-ExtensionListEditor_AddDialogTitle=Add extension
-ExtensionListEditor_AddDialogPrompt=Enter an extension
-ExtensionListEditor_AddDialogErrorMsg=Extension must be a sequence of letters and/or digits
-JETPreferencePage_LocationsLabel=&Additional locations for JET Transformations
-JETPreferencePage_LocationsAddDialogTitle=Select a Folder
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JET2TransformationTabGroup.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JET2TransformationTabGroup.java
deleted file mode 100644
index 44035bf..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JET2TransformationTabGroup.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- * /
- *******************************************************************************/
-
-package org.eclipse.jet.internal.ui.launch;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-
-/**
- * @author pelder
- *
- */
-public class JET2TransformationTabGroup extends
- AbstractLaunchConfigurationTabGroup {
-
- /**
- *
- */
- public JET2TransformationTabGroup() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
-// new JET2TransformMainTab(),
- new JETTransformMainTab(),
- new CommonTab(),
- };
-
- setTabs(tabs);
- }
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java
deleted file mode 100644
index 24b7db0..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETConsoleColorProvider.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.ui.launch;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.console.ConsoleColorProvider;
-import org.eclipse.debug.ui.console.IConsole;
-import org.eclipse.debug.ui.console.IConsoleColorProvider;
-import org.eclipse.jet.internal.JETPreferences;
-import org.eclipse.jet.internal.launch.JETProcess;
-import org.eclipse.jet.internal.launch.JETStreamsProxy;
-import org.eclipse.jet.ui.Activator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Colorize the JET execution console
- *
- */
-public class JETConsoleColorProvider extends ConsoleColorProvider implements IConsoleColorProvider {
-
- private Map colors;
- /**
- *
- */
- public JETConsoleColorProvider() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#connect(org.eclipse.debug.core.model.IProcess, org.eclipse.debug.ui.console.IConsole)
- */
- public void connect(IProcess process, IConsole console) {
- colors = new HashMap();
- JETProcess jetProcess = (JETProcess) process;
- final JETStreamsProxy jetStreamsProxy = (JETStreamsProxy) jetProcess
- .getStreamsProxy();
-
- if (jetStreamsProxy != null) {
- if (jetStreamsProxy.getWarningStreamMonitor() != null) {
- console.connect(jetStreamsProxy.getWarningStreamMonitor(),
- JETStreamsProxy.JET_WARNING_STREAM);
- }
- if (jetStreamsProxy.getTraceStreamMonitor() != null) {
- console.connect(jetStreamsProxy.getTraceStreamMonitor(),
- JETStreamsProxy.JET_TRACE_STREAM);
- }
- if (jetStreamsProxy.getDebugStreamMonitor() != null) {
- console.connect(jetStreamsProxy.getDebugStreamMonitor(),
- JETStreamsProxy.JET_DEBUG_STREAM);
- }
- }
- super.connect(process, console);
- }
-
- public void disconnect() {
- for (Iterator i = colors.values().iterator(); i.hasNext();) {
- Color color = (Color) i.next();
- color.dispose();
- }
- colors.clear();
- super.disconnect();
- }
-
- private Color getPrefColor(String prefKey) {
- Color color = (Color) colors.get(prefKey);
- if(color == null) {
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- final RGB rgb = PreferenceConverter.getColor(store, prefKey);
- color = new Color(Display.getCurrent(), rgb);
- colors.put(prefKey, color);
- }
- return color;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(java.lang.String)
- */
- public Color getColor(String streamIdentifer) {
- if (streamIdentifer.equals(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM)) {
- return getPrefColor(JETPreferences.CONSOLE_INFO_COLOR);
- }
- if (streamIdentifer.equals(IDebugUIConstants.ID_STANDARD_ERROR_STREAM)) {
- return getPrefColor(JETPreferences.CONSOLE_ERROR_COLOR);
- }
- if (streamIdentifer.equals(JETStreamsProxy.JET_DEBUG_STREAM)) {
- return getPrefColor(JETPreferences.CONSOLE_DEBUG_COLOR);
- }
- if (streamIdentifer.equals(JETStreamsProxy.JET_TRACE_STREAM)) {
- return getPrefColor(JETPreferences.CONSOLE_TRACE_COLOR);
- }
- if (streamIdentifer.equals(JETStreamsProxy.JET_WARNING_STREAM)) {
- return getPrefColor(JETPreferences.CONSOLE_WARNING_COLOR);
- }
- return super.getColor(streamIdentifer);
- }
-
- public boolean isReadOnly() {
- return true;
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java
deleted file mode 100644
index 2fe324c..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETLaunchHelper.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-package org.eclipse.jet.internal.ui.launch;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-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.core.runtime.Status;
-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.IDebugUIConstants;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-import org.eclipse.jet.transform.JETLaunchConstants;
-import org.eclipse.jet.ui.Activator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-public class JETLaunchHelper {
-
- private static ILaunchConfigurationType jetLaunchType = getConfigurationType();
- /**
- * @param resource
- * @param mode
- */
- public static ILaunchConfiguration createConfig(String id,
- IResource resource) {
- try {
- final ILaunchConfigurationWorkingCopy wConfig = jetLaunchType
- .newInstance(null, generateLaunchName(id, resource,
- Messages.LaunchShortcut_DefaultLaunchName));
- wConfig.setAttribute(JETLaunchConstants.ID, id);
- wConfig.setAttribute(JETLaunchConstants.SOURCE,
- resource != null
- ? resource.getFullPath().toString()
- : ""); //$NON-NLS-1$
- final ILaunchConfiguration config = wConfig.doSave();
- return config;
- } catch (CoreException e) {
- throw convertToRuntimeException(e);
- }
- }
-
- public static void findAndLaunchForTransformAndResource(Shell shell, String mode, String transformId, IResource resource) {
- ILaunchConfiguration[] configs = findConfigsForTransformAndResource(mode, transformId, resource);
- ILaunchConfiguration configToLaunch;
- switch(configs.length) {
- case 0:
- configToLaunch = createConfig(transformId, resource);
- break;
- case 1:
- configToLaunch = configs[0];
- break;
- default:
- configToLaunch = chooseExistingConfig(shell, configs);
- break;
- }
- if(configToLaunch != null) {
- DebugUITools.launch(configToLaunch, mode);
- }
- }
-
- public static boolean findAndLaunchForTransform(Shell shell, String mode, String transformId, boolean showConfigFirst) {
- ILaunchConfiguration[] configs = findConfigsForTransform(transformId);
- ILaunchConfiguration configToLaunch = null;
- switch(configs.length) {
- case 0:
- IResource resource = chooseResource(shell);
- if(resource != null) {
- configToLaunch = createConfig(transformId, resource);
- }
- break;
- case 1:
- configToLaunch = configs[0];
- break;
- default:
- configToLaunch = chooseExistingConfig(shell, configs);
- break;
- }
- if(configToLaunch != null) {
- boolean doLaunch = true;
- if(showConfigFirst) {
- int dialogResult = DebugUITools.openLaunchConfigurationDialog(shell, configToLaunch,
- IDebugUIConstants.ID_RUN_LAUNCH_GROUP, null);
- doLaunch = dialogResult != Window.CANCEL;
- }
- if(doLaunch) {
- DebugUITools.launch(configToLaunch, mode);
- }
- }
- return configToLaunch != null;
- }
-
- private static IResource chooseResource(Shell shell) {
- IResource resource = null;
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
- shell, new WorkbenchLabelProvider(),
- new WorkbenchContentProvider());
-
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setAllowMultiple(false);
- dialog.setTitle(Messages.JETTransformMainTab_SelectResourceDialogTitle);
- dialog.setMessage(Messages.JETTransformMainTab_SelectResourceDialogTitle);
- dialog.setValidator(new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
- if (selection.length > 0) {
- return new Status(IStatus.OK, Activator.getDefault()
- .getBundle().getSymbolicName(), IStatus.OK,
- "", null); //$NON-NLS-1$
- }
-
- return new Status(IStatus.ERROR, Activator.getDefault()
- .getBundle().getSymbolicName(), IStatus.ERROR, "", null); //$NON-NLS-1$
- }
- });
- if (dialog.open() == ElementTreeSelectionDialog.OK) {
- resource = (IResource) dialog.getFirstResult();
- }
- return resource;
- }
-
- public static boolean findAndLauchForResource(Shell shell, String mode, IResource resource) {
- ILaunchConfiguration[] configs = findConfigsForResource(mode, resource);
- ILaunchConfiguration configToLaunch = null;
- switch(configs.length) {
- case 0:
-// MessageDialog.openError(shell, "Run JET Transform", "No JET transforms found.");
- IJETBundleDescriptor jetBundleDesc = JET2Platform.getProjectDescription(resource.getProject().getName());
- if(jetBundleDesc != null) {
- configToLaunch = createConfig(jetBundleDesc.getId(), resource);
- } else {
- configToLaunch = createConfig("", resource); //$NON-NLS-1$
- if(configToLaunch != null) {
- int dialogResult = DebugUITools.openLaunchConfigurationPropertiesDialog(shell, configToLaunch,
- IDebugUIConstants.ID_RUN_LAUNCH_GROUP, null);
- if(dialogResult == Window.CANCEL) {
- try {
- configToLaunch.delete();
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- configToLaunch = null;
- } else {
- configs = findConfigsForResource(mode, resource);
- configToLaunch = configs.length > 0 ? configs[0] : null;
- }
- }
- }
- break;
- case 1:
- configToLaunch = configs[0];
- break;
- default:
- configToLaunch = chooseExistingConfig(shell, configs);
- break;
- }
- if(configToLaunch != null) {
- DebugUITools.launch(configToLaunch, mode);
- }
- return configToLaunch != null;
- }
-
- private static ILaunchConfiguration chooseExistingConfig(Shell shell,
- ILaunchConfiguration[] configs) {
- ILabelProvider labelProvider = new LabelProvider() {
-
- public String getText(Object element) {
- return ((ILaunchConfiguration)element).getName();
- } };
-
- ElementListSelectionDialog dlg = new ElementListSelectionDialog(shell, labelProvider);
- dlg.setElements(configs);
- dlg.setTitle(Messages.LaunchShortcut_DefaultLaunchName);
- dlg.setMessage(Messages.LaunchShortcut_DefaultLaunchName);
- dlg.setMultipleSelection(false);
- int result = dlg.open();
- labelProvider.dispose();
- if (result == Window.OK) {
- return (ILaunchConfiguration) dlg.getFirstResult();
- }
- return null;
- }
-
- public static ILaunchConfiguration[] findConfigsForResource(String mode, IResource resource) {
- final List finds = new ArrayList();
- final ILaunchConfiguration[] configs = getJETLaunchConfigs();
- final IPath fullPath = resource.getFullPath().makeRelative();
- for (int i = 0; i < configs.length; i++) {
- if(fullPath.equals(new Path(getSource(configs[i])).makeRelative())){
- finds.add(configs[i]);
- }
- }
- return (ILaunchConfiguration[]) finds.toArray(new ILaunchConfiguration[finds.size()]);
- }
-
- public static ILaunchConfiguration[] findConfigsForTransformAndResource(String mode, String transformId, IResource resource) {
- final List finds = new ArrayList();
- final ILaunchConfiguration[] configs = getJETLaunchConfigs();
- final String fullPath = resource.getFullPath().toString();
- for (int i = 0; i < configs.length; i++) {
- if(fullPath.equals(getSource(configs[i]))
- && transformId.equals(getTransformID(configs[i]))){
- finds.add(configs[i]);
- }
- }
-
- return (ILaunchConfiguration[]) finds.toArray(new ILaunchConfiguration[finds.size()]);
- }
-
- public static ILaunchConfiguration[] findConfigsForTransform(String transformId) {
- final ILaunchConfiguration[] configs = getJETLaunchConfigs();
- List finds = new ArrayList();
- for (int i = 0; i < configs.length; i++) {
- if(transformId.equals(getTransformID(configs[i]))){
- finds.add(configs[i]);
- }
- }
- return (ILaunchConfiguration[]) finds.toArray(new ILaunchConfiguration[finds.size()]);
- }
-
-
- private static String getSource(ILaunchConfiguration config) {
- try {
- return config.getAttribute(JETLaunchConstants.SOURCE, (String)null);
- } catch (CoreException e) {
- throw convertToRuntimeException(e);
- }
- }
-
- private static String getTransformID(ILaunchConfiguration config) {
- try {
- return config.getAttribute(JETLaunchConstants.ID, (String)null);
- } catch (CoreException e) {
- throw convertToRuntimeException(e);
- }
- }
-
- private static RuntimeException convertToRuntimeException(CoreException e) {
- return new RuntimeException("Unexpected exception", e); //$NON-NLS-1$
- }
-
- private static ILaunchConfiguration[] getJETLaunchConfigs() {
- try {
- ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
- return lm.getLaunchConfigurations(jetLaunchType);
- } catch (CoreException e) {
- throw convertToRuntimeException(e);
- }
- }
-
- private static ILaunchConfigurationType getConfigurationType() {
- ILaunchManager lm= DebugPlugin.getDefault().getLaunchManager();
- return lm.getLaunchConfigurationType(JETLaunchConstants.CONFIG_ID);
- }
-
- public static String generateLaunchName(String id, IResource input, String defaultName)
- {
- ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
- String prefix;
- if (id == null && input == null) {
- prefix = defaultName;
- } else if(input == null) {
- prefix = id;
- } else if(id == null)
- {
- prefix = input.getName();
- } else {
- prefix = id + " (" + input.getName() + ")"; //$NON-NLS-1$//$NON-NLS-2$
- }
-
- return lm.generateUniqueLaunchConfigurationNameFrom(prefix);
- }
-
- public static ILaunchConfiguration[] findAllConfigs() {
- return getJETLaunchConfigs();
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
deleted file mode 100644
index 4d38ae7..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/JETTransformMainTab.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.ui.launch;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtender;
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jet.transform.IJETBundleDescriptor;
-import org.eclipse.jet.transform.JETLaunchConstants;
-import org.eclipse.jet.ui.Activator;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-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.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Main tab for JET Launch Configuraitons
- *
- */
-public class JETTransformMainTab extends AbstractLaunchConfigurationTab {
-
- private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- // input block controls
- private Text sourceField;
- private Button workspaceLocationButton;
-
- private final Listener fListener = new Listener();;
-
- private Image tabImage;
- private Combo transformCombo;
- private Text transformName;
- private Text transformDescription;
- private Combo logLevelCombo;
- private String[] logLevels;
-
-
- private class Listener extends SelectionAdapter implements ModifyListener
- {
-
- public void widgetSelected(SelectionEvent e) {
- setDirty(true);
- final Object source = e.getSource();
- if(source == transformCombo) {
- handleTransformSelection();
- }
- updateLaunchConfigurationDialog();
- }
- public void modifyText(ModifyEvent e) {
- setDirty(true);
- updateLaunchConfigurationDialog();
- }
- }
-
- /**
- *
- */
- public JETTransformMainTab() {
- super();
- }
-
- private void handleTransformSelection() {
- String id = transformCombo.getText();
- final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(id);
- transformName.setText(descriptor.getName());
- transformDescription.setText(descriptor.getDescription().trim());
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.verticalSpacing = 15;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- createInputBlock(composite);
- createTransformBlock(composite);
- createMessagesBlock(composite);
-
- setControl(composite);
- Dialog.applyDialogFont(composite);
- }
-
- private void createMessagesBlock(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(Messages.JETTransformMainTab_DisplayMessage_Gropu);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- createLogLevelsSection(group);
- }
-
- private void createLogLevelsSection(Group parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(Messages.JETTransformMainTab_SeverityLabel);
-
- logLevelCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- logLevelCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- logLevelCombo.setItems(getLogLevels());
- logLevelCombo.addSelectionListener(fListener);
- }
-
- /**
- * @param composite
- */
- private void createTransformBlock(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- group.setText(Messages.JETTransformMainTab_TransformGroupLabel);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- createTransformIdSection(group);
- createTransformNameSection(group);
- createTransformDescriptionSection(group);
- }
-
- private void createTransformDescriptionSection(Group parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(Messages.JETTransformMainTab_DescriptionLabel);
-
- transformDescription = new Text(parent, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 300;
- gd.heightHint = 40;
- transformDescription.setLayoutData(gd);
- }
-
- private void createTransformNameSection(Group parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(Messages.JETTransformMainTab_NameLabel);
-
- transformName = new Text(parent, SWT.BORDER | SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 300;
- transformName.setLayoutData(gd);
-
- }
-
- private void createTransformIdSection(Group parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(Messages.JETTransformMainTab_IdLabel);
-
- transformCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
- transformCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- transformCombo.setItems(JET2Platform.getJETBundleManager().getAllTransformIds());
- transformCombo.addSelectionListener(fListener);
- }
-
- private void createInputBlock(Composite parent)
- {
- Group group = new Group(parent, SWT.NONE);
- group.setText(Messages.JETTransformMainTab_TransformInputGroup);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- group.setLayout(layout);
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- sourceField = new Text(group, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- sourceField.setLayoutData(gridData);
- sourceField.addModifyListener(fListener);
- final String accessibleName = group.getText().replaceFirst("(?<!&)&", ""); //$NON-NLS-1$ //$NON-NLS-2$
- sourceField.getAccessible().addAccessibleListener(new AccessibleAdapter() {
-
- public void getName(AccessibleEvent e) {
- e.result = accessibleName;
- }
- });
-
- Composite buttonComposite = new Composite(group, SWT.NONE);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 3;
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonComposite.setLayout(layout);
- buttonComposite.setLayoutData(gridData);
- buttonComposite.setFont(parent.getFont());
-
- workspaceLocationButton= createPushButton(buttonComposite, Messages.JETTransformMainTab_BrowseButtonLabel, null);
- workspaceLocationButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
-
- IResource resource = chooseResource(getShell());
- if(resource != null) {
- sourceField.setText(resource.getFullPath().makeRelative().toString());
- }
- }
- });
-
- }
-
- private static IResource chooseResource(Shell shell) {
- IResource resource = null;
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
- shell, new WorkbenchLabelProvider(),
- new WorkbenchContentProvider());
-
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setAllowMultiple(false);
- dialog.setTitle(Messages.JETTransformMainTab_SelectResourceDialogTitle);
- dialog.setMessage(Messages.JETTransformMainTab_SelectResourceDialogTitle);
- dialog.setValidator(new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
- if (selection.length > 0)
- return new Status(IStatus.OK, Activator.getDefault().getBundle().getSymbolicName(),
- IStatus.OK, "", null); //$NON-NLS-1$
-
- return new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(),
- IStatus.ERROR, "", null); //$NON-NLS-1$
- }
- });
- if (dialog.open() == ElementTreeSelectionDialog.OK) {
- resource = (IResource) dialog.getFirstResult();
- }
- return resource;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return Messages.LaunchWizard_MainTab_Name;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- try {
- final String id = configuration.getAttribute(JETLaunchConstants.ID, EMPTY_STRING);
- transformCombo.setText(id);
- final IJETBundleDescriptor descriptor = JET2Platform.getJETBundleManager().getDescriptor(id);
- if(descriptor != null)
- {
- transformName.setText(descriptor.getName());
- transformDescription.setText(descriptor.getDescription().trim());
- }
- } catch (CoreException e) {
- transformCombo.setText(EMPTY_STRING);
- }
- try {
- sourceField.setText(configuration.getAttribute(JETLaunchConstants.SOURCE, EMPTY_STRING));
- } catch (CoreException e) {
- sourceField.setText(EMPTY_STRING);
- }
-
- int level;
- try {
- level = configuration.getAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, RuntimeLoggerContextExtender.INFO_LEVEL);
- } catch (CoreException e) {
- level = RuntimeLoggerContextExtender.INFO_LEVEL;
- }
- logLevelCombo.setText(getLogLevelText(level));
- }
-
- private String[] getLogLevels() {
- if (logLevels == null) {
- logLevels = new String[] {
- Messages.JETTransformMainTab_ErrorSeverity,
- Messages.JETTransformMainTab_WarningSeverity,
- Messages.JETTransformMainTab_InformationSeverity,
- Messages.JETTransformMainTab_TraceSeverity,
- Messages.JETTransformMainTab_DebugSeverity,
- };
- }
- return logLevels;
- }
-
- private int getLogLevelFromIndex(int selectionIndex) {
- // list is from highest (5) to lowest (1)
- return getLogLevels().length - selectionIndex;
- }
-
- private String getLogLevelText(int logLevel) {
- // log levels list are from highest (5) to lowest (1)
- return getLogLevels()[getLogLevels().length - logLevel];
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(JETLaunchConstants.ID, transformCombo.getText());
-
- configuration.setAttribute(JETLaunchConstants.SOURCE, sourceField.getText());
-
- configuration.setAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, getLogLevelFromIndex(logLevelCombo.getSelectionIndex()));
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
-
- IFile resource = null;
- String id = null;
-
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection iss = (IStructuredSelection) selection;
- Object firstElement = iss.getFirstElement();
- if(firstElement instanceof IFile) {
- resource = (IFile)firstElement;
- } else if (firstElement instanceof IAdaptable) {
- resource = (IFile) ((IAdaptable)firstElement).getAdapter(IFile.class);
- }
- }
- if(resource != null) {
- configuration.setAttribute(JETLaunchConstants.SOURCE,
- resource.getFullPath().makeRelative().toString());
-
- final IProject project = resource.getProject();
- final IJETBundleDescriptor descriptor = JET2Platform.getProjectDescription(project.getName());
- if(descriptor != null) {
- id = descriptor.getId();
- configuration.setAttribute(JETLaunchConstants.ID, id);
-
-
-
- }
- }
- configuration.setAttribute(JETLaunchConstants.LOG_FILTER_LEVEL, RuntimeLoggerContextExtender.INFO_LEVEL);
-
- configuration.rename(LaunchShortcut.generateLaunchName(id, resource));
- }
-
- public Image getImage() {
- if(tabImage == null) {
- ImageDescriptor imageDescriptor = Activator.getImageDescriptor("icons/JET2LaunchIcon.gif"); //$NON-NLS-1$
- tabImage = imageDescriptor.createImage();
- }
- return tabImage;
- }
-
- public void dispose() {
- if(tabImage != null) {
- tabImage.dispose();
- }
- super.dispose();
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
deleted file mode 100644
index 7c0cd0c..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/launch/LaunchShortcut.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.ui.launch;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Launch shortcut for launching JET transforms on an XML document.
- *
- */
-public class LaunchShortcut implements ILaunchShortcut {
-
- /**
- *
- */
- public LaunchShortcut() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String)
- */
- public void launch(ISelection selection, String mode) {
- // TODO Auto-generated method stub
- if(!(selection instanceof IStructuredSelection)) {
- return;
- }
- IResource resource = (IResource) ((IStructuredSelection)selection).getFirstElement();
- JETLaunchHelper.findAndLauchForResource(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- ILaunchManager.RUN_MODE, resource);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
- */
- public void launch(IEditorPart editor, String mode) {
- final IResource resource = (IResource) editor.getEditorInput().getAdapter(IResource.class);
- JETLaunchHelper.findAndLauchForResource(editor.getSite().getShell(), ILaunchManager.RUN_MODE, resource);
-// findAndLaunch(resource, mode);
-
- }
-
- public static String generateLaunchName(String id, IResource input)
- {
- return JETLaunchHelper.generateLaunchName(id, input, Messages.LaunchShortcut_DefaultLaunchName);
- }
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/popup/actions/UnloadAction.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/popup/actions/UnloadAction.java
deleted file mode 100644
index 3215591..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/popup/actions/UnloadAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 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
- *******************************************************************************/
-package org.eclipse.jet.internal.ui.popup.actions;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jet.internal.InternalJET2Platform;
-import org.eclipse.jet.internal.runtime.JETBundleInstaller;
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-public class UnloadAction implements IObjectActionDelegate, IActionDelegate {
-
- private String bundleName;
- /**
- * Constructor for Action1.
- */
- public UnloadAction() {
- super();
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- Shell shell = new Shell();
- final JETBundleInstaller mgr = InternalJET2Platform.getDefault().getJETBundleInstaller();
- Bundle bundle = Platform.getBundle(bundleName);
- final String DialogTitle = Messages.UnloadAction_DialogTitle;
- if(bundle != null) {
- try {
- mgr.uninstallBundle(bundle);
- MessageDialog.openInformation(
- shell,
- DialogTitle,
- MessageFormat.format(Messages.UnloadAction_UnloadSuccessful, new Object[] {bundleName}));
- } catch (BundleException e) {
- e.printStackTrace();
- MessageDialog.openInformation(
- shell,
- DialogTitle,
- MessageFormat.format(Messages.UnloadAction_UnloadFailed, new Object[] {bundleName, e.toString()}));
- }}
- else {
- MessageDialog.openInformation(
- shell,
- DialogTitle,
- MessageFormat.format(Messages.UnloadAction_NotLoaded, new Object[] {bundleName}));
-
- }
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- IStructuredSelection se = (IStructuredSelection) selection;
-
- final Object firstElement = se.getFirstElement();
- if(firstElement instanceof IProject) {
- IProject project = (IProject) firstElement;
- bundleName = project.getName();
- }
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java
deleted file mode 100644
index 8e0819c..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/CompilePreferencePage.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- * /
- *******************************************************************************/
-
-package org.eclipse.jet.internal.ui.prefs;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.core.compiler.JETCompilerOptions;
-import org.eclipse.jet.core.parser.ast.JETAST;
-import org.eclipse.jet.internal.JETPreferences;
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-
-/**
- * @author pelder
- *
- */
-public class CompilePreferencePage extends FieldEditorPreferencePage implements
- IWorkbenchPreferencePage, IWorkbenchPropertyPage {
-
- private IProject element;
- private StringFieldEditor packageFieldEditor;
- private ExtensionListEditor extFieldEditor;
- private StringFieldEditor srcFolderFieldEditor;
- private StringFieldEditor templatesFolderFieldEditor;
- private BooleanFieldEditor derivedJavaFieldEditor;
- private BooleanFieldEditor projectSpecificSettingsEditor = null;
- private RadioGroupFieldEditor jetVersionFieldEditor;
- private BooleanFieldEditor compileBaseTemplatesFieldEditor = null;
- private StringFieldEditor baseTransformationFieldEditor = null;
- private Composite javaGenerationGroup;
- private Composite v1OptionsGroup;
- private Composite v2OptionsGroup;
- private boolean v1OptionsEnabled;
- private BooleanFieldEditor useJava5FieldEditor;
-
- /**
- * @param style
- */
- public CompilePreferencePage() {
- super(GRID);
-// setDescription(Messages.CompilePreferencePage_Description);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
- */
- protected void createFieldEditors() {
-
- // determine whether the page is showing the workspace scope (Windows > Preferences)
- // or in project scope (Project properties)
- final boolean projectSettings = element != null;
- if(projectSettings) {
- setPreferenceStore(new ScopedPreferenceStore(new ProjectScope(element), JET2Platform.PLUGIN_ID));
- } else {
- setPreferenceStore(new ScopedPreferenceStore(new InstanceScope(), JET2Platform.PLUGIN_ID));
- }
-
- if(projectSettings) {
- // add a check box to use project specific settings
- projectSpecificSettingsEditor = new BooleanFieldEditor(JETPreferences.PROJECT_SPECIFIC_SETTINGS,
- Messages.CompilePreferencePage_EnableProjectSettings, getFieldEditorParent());
- addField(projectSpecificSettingsEditor);
- Label horizontalLine= new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL);
- horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- horizontalLine.setFont(getFieldEditorParent().getFont());
- }
-
- // create "global" option editors...
- jetVersionFieldEditor = new RadioGroupFieldEditor(JETCompilerOptions.OPTION_JET_SPECIFICATION_VERSION, Messages.CompilePreferencePage_JETComformanceGroupLabel, 1,
- new String[][] {
- {Messages.CompilePreferencePage_JET1_OPTION, String.valueOf(JETAST.JET_SPEC_V1)},
- {Messages.CompilePreferencePage_JET2_Option, String.valueOf(JETAST.JET_SPEC_V2)},
- },
- getFieldEditorParent(), true);
- addField(jetVersionFieldEditor);
-
- v1OptionsEnabled = getPreferenceStore().getInt(JETCompilerOptions.OPTION_JET_SPECIFICATION_VERSION) == JETAST.JET_SPEC_V1;
-
-
-
- // common generation group
- javaGenerationGroup = createGroup(Messages.CompilePreferencePage_JavaGenerationGroupLabel);
-
- srcFolderFieldEditor = new StringFieldEditor(JETCompilerOptions.OPTION_COMPILED_TEMPLATE_SRC_DIR,
- Messages.CompilePreferencePage_SourceFolder, javaGenerationGroup);
- addField(srcFolderFieldEditor);
-
- derivedJavaFieldEditor = new BooleanFieldEditor(JETCompilerOptions.OPTION_SET_JAVA_FILES_AS_DERIVED,
- Messages.CompilePreferencePage_DeriveJavaFiles, javaGenerationGroup);
- addField(derivedJavaFieldEditor);
-
- useJava5FieldEditor = new BooleanFieldEditor(JETCompilerOptions.OPTION_USE_JAVA5, Messages.CompilePreferencePage_use_java5, javaGenerationGroup);
- addField(useJava5FieldEditor);
-
- // v1 options group
- v1OptionsGroup = createGroup(Messages.CompilePreferencePage_JET1OptionsGroupLabel);
- templatesFolderFieldEditor = new StringFieldEditor(JETCompilerOptions.OPTION_V1_TEMPLATES_DIR,
- Messages.CompilePreferencePage_TemplatesDirLabel, v1OptionsGroup);
- addField(templatesFolderFieldEditor);
- if(projectSettings) {
- baseTransformationFieldEditor = new StringFieldEditor(JETCompilerOptions.OPTION_V1_BASE_TRANSFORMATION,
- Messages.CompilePreferencePage_BaseLocationsLabel,
- StringFieldEditor.UNLIMITED,
- StringFieldEditor.VALIDATE_ON_KEY_STROKE,
- v1OptionsGroup) {
- protected boolean doCheckState() {
- String trimmedValue = getStringValue().trim();
- return trimmedValue.length() == 0 || isValidURIList(trimmedValue);
- }
-
- };
- baseTransformationFieldEditor.setErrorMessage(Messages.CompilePreferencePage_InvalidBaseLocations);
- addField(baseTransformationFieldEditor);
-
- compileBaseTemplatesFieldEditor = new BooleanFieldEditor(JETCompilerOptions.OPTION_V1_COMPILE_BASE_TEMPLATES, Messages.CompilePreferencePage_CompileBaseTemplates, v1OptionsGroup);
- addField(compileBaseTemplatesFieldEditor);
-
- }
-
- // v2 options group
- v2OptionsGroup = createGroup(Messages.CompilePreferencePage_JET2_OPTIONS_GROUP_LABEL);
-
- extFieldEditor = new ExtensionListEditor(JETCompilerOptions.OPTION_TEMPLATE_EXT,
- Messages.CompilePreferencePage_FileExtensions, v2OptionsGroup);
- addField(extFieldEditor);
-
- packageFieldEditor = new StringFieldEditor(JETCompilerOptions.OPTION_COMPILED_TEMPLATE_PACKAGE,
- Messages.CompilePreferencePage_JavaPackage, v2OptionsGroup);
- addField(packageFieldEditor);
-
-
-
- }
-
- private boolean isValidURIList(String uriList) {
- String[] uriStrings = uriList.split(","); //$NON-NLS-1$
- boolean ok = true;
- for (int i = 0; i < uriStrings.length; i++) {
- try {
- new URI(uriStrings[i]);
- } catch (URISyntaxException e) {
- ok = false;
- }
- }
- return ok;
- }
-
- /**
- * @param groupTitle
- * @return
- */
- private Composite createGroup(final String groupTitle) {
-
- final Group group = new Group(getFieldEditorParent(), SWT.NONE);
- group.setFont(getFieldEditorParent().getFont());
- group.setText(groupTitle);
- group.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- setGroupLayout(group, 2);
-
- return group;
- }
-
- /**
- * @param group
- * @param numColumns TODO
- */
- private void setGroupLayout(final Composite group, int numColumns) {
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- group.setLayout(layout);
- }
-
- /**
- *
- */
- private void updateControlEnablement() {
- final boolean projectSettings = projectSpecificSettingsEditor != null;
- // enable "global" options
- boolean enabledGlobalSettings = !projectSettings || projectSpecificSettingsEditor.getBooleanValue();
- jetVersionFieldEditor.setEnabled(enabledGlobalSettings, getFieldEditorParent());
- srcFolderFieldEditor.setEnabled(enabledGlobalSettings, javaGenerationGroup);
- derivedJavaFieldEditor.setEnabled(enabledGlobalSettings, javaGenerationGroup);
- useJava5FieldEditor.setEnabled(enabledGlobalSettings, javaGenerationGroup);
- if(!enabledGlobalSettings) {
- srcFolderFieldEditor.loadDefault();
- derivedJavaFieldEditor.loadDefault();
- jetVersionFieldEditor.loadDefault();
- useJava5FieldEditor.loadDefault();
- }
-
- // Enable JET1 options
- if(projectSettings) {
- boolean enableV1Options = v1OptionsEnabled && enabledGlobalSettings;
- baseTransformationFieldEditor.setEnabled(enableV1Options, v1OptionsGroup);
- compileBaseTemplatesFieldEditor.setEnabled(enableV1Options, v1OptionsGroup);
- templatesFolderFieldEditor.setEnabled(enableV1Options, v1OptionsGroup);
- if(!enableV1Options) {
- baseTransformationFieldEditor.loadDefault();
- compileBaseTemplatesFieldEditor.loadDefault();
- templatesFolderFieldEditor.loadDefault();
- }
- }
-
- // Enable JET2 options
- if(projectSettings) {
- boolean enableV2Options = !v1OptionsEnabled && enabledGlobalSettings;
- extFieldEditor.setEnabled(enableV2Options, v2OptionsGroup);
- packageFieldEditor.setEnabled(enableV2Options, v2OptionsGroup);
- if(!enableV2Options) {
- extFieldEditor.loadDefault();
- packageFieldEditor.loadDefault();
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-
- public IAdaptable getElement() {
- return element;
- }
-
- public void setElement(IAdaptable element) {
- this.element = (IProject)element;
- }
-
- protected void initialize() {
- super.initialize();
- if(projectSpecificSettingsEditor != null)
- {
- updateControlEnablement();
- }
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- super.propertyChange(event);
- if(event.getSource() == projectSpecificSettingsEditor && FieldEditor.VALUE.equals(event.getProperty())) {
- updateControlEnablement();
- } else if(event.getSource() == jetVersionFieldEditor && FieldEditor.VALUE.equals(event.getProperty())) {
- v1OptionsEnabled = String.valueOf(JETAST.JET_SPEC_V1).equals(event.getNewValue());
- updateControlEnablement();
- }
- }
-
- protected void performDefaults() {
- super.performDefaults();
- if (projectSpecificSettingsEditor != null) {
- updateControlEnablement();
- }
-
- }
-
- public boolean performOk() {
- final boolean ok = super.performOk();
- if(ok) {
- try {
- if(element != null)
- {
- element.build(IncrementalProjectBuilder.CLEAN_BUILD, null);
- }
- else
- {
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, null);
- }
- } catch (CoreException e) {
- // build failed, we don't care
- }
- }
- return ok;
- }
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java
deleted file mode 100644
index 2130113..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/ExtensionListEditor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2006 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.ui.prefs;
-
-import java.util.regex.Pattern;
-
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.preference.ListEditor;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * @author pelder
- *
- */
-public class ExtensionListEditor extends ListEditor {
-
- /**
- *
- */
- public ExtensionListEditor(String name, String labelText, Composite parent) {
- init(name, labelText);
- createControl(parent);
- }
-
- protected String createList(String[] items) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < items.length; i++) {
- if(i != 0)
- {
- buffer.append(","); //$NON-NLS-1$
- }
- buffer.append(items[i]);
- }
- return buffer.toString();
- }
-
- protected String getNewInputObject() {
- InputDialog dialog = new InputDialog(getShell(), Messages.ExtensionListEditor_AddDialogTitle, Messages.ExtensionListEditor_AddDialogPrompt, "", new IInputValidator() { //$NON-NLS-1$
-
- public String isValid(String newText) {
- return !Pattern.matches("(\\p{L}|\\d)+", newText) ? //$NON-NLS-1$
- Messages.ExtensionListEditor_AddDialogErrorMsg : null;
- }});
- final int result = dialog.open();
- return result == InputDialog.OK ? dialog.getValue() : null;
- }
-
- protected String[] parseString(String stringList) {
- return stringList.split(","); //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java b/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java
deleted file mode 100644
index bf47b66..0000000
--- a/plugins/org.eclipse.jet.ui/src/org/eclipse/jet/internal/ui/prefs/JETPreferencePage.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * 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 - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- * /
- *******************************************************************************/
-
-package org.eclipse.jet.internal.ui.prefs;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.JETPreferences;
-import org.eclipse.jet.internal.ui.l10n.Messages;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.PathEditor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
-
-/**
- * @author pelder
- *
- */
-public class JETPreferencePage extends FieldEditorPreferencePage implements
- IWorkbenchPreferencePage, IWorkbenchPropertyPage {
-
- private IAdaptable element;
-
- /**
- * @param style
- */
- public JETPreferencePage() {
- super(GRID);
-
-// setDescription(Messages.JETPreferencePage_Description);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
- */
- protected void createFieldEditors() {
- if(element != null)
- {
- setPreferenceStore(new ScopedPreferenceStore(new ProjectScope((IProject)element), JET2Platform.PLUGIN_ID));
- }
- else {
- setPreferenceStore(new ScopedPreferenceStore(new InstanceScope(), JET2Platform.PLUGIN_ID));
- }
- addField(new PathEditor(JETPreferences.ADDITIONAL_TEMPLATE_JAR_LOCATIONS,
- Messages.JETPreferencePage_LocationsLabel,
- Messages.JETPreferencePage_LocationsAddDialogTitle,
- getFieldEditorParent()));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- // TODO Auto-generated method stub
-
- }
-
- public IAdaptable getElement() {
- return element;
- }
-
- public void setElement(IAdaptable element) {
- this.element = element;
- }
-
-}

Back to the top