This commit was manufactured by cvs2svn to create tag 'v20040616'.
Sprout from master 2004-06-16 13:34:17 UTC Darin Wright <darin> '*** empty log message ***'
Delete:
org.eclipse.core.variables/.classpath
org.eclipse.core.variables/.cvsignore
org.eclipse.core.variables/.options
org.eclipse.core.variables/.project
org.eclipse.core.variables/about.html
org.eclipse.core.variables/build.properties
org.eclipse.core.variables/plugin.properties
org.eclipse.core.variables/plugin.xml
org.eclipse.core.variables/schema/dynamicVariables.exsd
org.eclipse.core.variables/schema/valueVariables.exsd
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java
org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties
org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java
org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java
org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java
org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java
org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java
org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java
org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java
org.eclipse.core.variables/src/org/eclipse/core/variables/package.html
org.eclipse.ui.console/.classpath
org.eclipse.ui.console/.cvsignore
org.eclipse.ui.console/.options
org.eclipse.ui.console/.project
org.eclipse.ui.console/about.html
org.eclipse.ui.console/build.properties
org.eclipse.ui.console/hglegal2003.htm
org.eclipse.ui.console/icons/full/clcl16/clear_co.gif
org.eclipse.ui.console/icons/full/clcl16/pin.gif
org.eclipse.ui.console/icons/full/cview16/console_view.gif
org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif
org.eclipse.ui.console/icons/full/dlcl16/pin.gif
org.eclipse.ui.console/icons/full/elcl16/clear_co.gif
org.eclipse.ui.console/icons/full/elcl16/pin.gif
org.eclipse.ui.console/icons/full/eview16/console_view.gif
org.eclipse.ui.console/ngibmcpy2003.gif
org.eclipse.ui.console/plugin.properties
org.eclipse.ui.console/plugin.xml
org.eclipse.ui.console/scripts/exportplugin.xml
org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java
org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java
org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java
org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java
org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java
org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java
org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java
org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java
org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java
org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java
org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java
org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html
org.eclipse.ui.console/src/org/eclipse/ui/console/package.html
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePage.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartition.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartitioner.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsoleViewer.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java
org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java
diff --git a/org.eclipse.core.variables/.classpath b/org.eclipse.core.variables/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/org.eclipse.core.variables/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.core.variables/.cvsignore b/org.eclipse.core.variables/.cvsignore
deleted file mode 100644
index 6938697..0000000
--- a/org.eclipse.core.variables/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-doc
diff --git a/org.eclipse.core.variables/.options b/org.eclipse.core.variables/.options
deleted file mode 100644
index 34a7de8..0000000
--- a/org.eclipse.core.variables/.options
+++ /dev/null
@@ -1 +0,0 @@
-# Debugging options for the org.eclipse.core.variables plugin.
diff --git a/org.eclipse.core.variables/.project b/org.eclipse.core.variables/.project
deleted file mode 100644
index efb82a1..0000000
--- a/org.eclipse.core.variables/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.core.variables</name>
- <comment></comment>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.core.variables/about.html b/org.eclipse.core.variables/about.html
deleted file mode 100644
index abd7bd7..0000000
--- a/org.eclipse.core.variables/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>2nd October, 2003</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, "Program" will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or
-other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/org.eclipse.core.variables/build.properties b/org.eclipse.core.variables/build.properties
deleted file mode 100644
index e6c0fda..0000000
--- a/org.eclipse.core.variables/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = .options,\
- plugin.xml,\
- plugin.properties,\
- *.jar,\
- about.html
-source.variables.jar = src/
-src.includes=about.html, schema/
diff --git a/org.eclipse.core.variables/plugin.properties b/org.eclipse.core.variables/plugin.properties
deleted file mode 100644
index 5457749..0000000
--- a/org.eclipse.core.variables/plugin.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-pluginName=Core Variables
-providerName=Eclipse.org
-valueVariablesExtensionPointName=Value Variables
-dynamicVariablesExtensionPointName=Dynamic Variables
\ No newline at end of file
diff --git a/org.eclipse.core.variables/plugin.xml b/org.eclipse.core.variables/plugin.xml
deleted file mode 100644
index d622df3..0000000
--- a/org.eclipse.core.variables/plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.core.variables"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName"
- class="org.eclipse.core.variables.VariablesPlugin">
-
- <runtime>
- <library name="variables.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- </requires>
-
- <extension-point id="valueVariables" name="%valueVariablesExtensionPointName" schema="schema/valueVariables.exsd"/>
- <extension-point id="dynamicVariables" name="%dynamicVariablesExtensionPointName" schema="schema/dynamicVariables.exsd"/>
-
-</plugin>
diff --git a/org.eclipse.core.variables/schema/dynamicVariables.exsd b/org.eclipse.core.variables/schema/dynamicVariables.exsd
deleted file mode 100644
index a95608b..0000000
--- a/org.eclipse.core.variables/schema/dynamicVariables.exsd
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.core.variables">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.core.variables" id="dynamicVariables" name="Dynamic Stirng Substitution Variables"/>
- </appInfo>
- <documentation>
- This extension point provides a mechanism for defining dynamic variables used in string substitution. The value of a dynamic variable is resolved at the time a string substitution is performed, with an optional argument.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="variable">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique name for this variable.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="resolver" type="string" use="required">
- <annotation>
- <documentation>
- specifies a Java class which implements <samp>org.eclipse.core.variables.IDynamicVariableResolver</samp>, which is used to determine the value of the variable
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.core.variables.IDynamicVariableResolver"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="description" type="string" use="required">
- <annotation>
- <documentation>
- specifies a human-readable description of this variable
- </documentation>
- </annotation>
- </attribute>
- <attribute name="supportsArgument" type="boolean">
- <annotation>
- <documentation>
- Whether this variable supports an argument. When unspecified, the implied value is <code>true</code>.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is a definition of a dynamic variable that resolves to the name of the selected resource:
-<pre>
- <extension point="org.eclipse.core.variables.dynamicVariables">
- <variable
- name="resource_name"
- expanderClass="com.example.ResourceNameExpander"
- description="The name of the selected resource">
- </variable>
- </extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>resolver</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.core.variables.IDynamicVariableResolver</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- <p>
-<a href="hglegal.htm">
- <img SRC="ngibmcpy.gif"
- ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved."
- BORDER=0 height=14 width=324></a>
-</p>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.core.variables/schema/valueVariables.exsd b/org.eclipse.core.variables/schema/valueVariables.exsd
deleted file mode 100644
index f4ee537..0000000
--- a/org.eclipse.core.variables/schema/valueVariables.exsd
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.core.variables">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.core.variables" id="valueVariables" name="Value Variables"/>
- </appInfo>
- <documentation>
- This extension point provides a mechanism for defining variables used for string substitution. A value variable has a static value.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="variable">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- specifies a unique name for this variable.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="initialValue" type="string">
- <annotation>
- <documentation>
- specifies the initial value for this variable. When specified, an <samp>initializerClass</samp> attribute must not be specified.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="initializerClass" type="string">
- <annotation>
- <documentation>
- specifies the fully qualified name of the Java class that implements <samp>org.eclipse.core.variables.IValueVariableInitializer</samp>. When specified, an <samp>initialValue</samp> attribute must not be specified.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.core.variables.IValueVariableInitializer"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- specifies a human-readable description of this variable.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following is an example of a value variable contribution with an initial value:
-
-<p>
-<pre>
- <extension point="org.eclipse.core.variables.valueVariables">
- <variable
- name="FOO_HOME"
- initialValue="/usr/local/foo">
- </variable>
- </extension>
-</pre>
-</p>
-
-In the example above, the specified variable is created with the initial value "/usr/local/foo".
-
- The following is an example of a value variable contribution with an initializer class:
-<p>
-<pre>
- <extension point="org.eclipse.core.variables.valueVariables">
- <variable
- name="FOO_HOME"
- initializerClass="com.example.FooLocator">
- </variable>
- </extension>
-</pre>
-</p>
-
-In the example above, the variable FOO_HOME is created and the class "com.example.FooLocator" will be
-used to initialize the value the first time it's requested.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Value of the attribute <b>initializerClass</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.core.variables.IValueVariableInitializer</b>.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- <p>
-<a href="hglegal.htm">
- <img SRC="ngibmcpy.gif"
- ALT="Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved."
- BORDER=0 height=14 width=324></a>
-</p>
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java
deleted file mode 100644
index 056e0db..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-import java.text.MessageFormat;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IDynamicVariableResolver;
-import org.eclipse.core.variables.VariablesPlugin;
-
-/**
- * Dynamic variable
- */
-public class DynamicVariable extends StringVariable implements IDynamicVariable {
-
- /**
- * Resolver, or <code>null</code> until needed
- */
- private IDynamicVariableResolver fResolver;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IContextVariable#getValue(java.lang.String)
- */
- public String getValue(String argument) throws CoreException {
- if (!supportsArgument()) {
- // check for an argument - not supported
- if (argument != null && argument.length() > 0) {
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("DynamicVariable.0"), new String[]{argument, getName()}), null)); //$NON-NLS-1$
- }
- }
- if (fResolver == null) {
- String name = getConfigurationElement().getAttribute("resolver"); //$NON-NLS-1$
- if (name == null) {
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format("Contributed context variable {0} must specify a resolver.",new String[]{getName()}), null)); //$NON-NLS-1$
- }
- Object object = getConfigurationElement().createExecutableExtension("resolver"); //$NON-NLS-1$
- if (object instanceof IDynamicVariableResolver) {
- fResolver = (IDynamicVariableResolver)object;
- } else {
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format("Contributed context variable resolver for {0} must be an instance of IContextVariableResolver.",new String[]{getName()}), null)); //$NON-NLS-1$
- }
- }
- return fResolver.resolveValue(this, argument);
- }
-
- /**
- * Constructs a new context variable.
- *
- * @param name variable name
- * @param description variable description or <code>null</code>
- * @param configurationElement configuration element
- */
- public DynamicVariable(String name, String description, IConfigurationElement configurationElement) {
- super(name, description, configurationElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.variables.IDynamicVariable#supportsArgument()
- */
- public boolean supportsArgument() {
- String arg = getConfigurationElement().getAttribute("supportsArgument"); //$NON-NLS-1$
- return arg == null || Boolean.valueOf(arg).booleanValue();
- }
-
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java
deleted file mode 100644
index 4ece741..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ListenerList.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-
-/**
- * Local version of org.eclipse.jface.util.ListenerList (modified)s
- */
-public class ListenerList {
- /**
- * The current number of listeners.
- * Maintains invariant: 0 <= fSize <= listeners.length.
- */
- private int fSize;
-
- /**
- * The list of listeners. Initially <code>null</code> but initialized
- * to an array of size capacity the first time a listener is added.
- * Maintains invariant: listeners != null if and only if fSize != 0
- */
- private Object[] fListeners= null;
-
- /**
- * The empty array singleton instance, returned by getListeners()
- * when size == 0.
- */
- private static final Object[] EmptyArray= new Object[0];
-
- /**
- * Creates a listener list with the given initial capacity.
- *
- * @param capacity the number of listeners which this list can initially accept
- * without growing its internal representation; must be at least 1
- */
- public ListenerList(int capacity) {
- if (capacity < 1) {
- throw new IllegalArgumentException();
- }
- fListeners= new Object[capacity];
- fSize= 0;
- }
-
- /**
- * Adds a listener to the list.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a listener
- */
- public synchronized void add(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
- // check for duplicates using identity
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- return;
- }
- }
- // grow array if necessary
- if (fSize == fListeners.length) {
- Object[] temp= new Object[(fSize * 2) + 1];
- System.arraycopy(fListeners, 0, temp, 0, fSize);
- fListeners= temp;
- }
- fListeners[fSize++]= listener;
- }
-
- /**
- * Returns an array containing all the registered listeners.
- * The resulting array is unaffected by subsequent adds or removes.
- * If there are no listeners registered, the result is an empty array
- * singleton instance (no garbage is created).
- * Use this method when notifying listeners, so that any modifications
- * to the listener list during the notification will have no effect on the
- * notification itself.
- */
- public synchronized Object[] getListeners() {
- if (fSize == 0) {
- return EmptyArray;
- }
- Object[] result= new Object[fSize];
- System.arraycopy(fListeners, 0, result, 0, fSize);
- return result;
- }
-
- /**
- * Removes a listener from the list.
- * Has no effect if an identical listener was not already registered.
- *
- * @param listener a listener
- */
- public synchronized void remove(Object listener) {
- if (listener == null) {
- throw new IllegalArgumentException();
- }
-
- for (int i= 0; i < fSize; ++i) {
- if (fListeners[i] == listener) {
- if (--fSize == 0) {
- fListeners= new Object[1];
- } else {
- if (i < fSize) {
- fListeners[i]= fListeners[fSize];
- }
- fListeners[fSize]= null;
- }
- return;
- }
- }
- }
-
- /**
- * Removes all the listeners from the list.
- */
- public void removeAll() {
- fListeners= new Object[0];
- fSize= 0;
- }
-
- /**
- * Returns the number of registered listeners
- *
- * @return the number of registered listeners
- */
- public int size() {
- return fSize;
- }
-}
-
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java
deleted file mode 100644
index 542fc7b..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.IValueVariable;
-import org.eclipse.core.variables.VariablesPlugin;
-
-/**
- * Performs string substitution for context and value variables.
- */
-public class StringSubstitutionEngine {
-
- // delimiters
- private static final String VARIABLE_START = "${"; //$NON-NLS-1$
- private static final char VARIABLE_END = '}'; //$NON-NLS-1$
- private static final char VARIABLE_ARG = ':'; //$NON-NLS-1$
- // parsing states
- private static final int SCAN_FOR_START = 0;
- private static final int SCAN_FOR_END = 1;
-
- /**
- * Resulting string
- */
- private StringBuffer fResult;
-
- /**
- * Whether substitutions were performed
- */
- private boolean fSubs;
-
- /**
- * Stack of variables to resolve
- */
- private Stack fStack;
-
- class VariableReference {
-
- // the text inside the variable reference
- private StringBuffer fText;
-
- public VariableReference() {
- fText = new StringBuffer();
- }
-
- public void append(String text) {
- fText.append(text);
- }
-
- public String getText() {
- return fText.toString();
- }
-
- }
-
- /**
- * Performs recursive string substitution and returns the resulting string.
- *
- * @param expression expression to resolve
- * @param reportUndefinedVariables whether to report undefined variables as an error
- * @param manager registry of variables
- * @return the resulting string with all variables recursively
- * substituted
- * @exception CoreException if unable to resolve a referenced variable or if a cycle exists
- * in referenced variables
- */
- public String performStringSubstitution(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException {
- substitute(expression, reportUndefinedVariables, resolveVariables, manager);
- List resolvedVariableSets = new ArrayList();
- while (fSubs) {
- HashSet resolved = substitute(fResult.toString(), reportUndefinedVariables, true, manager);
-
- for(int i=resolvedVariableSets.size()-1; i>=0; i--) {
-
- HashSet prevSet = (HashSet)resolvedVariableSets.get(i);
-
- if (prevSet.equals(resolved)) {
- HashSet conflictingSet = new HashSet();
- for (; i<resolvedVariableSets.size(); i++)
- conflictingSet.addAll((HashSet)resolvedVariableSets.get(i));
-
- StringBuffer problemVariableList = new StringBuffer();
- for (Iterator it=conflictingSet.iterator(); it.hasNext(); ) {
- problemVariableList.append(it.next().toString());
- problemVariableList.append(", "); //$NON-NLS-1$
- }
- problemVariableList.setLength(problemVariableList.length()-2); //truncate the last ", "
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, MessageFormat.format(VariablesMessages.getString("StringSubstitutionEngine.4"), new String[]{problemVariableList.toString()}), null)); //$NON-NLS-1$
- }
- }
-
- resolvedVariableSets.add(resolved);
- }
- return fResult.toString();
- }
-
- /**
- * Performs recursive string validation to ensure that all of the variables
- * contained in the expression exist
- * @param expression expression to validate
- * @param manager registry of variables
- * @exception CoreException if a referenced variable does not exist or if a cycle exists
- * in referenced variables
- */
- public void validateStringVariables(String expression, IStringVariableManager manager) throws CoreException {
- performStringSubstitution(expression, true, false, manager);
- }
-
- /**
- * Makes a substitution pass of the given expression returns a Set of the variables that were resolved in this
- * pass
- *
- * @param expression source expression
- * @param reportUndefinedVariables whether to report undefined variables as an error
- * @param resolveVariables whether to resolve the value of any variables
- * @exception CoreException if unable to resolve a variable
- */
- private HashSet substitute(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException {
- fResult = new StringBuffer(expression.length());
- fStack = new Stack();
- fSubs = false;
-
- HashSet resolvedVariables = new HashSet();
-
- int pos = 0;
- int state = SCAN_FOR_START;
- while (pos < expression.length()) {
- switch (state) {
- case SCAN_FOR_START:
- int start = expression.indexOf(VARIABLE_START, pos);
- if (start >= 0) {
- int length = start - pos;
- // copy non-variable text to the result
- if (length > 0) {
- fResult.append(expression.substring(pos, start));
- }
- pos = start + 2;
- state = SCAN_FOR_END;
-
- fStack.push(new VariableReference());
- } else {
- // done - no more variables
- fResult.append(expression.substring(pos));
- pos = expression.length();
- }
- break;
- case SCAN_FOR_END:
- // be careful of nested variables
- start = expression.indexOf(VARIABLE_START, pos);
- int end = expression.indexOf(VARIABLE_END, pos);
- if (end < 0) {
- // variables are not completed
- VariableReference tos = (VariableReference)fStack.peek();
- tos.append(expression.substring(pos));
- pos = expression.length();
- } else {
- if (start >= 0 && start < end) {
- // start of a nested variable
- int length = start - pos;
- if (length > 0) {
- VariableReference tos = (VariableReference)fStack.peek();
- tos.append(expression.substring(pos, start));
- }
- pos = start + 2;
- fStack.push(new VariableReference());
- } else {
- // end of variable reference
- VariableReference tos = (VariableReference)fStack.pop();
- String substring = expression.substring(pos, end);
- tos.append(substring);
- resolvedVariables.add(substring);
-
- pos = end + 1;
- String value= resolve(tos, reportUndefinedVariables, resolveVariables, manager);
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
- if (fStack.isEmpty()) {
- // append to result
- fResult.append(value);
- state = SCAN_FOR_START;
- } else {
- // append to previous variable
- tos = (VariableReference)fStack.peek();
- tos.append(value);
- }
- }
- }
- break;
- }
- }
- // process incomplete variable references
- while (!fStack.isEmpty()) {
- VariableReference tos = (VariableReference)fStack.pop();
- if (fStack.isEmpty()) {
- fResult.append(VARIABLE_START);
- fResult.append(tos.getText());
- } else {
- VariableReference var = (VariableReference)fStack.peek();
- var.append(VARIABLE_START);
- var.append(tos.getText());
- }
- }
-
-
- return resolvedVariables;
- }
-
- /**
- * Resolve and return the value of the given variable reference,
- * possibly <code>null</code>.
- *
- * @param var
- * @param reportUndefinedVariables whether to report undefined variables as
- * an error
- * @param resolveVariables whether to resolve the variables value or just to validate that this variable is valid
- * @param manager variable registry
- * @return variable value, possibly <code>null</code>
- * @exception CoreException if unable to resolve a value
- */
- private String resolve(VariableReference var, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException {
- String text = var.getText();
- int pos = text.indexOf(VARIABLE_ARG);
- String name = null;
- String arg = null;
- if (pos > 0) {
- name = text.substring(0, pos);
- pos++;
- if (pos < text.length()) {
- arg = text.substring(pos);
- }
- } else {
- name = text;
- }
- IValueVariable valueVariable = manager.getValueVariable(name);
- if (valueVariable == null) {
- IDynamicVariable dynamicVariable = manager.getDynamicVariable(name);
- if (dynamicVariable == null) {
- // no variables with the given name
- if (reportUndefinedVariables) {
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("StringSubstitutionEngine.3"), new String[]{name}), null)); //$NON-NLS-1$
- }
- // leave as is
- return getOriginalVarText(var);
- }
-
- if (resolveVariables) {
- fSubs = true;
- return dynamicVariable.getValue(arg);
- }
- //leave as is
- return getOriginalVarText(var);
- }
-
- if (arg == null) {
- if (resolveVariables) {
- fSubs = true;
- return valueVariable.getValue();
- }
- //leave as is
- return getOriginalVarText(var);
- }
- // error - an argument specified for a value variable
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("StringSubstitutionEngine.4"), new String[]{valueVariable.getName()}), null)); //$NON-NLS-1$
- }
-
- private String getOriginalVarText(VariableReference var) {
- StringBuffer res = new StringBuffer(var.getText());
- res.insert(0, VARIABLE_START);
- res.append(VARIABLE_END);
- return res.toString();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java
deleted file mode 100644
index cb76420..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.variables.IStringVariable;
-
-/**
- * Common implementation of context and value variables
- */
-public abstract class StringVariable implements IStringVariable {
-
- /**
- * Variable name
- */
- private String fName;
-
- /**
- * Variable description, or <code>null</code>
- */
- private String fDescription;
-
- /**
- * Configuration element associated with this variable, or <code>null</code>
- */
- private IConfigurationElement fConfigurationElement;
-
- /**
- * Constructs a new variable with the given name and description.
- *
- * @param name variable name
- * @param description variable description, or <code>null</code>
- */
- public StringVariable(String name, String description, IConfigurationElement configurationElement) {
- fName = name;
- fDescription = description;
- fConfigurationElement = configurationElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getName()
- */
- public String getName() {
- return fName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getDescription()
- */
- public String getDescription() {
- return fDescription;
- }
-
- /**
- * Returns the configuration element associated with this variable, or <code>null</code>
- * if none.
- *
- * @return configuration element or <code>null</code>
- */
- protected IConfigurationElement getConfigurationElement() {
- return fConfigurationElement;
- }
-
- /**
- * @see IValueVariable#setDescription(String)
- * @param description
- */
- public void setDescription(String description) {
- fDescription = description;
- }
-
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
deleted file mode 100644
index aa646f7..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
+++ /dev/null
@@ -1,558 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.IValueVariable;
-import org.eclipse.core.variables.IValueVariableListener;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * Singleton string variable manager.
- */
-public class StringVariableManager implements IStringVariableManager {
-
- /**
- * Dynamic variables - maps variable names to variables.
- */
- private Map fDynamicVariables;
-
- /**
- * Value varialbes - maps variable names to variables.
- */
- private Map fValueVariables;
-
- /**
- * Variable listeners
- */
- private ListenerList fListeners;
-
- // notifications
- private static final int ADDED = 0;
- private static final int CHANGED = 1;
- private static final int REMOVED = 2;
-
- /**
- * Singleton variable manager.
- */
- private static StringVariableManager fgManager;
-
- // true during initialization code - supress change notification
- private boolean fInitializing = false;
-
- // Variable extension point constants
- private static final String ATTR_NAME= "name"; //$NON-NLS-1$
- private static final String ATTR_DESCRIPTION="description"; //$NON-NLS-1$
- // Persisted variable XML constants
- private static final String VALUE_VARIABLES_TAG= "valueVariables"; //$NON-NLS-1$
- private static final String VALUE_VARIABLE_TAG= "valueVariable"; //$NON-NLS-1$
- private static final String NAME_TAG= "name"; //$NON-NLS-1$
- private static final String VALUE_TAG= "value"; //$NON-NLS-1$
- private static final String DESCRIPTION_TAG="description"; //$NON-NLS-1$
- private static final String INITIALIZED_TAG="contributed"; //$NON-NLS-1$
- // XML values
- private static final String TRUE_VALUE= "true"; //$NON-NLS-1$
- private static final String FALSE_VALUE= "false"; //$NON-NLS-1$
- // preference store key for value variables
- private static final String PREF_VALUE_VARIABLES= VariablesPlugin.getUniqueIdentifier() + ".valueVariables"; //$NON-NLS-1$
-
- /**
- * Notifies a string variable listener in a safe runnable to handle
- * exceptions.
- */
- class StringVariableNotifier implements ISafeRunnable {
-
- private IValueVariableListener fListener;
- private int fType;
- private IValueVariable[] fVariables;
-
- /**
- * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
- */
- public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, "An exception occurred during string variable change notification", exception); //$NON-NLS-1$
- VariablesPlugin.log(status);
- }
-
- /**
- * @see org.eclipse.core.runtime.ISafeRunnable#run()
- */
- public void run() throws Exception {
- switch (fType) {
- case ADDED:
- fListener.variablesAdded(fVariables);
- break;
- case REMOVED:
- fListener.variablesRemoved(fVariables);
- break;
- case CHANGED:
- fListener.variablesChanged(fVariables);
- break;
- }
- }
-
- /**
- * Notifies the given listener of the add/change/remove
- *
- * @param listener the listener to notify
- * @param launch the launch that has changed
- * @param update the type of change
- */
- public void notify(IValueVariable[] variables, int update) {
- fVariables = variables;
- fType = update;
- Object[] copiedListeners= fListeners.getListeners();
- for (int i= 0; i < copiedListeners.length; i++) {
- fListener = (IValueVariableListener)copiedListeners[i];
- Platform.run(this);
- }
- fVariables = null;
- fListener = null;
- // persist variables whenever there is an add/change/remove
- storeValueVariables();
- }
- }
-
- /**
- * Returns a new notifier.
- *
- * @return a new notifier
- */
- private StringVariableNotifier getNotifier() {
- return new StringVariableNotifier();
- }
-
- /**
- * Returns the default string variable manager
- *
- * @return string variable manager
- */
- public static StringVariableManager getDefault() {
- if (fgManager == null) {
- fgManager = new StringVariableManager();
- }
- return fgManager;
- }
-
- /**
- * Constructs a new string variable manager.
- */
- private StringVariableManager() {
- fListeners = new ListenerList(5);
- }
-
- /**
- * Load contributed variables and persisted variables
- */
- private void initialize() {
- if (fDynamicVariables == null) {
- fInitializing = true;
- fDynamicVariables = new HashMap(5);
- fValueVariables = new HashMap(5);
- loadPersistedValueVariables();
- loadContributedValueVariables();
- loadDynamicVariables();
- fInitializing = false;
- }
- }
-
- /**
- * Loads contributed dynamic variables
- */
- private void loadDynamicVariables() {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(VariablesPlugin.PI_CORE_VARIABLES, EXTENSION_POINT_DYNAMIC_VARIABLES);
- IConfigurationElement elements[]= point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- String name= element.getAttribute(ATTR_NAME);
- if (name == null) {
- VariablesPlugin.logMessage(MessageFormat.format("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$
- continue;
- }
- String description= element.getAttribute(ATTR_DESCRIPTION);
- DynamicVariable variable= new DynamicVariable(name, description, element);
- fDynamicVariables.put(variable.getName(), variable);
- }
- }
-
- /**
- * Loads any persisted value varialbes from the preference store.
- */
- private void loadPersistedValueVariables() {
- String variablesString= VariablesPlugin.getDefault().getPluginPreferences().getString(PREF_VALUE_VARIABLES);
- if (variablesString.length() == 0) {
- return;
- }
- Element root= null;
- Throwable ex = null;
- try {
- ByteArrayInputStream stream = new ByteArrayInputStream(variablesString.getBytes("UTF-8")); //$NON-NLS-1$
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- root = parser.parse(stream).getDocumentElement();
- } catch (UnsupportedEncodingException e) {
- ex = e;
- } catch (ParserConfigurationException e) {
- ex = e;
- } catch (FactoryConfigurationError e) {
- ex = e;
- } catch (SAXException e) {
- ex = e;
- } catch (IOException e) {
- ex = e;
- }
- if (ex != null) {
- VariablesPlugin.logMessage("An exception occurred while loading persisted value variables.", ex); //$NON-NLS-1$
- return;
- }
- if (!root.getNodeName().equals(VALUE_VARIABLES_TAG)) {
- VariablesPlugin.logMessage("Invalid format encountered while loading persisted value variables.", null); //$NON-NLS-1$
- return;
- }
- NodeList list= root.getChildNodes();
- for (int i= 0, numItems= list.getLength(); i < numItems; i++) {
- Node node= list.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element= (Element) node;
- if (!element.getNodeName().equals(VALUE_VARIABLE_TAG)) {
- VariablesPlugin.logMessage(MessageFormat.format("Invalid XML element encountered while loading value variables: {0}", new String[] {node.getNodeName()}), null); //$NON-NLS-1$
- continue;
- }
- String name= element.getAttribute(NAME_TAG);
- if (name.length() > 0) {
- String value= element.getAttribute(VALUE_TAG);
- String description= element.getAttribute(DESCRIPTION_TAG);
- boolean initialized= TRUE_VALUE.equals(element.getAttribute(INITIALIZED_TAG));
- ValueVariable variable= new ValueVariable(name, description, null);
- if (initialized) {
- variable.setValue(value);
- }
- fValueVariables.put(name, variable);
- } else {
- VariablesPlugin.logMessage("Invalid variable entry encountered while loading value variables. Variable name is null.", null); //$NON-NLS-1$
- }
- }
- }
- }
-
- /**
- * Loads contributed value variables. This is done after the persisted value
- * varaibles are restored. Any contributed variables with the same name are
- * merged with existing persisted values.
- */
- private void loadContributedValueVariables() {
- IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(VariablesPlugin.PI_CORE_VARIABLES, EXTENSION_POINT_VALUE_VARIABLES);
- IConfigurationElement elements[]= point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- String name= element.getAttribute(ATTR_NAME);
- if (name == null) {
- VariablesPlugin.logMessage(MessageFormat.format("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$
- continue;
- }
- String description= element.getAttribute(ATTR_DESCRIPTION);
- ValueVariable variable= new ValueVariable(name, description, element);
- // if already present, merge with persisted value
- ValueVariable existing = (ValueVariable)getValueVariable(name);
- if (existing != null) {
- if (existing.isInitialized()) {
- variable.setValue(existing.getValue());
- }
- }
- fValueVariables.put(variable.getName(), variable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getVariables()
- */
- public IStringVariable[] getVariables() {
- initialize();
- List list = new ArrayList(fDynamicVariables.size() + fValueVariables.size());
- list.addAll(fDynamicVariables.values());
- list.addAll(fValueVariables.values());
- return (IStringVariable[]) list.toArray(new IStringVariable[list.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getValueVariables()
- */
- public IValueVariable[] getValueVariables() {
- initialize();
- return (IValueVariable[]) fValueVariables.values().toArray(new IValueVariable[fValueVariables.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getDynamicVariables()
- */
- public IDynamicVariable[] getDynamicVariables() {
- initialize();
- return (IDynamicVariable[]) fDynamicVariables.values().toArray(new IDynamicVariable[fDynamicVariables.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#performStringSubstitution(java.lang.String)
- */
- public String performStringSubstitution(String expression) throws CoreException {
- return performStringSubstitution(expression, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#newValueVariable(java.lang.String, java.lang.String)
- */
- public IValueVariable newValueVariable(String name, String description) {
- IConfigurationElement element = null;
- ValueVariable existing = (ValueVariable)getValueVariable(name);
- if (existing != null && existing.isContributed()) {
- element = existing.getConfigurationElement();
- }
- return new ValueVariable(name, description, element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#addVariables(org.eclipse.debug.internal.core.stringsubstitution.IValueVariable[])
- */
- public void addVariables(IValueVariable[] variables) throws CoreException {
- initialize();
- MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.getString("StringVariableManager.26"), null); //$NON-NLS-1$
- for (int i = 0; i < variables.length; i++) {
- IValueVariable variable = variables[i];
- if (getValueVariable(variable.getName()) != null) {
- status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, MessageFormat.format(VariablesMessages.getString("StringVariableManager.27"), new String[]{variable.getName()}), null)); //$NON-NLS-1$
- }
- }
- if (status.isOK()) {
- for (int i = 0; i < variables.length; i++) {
- IValueVariable variable = variables[i];
- fValueVariables.put(variable.getName(), variable);
- }
- IValueVariable[] copy = new IValueVariable[variables.length];
- System.arraycopy(variables, 0, copy, 0, variables.length);
- getNotifier().notify(copy, ADDED);
- return;
- }
- throw new CoreException(status);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#removeVariables(org.eclipse.debug.internal.core.stringsubstitution.IValueVariable[])
- */
- public void removeVariables(IValueVariable[] variables) {
- initialize();
- List removed = new ArrayList(variables.length);
- for (int i = 0; i < variables.length; i++) {
- IValueVariable variable = variables[i];
- if (fValueVariables.remove(variable.getName()) != null) {
- removed.add(variable);
- }
- }
- if (removed.size() > 0) {
- getNotifier().notify((IValueVariable[])removed.toArray(new IValueVariable[removed.size()]), REMOVED);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getDynamicVariable(java.lang.String)
- */
- public IDynamicVariable getDynamicVariable(String name) {
- initialize();
- return (IDynamicVariable) fDynamicVariables.get(name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getValueVariable(java.lang.String)
- */
- public IValueVariable getValueVariable(String name) {
- initialize();
- return (IValueVariable) fValueVariables.get(name);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#addValueVariableListener(org.eclipse.debug.internal.core.stringsubstitution.IValueVariableListener)
- */
- public void addValueVariableListener(IValueVariableListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#removeValueVariableListener(org.eclipse.debug.internal.core.stringsubstitution.IValueVariableListener)
- */
- public void removeValueVariableListener(IValueVariableListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Returns a memento representing the value variables currently registered.
- *
- * @return memento representing the value variables currently registered
- * @throws IOException if an I/O exception occurs while creating the XML.
- */
- private String getValueVariablesAsXML() throws IOException, ParserConfigurationException, TransformerException {
- IValueVariable[] variables = getValueVariables();
-
- Document document= getDocument();
- Element rootElement= document.createElement(VALUE_VARIABLES_TAG);
- document.appendChild(rootElement);
- for (int i = 0; i < variables.length; i++) {
- ValueVariable variable = (ValueVariable)variables[i];
- Element element= document.createElement(VALUE_VARIABLE_TAG);
- element.setAttribute(NAME_TAG, variable.getName());
- String value= variable.getValue();
- if (value != null) {
- element.setAttribute(VALUE_TAG, value);
- }
- String description= variable.getDescription();
- if (description != null) {
- element.setAttribute(DESCRIPTION_TAG, description);
- }
- element.setAttribute(INITIALIZED_TAG, variable.isInitialized() ? TRUE_VALUE : FALSE_VALUE);
- rootElement.appendChild(element);
- }
- return serializeDocument(document);
- }
-
- private Document getDocument() throws ParserConfigurationException {
- DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
- Document doc =docBuilder.newDocument();
- return doc;
- }
-
- /**
- * Serializes a XML document into a string - encoded in UTF8 format,
- * with platform line separators.
- *
- * @param doc document to serialize
- * @return the document as a string
- * @throws TransformerException if an unrecoverable error occurs during the serialization
- * @throws IOException if the encoding attempted to be used is not supported
- */
- private String serializeDocument(Document doc) throws TransformerException, UnsupportedEncodingException {
- ByteArrayOutputStream s= new ByteArrayOutputStream();
-
- TransformerFactory factory= TransformerFactory.newInstance();
- Transformer transformer= factory.newTransformer();
- transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
- transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
-
- DOMSource source= new DOMSource(doc);
- StreamResult outputTarget= new StreamResult(s);
- transformer.transform(source, outputTarget);
-
- return s.toString("UTF8"); //$NON-NLS-1$
- }
-
- /**
- * Saves the value variables currently registered in the
- * preference store.
- */
- private void storeValueVariables() {
- Preferences prefs= VariablesPlugin.getDefault().getPluginPreferences();
- String variableString= ""; //$NON-NLS-1$
- if (!fValueVariables.isEmpty()) {
- try {
- variableString= getValueVariablesAsXML();
- } catch (IOException e) {
- VariablesPlugin.log(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), IStatus.ERROR, "An exception occurred while storing launch configuration variables.", e)); //$NON-NLS-1$
- return;
- } catch (ParserConfigurationException e) {
- VariablesPlugin.log(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), IStatus.ERROR, "An exception occurred while storing launch configuration variables.", e)); //$NON-NLS-1$
- return;
- } catch (TransformerException e) {
- VariablesPlugin.log(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), IStatus.ERROR, "An exception occurred while storing launch configuration variables.", e)); //$NON-NLS-1$
- return;
- }
- }
- prefs.setValue(PREF_VALUE_VARIABLES, variableString);
- VariablesPlugin.getDefault().savePluginPreferences();
- }
-
- /**
- * Fire a change notification for the given variable.
- *
- * @param variable the variable that has changed
- */
- protected void notifyChanged(ValueVariable variable) {
- if (!fInitializing) {
- IValueVariable existing = getValueVariable(variable.getName());
- if (variable.equals(existing)) {
- // do not do change notification for unregistered variables
- getNotifier().notify(new IValueVariable[]{variable}, CHANGED);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#generateVariableExpression(java.lang.String, java.lang.String)
- */
- public String generateVariableExpression(String varName, String arg) {
- StringBuffer buffer = new StringBuffer();
- buffer.append("${"); //$NON-NLS-1$
- buffer.append(varName);
- if (arg != null) {
- buffer.append(":"); //$NON-NLS-1$
- buffer.append(arg);
- }
- buffer.append("}"); //$NON-NLS-1$
- return buffer.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#performStringSubstitution(java.lang.String, boolean)
- */
- public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException {
- return new StringSubstitutionEngine().performStringSubstitution(expression, reportUndefinedVariables, true, this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.variables.IStringVariableManager#validateStringVariables(java.lang.String)
- */
- public void validateStringVariables(String expression) throws CoreException {
- new StringSubstitutionEngine().validateStringVariables(expression, this);
- }
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java
deleted file mode 100644
index 5ecb45a..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.variables.IValueVariable;
-import org.eclipse.core.variables.IValueVariableInitializer;
-import org.eclipse.core.variables.VariablesPlugin;
-
-/**
- * Implementation of a value variable.
- */
-public class ValueVariable extends StringVariable implements IValueVariable {
-
- /**
- * Variable value or <code>null</code> if none
- */
- private String fValue;
-
- /**
- * Whether this variable's value has been initialized
- */
- private boolean fInitialized = false;
-
- /**
- * Constructs a new value variable with the given name, description, and
- * associated configuration element.
- *
- * @param name variable name
- * @param description variable description, or <code>null</code>
- * @param configurationElement configuration element or <code>null</code>
- */
- public ValueVariable(String name, String description, IConfigurationElement configurationElement) {
- super(name, description, configurationElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IValueVariable#setValue(java.lang.String)
- */
- public void setValue(String value) {
- fValue = value;
- setInitialized(true);
- StringVariableManager.getDefault().notifyChanged(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IValueVariable#getValue()
- */
- public String getValue() {
- if (!isInitialized()) {
- initialize();
- }
- return fValue;
- }
-
- /**
- * Initialize this variable's value.
- */
- private void initialize() {
- if (getConfigurationElement() != null) {
- // check for a explicit value specified in plug-in XML
- String value = getConfigurationElement().getAttribute("initialValue"); //$NON-NLS-1$
- if (value == null) {
- // check for initializer
- String className = getConfigurationElement().getAttribute("initializerClass"); //$NON-NLS-1$
- if (className != null) {
- try {
- Object object = getConfigurationElement().createExecutableExtension("initializerClass"); //$NON-NLS-1$
- if (object instanceof IValueVariableInitializer) {
- IValueVariableInitializer initializer = (IValueVariableInitializer)object;
- initializer.initialize(this);
- } else {
- VariablesPlugin.logMessage(MessageFormat.format("Unable to initialize variable {0} - initializer must be an instance of IValueVariableInitializer.", new String[]{getName()}), null); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- VariablesPlugin.logMessage(MessageFormat.format("Unable to initialize variable {0}",new String[]{getName()}), e); //$NON-NLS-1$
- }
- }
- } else {
- setValue(value);
- }
- }
- setInitialized(true);
- }
-
- /**
- * Returns whether this variable has been initialized with a value by one of:
- * <ul>
- * <li><code>setValue(String)</code></li>
- * <li>its configuration element's <code>initialValue</code> attribute</li>
- * <li>its configuration element's initializer</li>
- * </ul>
- * @return whether this variable has been initialized with a value
- */
- protected boolean isInitialized() {
- return fInitialized;
- }
-
- /**
- * Sets whether this variable has been initialized with a value.
- *
- * @param initialized whether this variable has been initialized
- */
- protected void setInitialized(boolean initialized) {
- fInitialized = initialized;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IValueVariable#isContributed()
- */
- public boolean isContributed() {
- return getConfigurationElement() != null;
- }
-
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java
deleted file mode 100644
index 7791efb..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.variables;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class VariablesMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.core.internal.variables.VariablesMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE =
- ResourceBundle.getBundle(BUNDLE_NAME);
-
- private VariablesMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties
deleted file mode 100644
index 7113d13..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-StringSubstitutionEngine.3=Reference to undefined variable {0}
-StringSubstitutionEngine.4=Variable {0} does not accept arguments
-
-StringVariableManager.26=Variables with the specified names are already registered.
-StringVariableManager.27=Variable named {0} already registered
-
-DynamicVariable.0=Unsupported argument {0} specified for variable {1}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java
deleted file mode 100644
index 5614d91..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * A dynamic variable is a variable whose value is computed dynamically
- * by a resolver at the time a string substitution is performed. A dynamic
- * variable is contributed by an extension.
- * <p>
- * The following is a definition of a dynamic variable that resolves to the name of the selected resource:
- * <pre>
- * <extension point="org.eclipse.core.variables.dynamicVariables">
- * <variable
- * name="resource_name"
- * resolver="com.example.ResourceNameResolver"
- * description="The name of the selected resource"
- * supportsArgument="false">
- * </variable>
- * </extension>
- * </pre>
- * </p>
- *
- * @since 3.0
- */
-public interface IDynamicVariable extends IStringVariable {
-
- /**
- * Returns the value of this variable when referenced with the given
- * argument, possibly <code>null</code>.
- *
- * @param argument argument present in variable expression or <code>null</code>
- * if none
- * @return value of this variable when referenced with the given argument, possibly
- * <code>null</code>
- * @throws CoreException if unable to resolve a value for this variable
- */
- public String getValue(String argument) throws CoreException;
-
- /**
- * Returns whether this variable supports an argument, as specified
- * by this variable's extension definition in plug-in XML.
- *
- * @return whether this variable supports an argument
- */
- public boolean supportsArgument();
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java
deleted file mode 100644
index 6187525..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Resolves the value for a dynamic variable. A dynamic variable extension
- * contributes a resolver which must implement this interface.
- *
- * @since 3.0
- */
-public interface IDynamicVariableResolver {
-
- /**
- * Resolves and returns a value for the specified variable when referenced
- * with the given argument, possibly <code>null</code>
- *
- * @param variable variable to resolve a value for
- * @param argument argument present in expression or <code>null</code> if none
- * @return variable value, possibly <code>null</code>
- * @throws CoreException if unable to resolve a value for the given variable
- */
- public String resolveValue(IDynamicVariable variable, String argument) throws CoreException;
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java
deleted file mode 100644
index 69bab0a..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-
-/**
- * A variable that can be referenced in an expression, which resolves to a string
- * value. Variables are referenced in expressions via their name, in the following
- * format.
- * <pre>
- * ${varname} or ${varname:argument}
- * </pre>
- * <p>
- * A variable is identified by its name, and optionally accepts an argument. When an
- * argument is present, a colon seperates the variable name from its argument.
- * </p>
- * <p>
- * Variables can be contributed by extensions or programmatically. There are two
- * kinds of variables.
- * <ul>
- * <li><code>IValueVariable</code> - variables that have a value (with getter and setter), and
- * accept no arguments. The value of this type of variable is resolved at the time
- * its value is set via its setter API.</li>
- * <li><code>IDynamicVariable</code> - variables whose value is resolved at the time
- * a string substitution is performed by a contributed resolver. Dynamic variables
- * may accept an argument.</li>
- * </ul>
- * </p>
- * @since 3.0
- */
-public interface IStringVariable {
-
- /**
- * Returns the name of this variable. A variable is uniquely identified by
- * its name.
- *
- * @return variable name
- */
- public String getName();
-
- /**
- * Returns a human readable description of this variable, possibly <code>null</code>
- *
- * @return a description of this variable, or <code>null</code> if none
- */
- public String getDescription();
-
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
deleted file mode 100644
index 55e62b6..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Registry for string variables.
- *
- * @since 3.0
- */
-public interface IStringVariableManager {
-
- /**
- * Simple identifier constant (value <code>"dynamicVariables"</code>) for the
- * dynamic variables extension point.
- */
- public static final String EXTENSION_POINT_DYNAMIC_VARIABLES = "dynamicVariables"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"valueVariables"</code>) for the
- * value variables extension point.
- */
- public static final String EXTENSION_POINT_VALUE_VARIABLES = "valueVariables"; //$NON-NLS-1$
-
- /**
- * Returns all registered variables.
- *
- * @return a collection of all registered variables
- */
- public IStringVariable[] getVariables();
-
- /**
- * Returns all registered value variables.
- *
- * @return a collection of all registered value variables
- */
- public IValueVariable[] getValueVariables();
-
- /**
- * Returns the value variable with the given name, or <code>null</code>
- * if none.
- *
- * @param name variable name
- * @return the value variable with the given name, or <code>null</code>
- * if none
- */
- public IValueVariable getValueVariable(String name);
-
- /**
- * Returns all registered dynamic variables.
- *
- * @return a collection of all registered dynamic variables
- */
- public IDynamicVariable[] getDynamicVariables();
-
- /**
- * Returns the dynamic variable with the given name or <code>null</code>
- * if none.
- *
- * @param name variable name
- * @return the dynamic variable with the given name or <code>null</code>
- * if none
- */
- public IDynamicVariable getDynamicVariable(String name);
-
- /**
- * Recursively resolves and replaces all variable references in the given
- * expression with their corresponding values. Reports errors for references
- * to undefined variables (equivalent to calling
- * <code>performStringSubstitution(expression, true)</code>).
- *
- * @param expression expression referencing variables
- * @return expression with variable references replaced with variable values
- * @throws CoreException if unable to resolve the value of one or more variables
- */
- public String performStringSubstitution(String expression) throws CoreException;
-
- /**
- * Recursively resolves and replaces all variable references in the given
- * expression with their corresponding values. Allows the client to control
- * whether references to undefined variables are reported as an error (i.e.
- * an exception is thrown).
- *
- * @param expression expression referencing variables
- * @param reportUndefinedVariables whether a reference to an undefined variable
- * is to be considered an error (i.e. throw an exception)
- * @return expression with variable references replaced with variable values
- * @throws CoreException if unable to resolve the value of one or more variables
- */
- public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException;
-
- /**
- * Validates variables references in the given expression and reports errors
- * for references to undefined variables.
- *
- * @param expression expression referencing variables
- * @throws CoreException if one or more referenced variables do not exist
- */
- public void validateStringVariables(String expression) throws CoreException;
-
- /**
- * Returns a new value variable with the given name and description.
- *
- * @param name variable name, cannot be <code>null</code>
- * @param description variable description, possibly <code>null</code>
- * @return a new variable
- * @exception CoreException if a variable already exists with the given name
- */
- public IValueVariable newValueVariable(String name, String description);
-
- /**
- * Adds the given variables to the variable registry.
- *
- * @param variables the variables to add
- * @throws CoreException if one or more variables to add has a name collision with
- * an existing variable
- */
- public void addVariables(IValueVariable[] variables) throws CoreException;
-
- /**
- * Removes the given variables from the registry. Has no effect for unregistered
- * variables.
- *
- * @param variables variables to remove
- */
- public void removeVariables(IValueVariable[] variables);
-
- /**
- * Registers the given listener for value variable notifications. Has no effect
- * if an identical listener is already registered.
- *
- * @param listener value variable listener to add
- */
- public void addValueVariableListener(IValueVariableListener listener);
-
- /**
- * Removes the given listener from the list of registered value variable
- * listeners. Has no effect if an identical listener is not already registered.
- *
- * @param listener value variable listener to remove
- */
- public void removeValueVariableListener(IValueVariableListener listener);
-
- /**
- * Convenience method that returns an expression referencing the given
- * variable and optional argument. For example, calling the method with
- * a <code>varName</code> of <code>my_var</code> and an <code>argument</code>
- * of <code>my_arg</code> results in the string <code>$(my_var:my_arg}</code>.
- *
- * @param varName variable name
- * @param arg argument text or <code>null</code>
- * @return an expression referencing the given variable and
- * optional argument
- */
- public String generateVariableExpression(String varName, String arg);
-
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java
deleted file mode 100644
index 6c1bd80..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-/**
- * A variable with a value that can be set and retrieved. The context in which
- * a value variable is referenced does not effect the value of the variable.
- * A value variable can be contributed by an extension or created programmatically.
- * A contributor may optionally specify an initial value for a variable, or
- * provide a delegate that will initialie the variable with a value.
- * <p>
- * Example of a value variable contribution with an initial value, the specified
- * variable is created with the initial value "/usr/local/foo".
- * <pre>
- * <extension point="org.eclipse.core.variables.valueVariables">
- * <variable
- * name="FOO_HOME"
- * initialValue="/usr/local/foo">
- * </variable>
- * </extension>
- * </pre>
- * </p>
- * <p>
- * Example of a value variable contribution with an initializer class, the class
- * "com.example.FooLocator" will be used to initialize the value the first time
- * it's requested.
- * <pre>
- * <extension point="org.eclipse.core.variables.valueVariables">
- * <variable
- * name="FOO_HOME"
- * initializerClass="com.example.FooLocator">
- * </variable>
- * </extension>
- * </pre>
- * </p>
- *
- *
- * @since 3.0
- */
-public interface IValueVariable extends IStringVariable {
-
- /**
- * Sets the value of this variable to the given value. A value of
- * <code>null</code> indicates the value of this variable is undefined.
- *
- * @param value variable value, possibly <code>null</code>
- */
- public void setValue(String value);
-
- /**
- * Returns the value of this variable, or <code>null</code> if none.
- *
- * @return the value of this variable, or <code>null</code> if none
- */
- public String getValue();
-
- /**
- * Returns whether this variable was contributed by an extension.
- *
- * @return whether this variable was contributed by an extension
- */
- public boolean isContributed();
-
- /**
- * Sets the description of this variable to the given value.
- *
- * @param description variable description, possibly <code>null</code>
- */
- public void setDescription(String description);
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java
deleted file mode 100644
index 16cc8fe..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-/**
- * Value variable initializers compute an initial value for a value
- * variable contributed by an extension, which is not defined with an initial
- * value. This provides a mechnism for programatically computing the initial
- * value of a value variable.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.0
- */
-public interface IValueVariableInitializer {
- /**
- * Initializes the specified variable.
- *
- * @param variable variable to initialize
- */
- public void initialize(IValueVariable variable);
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java
deleted file mode 100644
index 87c018a..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.variables;
-
-/**
- * A string variable listener is notified of variables as they are added
- * and removed from the string variable manager. As well, listeners are
- * notified when a value variable changes value.
- *
- * @since 3.0
- */
-public interface IValueVariableListener {
-
- /**
- * Notification the given variables have been added to the variable
- * manager.
- *
- * @param variables added variables
- */
- public void variablesAdded(IValueVariable[] variables);
-
- /**
- * Notification the given variables have been removed from the variable
- * manager.
- *
- * @param variables removed variables
- */
- public void variablesRemoved(IValueVariable[] variables);
-
- /**
- * Notification the given variables have been changed value.
- *
- * @param variables changed variables
- */
- public void variablesChanged(IValueVariable[] variables);
-
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java
deleted file mode 100644
index fa82ad9..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.core.variables;
-
-import org.eclipse.core.internal.variables.StringVariableManager;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-
-/**
- * The plug-in runtime class for the Core Variables plug-in.
- * @since 3.0
- */
-public class VariablesPlugin extends Plugin {
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-
- /**
- * Status code indicating a variable reference cycle error.
- */
- public static final int REFERENCE_CYCLE_ERROR = 130;
-
- /**
- * The single instance of this plug-in runtime class.
- */
- private static VariablesPlugin plugin;
-
- /**
- * Unique identifier constant (value <code>"org.eclipse.core.variables"</code>)
- * for the Core Variables plug-in.
- */
- public static final String PI_CORE_VARIABLES = "org.eclipse.core.variables"; //$NON-NLS-1$
-
-
- /**
- * Constructs an instance of this plug-in runtime class.
- * <p>
- * An instance of this plug-in runtime class is automatically created
- * when the facilities provided by the Variables plug-in are required.
- * <b>Clients must never explicitly instantiate a plug-in runtime class.</b>
- * </p>
- */
- public VariablesPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * Returns this plug-in instance.
- *
- * @return the single instance of this plug-in runtime class
- */
- public static VariablesPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- */
- public static void log(Throwable t) {
- log(new Status(IStatus.ERROR, PI_CORE_VARIABLES, INTERNAL_ERROR, "Error logged from Core Variables: ", t)); //$NON-NLS-1$
- }
-
- /**
- * Logs the given message with this plug-in's log and the given
- * throwable or <code>null</code> if none.
- * @param message the message to log
- * @param throwable the exception that occurred or <code>null</code> if none
- */
- public static void logMessage(String message, Throwable throwable) {
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, message, throwable));
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- return PI_CORE_VARIABLES;
- }
-
- /**
- * Returns the string variable manager.
- *
- * @return the string variable manager
- */
- public IStringVariableManager getStringVariableManager() {
- return StringVariableManager.getDefault();
- }
-}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/package.html b/org.eclipse.core.variables/src/org/eclipse/core/variables/package.html
deleted file mode 100644
index 0d27de0..0000000
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/package.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Platform</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides support for defining and contributing variables for the purpose of
- string substitution.</p>
-
-<h2>Package Specification</h2>
-
-<p>This package provides classes and interfaces to support the definition and
- contribution of variables for the purpose of string substitution. The plug-in
- supports the recursive replacement of variables referenced by name in arbitrary
- strings with the value of the variable. Two types of variables are provided
- - value variables (<code>IValueVariable</code>) and dynamic variables (<code>IDynamicVariable</code>).
- A value variable has a simple setter and getter for its current value. A dynamic
- variable has an associated resolver that provides a variable's value each time
- it is referenced (replaced) in a string substitution. A dynamic variable may
- also provide an argument in its reference that can be used by its resolver to
- determine its substitution value.</p>
-<p>A variable manager (<code>IStringVariableManager</code>) is provided to manage
- the set of defined variables. Value variables may be created via API on the
- variable manager, or contributed via the <code>valueVariables</code> extension
- point. Dynamic variables must be contributed via the <code>dynamicVariables</code>
- extension point. The variable manager also provides change notification for
- value variables. The variable manager also provides an API for performing string
- substitution, which accepts a string, and returns a string with all variable
- references replaced by associated variable values.</p>
-<p>Variables are referenced in strings by enclosing them in braces, preceded with
- a dollar sign. For example, consider a variable defined with the name <code>foo</code>,
- and referenced in the following string: <code>"abc${foo}ghi"</code>.
- If the value of <code>foo</code> is <code>"def"</code>, the result
- of a string substitution would be <code>"abcdefghi"</code>. In the
- case of a dynamic variable, an (optional) argument is supplied by appending
- a colon and argument value after the variable name. For example <code>"${foo:bar}"</code>.
- In this case, the resolver associated with <code>foo</code> would be provided
- with the referenced argument (<code>bar</code>) when asked to resolve a value
- for the variable <code>foo</code>. </p>
-</body>
-</html>
diff --git a/org.eclipse.ui.console/.classpath b/org.eclipse.ui.console/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/org.eclipse.ui.console/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.ui.console/.cvsignore b/org.eclipse.ui.console/.cvsignore
deleted file mode 100644
index ba077a4..0000000
--- a/org.eclipse.ui.console/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.ui.console/.options b/org.eclipse.ui.console/.options
deleted file mode 100644
index d7752ad..0000000
--- a/org.eclipse.ui.console/.options
+++ /dev/null
@@ -1 +0,0 @@
-# Debugging options for the org.eclipse.ui.console plugin.
diff --git a/org.eclipse.ui.console/.project b/org.eclipse.ui.console/.project
deleted file mode 100644
index aa92a70..0000000
--- a/org.eclipse.ui.console/.project
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.console</name>
- <comment></comment>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.ui.console/about.html b/org.eclipse.ui.console/about.html
deleted file mode 100644
index 6b68e18..0000000
--- a/org.eclipse.ui.console/about.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>8th September, 2003</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 1.0 ("CPL"). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, "Program" will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL ("Other License"), any modifications, enhancements and/or
-other code and/or documentation ("Modifications") uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/org.eclipse.ui.console/build.properties b/org.eclipse.ui.console/build.properties
deleted file mode 100644
index d166e58..0000000
--- a/org.eclipse.ui.console/build.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = icons/,\
- .options,\
- plugin.xml,\
- plugin.properties,\
- *.jar,\
- about.html
-
-source.console.jar src/
-src.includes=about.html
diff --git a/org.eclipse.ui.console/hglegal2003.htm b/org.eclipse.ui.console/hglegal2003.htm
deleted file mode 100644
index 47c8540..0000000
--- a/org.eclipse.ui.console/hglegal2003.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <LINK REL="stylesheet" HREF="book.css" CHARSET="ISO-8859-1" TYPE="text/css">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.ui.console/icons/full/clcl16/clear_co.gif b/org.eclipse.ui.console/icons/full/clcl16/clear_co.gif
deleted file mode 100644
index 6bc10f9..0000000
--- a/org.eclipse.ui.console/icons/full/clcl16/clear_co.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/clcl16/pin.gif b/org.eclipse.ui.console/icons/full/clcl16/pin.gif
deleted file mode 100644
index ec50b70..0000000
--- a/org.eclipse.ui.console/icons/full/clcl16/pin.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/cview16/console_view.gif b/org.eclipse.ui.console/icons/full/cview16/console_view.gif
deleted file mode 100644
index a598f60..0000000
--- a/org.eclipse.ui.console/icons/full/cview16/console_view.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif b/org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif
deleted file mode 100644
index 9ff6416..0000000
--- a/org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/dlcl16/pin.gif b/org.eclipse.ui.console/icons/full/dlcl16/pin.gif
deleted file mode 100644
index 61615d5..0000000
--- a/org.eclipse.ui.console/icons/full/dlcl16/pin.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/elcl16/clear_co.gif b/org.eclipse.ui.console/icons/full/elcl16/clear_co.gif
deleted file mode 100644
index 6bc10f9..0000000
--- a/org.eclipse.ui.console/icons/full/elcl16/clear_co.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/elcl16/pin.gif b/org.eclipse.ui.console/icons/full/elcl16/pin.gif
deleted file mode 100644
index ec50b70..0000000
--- a/org.eclipse.ui.console/icons/full/elcl16/pin.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/icons/full/eview16/console_view.gif b/org.eclipse.ui.console/icons/full/eview16/console_view.gif
deleted file mode 100644
index a598f60..0000000
--- a/org.eclipse.ui.console/icons/full/eview16/console_view.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/ngibmcpy2003.gif b/org.eclipse.ui.console/ngibmcpy2003.gif
deleted file mode 100644
index c786e43..0000000
--- a/org.eclipse.ui.console/ngibmcpy2003.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.console/plugin.properties b/org.eclipse.ui.console/plugin.properties
deleted file mode 100644
index d29a1a3..0000000
--- a/org.eclipse.ui.console/plugin.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-pluginName=Console
-providerName=Eclipse.org
-ConsoleView.name=Console
-
-ViewCommand.consoleView.name=Console
-ViewCommand.consoleView.description=Show the Console view
-
-ConsoleFontDefinition.description= The console text font is used by the generic console
-ConsoleFontDefinition.label= Console Text Font
\ No newline at end of file
diff --git a/org.eclipse.ui.console/plugin.xml b/org.eclipse.ui.console/plugin.xml
deleted file mode 100644
index 9fdfc65..0000000
--- a/org.eclipse.ui.console/plugin.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.ui.console"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName"
- class="org.eclipse.ui.console.ConsolePlugin">
-
- <runtime>
- <library name="console.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.help"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.core.runtime"/>
- </requires>
-
-
- <extension
- point="org.eclipse.ui.views">
- <view
- name="%ConsoleView.name"
- icon="icons/full/cview16/console_view.gif"
- category="org.eclipse.ui"
- class="org.eclipse.ui.internal.console.ConsoleView"
- id="org.eclipse.ui.console.ConsoleView">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- name="%ViewCommand.consoleView.name"
- description="%ViewCommand.consoleView.description"
- category="org.eclipse.ui.category.views"
- id="org.eclipse.ui.console.ConsoleView">
- </command>
- <keyBinding
- string=""
- scope="org.eclipse.ui.globalScope"
- command="org.eclipse.ui.console.ConsoleView"
- configuration="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- </extension>
- <extension
- point="org.eclipse.ui.themes">
- <fontDefinition
- label="%ConsoleFontDefinition.label"
- defaultsTo="org.eclipse.jface.textfont"
- categoryId="org.eclipse.ui.workbenchMisc"
- id="org.eclipse.ui.console.ConsoleFont">
- <description>
- %ConsoleFontDefinition.description
- </description>
- </fontDefinition>
- </extension>
-
-</plugin>
diff --git a/org.eclipse.ui.console/scripts/exportplugin.xml b/org.eclipse.ui.console/scripts/exportplugin.xml
deleted file mode 100644
index af246f1..0000000
--- a/org.eclipse.ui.console/scripts/exportplugin.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<!-- Export a jar of .class files for the org.eclipse.ui.console Eclipse plugin
- along with other important plugin files to the "plugin-export" subdirectory
- of the target Eclipse installation -->
-<project name="Export ui.console" default="export" basedir="..">
-
- <!-- Set the timestamp and important properties -->
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="dest" value="${destdir}/org.eclipse.ui.console_3.0.0" />
- </target>
-
- <!-- Create the jar of .class files, and copy other important files to export dir -->
- <target name="export" depends="init">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/console.jar"
- basedir="bin"
- />
- <!-- Create the source zip -->
- <zip zipfile="${dest}/consolesrc.zip">
- <fileset dir="src"/>
- </zip>
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy file=".classpath" todir="${dest}"/>
- <copy file=".options" todir="${dest}"/>
- <copy todir="${dest}/icons">
- <fileset dir="icons" />
- </copy>
- </target>
-
-</project>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
deleted file mode 100644
index 6f80f0b..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.ui.internal.console.ConsoleMessages;
-
-/**
- * Common function for consoles.
- * <p>
- * Clients implementing consoles should subclass this class.
- * </p>
- * @since 3.0
- */
-public abstract class AbstractConsole implements IConsole {
-
- // property listeners
- private ListenerList fListeners;
-
- /**
- * Console name
- */
- private String fName = null;
-
- /**
- * Console image descriptor
- */
- private ImageDescriptor fImageDescriptor = null;
-
- /**
- * Used to notify this console of lifecycle methods <code>init()</code>
- * and <code>dispose()</code>.
- */
- class Lifecycle implements IConsoleListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
- */
- public void consolesAdded(IConsole[] consoles) {
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if (console == AbstractConsole.this) {
- init();
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
- */
- public void consolesRemoved(IConsole[] consoles) {
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if (console == AbstractConsole.this) {
- ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
- dispose();
- }
- }
- }
- }
-
- /**
- * Notifies listeners of property changes, handling any exceptions
- */
- class PropertyNotifier implements ISafeRunnable {
-
- private IPropertyChangeListener fListener;
- private PropertyChangeEvent fEvent;
-
- /**
- * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
- */
- public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.getString("AbstractConsole.0"), exception); //$NON-NLS-1$
- ConsolePlugin.log(status);
- }
-
- /**
- * @see org.eclipse.core.runtime.ISafeRunnable#run()
- */
- public void run() throws Exception {
- fListener.propertyChange(fEvent);
- }
-
- /**
- * Notifies listeners of the property change
- *
- * @param event the event that describes the property that has changed
- */
- public void notify(PropertyChangeEvent event) {
- if (fListeners == null) {
- return;
- }
- fEvent = event;
- Object[] copiedListeners= fListeners.getListeners();
- for (int i= 0; i < copiedListeners.length; i++) {
- fListener = (IPropertyChangeListener)copiedListeners[i];
- Platform.run(this);
- }
- fListener = null;
- }
- }
-
- /**
- * Constructs a new console with the given name and image.
- *
- * @param name console name, cannot be <code>null</code>
- * @param imageDescriptor image descriptor, or <code>null</code> if none
- */
- public AbstractConsole(String name, ImageDescriptor imageDescriptor) {
- setName(name);
- setImageDescriptor(imageDescriptor);
- ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new Lifecycle());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsole#getName()
- */
- public String getName() {
- return fName;
- }
-
- /**
- * Sets the name of this console to the specified value and notifies
- * property listeners of the change.
- *
- * @param name the new name
- */
- protected void setName(String name) {
- String old = fName;
- fName = name;
- firePropertyChange(this, IBasicPropertyConstants.P_TEXT, old, name);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsole#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return fImageDescriptor;
- }
-
- /**
- * Sets the image descriptor for this console to the specified value and notifies
- * property listeners of the change.
- *
- * @param imageDescriptor the new image descriptor
- */
- protected void setImageDescriptor(ImageDescriptor imageDescriptor) {
- ImageDescriptor old = fImageDescriptor;
- fImageDescriptor =imageDescriptor;
- firePropertyChange(this, IBasicPropertyConstants.P_IMAGE, old, imageDescriptor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsole#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- if (fListeners == null) {
- fListeners = new ListenerList();
- }
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsole#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- if (fListeners != null) {
- fListeners.remove(listener);
- }
- }
-
- /**
- * Notify all listeners that the given property has changed.
- *
- * @param source the object on which a property has changed
- * @param property identifier of the property that has changed
- * @param oldValue the old value of the property, or <code>null</code>
- * @param newValue the new value of the property, or <code>null</code>
- */
- public void firePropertyChange(Object source, String property, Object oldValue, Object newValue) {
- if (fListeners == null) {
- return;
- }
- PropertyNotifier notifier = new PropertyNotifier();
- notifier.notify(new PropertyChangeEvent(source, property, oldValue, newValue));
- }
-
- /**
- * Called when this console is added to the console manager. Default
- * implementation does nothing. Subclasses may override.
- */
- protected void init() {
- }
-
- /**
- * Called when this console is removed from the console manager. Default
- * implementation does nothing. Subclasses may override.
- */
- protected void dispose() {
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java
deleted file mode 100644
index 5446acf..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.ui.console;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.internal.console.ConsoleManager;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The console plug-in class.
- *
- * @since 3.0
- */
-
-public class ConsolePlugin extends AbstractUIPlugin {
-
- /**
- * Singleton console manager
- */
- private IConsoleManager fConsoleManager = null;
-
- /**
- * The singleton console plugin instance
- */
- private static ConsolePlugin fgPlugin= null;
-
- /**
- * Unique identifier constant (value <code>"org.eclipse.ui.console"</code>)
- * for the UI Console plug-in.
- */
- private static final String PI_UI_CONSOLE = "org.eclipse.ui.console"; //$NON-NLS-1$
-
- /**
- * Returns the singleton instance of the console plugin.
- */
- public static ConsolePlugin getDefault() {
- return fgPlugin;
- }
-
- public ConsolePlugin() {
- super();
- fgPlugin = this;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- return PI_UI_CONSOLE;
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- */
- public static void log(Throwable t) {
- log(newErrorStatus("Error logged from Console plug-in: ", t)); //$NON-NLS-1$
- }
-
- /**
- * Returns a new error status for this plugin with the given message
- * @param message the message to be included in the status
- * @param exception the exception to be included in the status or <code>null</code> if none
- * @return a new error status
- */
- public static IStatus newErrorStatus(String message, Throwable exception) {
- return new Status(IStatus.ERROR, getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, message, exception);
- }
-
- /**
- * Returns the console manager. The manager will be created lazily on
- * the first access.
- *
- * @return IConsoleManager
- */
- public IConsoleManager getConsoleManager() {
- if (fConsoleManager == null) {
- fConsoleManager = new ConsoleManager();
- }
- return fConsoleManager;
- }
-
- /**
- * Returns the standard display to be used. The method first checks, if
- * the thread calling this method has an associated display. If so, this
- * display is returned. Otherwise the method returns the default display.
- */
- public static Display getStandardDisplay() {
- Display display= Display.getCurrent();
- if (display == null) {
- display= Display.getDefault();
- }
- return display;
- }
-
- /**
- * Utility method with conventions
- */
- public static void errorDialog(Shell shell, String title, String message, Throwable t) {
- IStatus status;
- if (t instanceof CoreException) {
- status= ((CoreException)t).getStatus();
- // if the 'message' resource string and the IStatus' message are the same,
- // don't show both in the dialog
- if (status != null && message.equals(status.getMessage())) {
- message= null;
- }
- } else {
- status= new Status(IStatus.ERROR, getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$
- log(status);
- }
- ErrorDialog.openError(shell, title, message, status);
- }
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java
deleted file mode 100644
index 935399e..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.ui.part.IPageBookViewPage;
-
-/**
- * A logical console. A console is commonly used to display messages. For example,
- * a console may display the output streams of a system process. A console can be
- * displayed by one or more views.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.0
- */
-public interface IConsole {
-
- /**
- * Returns the name of this console.
- *
- * @return the name of this console
- */
- public String getName();
-
- /**
- * Returns an image descriptor for this console, or <code>null</code>
- * if none.
- *
- * @return an image descriptor for this console, or <code>null</code>
- * if none
- */
- public ImageDescriptor getImageDescriptor();
-
- /**
- * Creates and returns a new page for this console. The page is displayed
- * for this console in the console given view.
- *
- * @param view the view in which the page is to be created
- * @return a page book view page representation of this console
- */
- public IPageBookViewPage createPage(IConsoleView view);
-
- /**
- * Adds a listener for changes to properties of this console.
- * Has no effect if an identical listener is already registered.
- * <p>
- * The changes supported by the console view are as follows:
- * <ul>
- * <li><code>IBasicPropertyConstants.P_TEXT</code> - indicates the name
- * of a console has changed</li>
- * <li><code>IBasicPropertyConstants.P_IMAGE</code> - indicates the image
- * of a console has changed</li>
- * </ul>
- * </p>
- * <p>
- * Clients may define additional properties as required.
- * </p>
- *
- * @param listener a property change listener
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Removes the given property listener from this console page.
- * Has no effect if an identical listener is not alread registered.
- *
- * @param listener a property listener
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java
deleted file mode 100644
index 5bd8bf8..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.ui.console;
-
-/**
- * Constants relating to the console plug-in.
- *
- * @since 3.0
- */
-public interface IConsoleConstants {
-
- /**
- * Console plug-in identifier (value <code>"org.eclipse.ui.console"</code>).
- */
- public static final String PLUGIN_ID = ConsolePlugin.getUniqueIdentifier();
-
- /**
- * Console view identifier (value <code>"org.eclipse.ui.console.ConsoleView"</code>).
- */
- public static final String ID_CONSOLE_VIEW= "org.eclipse.ui.console.ConsoleView"; //$NON-NLS-1$
-
- /**
- * The name of the font to use for the Console (value <code>"org.eclipse.ui.console.ConsoleFont"</code>).
- */
- public static final String CONSOLE_FONT= "org.eclipse.ui.console.ConsoleFont"; //$NON-NLS-1$
-
- /**
- * Identifier for a launch group in a menu (value <code>"launchGroup"</code>).
- */
- public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an output group in a menu (value
- * <code>"outputGroup"</code>).
- */
- public static final String OUTPUT_GROUP = "outputGroup"; //$NON-NLS-1$
-
- /**
- * Console view image identifier
- */
- public static final String IMG_VIEW_CONSOLE= "IMG_VIEW_CONSOLE"; //$NON-NLS-1$
-
- /**
- * Clear action image identifier.
- */
- public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java
deleted file mode 100644
index 7d22c8a..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-/**
- * A console listener is notified when consoles are added or removed from
- * the console manager.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.0
- */
-public interface IConsoleListener {
-
- /**
- * Notification the given consoles have been added to the console
- * manager.
- *
- * @param consoles added consoles
- */
- public void consolesAdded(IConsole[] consoles);
-
- /**
- * Notification the given consoles have been removed from the
- * console manager.
- *
- * @param consoles removed consoles
- */
- public void consolesRemoved(IConsole[] consoles);
-
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java
deleted file mode 100644
index 200408f..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-/**
- * Manages consoles.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.0
- */
-public interface IConsoleManager {
-
- /**
- * Registers the given listener for console notifications. Has
- * no effect if an identical listener is already registered.
- *
- * @param listener listener to register
- */
- public void addConsoleListener(IConsoleListener listener);
-
- /**
- * Deregisters the given listener for console notifications. Has
- * no effect if an identical listener is not already registered.
- *
- * @param listener listener to deregister
- */
- public void removeConsoleListener(IConsoleListener listener);
-
- /**
- * Adds the given consoles to the console manager. Has no effect for
- * equivalent consoles already registered. The consoles will be added
- * to any existing console views.
- *
- * @param consoles consoles to add
- */
- public void addConsoles(IConsole[] consoles);
-
- /**
- * Removes the given consoles from the console manager. If the consoles are
- * being displayed in any console views, the associated pages will be closed.
- *
- * @param consoles consoles to remove
- */
- public void removeConsoles(IConsole[] consoles);
-
- /**
- * Returns a collection of consoles registered with the console manager.
- *
- * @return a collection of consoles registered with the console manager
- */
- public IConsole[] getConsoles();
-
- /**
- * Opens the console view and displays given the console.
- * If the view is already open, it is brought to the front unless
- * the view is pinned on a console other than the given console.
- *
- * @param console console to display
- */
- public void showConsoleView(IConsole console);
-
- /**
- * Warns that the content of the given console has changed in
- * all console views.
- *
- * @param console the console that has changed
- */
- public void warnOfContentChange(IConsole console);
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java
deleted file mode 100644
index 54ef81e..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-import org.eclipse.ui.IViewPart;
-
-/**
- * A view that displays consoles registered with the console manager.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.0
- */
-public interface IConsoleView extends IViewPart {
-
- /**
- * Displays the page for the given console in this console view.
- * Has no effect if this console view has a pinned console.
- *
- * @param console console to display, cannot be <code>null</code>
- */
- public void display(IConsole console);
-
- /**
- * Displays and pins the given console in this console view. No
- * other console can be displayed until this console view is
- * un-pinned. Specifying <code>null</code> un-pins this console
- *
- * @param console console to pin, or <code>null</code> to un-pin
- */
- public void pin(IConsole console);
-
- /**
- * Returns whether this console view is currently pinned to a
- * specific console.
- *
- * @return whether this console view is currently pinned to a
- * specific console
- */
- public boolean isPinned();
-
- /**
- * Returns the console currently being displayed, or <code>null</code>
- * if none
- *
- * @return the console currently being displayed, or <code>null</code>
- * if none
- */
- public IConsole getConsole();
-
- /**
- * Warns that the content of the given console has changed.
- *
- * @param console the console that has changed
- */
- public void warnOfContentChange(IConsole console);
-
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java
deleted file mode 100644
index 99d833f..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.ui.internal.console.MessageConsolePage;
-import org.eclipse.ui.internal.console.MessageConsolePartitioner;
-import org.eclipse.ui.part.IPageBookViewPage;
-
-/**
- * A console that displays messages. A message console may have one or
- * more streams connected to it (<code>MessageConsoleStream</code>).
- * Text written to streams is buffered and processed in a background
- * thread.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.0
- */
-public class MessageConsole extends AbstractConsole {
-
- /**
- * The font used by this console
- */
- private Font fFont = null;
-
- /**
- * Property constant indicating the font of this console has changed.
- */
- public static final String P_FONT = ConsolePlugin.getUniqueIdentifier() + ".P_FONT"; //$NON-NLS-1$
-
- /**
- * Property constant indicating the color of a stream has changed.
- */
- public static final String P_STREAM_COLOR = ConsolePlugin.getUniqueIdentifier() + ".P_STREAM_COLOR"; //$NON-NLS-1$
-
- /**
- * Property constant indicating tab size has changed
- */
- public static final String P_TAB_SIZE = ConsolePlugin.getUniqueIdentifier() + ".P_TAB_SIZE"; //$NON-NLS-1$
-
- /**
- * The default tab size
- */
- public static final int DEFAULT_TAB_SIZE = 8;
-
- // document partitioner
- private MessageConsolePartitioner fPartitioner = null;
-
- // current tab size
- private int tabWidth = DEFAULT_TAB_SIZE;
-
-
- /**
- * Constructs a new message console.
- *
- * @param name console name
- * @param imageDescriptor console image descriptor or <code>null</code>
- * if none
- */
- public MessageConsole(String name, ImageDescriptor imageDescriptor) {
- super(name, imageDescriptor);
- fPartitioner = new MessageConsolePartitioner();
- }
-
- /**
- * Returns the maximum number of characters that the console will display at
- * once. This is analagous to the size of the text buffer this console
- * maintains.
- *
- * @return the maximum number of characters that the console will display
- */
- public int getHighWaterMark() {
- return fPartitioner.getHighWaterMark();
- }
-
- /**
- * Sets the text buffer size for this console. The high water mark indicates
- * the maximum number of characters stored in the buffer. The low water mark
- * indicates the number of characters remaining in the buffer when the high
- * water mark is exceeded.
- *
- * @param low the number of characters remaining in the buffer when the high
- * water mark is exceeded
- * @param high the maximum number of characters this console will cache in
- * its text buffer
- * @exception IllegalArgumentException if low >= high
- */
- public void setWaterMarks(int low, int high) {
- fPartitioner.setWaterMarks(low, high);
- }
-
- /**
- * Returns the number of characters that will remain in this console
- * when its high water mark is exceeded.
- *
- * @return the number of characters that will remain in this console
- * when its high water mark is exceeded
- */
- public int getLowWaterMark() {
- return fPartitioner.getLowWaterMark();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.AbstractConsole#dispose()
- */
- protected void dispose() {
- fPartitioner.disconnect();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView)
- */
- public IPageBookViewPage createPage(IConsoleView view) {
- return new MessageConsolePage(view, this);
- }
-
- /**
- * Sets the font used by this console
- *
- * @param font font
- */
- public void setFont(Font font) {
- Font old = fFont;
- fFont = font;
- firePropertyChange(this, P_FONT, old, font);
- }
-
- /**
- * Returns the font for this console
- *
- * @return font for this console
- */
- public Font getFont() {
- if (fFont == null) {
- return JFaceResources.getTextFont();
- }
- return fFont;
- }
-
- /**
- * Returns a new message stream connected to this console.
- *
- * @return a new message stream connected to this console
- */
- public MessageConsoleStream newMessageStream() {
- return new MessageConsoleStream(this);
- }
-
- /**
- * Appends the given message to this console, from the specified stream.
- *
- * @param text message
- * @param stream stream the message belongs to
- */
- protected synchronized void appendToDocument(String text, MessageConsoleStream stream) {
- fPartitioner.appendToDocument(text, stream);
- }
-
- /**
- * Returns the document this console writes to.
- *
- * @return the document this console wites to
- */
- public IDocument getDocument() {
- return fPartitioner.getDocument();
- }
-
- /**
- * Sets the tab width.
- * @param tabSize The tab width
- */
- public void setTabWidth(int tabWidth) {
- int old = this.tabWidth;
- this.tabWidth = tabWidth;
- firePropertyChange(this, P_TAB_SIZE, new Integer(old), new Integer(tabWidth));
- }
-
- /**
- * Returns the tab width.
- * @return tab width
- */
- public int getTabWidth() {
- return tabWidth;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java
deleted file mode 100644
index 6906c3d..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console;
-
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Used to write messages to a message console. A message console may have more
- * than one stream connected to it. Each stream may be displayed in a different
- * color.
- *
- * @since 3.0
- */
-public class MessageConsoleStream {
-
- private MessageConsole fConsole = null;
-
- private Color fColor = null;
-
- /**
- * Constructs a new stream connected to the given console.
- *
- * @param console the console to write messages to
- */
- public MessageConsoleStream(MessageConsole console) {
- fConsole = console;
- }
-
- /**
- * Appends the specified message to this stream.
- *
- * @param message message to append
- */
- public void print(String message) {
- fConsole.appendToDocument(message, this);
- }
-
-
- /**
- * Appends a line separator string to this stream.
- */
- public void println() {
- print("\n"); //$NON-NLS-1$
- }
-
- /**
- * Appends the specified message to this stream, followed by a line
- * separator string.
- *
- * @param message message to print
- */
- public void println(String message) {
- print(message);
- println();
- }
-
- /**
- * Sets the color of this message stream
- *
- * @param color color of this message stream, possibly <code>null</code>
- */
- public void setColor(Color color) {
- Color old = fColor;
- fColor = color;
- fConsole.firePropertyChange(this, MessageConsole.P_STREAM_COLOR, old, color);
- }
-
- /**
- * Returns the color of this message stream, or <code>null</code>
- * if default.
- *
- * @return the color of this message stream, or <code>null</code>
- */
- public Color getColor() {
- return fColor;
- }
-
- /**
- * Returns the console this stream is connected to.
- *
- * @return the console this stream is connected to
- */
- public MessageConsole getConsole() {
- return fConsole;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java
deleted file mode 100644
index b90a3d3..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console.actions;
-
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.internal.console.ConsoleMessages;
-import org.eclipse.ui.internal.console.ConsolePluginImages;
-import org.eclipse.ui.internal.console.IConsoleHelpContextIds;
-import org.eclipse.ui.internal.console.IInternalConsoleConstants;
-
-/**
- * Clears the output in a text console.
- * <p>
- * Clients may instantiate this class; this class is not intended to
- * be subclassed.
- * </p>
- * @since 3.0
- */
-public class ClearOutputAction extends Action {
-
- private ITextViewer fViewer;
-
- public ClearOutputAction(ITextViewer viewer) {
- super(ConsoleMessages.getString("ClearOutputAction.title")); //$NON-NLS-1$
- fViewer= viewer;
- setToolTipText(ConsoleMessages.getString("ClearOutputAction.toolTipText")); //$NON-NLS-1$
- setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IConsoleConstants.IMG_LCL_CLEAR));
- setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_CLEAR));
- setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLEAR));
- WorkbenchHelp.setHelp(this, IConsoleHelpContextIds.CLEAR_CONSOLE_ACTION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- BusyIndicator.showWhile(ConsolePlugin.getStandardDisplay(), new Runnable() {
- public void run() {
- IDocument document = fViewer.getDocument();
- if (document != null) {
- document.set(""); //$NON-NLS-1$
- }
- fViewer.setSelectedRange(0, 0);
- }
- });
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java
deleted file mode 100644
index 9f187f3..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console.actions;
-
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for actions that operate on a text viewer.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.0
- */
-public class TextViewerAction extends Action implements IUpdate {
-
- private int fOperationCode= -1;
- private ITextOperationTarget fOperationTarget;
-
- /**
- * Constructs a new action in the given text viewer with
- * the specified operation code.
- *
- * @param viewer
- * @param operationCode
- */
- public TextViewerAction(ITextViewer viewer, int operationCode) {
- fOperationCode= operationCode;
- fOperationTarget= viewer.getTextOperationTarget();
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- *
- * Updates the enabled state of the action.
- * Fires a property change if the enabled state changes.
- *
- * @see org.eclipse.jface.action.Action#firePropertyChange(String, Object, Object)
- */
- public void update() {
-
- boolean wasEnabled= isEnabled();
- boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode));
- setEnabled(isEnabled);
-
- if (wasEnabled != isEnabled) {
- firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (fOperationCode != -1 && fOperationTarget != null) {
- fOperationTarget.doOperation(fOperationCode);
- }
- }
-
- /**
- * Configures this action with a label, tool tip, and description.
- *
- * @param text action label
- * @param toolTipText action tool tip
- * @param description action description
- */
- public void configureAction(String text, String toolTipText, String description) {
- setText(text);
- setToolTipText(toolTipText);
- setDescription(description);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java
deleted file mode 100644
index ea740b8..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.console.actions;
-
-
-import java.text.MessageFormat;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.internal.console.ConsoleMessages;
-
-/**
- * Action to position a text viewer to a specific line.
- * <p>
- * Clients may instantiate this class; this class is not intended to
- * be subclassed.
- * </p>
- * @since 3.0
- */
-public class TextViewerGotoLineAction extends TextViewerAction {
-
- /**
- * Validates whether the text found in the input field of the
- * dialog forms a valid line number, i.e. one to which can be
- * jumped.
- */
- class NumberValidator implements IInputValidator {
-
- public String isValid(String input) {
- try {
- int i= Integer.parseInt(input);
- if (i <= 0 || fLastLine < i)
- return ConsoleMessages.getString("TextViewerGotoLineAction.Line_number_out_of_range_1"); //$NON-NLS-1$
-
- } catch (NumberFormatException x) {
- return ConsoleMessages.getString("TextViewerGotoLineAction.Not_a_number_2"); //$NON-NLS-1$
- }
-
- return null;
- }
- }
-
- protected int fLastLine;
- protected ITextViewer fTextViewer;
-
- /**
- * Constructs a goto line action for the viewer using the provided resource bundle
- */
- public TextViewerGotoLineAction(ITextViewer viewer) {
- super(viewer, -1);
- fTextViewer= viewer;
- setText(ConsoleMessages.getString("TextViewerGotoLineAction.Go_to_&Line...@Ctrl+L_4")); //$NON-NLS-1$
- setToolTipText(ConsoleMessages.getString("TextViewerGotoLineAction.Go_To_Line_1")); //$NON-NLS-1$
- setDescription(ConsoleMessages.getString("TextViewerGotoLineAction.Go_To_Line_1")); //$NON-NLS-1$
- }
-
- /**
- * @see TextViewerAction#update()
- */
- public void update() {
- }
-
- /**
- * Jumps to the line.
- */
- protected void gotoLine(int line) {
-
- IDocument document= fTextViewer.getDocument();
- try {
- int start= document.getLineOffset(line);
- int length= document.getLineLength(line);
- fTextViewer.getTextWidget().setSelection(start, start + length);
- fTextViewer.revealRange(start, length);
- } catch (BadLocationException x) {
- ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ConsoleMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- try {
- Point selection= fTextViewer.getTextWidget().getSelection();
- IDocument document= fTextViewer.getDocument();
- fLastLine= document.getLineOfOffset(document.getLength()) + 1;
- int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1;
- String title= ConsoleMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"); //$NON-NLS-1$
- String message= MessageFormat.format(ConsoleMessages.getString("TextViewerGotoLineAction.Enter_line_number__8"), new Object[] {new Integer(fLastLine)}); //$NON-NLS-1$
- String value= Integer.toString(startLine);
- Shell activeShell= fTextViewer.getTextWidget().getShell();
- InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator());
- if (d.open() == Window.OK) {
- try {
- int line= Integer.parseInt(d.getValue());
- gotoLine(line - 1);
- } catch (NumberFormatException x) {
- ConsolePlugin.errorDialog(activeShell, ConsoleMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ConsoleMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- } catch (BadLocationException x) {
- ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.getString("TextViewerGotoLineAction.Go_To_Line_1"), ConsoleMessages.getString("TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2"), x); //$NON-NLS-1$ //$NON-NLS-2$
- return;
- }
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html
deleted file mode 100644
index cfb538c..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Console Actions</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<p align="left"> Application programming interfaces for Eclipse console specific
- actions.</p>
-
-<h2 align="left">Package Specification</h2>
-
-<p>This package provides a set of actions related to the Eclipse console.</p>
-<p>Clients are allowed to instantiate classes from this package. The classes are
- not intended to be subclassed.</p>
-</body>
-</html>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/package.html b/org.eclipse.ui.console/src/org/eclipse/ui/console/package.html
deleted file mode 100644
index 95aa4ac..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/package.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Console</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Application programming interfaces for interaction
-with the Eclipse console.</p>
-
-<h2>Package Specification</h2>
-
-<p>The Eclipse platform UI console plug-in provides a set of classes and interfaces to
-support a generic console. This package contains a generic abstract console that provides the common functionality
-for consoles. Clients implementing consoles should subclass this <b>AbstractConsole</b>.</p>
-<p>The classes <b>MessageConsole</b> and <b>MessageConsoleStream</b> provide an
- implementation of a message console and message console stream that enables
- logging of messages to a console.</p>
-<p>A console manager (<b>IConsoleManager</b>) manages all active consoles, and
- provides notification of consoles which are added and removed. Consoles are
- displayed in a page book view. Each console implementation is reponsible for
- creating its page (<b>IPageBookView</b>), which provides freedom of presentation
- to the console implementation. A single console may be displayed simultaneously
- in multiple console views, in different workbench windows.</p>
-</body>
-</html>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
deleted file mode 100644
index 76f93c4..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-
-import java.util.List;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleListener;
-import org.eclipse.ui.console.IConsoleView;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Drop down action in the console to select the console to display.
- */
-class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleListener, IUpdate {
-
- private IConsoleView fView;
- private Menu fMenu;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
- setEnabled(consoles.length > 1);
- }
-
- public ConsoleDropDownAction(IConsoleView view) {
- fView= view;
- setText(ConsoleMessages.getString("ConsoleDropDownAction.0")); //$NON-NLS-1$
- setToolTipText(ConsoleMessages.getString("ConsoleDropDownAction.1")); //$NON-NLS-1$
- setImageDescriptor(ConsolePluginImages.getImageDescriptor(IConsoleConstants.IMG_VIEW_CONSOLE));
- setMenuCreator(this);
- ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this);
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (fMenu != null) {
- fMenu.dispose();
- }
-
- fView= null;
- ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- if (fMenu != null) {
- fMenu.dispose();
- }
-
- fMenu= new Menu(parent);
- IConsole[] consoles= ConsolePlugin.getDefault().getConsoleManager().getConsoles();
- IConsole current = fView.getConsole();
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- Action action = new ShowConsoleAction(fView, console);
- action.setChecked(console.equals(current));
- addActionToMenu(fMenu, action);
- }
- return fMenu;
- }
-
- protected void addActionToMenu(Menu parent, Action action) {
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- protected void addMenuSeparator() {
- new MenuItem(fMenu, SWT.SEPARATOR);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- List stack = ((ConsoleView)fView).getConsoleStack();
- if (stack.size() > 1) {
- IConsole console = (IConsole) stack.get(1);
- fView.display(console);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
- */
- public void consolesAdded(IConsole[] consoles) {
- Display display = ConsolePlugin.getStandardDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- update();
- }
- });
- }
-
- /* (non-Javadoc)
- *
- * Dispose the menu when a launch is removed, such that the actions in this
- * menu do not hang on to associated resources.
- *
- * @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
- */
- public void consolesRemoved(IConsole[] consoles) {
- Display display = ConsolePlugin.getStandardDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if (fMenu != null) {
- fMenu.dispose();
- }
- update();
- }
- });
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
deleted file mode 100644
index b3a5198..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleListener;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.IConsoleView;
-
-/**
- * The singleton console manager.
- *
- * @since 3.0
- */
-public class ConsoleManager implements IConsoleManager {
-
- /**
- * Console listeners
- */
- private ListenerList fListeners = null;
-
- /**
- * List of registered consoles
- */
- private List fConsoles = new ArrayList(10);
-
- // change notification constants
- private final static int ADDED = 1;
- private final static int REMOVED = 2;
-
- /**
- * Notifies a console listener of additions or removals
- */
- class ConsoleNotifier implements ISafeRunnable {
-
- private IConsoleListener fListener;
- private int fType;
- private IConsole[] fChanged;
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
- */
- public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.getString("ConsoleManager.0"), exception); //$NON-NLS-1$
- ConsolePlugin.log(status);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ISafeRunnable#run()
- */
- public void run() throws Exception {
- switch (fType) {
- case ADDED:
- fListener.consolesAdded(fChanged);
- break;
- case REMOVED:
- fListener.consolesRemoved(fChanged);
- break;
- }
- }
-
- /**
- * Notifies the given listener of the adds/removes
- *
- * @param consoles the consoles that changed
- * @param update the type of change
- */
- public void notify(IConsole[] consoles, int update) {
- if (fListeners == null) {
- return;
- }
- fChanged = consoles;
- fType = update;
- Object[] copiedListeners= fListeners.getListeners();
- for (int i= 0; i < copiedListeners.length; i++) {
- fListener = (IConsoleListener)copiedListeners[i];
- Platform.run(this);
- }
- fChanged = null;
- fListener = null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleManager#addConsoleListener(org.eclipse.ui.console.IConsoleListener)
- */
- public void addConsoleListener(IConsoleListener listener) {
- if (fListeners == null) {
- fListeners = new ListenerList(5);
- }
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleManager#removeConsoleListener(org.eclipse.ui.console.IConsoleListener)
- */
- public void removeConsoleListener(IConsoleListener listener) {
- if (fListeners != null) {
- fListeners.remove(listener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleManager#addConsoles(org.eclipse.ui.console.IConsole[])
- */
- public synchronized void addConsoles(IConsole[] consoles) {
- List added = new ArrayList(consoles.length);
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if (!fConsoles.contains(console)) {
- fConsoles.add(console);
- added.add(console);
- }
- }
- if (!added.isEmpty()) {
- fireUpdate((IConsole[])added.toArray(new IConsole[added.size()]), ADDED);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleManager#removeConsoles(org.eclipse.ui.console.IConsole[])
- */
- public synchronized void removeConsoles(IConsole[] consoles) {
- List removed = new ArrayList(consoles.length);
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if (fConsoles.remove(console)) {
- removed.add(console);
- }
- }
- if (!removed.isEmpty()) {
- fireUpdate((IConsole[])removed.toArray(new IConsole[removed.size()]), REMOVED);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleManager#getConsoles()
- */
- public synchronized IConsole[] getConsoles() {
- return (IConsole[])fConsoles.toArray(new IConsole[fConsoles.size()]);
- }
-
- /**
- * Fires notification.
- *
- * @param consoles consoles added/removed
- * @param type ADD or REMOVE
- */
- private void fireUpdate(IConsole[] consoles, int type) {
- new ConsoleNotifier().notify(consoles, type);
- }
-
- /**
- * @see IConsoleManager#showConsoleView(IConsole)
- */
- public void showConsoleView(final IConsole console) {
- ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page= window.getActivePage();
- if (page != null) {
- IViewPart consoleView= page.findView(IConsoleConstants.ID_CONSOLE_VIEW);
- if (consoleView == null) {
- try {
- consoleView = page.showView(IConsoleConstants.ID_CONSOLE_VIEW, null, IWorkbenchPage.VIEW_CREATE);
- } catch (PartInitException pie) {
- ConsolePlugin.log(pie);
- }
- } else {
- boolean bringToTop = shouldBringToTop(console, consoleView);
- if (bringToTop) {
- page.bringToTop(consoleView);
- }
- }
- if (consoleView instanceof IConsoleView) {
- ((IConsoleView)consoleView).display(console);
- }
- }
- }
- }
- });
- }
-
- /**
- * Returns whether the given console view should be brought to the top.
- * The view should not be brought to the top if the view is pinned on
- * a console other than the given console.
- */
- private boolean shouldBringToTop(IConsole console, IViewPart consoleView) {
- boolean bringToTop= true;
- if (consoleView instanceof IConsoleView) {
- IConsoleView cView= (IConsoleView)consoleView;
- if (cView.isPinned()) {
- IConsole pinnedConsole= cView.getConsole();
- bringToTop = console.equals(pinnedConsole);
- }
- }
- return bringToTop;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleManager#warnOfContentChange(org.eclipse.ui.console.IConsole)
- */
- public void warnOfContentChange(IConsole console) {
- IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page= window.getActivePage();
- if (page != null) {
- IConsoleView consoleView= (IConsoleView)page.findView(IConsoleConstants.ID_CONSOLE_VIEW);
- if (consoleView != null) {
- consoleView.warnOfContentChange(console);
- }
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java
deleted file mode 100644
index 6c89e23..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * ConsoleMessages
- */
-public class ConsoleMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.ui.internal.console.ConsoleMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE =
- ResourceBundle.getBundle(BUNDLE_NAME);
-
- private ConsoleMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties
deleted file mode 100644
index 60fcd40..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties
+++ /dev/null
@@ -1,47 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2003 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-AbstractConsole.0=Exception occurred during console property change notification.
-
-ConsoleDropDownAction.0=Select Console
-ConsoleDropDownAction.1=Display Selected Console
-
-ConsoleManager.0=An exception occurred during console notification
-
-ConsoleView.0=Console
-
-
-find_replace_action.label=&Find/Replace...@Ctrl+F
-find_replace_action.tooltip=Find/Replace
-find_replace_action.image=
-find_replace_action.description=Find/Replace
-
-MessageConsolePage.&Copy@Ctrl+C_6=&Copy@Ctrl+C
-MessageConsolePage.Copy_7=Copy
-MessageConsolePage.Select_&All@Ctrl+A_12=Select &All@Ctrl+A
-MessageConsolePage.Select_All=Select All
-
-MessageConsolePartitioner.2=Low water mark must be less than high water mark.
-MessageConsolePartitioner.3=Low water mark must be greater than or equal to 1000.
-
-PinConsoleAction.0=Pi&n Console
-PinConsoleAction.1=Pin Console
-
-ClearOutputAction.title=Clea&r
-ClearOutputAction.toolTipText=Clear Console
-
-TextViewerGotoLineAction.Enter_line_number__8=Enter line number (1...{0}):
-TextViewerGotoLineAction.Exceptions_occurred_attempt_to_go_to_line_2=Exceptions occurred attempt to go to line
-TextViewerGotoLineAction.Go_to_&Line...@Ctrl+L_4=Go to &Line...@Ctrl+L
-TextViewerGotoLineAction.Go_To_Line_1=Go to Line
-TextViewerGotoLineAction.Line_number_out_of_range_1=Line number out of range
-TextViewerGotoLineAction.Not_a_number_2=Not a number
-
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java
deleted file mode 100644
index ced5ab9..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsoleConstants;
-
-/**
- * The images provided by the debug plugin.
- */
-public class ConsolePluginImages {
-
- /**
- * The image registry containing <code>Image</code>s.
- */
- private static ImageRegistry imageRegistry;
-
- /**
- * A table of all the <code>ImageDescriptor</code>s.
- */
- private static Map imageDescriptors;
-
- /* Declare Common paths */
- private static URL ICON_BASE_URL= null;
-
- static {
- String pathSuffix = "icons/full/"; //$NON-NLS-1$
- ICON_BASE_URL= ConsolePlugin.getDefault().getBundle().getEntry(pathSuffix);
- }
-
- // Use IPath and toOSString to build the names to ensure they have the slashes correct
- private final static String LOCALTOOL= "clcl16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String DLCL= "dlcl16/"; //disabled - size 16x16 //$NON-NLS-1$
- private final static String ELCL= "elcl16/"; //enabled - size 16x16 //$NON-NLS-1$
- private final static String VIEW= "cview16/"; // views //$NON-NLS-1$
-
- /**
- * Declare all images
- */
- private static void declareImages() {
- // Actions
-
- //local toolbars
- declareRegistryImage(IConsoleConstants.IMG_LCL_CLEAR, LOCALTOOL + "clear_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalConsoleConstants.IMG_LCL_PIN, LOCALTOOL + "pin.gif"); //$NON-NLS-1$
-
- // disabled local toolbars
- declareRegistryImage(IInternalConsoleConstants.IMG_DLCL_CLEAR, DLCL + "clear_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalConsoleConstants.IMG_DLCL_PIN, DLCL + "pin.gif"); //$NON-NLS-1$
-
- // enabled local toolbars
- declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_CLEAR, ELCL + "clear_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_PIN, ELCL + "pin.gif"); //$NON-NLS-1$
-
- // Views
- declareRegistryImage(IConsoleConstants.IMG_VIEW_CONSOLE, VIEW + "console_view.gif"); //$NON-NLS-1$
- }
-
- /**
- * Declare an Image in the registry table.
- * @param key The key to use when registering the image
- * @param path The path where the image can be found. This path is relative to where
- * this plugin class is found (i.e. typically the packages directory)
- */
- private final static void declareRegistryImage(String key, String path) {
- ImageDescriptor desc= ImageDescriptor.getMissingImageDescriptor();
- try {
- desc= ImageDescriptor.createFromURL(makeIconFileURL(path));
- } catch (MalformedURLException me) {
- ConsolePlugin.log(me);
- }
- imageRegistry.put(key, desc);
- imageDescriptors.put(key, desc);
- }
-
- /**
- * Returns the ImageRegistry.
- */
- public static ImageRegistry getImageRegistry() {
- if (imageRegistry == null) {
- initializeImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * Initialize the image registry by declaring all of the required
- * graphics. This involves creating JFace image descriptors describing
- * how to create/find the image should it be needed.
- * The image is not actually allocated until requested.
- *
- * Prefix conventions
- * Wizard Banners WIZBAN_
- * Preference Banners PREF_BAN_
- * Property Page Banners PROPBAN_
- * Color toolbar CTOOL_
- * Enable toolbar ETOOL_
- * Disable toolbar DTOOL_
- * Local enabled toolbar ELCL_
- * Local Disable toolbar DLCL_
- * Object large OBJL_
- * Object small OBJS_
- * View VIEW_
- * Product images PROD_
- * Misc images MISC_
- *
- * Where are the images?
- * The images (typically gifs) are found in the same location as this plugin class.
- * This may mean the same package directory as the package holding this class.
- * The images are declared using this.getClass() to ensure they are looked up via
- * this plugin class.
- * @see org.eclipse.jface.resource.ImageRegistry
- */
- public static ImageRegistry initializeImageRegistry() {
- imageRegistry= new ImageRegistry(ConsolePlugin.getStandardDisplay());
- imageDescriptors = new HashMap(30);
- declareImages();
- return imageRegistry;
- }
-
- /**
- * Returns the <code>Image<code> identified by the given key,
- * or <code>null</code> if it does not exist.
- */
- public static Image getImage(String key) {
- return getImageRegistry().get(key);
- }
-
- /**
- * Returns the <code>ImageDescriptor<code> identified by the given key,
- * or <code>null</code> if it does not exist.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (imageDescriptors == null) {
- initializeImageRegistry();
- }
- return (ImageDescriptor)imageDescriptors.get(key);
- }
-
- private static URL makeIconFileURL(String iconPath) throws MalformedURLException {
- if (ICON_BASE_URL == null) {
- throw new MalformedURLException();
- }
-
- return new URL(ICON_BASE_URL, iconPath);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
deleted file mode 100644
index e58b735..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleListener;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.IConsoleView;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-
-/**
- * Page book console view.
- *
- * @since 3.0
- */
-public class ConsoleView extends PageBookView implements IConsoleView, IConsoleListener, IPropertyChangeListener {
-
- /**
- * Whether this console is pinned.
- */
- private boolean fPinned = false;
-
- /**
- * Stack of consoles in MRU order
- */
- private List fStack = new ArrayList();
-
- /**
- * The console being displayed, or <code>null</code> if none
- */
- private IConsole fActiveConsole = null;
-
- /**
- * Map of consoles to dummy console parts (used to close pages)
- */
- private Map fConsoleToPart;
-
- /**
- * Map of parts to consoles
- */
- private Map fPartToConsole;
-
- // actions
- private PinConsoleAction fPinAction = null;
- private ConsoleDropDownAction fDisplayConsoleAction = null;
-
- private boolean isAvailable() {
- return getPageBook() != null && !getPageBook().isDisposed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- Object source = event.getSource();
- if (source instanceof IConsole && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) {
- if (source.equals(getConsole())) {
- updateTitle();
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- if (isPinned()) {
- // if closing the pinned console, un-pin
- IConsole console = (IConsole)fPartToConsole.get(part);
- if (console != null && console.equals(getConsole())) {
- pin(null);
- }
- }
- super.partClosed(part);
- fPinAction.update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.console.IConsoleView#getConsole()
- */
- public IConsole getConsole() {
- return fActiveConsole;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#showPageRec(org.eclipse.ui.part.PageBookView.PageRec)
- */
- protected void showPageRec(PageRec pageRec) {
- if (!isPinned()) {
- super.showPageRec(pageRec);
- fActiveConsole = (IConsole)fPartToConsole.get(pageRec.part);
- fStack.remove(fActiveConsole);
- fStack.add(0,fActiveConsole);
- updateTitle();
- // update console actions
- if (fPinAction != null) {
- fPinAction.update();
- }
- }
- }
-
- /**
- * Returns a stack of consoles in the view in MRU order.
- *
- * @return a stack of consoles in the view in MRU order
- */
- protected List getConsoleStack() {
- return fStack;
- }
-
- /**
- * Updates the view title based on the active console
- */
- protected void updateTitle() {
- IConsole console = getConsole();
- if (console == null) {
- setContentDescription(ConsoleMessages.getString("ConsoleView.0")); //$NON-NLS-1$
- } else {
- setContentDescription(console.getName()); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
- */
- protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- IPage page = pageRecord.page;
- page.dispose();
- pageRecord.dispose();
-
- IConsole console = (IConsole)fPartToConsole.get(part);
- console.removePropertyChangeListener(this);
-
- // empty cross-reference cache
- fPartToConsole.remove(part);
- fConsoleToPart.remove(console);
-
- // update console actions
- fPinAction.update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
- */
- protected PageRec doCreatePage(IWorkbenchPart dummyPart) {
- ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)dummyPart;
- IConsole console = part.getConsole();
- IPageBookViewPage page = console.createPage(this);
- initPage(page);
- page.createControl(getPageBook());
- console.addPropertyChangeListener(this);
- PageRec rec = new PageRec(dummyPart, page);
- return rec;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#isImportant(org.eclipse.ui.IWorkbenchPart)
- */
- protected boolean isImportant(IWorkbenchPart part) {
- return part instanceof ConsoleWorkbenchPart;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- super.dispose();
- ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#createDefaultPage(org.eclipse.ui.part.PageBook)
- */
- protected IPage createDefaultPage(PageBook book) {
- MessagePage page = new MessagePage();
- page.createControl(getPageBook());
- initPage(page);
- return page;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
- */
- public void consolesAdded(final IConsole[] consoles) {
- if (isAvailable()) {
- Runnable r = new Runnable() {
- public void run() {
- for (int i = 0; i < consoles.length; i++) {
- if (isAvailable()) {
- IConsole console = consoles[i];
- ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite());
- fConsoleToPart.put(console, part);
- fPartToConsole.put(part, console);
- partActivated(part);
- }
- }
- }
- };
- asyncExec(r);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
- */
- public void consolesRemoved(final IConsole[] consoles) {
- if (isAvailable()) {
- Runnable r = new Runnable() {
- public void run() {
- for (int i = 0; i < consoles.length; i++) {
- if (isAvailable()) {
- IConsole console = consoles[i];
- fStack.remove(console);
- ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)fConsoleToPart.get(console);
- if (part != null) {
- partClosed(part);
- }
- if (getConsole() == null) {
- IConsole[] available = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
- if (available.length > 0) {
- display(available[available.length - 1]);
- }
- }
- }
- }
- }
- };
- asyncExec(r);
- }
- }
-
- /**
- * Constructs a console view
- */
- public ConsoleView() {
- super();
- fConsoleToPart = new HashMap();
- fPartToConsole = new HashMap();
- }
-
- /**
- * Creates a pop-up menu on the given control. The menu
- * is registered with this view's site, such that other
- * plug-ins may contribute to the menu.
- *
- * @param menuControl the control with which the pop-up
- * menu will be associated with.
- */
- protected void createContextMenu(Control menuControl) {
- MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- Menu menu= menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
-
- // register the context menu such that other plugins may contribute to it
- if (getSite() != null) {
- getSite().registerContextMenu(menuMgr, null);
- }
- }
-
- protected void createActions() {
- fPinAction = new PinConsoleAction(this);
- fDisplayConsoleAction = new ConsoleDropDownAction(this);
- }
-
- protected void configureToolBar(IToolBarManager mgr) {
- mgr.add(new Separator(IConsoleConstants.LAUNCH_GROUP));
- mgr.add(new Separator(IConsoleConstants.OUTPUT_GROUP));
- mgr.add(new Separator("fixedGroup")); //$NON-NLS-1$
- mgr.add(fPinAction);
- mgr.add(fDisplayConsoleAction);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleView#display(org.eclipse.ui.console.IConsole)
- */
- public void display(IConsole console) {
- if (!isPinned()) {
- ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)fConsoleToPart.get(console);
- if (part != null) {
- partActivated(part);
- }
- }
- }
-
- /*/* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleView#pin(org.eclipse.ui.console.IConsole)
- */
- public void pin(IConsole console) {
- if (console == null) {
- fPinned = false;
- } else {
- fPinned = false; // need this off to change displayed console
- display(console);
- fPinned = true;
- }
- if (fPinAction != null) {
- fPinAction.update();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleView#isPinned()
- */
- public boolean isPinned() {
- return fPinned;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#getBootstrapPart()
- */
- protected IWorkbenchPart getBootstrapPart() {
- return null;
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#asyncExec(java.lang.Runnable)
- */
- public void asyncExec(Runnable r) {
- if (isAvailable()) {
- getPageBook().getDisplay().asyncExec(r);
- }
- }
-
- /**
- * Creates this view's underlying viewer and actions.
- * Hooks a pop-up menu to the underlying viewer's control,
- * as well as a key listener. When the delete key is pressed,
- * the <code>REMOVE_ACTION</code> is invoked. Hooks help to
- * this view. Subclasses must implement the following methods
- * which are called in the following order when a view is
- * created:<ul>
- * <li><code>createViewer(Composite)</code> - the context
- * menu is hooked to the viewer's control.</li>
- * <li><code>createActions()</code></li>
- * <li><code>configureToolBar(IToolBarManager)</code></li>
- * <li><code>getHelpContextId()</code></li>
- * </ul>
- * @see IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- //registerPartListener();
- super.createPartControl(parent);
- createActions();
- IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- configureToolBar(tbm);
- updateForExistingConsoles();
- getViewSite().getActionBars().updateActionBars();
-// Viewer viewer = getViewer();
-// if (viewer != null) {
-// createContextMenu(viewer.getControl());
-// }
- WorkbenchHelp.setHelp(parent, IConsoleHelpContextIds.CONSOLE_VIEW);
-// if (viewer != null) {
-// getViewer().getControl().addKeyListener(new KeyAdapter() {
-// public void keyPressed(KeyEvent e) {
-// handleKeyPressed(e);
-// }
-// });
-// if (getViewer() instanceof StructuredViewer) {
-// ((StructuredViewer)getViewer()).addDoubleClickListener(this);
-// }
-// }
- // create the message page
- //setMessagePage(new MessagePage());
- //getMessagePage().createControl(getPageBook());
- //initPage(getMessagePage());
-
-// if (fEarlyMessage != null) { //bug 28127
-// showMessage(fEarlyMessage);
-// fEarlyMessage= null;
-// }
- }
-
- /**
- * Initialize for existing consoles
- */
- private void updateForExistingConsoles() {
- IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
- // create pages for consoles
- IConsole[] consoles = manager.getConsoles();
- consolesAdded(consoles);
- // add as a listener
- manager.addConsoleListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsoleView#warnOfContentChange(org.eclipse.ui.console.IConsole)
- */
- public void warnOfContentChange(IConsole console) {
- IWorkbenchPart part = (IWorkbenchPart)fConsoleToPart.get(console);
- if (part != null) {
- IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) part.getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (service != null) {
- service.warnOfContentChange();
- }
- }
- }
-
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java
deleted file mode 100644
index 780d2b5..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.console.*;
-
-/**
- * Fake part to use as keys in page book for console pages
- */
-public class ConsoleWorkbenchPart implements IWorkbenchPart {
-
- private IConsole fConsole = null;
- private IWorkbenchPartSite fSite = null;
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return (obj instanceof ConsoleWorkbenchPart) &&
- fConsole.equals(((ConsoleWorkbenchPart)obj).fConsole);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fConsole.hashCode();
- }
-
- /**
- * Constructs a part for the given console that binds to the given
- * site
- */
- public ConsoleWorkbenchPart(IConsole console, IWorkbenchPartSite site) {
- fConsole = console;
- fSite = site;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
- */
- public void addPropertyListener(IPropertyListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getSite()
- */
- public IWorkbenchPartSite getSite() {
- return fSite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitle()
- */
- public String getTitle() {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
- */
- public Image getTitleImage() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
- */
- public String getTitleToolTip() {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
- */
- public void removePropertyListener(IPropertyListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- /**
- * Returns the console associated with this part.
- *
- * @return console associated with this part
- */
- protected IConsole getConsole() {
- return fConsole;
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java
deleted file mode 100644
index b81cbea..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import org.eclipse.ui.console.IConsoleConstants;
-
-/**
- * Help context ids for the debug ui.
- * <p>
- * This interface contains constants only; it is not intended to be implemented
- * or extended.
- * </p>
- *
- */
-public interface IConsoleHelpContextIds {
-
- public static final String PREFIX = IConsoleConstants.PLUGIN_ID + "."; //$NON-NLS-1$
-
- // Actions
- public static final String CLEAR_CONSOLE_ACTION = PREFIX + "clear_console_action_context"; //$NON-NLS-1$
- public static final String CONSOLE_SCROLL_LOCK_ACTION = PREFIX + "console_scroll_lock_action_context"; //$NON-NLS-1$
-
- // Views
- public static final String CONSOLE_VIEW = PREFIX + "console_view_context"; //$NON-NLS-1$
-
- // Preference pages
- public static final String CONSOLE_PREFERENCE_PAGE = PREFIX + "console_preference_page_context"; //$NON-NLS-1$
-}
-
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java
deleted file mode 100644
index 5796bf8..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-public interface IInternalConsoleConstants {
-
- // tool images
- public static final String IMG_LCL_PIN = "IMG_LCL_PIN"; //$NON-NLS-1$
-
- // disabled local tool images
- public static final String IMG_DLCL_PIN = "IMG_DLCL_PIN"; //$NON-NLS-1$
- public static final String IMG_DLCL_CLEAR= "IMG_DLCL_CLEAR"; //$NON-NLS-1$
-
- // enabled local tool images
- public static final String IMG_ELCL_PIN = "IMG_ELCL_PIN"; //$NON-NLS-1$
- public static final String IMG_ELCL_CLEAR= "IMG_ELCL_CLEAR"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePage.java
deleted file mode 100644
index f59d9d9..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePage.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.text.IFindReplaceTarget;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleView;
-import org.eclipse.ui.console.MessageConsole;
-import org.eclipse.ui.console.MessageConsoleStream;
-import org.eclipse.ui.console.actions.ClearOutputAction;
-import org.eclipse.ui.console.actions.TextViewerAction;
-import org.eclipse.ui.console.actions.TextViewerGotoLineAction;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.texteditor.FindReplaceAction;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * A page for a console connected to I/O streams of a process
- *
- * @since 3.0
- */
-public class MessageConsolePage implements IPageBookViewPage, IAdaptable, IPropertyChangeListener {
-
- //page site
- private IPageSite fSite = null;
-
- // viewer
- private MessageConsoleViewer fViewer = null;
-
- // the view this page is contained in
- private IConsoleView fView;
-
- // the console this page displays
- private MessageConsole fConsole;
-
- // text selection listener
- private ISelectionChangedListener fTextListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateSelectionDependentActions();
- }};
-
- // actions
- private ClearOutputAction fClearOutputAction;
- private Map fGlobalActions= new HashMap(10);
- private List fSelectionActions = new ArrayList(3);
-
- // menus
- private Menu fMenu;
-
- /**
- * Constructs a new process page
- */
- public MessageConsolePage(IConsoleView view, MessageConsole console) {
- fView = view;
- fConsole = console;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPageBookViewPage#getSite()
- */
- public IPageSite getSite() {
- return fSite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite)
- */
- public void init(IPageSite site) {
- fSite = site;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- fViewer = new MessageConsoleViewer(parent);
- fViewer.setDocument(getConsole().getDocument());
- fViewer.getTextWidget().setTabs(getConsole().getTabWidth());
-
- MenuManager manager= new MenuManager("#MessageConsole", "#MessageConsole"); //$NON-NLS-1$ //$NON-NLS-2$
- manager.setRemoveAllWhenShown(true);
- manager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager m) {
- contextMenuAboutToShow(m);
- }
- });
- fMenu= manager.createContextMenu(getControl());
- getControl().setMenu(fMenu);
-
- IPageSite site= getSite();
- site.registerContextMenu(ConsolePlugin.getUniqueIdentifier() + ".messageConsole", manager, getViewer()); //$NON-NLS-1$
- site.setSelectionProvider(getViewer());
-
- createActions();
- configureToolBar(getSite().getActionBars().getToolBarManager());
-
- fViewer.getSelectionProvider().addSelectionChangedListener(fTextListener);
- setFont(getConsole().getFont());
- getConsole().addPropertyChangeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- Object source = event.getSource();
- String property = event.getProperty();
- if (source.equals(getConsole()) && MessageConsole.P_FONT.equals(property)) {
- setFont(getConsole().getFont());
- } else if (MessageConsole.P_STREAM_COLOR.equals(property) && source instanceof MessageConsoleStream) {
- MessageConsoleStream stream = (MessageConsoleStream)source;
- if (stream.getConsole().equals(getConsole())) {
- getViewer().getTextWidget().redraw();
- }
- } else if (source.equals(getConsole()) && property.equals(MessageConsole.P_TAB_SIZE)) {
- if (fViewer != null) {
- fViewer.getTextWidget().setTabs(getConsole().getTabWidth());
- fViewer.getTextWidget().redraw();
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#dispose()
- */
- public void dispose() {
- getConsole().removePropertyChangeListener(this);
- fViewer.getSelectionProvider().removeSelectionChangedListener(fTextListener);
-
- if (fMenu != null && !fMenu.isDisposed()) {
- fMenu.dispose();
- fMenu= null;
- }
-
- if (fViewer != null) {
- fViewer.dispose();
- fViewer = null;
- }
- fSite = null;
- fSelectionActions.clear();
- }
-
-
- /**
- * Fill the context menu
- *
- * @param menu menu
- */
- protected void contextMenuAboutToShow(IMenuManager menu) {
- menu.add((IAction)fGlobalActions.get(ActionFactory.COPY.getId()));
- menu.add((IAction)fGlobalActions.get(ActionFactory.SELECT_ALL.getId()));
- menu.add(new Separator("FIND")); //$NON-NLS-1$
- menu.add((IAction)fGlobalActions.get(ActionFactory.FIND.getId()));
- menu.add((IAction)fGlobalActions.get(ITextEditorActionConstants.GOTO_LINE));
- menu.add(fClearOutputAction);
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#getControl()
- */
- public Control getControl() {
- if (fViewer != null) {
- return fViewer.getControl();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars)
- */
- public void setActionBars(IActionBars actionBars) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#setFocus()
- */
- public void setFocus() {
- Control control = getControl();
- if (control != null) {
- control.setFocus();
- }
- updateSelectionDependentActions();
- }
-
- protected void createActions() {
- fClearOutputAction= new ClearOutputAction(getViewer());
-
- // In order for the clipboard actions to accessible via their shortcuts
- // (e.g., Ctrl-C, Ctrl-V), we *must* set a global action handler for
- // each action
- IActionBars actionBars= getSite().getActionBars();
- TextViewerAction action= new TextViewerAction(getViewer(), ITextOperationTarget.COPY);
- action.configureAction(ConsoleMessages.getString("MessageConsolePage.&Copy@Ctrl+C_6"), ConsoleMessages.getString("MessageConsolePage.Copy_7"), ConsoleMessages.getString("MessageConsolePage.Copy_7")); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- setGlobalAction(actionBars, ActionFactory.COPY.getId(), action);
- action= new TextViewerAction(getViewer(), ITextOperationTarget.SELECT_ALL);
- action.configureAction(ConsoleMessages.getString("MessageConsolePage.Select_&All@Ctrl+A_12"), ConsoleMessages.getString("MessageConsolePage.Select_All"), ConsoleMessages.getString("MessageConsolePage.Select_All")); //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
- setGlobalAction(actionBars, ActionFactory.SELECT_ALL.getId(), action);
-
- //XXX Still using "old" resource access
- ResourceBundle bundle= ResourceBundle.getBundle("org.eclipse.ui.internal.console.ConsoleMessages"); //$NON-NLS-1$
- setGlobalAction(actionBars, ActionFactory.FIND.getId(), new FindReplaceAction(bundle, "find_replace_action.", getConsoleView())); //$NON-NLS-1$
-
- action= new TextViewerGotoLineAction(getViewer());
- setGlobalAction(actionBars, ITextEditorActionConstants.GOTO_LINE, action);
-
- actionBars.updateActionBars();
-
- fSelectionActions.add(ActionFactory.COPY.getId());
- fSelectionActions.add(ActionFactory.FIND.getId());
- }
-
- protected void updateSelectionDependentActions() {
- Iterator iterator= fSelectionActions.iterator();
- while (iterator.hasNext()) {
- updateAction((String)iterator.next());
- }
- }
-
- protected void updateAction(String actionId) {
- IAction action= (IAction)fGlobalActions.get(actionId);
- if (action instanceof IUpdate) {
- ((IUpdate) action).update();
- }
- }
-
- protected void setGlobalAction(IActionBars actionBars, String actionID, IAction action) {
- fGlobalActions.put(actionID, action);
- actionBars.setGlobalActionHandler(actionID, action);
- }
-
- /**
- * Returns the viewer in this page.
- *
- * @return the viewer in this page
- */
- protected MessageConsoleViewer getViewer() {
- return fViewer;
- }
-
- protected void configureToolBar(IToolBarManager mgr) {
- mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, fClearOutputAction);
- }
-
- /**
- * Returns the view this page is contained in
- *
- * @return the view this page is contained in
- */
- protected IConsoleView getConsoleView() {
- return fView;
- }
-
- /**
- * Returns the console this page is displaying
- *
- * @return the console this page is displaying
- */
- protected MessageConsole getConsole() {
- return fConsole;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class required) {
- if (IFindReplaceTarget.class.equals(required)) {
- return getViewer().getFindReplaceTarget();
- }
- if (Widget.class.equals(required)) {
- return getViewer().getTextWidget();
- }
- return null;
- }
-
- /**
- * Sets the font for this page.
- *
- * @param font font
- */
- protected void setFont(Font font) {
- getViewer().getTextWidget().setFont(font);
- }
-
- /**
- * Refreshes this page
- */
- protected void refresh() {
- getViewer().refresh();
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartition.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartition.java
deleted file mode 100644
index 7f3e9f1..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartition.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-
-import org.eclipse.jface.text.TypedRegion;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.MessageConsoleStream;
-
-/**
- * A partition from a message stream connected to a message console.
- */
-public class MessageConsolePartition extends TypedRegion {
-
- /**
- * Associated stream
- */
- private MessageConsoleStream fStream;
-
- /**
- * Partition type
- */
- public static final String MESSAGE_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".MESSAGE_PARTITION_TYPE"; //$NON-NLS-1$
-
- public MessageConsolePartition(MessageConsoleStream stream, int offset, int length) {
- super(offset, length, MESSAGE_PARTITION_TYPE);
- fStream = stream;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object partition) {
- if (super.equals(partition)) {
- fStream.equals(((MessageConsolePartition)partition).getStream());
- }
- return false;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return super.hashCode() + fStream.hashCode();
- }
-
- /**
- * Returns this partition's stream
- *
- * @return this partition's stream
- */
- public MessageConsoleStream getStream() {
- return fStream;
- }
-
- /**
- * Returns whether this partition is allowed to be combined with the
- * given partition.
- *
- * @param partition
- * @return boolean
- */
- public boolean canBeCombinedWith(MessageConsolePartition partition) {
- int start = getOffset();
- int end = start + getLength();
- int otherStart = partition.getOffset();
- int otherEnd = otherStart + partition.getLength();
- boolean overlap = (otherStart >= start && otherStart <= end) || (start >= otherStart && start <= otherEnd);
- return overlap && getType().equals(partition.getType()) && getStream().equals(partition.getStream());
- }
-
- /**
- * Returns a new partition representing this and the given parition
- * combined.
- *
- * @param partition
- * @return partition
- */
- public MessageConsolePartition combineWith(MessageConsolePartition partition) {
- int start = getOffset();
- int end = start + getLength();
- int otherStart = partition.getOffset();
- int otherEnd = otherStart + partition.getLength();
- int theStart = Math.min(start, otherStart);
- int theEnd = Math.max(end, otherEnd);
- return createNewPartition(theStart, theEnd - theStart);
- }
-
- /**
- * Creates a new patition of this type with the given color, offset,
- * and length.
- *
- * @param offset
- * @param length
- * @return a new partition with the given range
- */
- public MessageConsolePartition createNewPartition(int offset, int length) {
- return new MessageConsolePartition(getStream(), offset, length);
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartitioner.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartitioner.java
deleted file mode 100644
index 2279b84..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsolePartitioner.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.ui.internal.console;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.IDocumentPartitionerExtension;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.MessageConsoleStream;
-
-/**
- * A console that displays text messages.
- *
- * @since 3.0
- */
-public class MessageConsolePartitioner implements IDocumentPartitioner, IDocumentPartitionerExtension {
-
- /**
- * The associated docuemnt
- */
- private IDocument fDocument = null;
-
- /**
- * List of partitions
- */
- private List fPartitions = new ArrayList(5);
-
- /**
- * The stream that was last appended to
- */
- private MessageConsoleStream fLastStream = null;
-
-
- private int highWaterMark = 100000;
- private int lowWaterMark = 80000;
- private int maxAppendSize = lowWaterMark;
-
- private List streamEntries = new ArrayList();
- private boolean killed = false;
- private boolean updaterThreadStarted = false;
-
- private IConsoleManager fConsoleManager;
- /**
- * Creates a new paritioner and document, and connects this partitioner
- * to the document.
- */
- public MessageConsolePartitioner() {
- IDocument doc = new Document();
- connect(doc);
- }
-
- /**
- * Sets the low and high water marks for this console's text buffer.
- *
- * @param low low water mark
- * @param high high water mark
- */
- public void setWaterMarks(int low, int high) {
- if (low >= high) {
- throw new IllegalArgumentException(ConsoleMessages.getString("MessageConsolePartitioner.2")); //$NON-NLS-1$
- }
- if (low < 1000) {
- throw new IllegalArgumentException(ConsoleMessages.getString("MessageConsolePartitioner.3")); //$NON-NLS-1$
- }
- lowWaterMark = low;
- highWaterMark = high;
- maxAppendSize = Math.min(80000, low);
- }
- /**
- * @return Returns the highWaterMark.
- */
- public int getHighWaterMark() {
- return highWaterMark;
- }
-
- /**
- * @return Returns the lowWaterMark.
- */
- public int getLowWaterMark() {
- return lowWaterMark;
- }
-
- /**
- * @return Returns the maxAppendSize.
- */
- public int getMaxAppendSize() {
- return maxAppendSize;
- }
-
- /**
- * @param maxAppendSize The maxAppendSize to set.
- */
- public void setMaxAppendSize(int maxAppendSize) {
- this.maxAppendSize = maxAppendSize;
- }
-
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#connect(org.eclipse.jface.text.IDocument)
- */
- public void connect(IDocument document) {
- fDocument = document;
- document.setDocumentPartitioner(this);
- fConsoleManager = ConsolePlugin.getDefault().getConsoleManager();
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
- */
- public void disconnect() {
- fDocument.setDocumentPartitioner(null);
- killed = true;
- fConsoleManager = null;
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public boolean documentChanged(DocumentEvent event) {
- return documentChanged2(event) != null;
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes()
- */
- public String[] getLegalContentTypes() {
- return new String[] {MessageConsolePartition.MESSAGE_PARTITION_TYPE};
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int)
- */
- public String getContentType(int offset) {
- ITypedRegion partition = getPartition(offset);
- if (partition != null) {
- return partition.getType();
- }
- return null;
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#computePartitioning(int, int)
- */
- public ITypedRegion[] computePartitioning(int offset, int length) {
- if (offset == 0 && length == fDocument.getLength()) {
- return (ITypedRegion[])fPartitions.toArray(new ITypedRegion[fPartitions.size()]);
- }
- int end = offset + length;
- List list = new ArrayList();
- for (int i = 0; i < fPartitions.size(); i++) {
- ITypedRegion partition = (ITypedRegion)fPartitions.get(i);
- int partitionStart = partition.getOffset();
- int partitionEnd = partitionStart + partition.getLength();
- if ((offset >= partitionStart && offset <= partitionEnd) ||
- (offset < partitionStart && end >= partitionStart)) {
- list.add(partition);
- }
- }
- return (ITypedRegion[])list.toArray(new ITypedRegion[list.size()]);
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int)
- */
- public ITypedRegion getPartition(int offset) {
- for (int i = 0; i < fPartitions.size(); i++) {
- ITypedRegion partition = (ITypedRegion)fPartitions.get(i);
- int start = partition.getOffset();
- int end = start + partition.getLength();
- if (offset >= start && offset < end) {
- return partition;
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitionerExtension#documentChanged2(org.eclipse.jface.text.DocumentEvent)
- */
- public IRegion documentChanged2(DocumentEvent event) {
-
- String text = event.getText();
- if (getDocument().getLength() == 0) {
- // cleared
- fPartitions.clear();
- return new Region(0,0);
- }
- addPartition(new MessageConsolePartition(fLastStream, event.getOffset(), text.length()));
- ITypedRegion[] affectedRegions = computePartitioning(event.getOffset(), text.length());
- if (affectedRegions.length == 0) {
- return null;
- }
- if (affectedRegions.length == 1) {
- return affectedRegions[0];
- }
- int affectedLength = affectedRegions[0].getLength();
- for (int i = 1; i < affectedRegions.length; i++) {
- ITypedRegion region = affectedRegions[i];
- affectedLength += region.getLength();
- }
-
- return new Region(affectedRegions[0].getOffset(), affectedLength);
- }
-
-
- /**
- * Checks to see if the console buffer has overflowed, and empties the
- * overflow if needed, updating partitions and hyperlink positions.
- */
- protected void checkOverflow() {
- if (highWaterMark >= 0) {
- if (fDocument.getLength() > highWaterMark) {
- int overflow = fDocument.getLength() - lowWaterMark;
-
- try {
- int line = fDocument.getLineOfOffset(overflow);
- int nextLineOffset = fDocument.getLineOffset(line+1);
- overflow = nextLineOffset;
- } catch (BadLocationException e1) {
- }
-
- // update partitions
- List newParitions = new ArrayList(fPartitions.size());
- Iterator partitions = fPartitions.iterator();
- while (partitions.hasNext()) {
- ITypedRegion region = (ITypedRegion) partitions.next();
- if (region instanceof MessageConsolePartition) {
- MessageConsolePartition messageConsolePartition = (MessageConsolePartition)region;
-
- ITypedRegion newPartition = null;
- int offset = region.getOffset();
- if (offset < overflow) {
- int endOffset = offset + region.getLength();
- if (endOffset < overflow) {
- // remove partition
- } else {
- // split partition
- int length = endOffset - overflow;
- newPartition = messageConsolePartition.createNewPartition(0, length);
- }
- } else {
- // modify parition offset
- newPartition = messageConsolePartition.createNewPartition(messageConsolePartition.getOffset()-overflow, messageConsolePartition.getLength());
- }
- if (newPartition != null) {
- newParitions.add(newPartition);
- }
- }
- }
- fPartitions = newParitions;
-
- //called from GUI Thread (see startUpdaterThread()), no asyncExec needed.
- try {
- fDocument.replace(0, overflow, ""); //$NON-NLS-1$
- } catch (BadLocationException e) {
- }
- }
- }
- }
-
-
- /**
- * Adds a new colored input partition, combining with the previous partition if
- * possible.
- */
- private MessageConsolePartition addPartition(MessageConsolePartition partition) {
- if (fPartitions.isEmpty()) {
- fPartitions.add(partition);
- } else {
- int index = fPartitions.size() - 1;
- MessageConsolePartition last = (MessageConsolePartition)fPartitions.get(index);
- if (last.canBeCombinedWith(partition)) {
- // replace with a single partition
- partition = last.combineWith(partition);
- fPartitions.set(index, partition);
- } else {
- // different kinds - add a new parition
- fPartitions.add(partition);
- }
- }
- return partition;
- }
-
- /**
- * Returns the document this partitioner is connected to, or <code>null</code>
- * if none.
- *
- * @return the document this partitioner is connected to, or <code>null</code>
- * if none
- */
- public IDocument getDocument() {
- return fDocument;
- }
-
- /**
- *
- */
- private void startUpdaterThread() {
- if (updaterThreadStarted) {
- return;
- }
-
- updaterThreadStarted = true;
-
- Runnable r = new Runnable() {
- public void run() {
-
- while(!killed && streamEntries.size()>0) {
- synchronized(streamEntries) {
- final StreamEntry streamEntry = (StreamEntry)streamEntries.get(0);
- streamEntries.remove(0);
-
- Runnable innerRunnable = new Runnable() {
- public void run() {
- fLastStream = streamEntry.stream;
- try {
- fDocument.replace(fDocument.getLength(), 0, streamEntry.text.toString());
- checkOverflow();
- fConsoleManager.warnOfContentChange(streamEntry.stream.getConsole());
- } catch (BadLocationException e) {
- }
- }
- };
- Display display = ConsolePlugin.getStandardDisplay();
- if (display != null) {
- display.asyncExec(innerRunnable);
- }
-
- try {
- //Don't just die! Give up the lock and allow more StreamEntry objects to be
- //added to list
- Thread.sleep(100);
- } catch (InterruptedException e) {
- }
- }
- }
- updaterThreadStarted = false;
- }
- };
-
- new Thread(r, "MessageConsoleUpdaterThread").start(); //$NON-NLS-1$
- }
-
- /**
- * Adds the new text to the document.
- *
- * @param text the text to append
- * @param stream the stream to append to
- */
- public void appendToDocument(final String text, final MessageConsoleStream stream) {
- int offset = 0;
- int length = text.length();
-
- synchronized(streamEntries) {
- //try to fit in last StreamEntry if they are the same stream
- if (streamEntries.size() > 0) {
- StreamEntry streamEntry = (StreamEntry)streamEntries.get(streamEntries.size()-1);
- if (streamEntry.stream == stream) {
- int emptySpace = maxAppendSize - streamEntry.text.length();
- if (length <= emptySpace) {
- streamEntry.text.append(text);
- offset = length;
- length = 0;
- } else {
- streamEntry.text.append(text.substring(offset, emptySpace));
- offset += emptySpace;
- length -= emptySpace;
- }
- }
- }
-
- //put remaining text into new StreamEntry objects
- while (length > 0) {
- int toCopy = Math.min(maxAppendSize, length);
- String substring = text.substring(offset, offset+toCopy);
- StreamEntry streamEntry = new StreamEntry(substring, stream);
- streamEntries.add(streamEntry);
- offset += toCopy;
- length -= toCopy;
- }
-
- } //give up the lock
-
- startUpdaterThread();
- }
-
- private class StreamEntry {
- MessageConsoleStream stream;
- StringBuffer text;
-
- StreamEntry(String text, MessageConsoleStream stream) {
- this.stream = stream;
- this.text = new StringBuffer(text);
- }
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsoleViewer.java
deleted file mode 100644
index 300e50f..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/MessageConsoleViewer.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.ITypedRegion;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.LineStyleEvent;
-import org.eclipse.swt.custom.LineStyleListener;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-
-public class MessageConsoleViewer extends TextViewer implements LineStyleListener {
-
- protected InternalDocumentListener fInternalDocumentListener= new InternalDocumentListener();
-
- /**
- * Internal document listener.
- */
- class InternalDocumentListener implements IDocumentListener {
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent e) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent e) {
- revealEndOfDocument();
- }
- }
-
- /**
- * Creates a new console viewer and adds verification checking
- * to only allow text modification if the text is being modified
- * in the editable portion of the underlying document.
- *
- * @see org.eclipse.swt.events.VerifyListener
- */
- public MessageConsoleViewer(Composite parent) {
- super(parent, getSWTStyles());
- getTextWidget().setDoubleClickEnabled(true);
- getTextWidget().setFont(parent.getFont());
- getTextWidget().addLineStyleListener(this);
- getTextWidget().setEditable(false);
- }
-
- /**
- * Returns the SWT style flags used when instantiating this viewer
- */
- private static int getSWTStyles() {
- int styles= SWT.H_SCROLL | SWT.V_SCROLL;
- return styles;
- }
-
- /**
- * Reveals (makes visible) the end of the current document
- */
- protected void revealEndOfDocument() {
- IDocument doc = getDocument();
- int lines = doc.getNumberOfLines();
- try {
- // lines are 0-based
- int lineStartOffset = doc.getLineOffset(lines - 1);
- StyledText widget= getTextWidget();
- if (lineStartOffset > 0) {
- widget.setCaretOffset(lineStartOffset);
- widget.showSelection();
- }
- int lineEndOffset = lineStartOffset + doc.getLineLength(lines - 1);
- if (lineEndOffset > 0) {
- widget.setCaretOffset(lineEndOffset);
- }
- } catch (BadLocationException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.ITextViewer#setDocument(org.eclipse.jface.text.IDocument)
- */
- public void setDocument(IDocument doc) {
- IDocument oldDoc= getDocument();
- IDocument document= doc;
- if (oldDoc == null && document == null) {
- return;
- }
- if (oldDoc != null) {
- oldDoc.removeDocumentListener(fInternalDocumentListener);
- if (oldDoc.equals(document)) {
- document.addDocumentListener(fInternalDocumentListener);
- return;
- }
- }
-
- super.setDocument(document);
- if (document != null) {
- revealEndOfDocument();
- document.addDocumentListener(fInternalDocumentListener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.TextViewer#canPerformFind()
- */
- protected boolean canPerformFind() {
- return (getTextWidget() != null && getVisibleDocument() != null && getVisibleDocument().getLength() > 0);
- }
-
- /**
- * Dispose this viewer and resources
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.custom.LineStyleListener#lineGetStyle(org.eclipse.swt.custom.LineStyleEvent)
- */
- public void lineGetStyle(LineStyleEvent event) {
- IDocument document = getDocument();
- if (document != null) {
- MessageConsolePartitioner partitioner = (MessageConsolePartitioner)document.getDocumentPartitioner();
- if (partitioner != null) {
- ITypedRegion[] regions = partitioner.computePartitioning(event.lineOffset, event.lineOffset + event.lineText.length());
- StyleRange[] styles = new StyleRange[regions.length];
- for (int i = 0; i < regions.length; i++) {
- MessageConsolePartition partition = (MessageConsolePartition)regions[i];
- Color color = partition.getStream().getColor();
- styles[i] = new StyleRange(partition.getOffset(), partition.getLength(), color, null);
- }
- event.styles = styles;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java
deleted file mode 100644
index 586d3c2..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.console.IConsoleView;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Pins the currently visible console in a console view.
- */
-public class PinConsoleAction extends Action implements IUpdate {
-
- private IConsoleView fView = null;
-
- /**
- * Constructs a 'pin console' action
- */
- public PinConsoleAction(IConsoleView view) {
- super(ConsoleMessages.getString("PinConsoleAction.0"), IAction.AS_CHECK_BOX); //$NON-NLS-1$
- setToolTipText(ConsoleMessages.getString("PinConsoleAction.1")); //$NON-NLS-1$
- setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_PIN));
- setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_PIN));
- setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_LCL_PIN));
- fView = view;
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (isChecked()) {
- fView.pin(fView.getConsole());
- } else {
- fView.pin(null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- setEnabled(fView.getConsole() != null);
- setChecked(fView.isPinned());
- }
-}
\ No newline at end of file
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java
deleted file mode 100644
index 6477805..0000000
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.console;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleView;
-
-/**
- * Shows a specific console in the console view
- */
-public class ShowConsoleAction extends Action {
-
- private IConsole fConsole;
- private IConsoleView fView;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (!fConsole.equals(fView.getConsole())) {
- // only change if required (and pin the console if pinned)
- if (fView.isPinned()) {
- fView.pin(fConsole);
- } else {
- fView.display(fConsole);
- }
- }
- }
-
- /**
- * Constructs an action to display the given console.
- *
- * @param view the console view in which the given console is contained
- * @param console the console
- */
- public ShowConsoleAction(IConsoleView view, IConsole console) {
- super();
- fConsole = console;
- fView = view;
- setText(console.getName());
- setImageDescriptor(console.getImageDescriptor());
- }
-}
\ No newline at end of file