/**
* Returns the resource bundle for the plug-in
*/
- public static ResourceBundle getResourceBundle() {
- return bundle;
- }
+// public static ResourceBundle getResourceBundle() {
+// return bundle;
+// }
}
+++ /dev/null
-package net.sourceforge.phpdt.externaltools.internal.model;
-
-/**********************************************************************
- Copyright (c) 2002 IBM Corp. and others. All rights reserved.
- This file is made available under the terms of the Common Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/cpl-v10.html
- �
- Contributors:
- **********************************************************************/
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Utility class which helps managing messages
- */
-public final class ToolMessages {
- private static final String RESOURCE_BUNDLE = "net.sourceforge.phpdt.externaltools.internal.model.messages"; //$NON-NLS-1$
-
- private static ResourceBundle bundle = ResourceBundle
- .getBundle(RESOURCE_BUNDLE);
-
- private ToolMessages() {
- // prevent instantiation of class
- }
-
- /**
- * Returns the formatted message for the given key in the resource bundle.
- *
- * @param key
- * the message name
- * @param args
- * the message arguments
- * @return the formatted message
- */
- public static String format(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
- }
-
- /**
- * Returns the message with the given key in the resource bundle. If there
- * isn't any value under the given key, the key is returned.
- *
- * @param key
- * the message name
- * @return the message
- */
- public static String getString(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the resource bundle for the plug-in
- */
- public static ResourceBundle getResourceBundle() {
- return bundle;
- }
-}
http://www.eclipse.org/legal/cpl-v10.html
**********************************************************************/
-import java.util.Map;
+//import java.util.Map;
import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
+//import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder;
+//import org.eclipse.ui.externaltools.internal.model.ExternalToolBuilder;
/**
* Maintains the context used to expand variables. The context is based on the
* @param kind
* @see ExternalToolBuilder#build(int, Map, IProgressMonitor)
*/
- public void buildStarted(IProject project, int kind) {
- fBuilding = true;
- fProject = project;
- fKind = kind;
- }
+// public void buildStarted(IProject project, int kind) {
+// fBuilding = true;
+// fProject = project;
+// fKind = kind;
+// }
/**
* Notification the building the current project has completed.
*
* @see ExternalToolBuilder#build(int, Map, IProgressMonitor)
*/
- public void buildEnded() {
- fBuilding = false;
- fProject = null;
- }
+// public void buildEnded() {
+// fBuilding = false;
+// fProject = null;
+// }
}
Contributors:
**********************************************************************/
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
+//import java.io.File;
+//import java.io.FileInputStream;
+//import java.io.FileNotFoundException;
+//import java.io.IOException;
+//import java.io.InputStreamReader;
import java.util.ArrayList;
-import java.util.HashMap;
+//import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants;
import net.sourceforge.phpdt.externaltools.model.ToolUtil;
-import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
+//import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
+//import org.eclipse.core.runtime.IPath;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
+//import org.eclipse.ui.IMemento;
+//import org.eclipse.ui.WorkbenchException;
+//import org.eclipse.ui.XMLMemento;
/**
* Responsible reading an old external tool format and creating and migrating it
public final class ExternalToolMigration {
//private static final String SEPERATOR = ";"; //$NON-NLS-1$
- private static final String STATE_FILE_NAME_OLD = "oldexternaltools.xml"; //$NON-NLS-1$
+ //private static final String STATE_FILE_NAME_OLD = "oldexternaltools.xml"; //$NON-NLS-1$
- private static final String STATE_FILE_NAME = "externaltools.xml"; //$NON-NLS-1$
+ //private static final String STATE_FILE_NAME = "externaltools.xml"; //$NON-NLS-1$
//private static final String TAG_EXTERNALTOOLS = "externaltools"; //$NON-NLS-1$
- private static final String TAG_TOOL = "tool"; //$NON-NLS-1$
+ //private static final String TAG_TOOL = "tool"; //$NON-NLS-1$
- private static final String TAG_ENTRY = "entry"; //$NON-NLS-1$
+ //private static final String TAG_ENTRY = "entry"; //$NON-NLS-1$
// private static final String TAG_KEY = "key"; //$NON-NLS-1$
// private static final String TAG_VALUE = "value"; //$NON-NLS-1$
private static final String TAG_EXTRA_ATTR = "extraAttribute"; //$NON-NLS-1$
- private static final String TAG_KEY = "key"; //$NON-NLS-1$
+ //private static final String TAG_KEY = "key"; //$NON-NLS-1$
private static final String TAG_VERSION = "version"; //$NON-NLS-1$
// private static void readIn21Tools() {
// }
- public static void readIn20Tools() {
- boolean migrationSuccessful = true;
- IPath path = ExternalToolsPlugin.getDefault().getStateLocation();
- File file = path.append(STATE_FILE_NAME).toFile();
- if (!file.exists())
- return;
-
- InputStreamReader reader = null;
- try {
- FileInputStream input = new FileInputStream(file);
- reader = new InputStreamReader(input, "utf-8"); //$NON-NLS-1$
- XMLMemento memento = XMLMemento.createReadRoot(reader);
-
- // Get the external tool children element
- IMemento[] tools = memento.getChildren(TAG_TOOL);
- for (int i = 0; i < tools.length; i++) {
- HashMap args = new HashMap();
- IMemento[] entries = tools[i].getChildren(TAG_ENTRY);
- for (int j = 0; j < entries.length; j++) {
- String key = entries[j].getString(TAG_KEY);
- if (key != null) {
- String value = entries[j].getTextData();
- args.put(key, value);
- }
- }
- ILaunchConfigurationWorkingCopy config = configFromArgumentMap(args);
- if (config != null) {
- try {
- config.doSave();
- } catch (CoreException e) {
- // TODO: Decide what to do when saving fails.
- }
- }
- }
- } catch (FileNotFoundException e) {
- // Silently ignore this...
- } catch (IOException e) {
- ExternalToolsPlugin.getDefault().log(
- "File I/O error with reading old external tools.", e);
- migrationSuccessful = false;
- } catch (WorkbenchException e) {
- ExternalToolsPlugin.getDefault().getLog().log(e.getStatus());
- System.err
- .println("Error reading old external tools. See .log file for more details");
- migrationSuccessful = false;
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (IOException e) {
- ExternalToolsPlugin.getDefault().log(
- "Unable to close external tool old state reader.",
- e);
- }
- }
- }
-
- if (migrationSuccessful) {
- if (!file.renameTo(path.append(STATE_FILE_NAME_OLD).toFile())) {
- ExternalToolsPlugin
- .getDefault()
- .log(
- "Unable to rename old external tool state file. Please rename externaltools.xml to oldexternaltools.xml manually.",
- null);
- System.err
- .println("Unable to rename old external tool state file. Please rename externaltools.xml to oldexternaltools.xml manually.");
- }
- }
- }
+// public static void readIn20Tools() {
+// boolean migrationSuccessful = true;
+// IPath path = ExternalToolsPlugin.getDefault().getStateLocation();
+// File file = path.append(STATE_FILE_NAME).toFile();
+// if (!file.exists())
+// return;
+//
+// InputStreamReader reader = null;
+// try {
+// FileInputStream input = new FileInputStream(file);
+// reader = new InputStreamReader(input, "utf-8"); //$NON-NLS-1$
+// XMLMemento memento = XMLMemento.createReadRoot(reader);
+//
+// // Get the external tool children element
+// IMemento[] tools = memento.getChildren(TAG_TOOL);
+// for (int i = 0; i < tools.length; i++) {
+// HashMap args = new HashMap();
+// IMemento[] entries = tools[i].getChildren(TAG_ENTRY);
+// for (int j = 0; j < entries.length; j++) {
+// String key = entries[j].getString(TAG_KEY);
+// if (key != null) {
+// String value = entries[j].getTextData();
+// args.put(key, value);
+// }
+// }
+// ILaunchConfigurationWorkingCopy config = configFromArgumentMap(args);
+// if (config != null) {
+// try {
+// config.doSave();
+// } catch (CoreException e) {
+// // TODO: Decide what to do when saving fails.
+// }
+// }
+// }
+// } catch (FileNotFoundException e) {
+// // Silently ignore this...
+// } catch (IOException e) {
+// ExternalToolsPlugin.getDefault().log(
+// "File I/O error with reading old external tools.", e);
+// migrationSuccessful = false;
+// } catch (WorkbenchException e) {
+// ExternalToolsPlugin.getDefault().getLog().log(e.getStatus());
+// System.err
+// .println("Error reading old external tools. See .log file for more details");
+// migrationSuccessful = false;
+// } finally {
+// if (reader != null) {
+// try {
+// reader.close();
+// } catch (IOException e) {
+// ExternalToolsPlugin.getDefault().log(
+// "Unable to close external tool old state reader.",
+// e);
+// }
+// }
+// }
+//
+// if (migrationSuccessful) {
+// if (!file.renameTo(path.append(STATE_FILE_NAME_OLD).toFile())) {
+// ExternalToolsPlugin
+// .getDefault()
+// .log(
+// "Unable to rename old external tool state file. Please rename externaltools.xml to oldexternaltools.xml manually.",
+// null);
+// System.err
+// .println("Unable to rename old external tool state file. Please rename externaltools.xml to oldexternaltools.xml manually.");
+// }
+// }
+// }
/**
* Returns a launch configuration working copy from the argument map or
* Returns the tool name extracted from the given command argument map.
* Extraction is attempted using 2.0 and 2.1 external tool formats.
*/
- public static String getNameFromCommandArgs(Map commandArgs) {
- String name = (String) commandArgs.get(TAG_NAME);
- if (name == null) {
- name = (String) commandArgs.get(TAG_TOOL_NAME);
- }
- return name;
- }
+// public static String getNameFromCommandArgs(Map commandArgs) {
+// String name = (String) commandArgs.get(TAG_NAME);
+// if (name == null) {
+// name = (String) commandArgs.get(TAG_TOOL_NAME);
+// }
+// return name;
+// }
}
/**
* Returns the list of path location variables in the registry.
*/
- public PathLocationVariable[] getPathLocationVariables() {
- PathLocationVariable[] results = new PathLocationVariable[getVariableCount()];
- copyVariables(results);
- return results;
- }
+// public PathLocationVariable[] getPathLocationVariables() {
+// PathLocationVariable[] results = new PathLocationVariable[getVariableCount()];
+// copyVariables(results);
+// return results;
+// }
/*
* (non-Javadoc) Method declared on ExternalToolVariableRegistry.
* if true, case is ignored. If the pattern argument is
* <code>null</code>, this argument is ignored.
*/
- public void setFileFilter(String pattern, boolean ignoreCase) {
- if (pattern != null) {
- stringMatcher = new StringMatcher(pattern, ignoreCase, false);
- } else {
- stringMatcher = null;
- }
- }
+// public void setFileFilter(String pattern, boolean ignoreCase) {
+// if (pattern != null) {
+// stringMatcher = new StringMatcher(pattern, ignoreCase, false);
+// } else {
+// stringMatcher = null;
+// }
+// }
/*
* (non-Javadoc) Method declared in Window.
* @return <code>true</code> if the user presses the OK button,
* <code>false</code> otherwise
*/
- public static boolean openConfirm(Shell parent, String title,
- String message, String preferenceKey, String toggleMessage,
- IPreferenceStore store) {
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
- title, null, // accept the default window icon
- message, QUESTION, new String[] { IDialogConstants.OK_LABEL,
- IDialogConstants.CANCEL_LABEL }, 0, // OK is the default
- preferenceKey, toggleMessage, store);
- return dialog.open() == 0;
- }
+// public static boolean openConfirm(Shell parent, String title,
+// String message, String preferenceKey, String toggleMessage,
+// IPreferenceStore store) {
+// MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
+// title, null, // accept the default window icon
+// message, QUESTION, new String[] { IDialogConstants.OK_LABEL,
+// IDialogConstants.CANCEL_LABEL }, 0, // OK is the default
+// preferenceKey, toggleMessage, store);
+// return dialog.open() == 0;
+// }
/**
* Convenience method to open a standard error dialog.
* @param message
* the message
*/
- public static void openError(Shell parent, String title, String message,
- String preferenceKey, String toggleMessage, IPreferenceStore store) {
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
- title, null, // accept the default window icon
- message, ERROR, new String[] { IDialogConstants.OK_LABEL }, 0, // ok
- // is
- // the
- // default
- preferenceKey, toggleMessage, store);
- dialog.open();
- }
+// public static void openError(Shell parent, String title, String message,
+// String preferenceKey, String toggleMessage, IPreferenceStore store) {
+// MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
+// title, null, // accept the default window icon
+// message, ERROR, new String[] { IDialogConstants.OK_LABEL }, 0, // ok
+// // is
+// // the
+// // default
+// preferenceKey, toggleMessage, store);
+// dialog.open();
+// }
/**
* Convenience method to open a standard information dialog.
* @param message
* the message
*/
- public static void openInformation(Shell parent, String title,
- String message, String preferenceKey, String toggleMessage,
- IPreferenceStore store) {
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
- title,
- null, // accept the default window icon
- message, INFORMATION,
- new String[] { IDialogConstants.OK_LABEL }, 0, // ok is the
- // default
- preferenceKey, toggleMessage, store);
- dialog.open();
- }
+// public static void openInformation(Shell parent, String title,
+// String message, String preferenceKey, String toggleMessage,
+// IPreferenceStore store) {
+// MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
+// title,
+// null, // accept the default window icon
+// message, INFORMATION,
+// new String[] { IDialogConstants.OK_LABEL }, 0, // ok is the
+// // default
+// preferenceKey, toggleMessage, store);
+// dialog.open();
+// }
/**
* Convenience method to open a simple Yes/No question dialog.
* @return <code>true</code> if the user presses the OK button,
* <code>false</code> otherwise
*/
- public static boolean openQuestion(Shell parent, String title,
- String message, String preferenceKey, String toggleMessage,
- IPreferenceStore store) {
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
- title, null, // accept the default window icon
- message, QUESTION, new String[] { IDialogConstants.YES_LABEL,
- IDialogConstants.NO_LABEL }, 0, // yes is the default
- preferenceKey, toggleMessage, store);
- return dialog.open() == 0;
- }
+// public static boolean openQuestion(Shell parent, String title,
+// String message, String preferenceKey, String toggleMessage,
+// IPreferenceStore store) {
+// MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
+// title, null, // accept the default window icon
+// message, QUESTION, new String[] { IDialogConstants.YES_LABEL,
+// IDialogConstants.NO_LABEL }, 0, // yes is the default
+// preferenceKey, toggleMessage, store);
+// return dialog.open() == 0;
+// }
/**
* Convenience method to open a standard warning dialog.
* @param message
* the message
*/
- public static void openWarning(Shell parent, String title, String message,
- String preferenceKey, String toggleMessage, IPreferenceStore store) {
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
- title,
- null, // accept the default window icon
- message, WARNING, new String[] { IDialogConstants.OK_LABEL },
- 0, // ok is the default
- preferenceKey, toggleMessage, store);
- dialog.open();
- }
+// public static void openWarning(Shell parent, String title, String message,
+// String preferenceKey, String toggleMessage, IPreferenceStore store) {
+// MessageDialogWithToggle dialog = new MessageDialogWithToggle(parent,
+// title,
+// null, // accept the default window icon
+// message, WARNING, new String[] { IDialogConstants.OK_LABEL },
+// 0, // ok is the default
+// preferenceKey, toggleMessage, store);
+// dialog.open();
+// }
}
/**
* Returns if the status' severity is WARNING.
*/
- public boolean isWarning() {
- return fSeverity == IStatus.WARNING;
- }
+// public boolean isWarning() {
+// return fSeverity == IStatus.WARNING;
+// }
/**
* Returns if the status' severity is INFO.
*/
- public boolean isInfo() {
- return fSeverity == IStatus.INFO;
- }
+// public boolean isInfo() {
+// return fSeverity == IStatus.INFO;
+// }
/**
* Returns if the status' severity is ERROR.
*/
- public boolean isError() {
- return fSeverity == IStatus.ERROR;
- }
+// public boolean isError() {
+// return fSeverity == IStatus.ERROR;
+// }
/**
* @see IStatus#getMessage
* @param The
* warning message (can be empty, but not null)
*/
- public void setWarning(String warningMessage) {
- Assert.isNotNull(warningMessage);
- fStatusMessage = warningMessage;
- fSeverity = IStatus.WARNING;
- }
+// public void setWarning(String warningMessage) {
+// Assert.isNotNull(warningMessage);
+// fStatusMessage = warningMessage;
+// fSeverity = IStatus.WARNING;
+// }
/**
* Sets the status to INFO.
* @param The
* info message (can be empty, but not null)
*/
- public void setInfo(String infoMessage) {
- Assert.isNotNull(infoMessage);
- fStatusMessage = infoMessage;
- fSeverity = IStatus.INFO;
- }
+// public void setInfo(String infoMessage) {
+// Assert.isNotNull(infoMessage);
+// fStatusMessage = infoMessage;
+// fSeverity = IStatus.INFO;
+// }
/**
* Sets the status to OK.
*/
- public void setOK() {
- fStatusMessage = null;
- fSeverity = IStatus.OK;
- }
+// public void setOK() {
+// fStatusMessage = null;
+// fSeverity = IStatus.OK;
+// }
/*
* @see IStatus#matches(int)
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+//import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
/**
* This method must be called just before this window becomes visible.
*/
- public void aboutToOpen() {
- currentTreeSelection = null;
-
- // select the first element in the list
- Object[] elements = treeContentProvider.getElements(root);
- Object primary = elements.length > 0 ? elements[0] : null;
- if (primary != null) {
- treeViewer.setSelection(new StructuredSelection(primary));
- }
- treeViewer.getControl().setFocus();
- }
+// public void aboutToOpen() {
+// currentTreeSelection = null;
+//
+// // select the first element in the list
+// Object[] elements = treeContentProvider.getElements(root);
+// Object primary = elements.length > 0 ? elements[0] : null;
+// if (primary != null) {
+// treeViewer.setSelection(new StructuredSelection(primary));
+// }
+// treeViewer.getControl().setFocus();
+// }
/**
* Add the passed listener to collection of clients that listen for changes
}
}
- protected void initialListItem(Object element) {
- Object parent = treeContentProvider.getParent(element);
- selectAndRevealFolder(parent);
- }
+// protected void initialListItem(Object element) {
+// Object parent = treeContentProvider.getParent(element);
+// selectAndRevealFolder(parent);
+// }
- public void selectAndRevealFolder(Object treeElement) {
- treeViewer.reveal(treeElement);
- IStructuredSelection selection = new StructuredSelection(treeElement);
- treeViewer.setSelection(selection);
- }
+// public void selectAndRevealFolder(Object treeElement) {
+// treeViewer.reveal(treeElement);
+// IStructuredSelection selection = new StructuredSelection(treeElement);
+// treeViewer.setSelection(selection);
+// }
- public void selectAndRevealFile(Object treeElement) {
- listViewer.reveal(treeElement);
- IStructuredSelection selection = new StructuredSelection(treeElement);
- listViewer.setSelection(selection);
- }
+// public void selectAndRevealFile(Object treeElement) {
+// listViewer.reveal(treeElement);
+// IStructuredSelection selection = new StructuredSelection(treeElement);
+// listViewer.setSelection(selection);
+// }
/**
* Initialize this group's viewers after they have been laid out.
* @param labelProvider
* ILabelProvider
*/
- public void setListProviders(IStructuredContentProvider contentProvider,
- ILabelProvider labelProvider) {
- listViewer.setContentProvider(contentProvider);
- listViewer.setLabelProvider(labelProvider);
- }
+// public void setListProviders(IStructuredContentProvider contentProvider,
+// ILabelProvider labelProvider) {
+// listViewer.setContentProvider(contentProvider);
+// listViewer.setLabelProvider(labelProvider);
+// }
/**
* Set the sorter that is to be applied to self's list viewer
*/
- public void setListSorter(ViewerSorter sorter) {
- listViewer.setSorter(sorter);
- }
+// public void setListSorter(ViewerSorter sorter) {
+// listViewer.setSorter(sorter);
+// }
/**
* Set the root of the widget to be new Root. Regenerate all of the tables
*
* @param newRoot
*/
- public void setRoot(Object newRoot) {
- this.root = newRoot;
- initialize();
- }
+// public void setRoot(Object newRoot) {
+// this.root = newRoot;
+// initialize();
+// }
/**
* Set the tree viewer's providers to those passed
* @param labelProvider
* ILabelProvider
*/
- public void setTreeProviders(ITreeContentProvider contentProvider,
- ILabelProvider labelProvider) {
- treeViewer.setContentProvider(contentProvider);
- treeViewer.setLabelProvider(labelProvider);
- }
+// public void setTreeProviders(ITreeContentProvider contentProvider,
+// ILabelProvider labelProvider) {
+// treeViewer.setContentProvider(contentProvider);
+// treeViewer.setLabelProvider(labelProvider);
+// }
/**
* Set the sorter that is to be applied to self's tree viewer
*/
- public void setTreeSorter(ViewerSorter sorter) {
- treeViewer.setSorter(sorter);
- }
+// public void setTreeSorter(ViewerSorter sorter) {
+// treeViewer.setSorter(sorter);
+// }
/**
* Set the focus on to the list widget.
*/
- public void setFocus() {
-
- this.treeViewer.getTree().setFocus();
- }
-
- public void setAllowMultiselection(boolean allowMultiselection) {
- this.allowMultiselection = allowMultiselection;
-
- }
+// public void setFocus() {
+//
+// this.treeViewer.getTree().setFocus();
+// }
+
+// public void setAllowMultiselection(boolean allowMultiselection) {
+// this.allowMultiselection = allowMultiselection;
+//
+// }
}
import java.io.File;
import java.text.MessageFormat;
-import java.util.Map;
+//import java.util.Map;
import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages;
import net.sourceforge.phpdt.externaltools.internal.model.VariableContextManager;
-import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolMigration;
+//import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolMigration;
import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariable;
import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariableRegistry;
import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants;
*/
public class ExternalToolsUtil {
- private static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$
+ //private static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$
/**
* Not to be instantiated.
* @return a launch configuration, a launch configuration working copy, or
* <code>null</code> if not possible.
*/
- public static ILaunchConfiguration configFromBuildCommandArgs(
- Map commandArgs) {
- String configHandle = (String) commandArgs.get(LAUNCH_CONFIG_HANDLE);
- if (configHandle == null) {
- // Probably an old-style external tool. Try to migrate.
- return ExternalToolMigration.configFromArgumentMap(commandArgs);
- }
- try {
- return DebugPlugin.getDefault().getLaunchManager()
- .getLaunchConfiguration(configHandle);
- } catch (CoreException e) {
- return null;
- }
- }
+// public static ILaunchConfiguration configFromBuildCommandArgs(
+// Map commandArgs) {
+// String configHandle = (String) commandArgs.get(LAUNCH_CONFIG_HANDLE);
+// if (configHandle == null) {
+// // Probably an old-style external tool. Try to migrate.
+// return ExternalToolMigration.configFromArgumentMap(commandArgs);
+// }
+// try {
+// return DebugPlugin.getDefault().getLaunchManager()
+// .getLaunchConfiguration(configHandle);
+// } catch (CoreException e) {
+// return null;
+// }
+// }
/**
* Executes an external progam and saves the LaunchConfiguration under
* if true, wild cards and their escape sequences are ignored
* (everything is taken literally).
*/
- public StringMatcher(String pattern, boolean ignoreCase,
- boolean ignoreWildCards) {
- if (pattern == null)
- throw new IllegalArgumentException();
- fIgnoreCase = ignoreCase;
- fIgnoreWildCards = ignoreWildCards;
- fPattern = pattern;
- fLength = pattern.length();
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
+// public StringMatcher(String pattern, boolean ignoreCase,
+// boolean ignoreWildCards) {
+// if (pattern == null)
+// throw new IllegalArgumentException();
+// fIgnoreCase = ignoreCase;
+// fIgnoreWildCards = ignoreWildCards;
+// fPattern = pattern;
+// fLength = pattern.length();
+//
+// if (fIgnoreWildCards) {
+// parseNoWildCards();
+// } else {
+// parseWildCards();
+// }
+// }
/**
* Find the first occurrence of the pattern between
* Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
* is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
*/
- public StringMatcher.Position find(String text, int start, int end) {
- if (text == null)
- throw new IllegalArgumentException();
-
- int tlen = text.length();
- if (start < 0)
- start = 0;
- if (end > tlen)
- end = tlen;
- if (end < 0 || start >= end)
- return null;
- if (fLength == 0)
- return new Position(start, start);
- if (fIgnoreWildCards) {
- int x = posIn(text, start, end);
- if (x < 0)
- return null;
- return new Position(x, x + fLength);
- }
-
- int segCount = fSegments.length;
- if (segCount == 0)// pattern contains only '*'(s)
- return new Position(start, end);
-
- int curPos = start;
- int matchStart = -1;
- int i;
- for (i = 0; i < segCount && curPos < end; ++i) {
- String current = fSegments[i];
- int nextMatch = regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0)
- return null;
- if (i == 0)
- matchStart = nextMatch;
- curPos = nextMatch + current.length();
- }
- if (i < segCount)
- return null;
- return new Position(matchStart, curPos);
- }
+// public StringMatcher.Position find(String text, int start, int end) {
+// if (text == null)
+// throw new IllegalArgumentException();
+//
+// int tlen = text.length();
+// if (start < 0)
+// start = 0;
+// if (end > tlen)
+// end = tlen;
+// if (end < 0 || start >= end)
+// return null;
+// if (fLength == 0)
+// return new Position(start, start);
+// if (fIgnoreWildCards) {
+// int x = posIn(text, start, end);
+// if (x < 0)
+// return null;
+// return new Position(x, x + fLength);
+// }
+//
+// int segCount = fSegments.length;
+// if (segCount == 0)// pattern contains only '*'(s)
+// return new Position(start, end);
+//
+// int curPos = start;
+// int matchStart = -1;
+// int i;
+// for (i = 0; i < segCount && curPos < end; ++i) {
+// String current = fSegments[i];
+// int nextMatch = regExpPosIn(text, curPos, end, current);
+// if (nextMatch < 0)
+// return null;
+// if (i == 0)
+// matchStart = nextMatch;
+// curPos = nextMatch + current.length();
+// }
+// if (i < segCount)
+// return null;
+// return new Position(matchStart, curPos);
+// }
/**
* match the given <code>text</code> with the pattern
* @return the starting index in the text of the pattern , or -1 if not
* found
*/
- protected int posIn(String text, int start, int end) {// no wild card in
- // pattern
- int max = end - fLength;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(fPattern, start);
- if (i == -1 || i > max)
- return -1;
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength))
- return i;
- }
-
- return -1;
- }
+// protected int posIn(String text, int start, int end) {// no wild card in
+// // pattern
+// int max = end - fLength;
+//
+// if (!fIgnoreCase) {
+// int i = text.indexOf(fPattern, start);
+// if (i == -1 || i > max)
+// return -1;
+// return i;
+// }
+//
+// for (int i = start; i <= max; ++i) {
+// if (text.regionMatches(true, i, fPattern, 0, fLength))
+// return i;
+// }
+//
+// return -1;
+// }
/**
* @param <code>text</code>, a simple regular expression that may only
package net.sourceforge.phpdt.externaltools.preferences;
-import java.text.MessageFormat;
+//import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
* @param key
* the string used to get the bundle value, must not be null
*/
- public static String getFormattedString(String key, Object arg) {
- return MessageFormat.format(getString(key), new Object[] { arg });
- }
+// public static String getFormattedString(String key, Object arg) {
+// return MessageFormat.format(getString(key), new Object[] { arg });
+// }
/**
* Gets a string from the resource bundle and formats it with arguments
*/
- public static String getFormattedString(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
- }
+// public static String getFormattedString(String key, Object[] args) {
+// return MessageFormat.format(getString(key), args);
+// }
}
import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariableRegistry;
import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants;
-import org.eclipse.core.runtime.CoreException;
+//import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbenchWindow;
+//import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/**
* This version is recommended for eclipse3.0 and above
*/
- public ExternalToolsPlugin() {
- super();
- plugin = this;
- }
+// public ExternalToolsPlugin() {
+// super();
+// plugin = this;
+// }
/**
* Returns the default instance of the receiver. This represents the runtime
/**
* Returns a new <code>CoreException</code> for this plug-in
*/
- public static CoreException newError(String message, Throwable exception) {
- return new CoreException(new Status(Status.ERROR,
- IExternalToolConstants.PLUGIN_ID, 0, message, exception));
- }
+// public static CoreException newError(String message, Throwable exception) {
+// return new CoreException(new Status(Status.ERROR,
+// IExternalToolConstants.PLUGIN_ID, 0, message, exception));
+// }
/**
* Returns the registry of refresh scope variables.
IPreferenceConstants.CONSOLE_DEBUG_RGB, new RGB(0, 0, 0)); // black
}
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return ExternalToolsPlugin.getDefault().getWorkbench()
- .getActiveWorkbenchWindow();
- }
+// public static IWorkbenchWindow getActiveWorkbenchWindow() {
+// return ExternalToolsPlugin.getDefault().getWorkbench()
+// .getActiveWorkbenchWindow();
+// }
/**
* Returns the standard display to be used. The method first checks, if the
import java.io.IOException;
import java.io.InputStream;
-import org.eclipse.swt.graphics.Color;
+//import org.eclipse.swt.graphics.Color;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.MessageConsole;
/**
* @return
*/
- public Color getColor() {
- return stream.getColor();
- }
+// public Color getColor() {
+// return stream.getColor();
+// }
/**
* @return
/**
*
*/
- public void println() {
- //hasMessages = true;
- stream.println();
- }
+// public void println() {
+// //hasMessages = true;
+// stream.println();
+// }
/**
* @param message
/**
* @param color
*/
- public void setColor(Color color) {
- stream.setColor(color);
- }
+// public void setColor(Color color) {
+// stream.setColor(color);
+// }
// public void reportError(String title, String message) {
// if (hasMessages) {