Released HEAD changes for merge to HEAD stream
diff --git a/org.eclipse.debug.core/buildnotes_platform-debug.html b/org.eclipse.debug.core/buildnotes_platform-debug.html
index f739bd2..c868da6 100644
--- a/org.eclipse.debug.core/buildnotes_platform-debug.html
+++ b/org.eclipse.debug.core/buildnotes_platform-debug.html
@@ -11,12 +11,33 @@
<h1>
Eclipse Platform Build Notes <br>
Platform Debug</h1>
+September 7, 2004
+<h3>
+Problem Reports Fixed</h3>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72986">72986</a>: ExpressionInformationControl leaks<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72000">72000</a>: Run as Application: duplicate menmonics<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72449">72449</a>: NPE in VariablesView.saveState<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73068">73068</a>: Support for ordering launch shortcuts<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73069">73069</a>: bogus extension point id in org.eclipse.debug.ui.launchShortcuts<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73110">73110</a>: IConsoleColorProvider is not disconnected<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72472">72472</a>: Remove unused dependancies<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72551">72551</a>: add System property to test suite to turn off workbench and console activation<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=51562">51562</a>: console doesn't wrap input<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72317">72317</a>: IOConsole inserts extra line breaks when pasting<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72517">72517</a>: Replace "Run As >" with context launch<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73272">73272</a>: NPE in ProcessConsoleManager when no process type<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=70664">70664</a>: TVT3.0: Improper characters combination "Run As"<br>
+
+<h1>
+Eclipse Platform Build Notes <br>
+Platform Debug</h1>
August 31, 2004
<h3>
Problem Reports Fixed</h3>
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72300">72300</a>: Confirmation on RemoveAll actions<br>
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72350">72350</a>: NPE in BreakpointsView.dispose<br>
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72881">72881</a>: LineTracker Test Failure<br>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=72483">72483</a>: NPE attempt to Inspect if never shown Variable view<br>
<h1>
Eclipse Platform Build Notes <br>
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
index dae4502..3384b5f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
@@ -154,6 +154,9 @@
* @see IBreakpoint#setGroup(String)
*/
public void setGroup(String group) throws CoreException {
+ if (group.length() == 0) {
+ group= null;
+ }
setAttribute(GROUP, group);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 6213acb..98643f0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -1632,11 +1632,11 @@
if (!file.delete()) {
file.deleteOnExit(); // if delete() fails try again on VM close
}
- for (Enumeration enum = p.keys(); enum.hasMoreElements();) {
+ for (Enumeration enumeration = p.keys(); enumeration.hasMoreElements();) {
// Win32's environment vars are case insensitive. Put everything
// to uppercase so that (for example) the "PATH" variable will match
// "pAtH" correctly on Windows.
- String key= ((String) enum.nextElement()).toUpperCase();
+ String key= ((String) enumeration.nextElement()).toUpperCase();
//no need to cast value
fgNativeEnv.put(key, p.get(key));
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingInfo.java
index 0c5f66f..9c329e0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingInfo.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingInfo.java
@@ -114,13 +114,13 @@
*/
public IConfigurationElement[] getAllProperties() {
- Enumeration enum = fProperties.elements();
+ Enumeration enumeration = fProperties.elements();
IConfigurationElement[] elements = new IConfigurationElement[fProperties.size()];
int i=0;
- while (enum.hasMoreElements())
+ while (enumeration.hasMoreElements())
{
- elements[i] = (IConfigurationElement)enum.nextElement();
+ elements[i] = (IConfigurationElement)enumeration.nextElement();
i++;
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingManager.java
index faad321..5894abf 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/memory/MemoryRenderingManager.java
@@ -807,11 +807,11 @@
addRenderingInfo(dynamicRenderingTypes);
// now compare the returned list to what is orginally cached
- Enumeration enum = fDynamicRenderingMap.keys();
+ Enumeration enumeration = fDynamicRenderingMap.keys();
- while (enum.hasMoreElements())
+ while (enumeration.hasMoreElements())
{
- String dynamicRenderingId = (String)enum.nextElement();
+ String dynamicRenderingId = (String)enumeration.nextElement();
String staticRenderingId = (String)fDynamicRenderingMap.get(dynamicRenderingId);
if (staticRenderingId.equals(rendering.getRenderingId()))
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index e4edf28..410f613 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -42,7 +42,7 @@
DebugPreferencePage.name=Run/Debug
DebugView.name=Debug
DebugViewsCategory.name=Debug
-DebugWithConfigurationAction.label=Debu&g
+DebugWithConfigurationAction.label=De&bug
DetailPaneFontDefinition.label=Detail Pane Text Font
DetailPaneFontDefinition.description=The detail pane text font is used in the detail panes of debug views
DisableBreakpointsAction.label=&Disable
@@ -58,7 +58,7 @@
LaunchConfigurationTypesPreferencePage.name=Launch Configuration Types
LauncherPropertyPage.name=Launcher
LaunchGroupsExtensionName=Launch Groups
-OpenDebugConfigurations.label=De&bug...
+OpenDebugConfigurations.label=Debu&g...
OpenRunConfigurations.label=Ru&n...
OpenProfileConfigurations.label=&Profile...
processPropertyPageName=Process Information
@@ -88,8 +88,8 @@
RunLaunchGroup.label=Ru&n
RunLaunchGroup.title=Select or configure an application to run
RunConfigurations.label=R&un Configurations...
-RunHistoryMenuAction.label=R&un History
-RunWithConfigurationAction.label=Ru&n
+RunHistoryMenuAction.label=Run His&tory
+RunWithConfigurationAction.label=R&un
RunToLine.label=Run to &Line
SelectAll.label=Select &All
StepWithFiltersAction.label=Use Step &Filters
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index a83f64c..207e241 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -291,6 +291,14 @@
</separator>
</menu>
<action
+ definitionId="org.eclipse.debug.ui.commands.OpenRunConfigurations"
+ label="%OpenRunConfigurations.label"
+ helpContextId="open_run_configurations_action_context"
+ class="org.eclipse.debug.internal.ui.actions.OpenRunConfigurations"
+ menubarPath="org.eclipse.ui.run/runGroup"
+ id="org.eclipse.debug.ui.actions.OpenRunConfigurations">
+ </action>
+ <action
label="%RunWithConfigurationAction.label"
pulldown="true"
helpContextId="run_with_configuration_action_context"
@@ -340,6 +348,14 @@
pulldown="true">
</action>
<action
+ definitionId="org.eclipse.debug.ui.commands.OpenDebugConfigurations"
+ label="%OpenDebugConfigurations.label"
+ helpContextId="open_debug_configurations_action_context"
+ class="org.eclipse.debug.internal.ui.actions.OpenDebugConfigurations"
+ menubarPath="org.eclipse.ui.run/debugGroup"
+ id="org.eclipse.debug.ui.actions.OpenDebugConfigurations">
+ </action>
+ <action
label="%DebugWithConfigurationAction.label"
pulldown="true"
helpContextId="debug_with_configuration_action_context"
@@ -459,6 +475,14 @@
pulldown="true">
</action>
<action
+ definitionId="org.eclipse.debug.ui.commands.OpenProfileConfigurations"
+ label="%OpenProfileConfigurations.label"
+ helpContextId="open_profile_configurations_action_context"
+ class="org.eclipse.debug.internal.ui.actions.OpenProfileConfigurations"
+ menubarPath="org.eclipse.ui.run/profileGroup"
+ id="org.eclipse.debug.ui.actions.OpenProfileConfigurations">
+ </action>
+ <action
label="%ProfileWithConfigurationAction.label"
pulldown="true"
helpContextId="profile_with_configuration_action_context"
@@ -504,7 +528,7 @@
<viewContribution
targetID="org.eclipse.debug.ui.DebugView"
id="org.eclipse.debug.ui.debugview.toolbar">
-<!-- Thread Group -->
+ <!-- Thread Group -->
<action
id="org.eclipse.debug.ui.debugview.toolbar.removeAllTerminated"
toolbarPath="threadGroup"
@@ -574,7 +598,7 @@
class="org.eclipse.debug.core.model.ISuspendResume">
</selection>
</action>
-<!-- Step Group -->
+ <!-- Step Group -->
<action
id="org.eclipse.debug.ui.debugview.toolbar.stepReturn"
toolbarPath="stepReturnGroup"
@@ -620,7 +644,7 @@
class="org.eclipse.debug.core.model.IStep">
</selection>
</action>
-<!-- Render Group -->
+ <!-- Render Group -->
<action
id="org.eclipse.debug.ui.debugview.toolbar.toggleStepFilters"
toolbarPath="renderGroup"
@@ -856,7 +880,7 @@
<viewerContribution
targetID="org.eclipse.debug.ui.DebugView"
id="org.eclipse.debug.ui.debugview.popupMenu">
-<!-- Edit Group -->
+ <!-- Edit Group -->
<action
label="%CopyToClipboardAction.label"
icon="icons/full/elcl16/copy_edit_co.gif"
@@ -868,7 +892,7 @@
class="org.eclipse.debug.core.model.IDebugElement">
</selection>
</action>
-<!-- Launch Group -->
+ <!-- Launch Group -->
<action
label="%TerminateAllAction.label"
icon="icons/full/elcl16/terminate_all_co.gif"
@@ -896,7 +920,7 @@
class="org.eclipse.debug.core.model.ITerminate">
</selection>
</action>
-<!-- Thread Group -->
+ <!-- Thread Group -->
<action
label="%RemoveAllTerminatedAction.label"
icon="icons/full/elcl16/rem_all_co.gif"
@@ -954,7 +978,7 @@
class="org.eclipse.debug.core.model.ISuspendResume">
</selection>
</action>
-<!-- Step Group -->
+ <!-- Step Group -->
<action
label="%StepReturnAction.label"
icon="icons/full/elcl16/stepreturn_co.gif"
@@ -994,7 +1018,7 @@
class="org.eclipse.debug.core.model.IStep">
</selection>
</action>
-<!-- Render Group -->
+ <!-- Render Group -->
<action
label="%StepWithFiltersAction.label"
icon="icons/full/elcl16/stepbystep_co.gif"
@@ -1011,13 +1035,43 @@
<viewerContribution
targetID="org.eclipse.debug.ui.BreakpointView"
id="org.eclipse.debug.ui.breakpointview.popupMenu">
+ <menu
+ label="Select"
+ path="additions"
+ id="selectMenu">
+ <separator
+ name="additions">
+ </separator>
+ </menu>
<action
label="%SelectAll.label"
helpContextId="select_all_breakpoints_action_context"
class="org.eclipse.debug.internal.ui.actions.SelectAllBreakpointsAction"
- menubarPath="breakpointSelectGroup"
+ menubarPath="selectMenu/additions"
id="org.eclipse.debug.ui.actions.SelectAllBreakpointsAction">
</action>
+ <menu
+ label="Group All By"
+ path="additions"
+ id="groupAllByMenu">
+ <separator
+ name="additions">
+ </separator>
+ </menu>
+ <action
+ label="File"
+ helpContextId="group_all_by_file_action_context"
+ class="org.eclipse.debug.internal.ui.actions.breakpointGroups.GroupAllByFileAction"
+ menubarPath="groupAllByMenu/additions"
+ id="org.eclipse.debug.ui.actions.GroupAllByFileAction">
+ </action>
+ <action
+ label="Project"
+ helpContextId="group_all_by_project_action_context"
+ class="org.eclipse.debug.internal.ui.actions.breakpointGroups.GroupAllByProjectAction"
+ menubarPath="groupAllByMenu/additions"
+ id="org.eclipse.debug.ui.actions.GroupAllByProjectAction">
+ </action>
<action
label="%RemoveAllAction.label"
icon="icons/full/elcl16/rem_all_co.gif"
@@ -1040,14 +1094,14 @@
label="Select By Type"
helpContextId="select_breakpoints_by_type_action_context"
class="org.eclipse.debug.internal.ui.actions.breakpointGroups.SelectBreakpointsByTypeAction"
- menubarPath="breakpointSelectGroup"
+ menubarPath="selectMenu/additions"
id="org.eclipse.debug.ui.actions.SelectBreakpointsByType">
</action>
<action
label="Select By File"
helpContextId="select_breakpoints_by_file_action_context"
class="org.eclipse.debug.internal.ui.actions.breakpointGroups.SelectBreakpointsByResourceAction"
- menubarPath="breakpointSelectGroup"
+ menubarPath="selectMenu/additions"
id="org.eclipse.debug.ui.actions.SelectBreakpointsByFile">
</action>
<action
@@ -1126,7 +1180,7 @@
<viewerContribution
targetID="org.eclipse.debug.ui.VariableView"
id="org.eclipse.debug.ui.variablesView.popupMenu">
-<!-- Variable Group -->
+ <!-- Variable Group -->
<action
label="%CopyVariablesToClipboardAction.label"
icon="icons/full/elcl16/copy_edit_co.gif"
@@ -1150,7 +1204,7 @@
<viewerContribution
targetID="org.eclipse.debug.ui.ExpressionView"
id="org.eclipse.debug.ui.expressionView.popupMenu">
-<!-- Expression Group -->
+ <!-- Expression Group -->
<action
label="%RemoveAllAction.label"
icon="icons/full/elcl16/rem_all_co.gif"
@@ -1195,7 +1249,7 @@
<viewerContribution
targetID="org.eclipse.debug.ui.RegistersView"
id="org.eclipse.debug.ui.registersView.popupMenu">
-<!-- Variable Group -->
+ <!-- Variable Group -->
<action
menubarPath="variableGroup"
class="org.eclipse.debug.internal.ui.actions.CopyVariablesToClipboardActionDelegate"
@@ -1968,6 +2022,12 @@
class="org.eclipse.debug.internal.ui.actions.LaunchablePropertyTester"
id="org.eclipse.debug.ui.propertyTesters.launchable">
</propertyTester>
+ <propertyTester
+ namespace="org.eclipse.debug.ui"
+ type="org.eclipse.ui.console.IOConsole"
+ class="org.eclipse.debug.internal.ui.views.console.JavaConsoleTrackerPropertyTester"
+ properties="processTypeTest"
+ id="org.eclipse.jdt.debug.ui.JavaConsolePropertyTester"/>
</extension>
<!-- Context extensions -->
<extension
@@ -2042,5 +2102,26 @@
value="org.eclipse.debug.internal.ui.views.memory.HexRenderer">
</rendering_property>
</rendering>
+ </extension>
+ <extension
+ point="org.eclipse.ui.console.consolePatternMatchListener">
+ <consolePatternMatchListener
+ class="org.eclipse.debug.internal.ui.views.console.ConsoleLineNotifier"
+ id="org.eclipse.debug.ui.consoleLineNotifier"
+ regex=".*\r(\n?)|.*\n">
+ <enablement>
+ <instanceof value="org.eclipse.debug.internal.ui.views.console.ProcessConsole"/>
+ </enablement>
+ </consolePatternMatchListener>
+ </extension>
+ <extension
+ point="org.eclipse.ui.console.consolePageParticipant">
+ <consolePageParticipant
+ class="org.eclipse.debug.internal.ui.views.console.ProcessConsolePageParticipant"
+ id="org.eclipse.debug.ui.processConsolePageParticipant">
+ <enablement>
+ <instanceof value="org.eclipse.debug.internal.ui.views.console.ProcessConsole"/>
+ </enablement>
+ </consolePageParticipant>
</extension>
</plugin>
\ No newline at end of file
diff --git a/org.eclipse.debug.ui/schema/launchShortcuts.exsd b/org.eclipse.debug.ui/schema/launchShortcuts.exsd
index f1a8d60..53c3b3a 100644
--- a/org.eclipse.debug.ui/schema/launchShortcuts.exsd
+++ b/org.eclipse.debug.ui/schema/launchShortcuts.exsd
@@ -3,7 +3,7 @@
<schema targetNamespace="org.eclipse.debug.ui">
<annotation>
<appInfo>
- <meta.schema plugin="org.eclipse.debug.ui" id="filaunchShortcuts" name="Launch Shortcuts"/>
+ <meta.schema plugin="org.eclipse.debug.ui" id="launchShortcuts" name="Launch Shortcuts"/>
</appInfo>
<documentation>
This extension point provides support for selection sensitive launching. Extensions register a shortcut which
@@ -110,10 +110,22 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="path" type="string">
+ <annotation>
+ <documentation>
+ an optional menu path used to group launch shortcuts in menus. Launch shortcuts are grouped alphabetically based on the <code>path</code> attribute, and then sorted alphabetically within groups based on the <code>label</code> attribute. When unspecified, a shortcut appears in the last group. This attribute was added in the 3.0.1 release.
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
<element name="perspective">
+ <annotation>
+ <documentation>
+ The <code>perspective</code> element has been <b>deprecated</b> in the 3.1 release. The top level Run/Debug/Profile cascade menus now support contextual (selection sensitive) launching, and clients should provide a <code>contextualLaunch</code> element instead.
+ </documentation>
+ </annotation>
<complexType>
<attribute name="id" type="string" use="required">
<annotation>
@@ -128,7 +140,7 @@
<element name="contextualLaunch">
<annotation>
<documentation>
- Holds all descriptions for adding shortcuts to the Run context menu (pop-up).
+ Holds all descriptions for adding shortcuts to the selection sensitive Run/Debug/Profile cascade menus.
</documentation>
</annotation>
<complexType>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 6b228aa..4cc29a9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -418,7 +418,6 @@
// work in progress TODO: remove
prefs.setDefault(DebugWorkInProgressPreferencePage.WIP_PREF_USE_LAUNCH_WIZARD, false);
- prefs.setDefault(DebugWorkInProgressPreferencePage.WIP_PREF_CONTEXT_LAUNCH, false);
}
protected IProcess getProcessFromInput(Object input) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractGroupBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractGroupBreakpointsAction.java
new file mode 100644
index 0000000..d320e95
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractGroupBreakpointsAction.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 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 implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.actions.breakpointGroups;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.jface.action.IAction;
+
+/**
+ *
+ */
+public abstract class AbstractGroupBreakpointsAction extends AbstractBreakpointsViewAction {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
+ for (int i = 0; i < breakpoints.length; i++) {
+ IBreakpoint breakpoint = breakpoints[i];
+ String group = getGroup(breakpoint);
+ try {
+ breakpoint.setGroup(group);
+ } catch (CoreException e) {
+ }
+ }
+ }
+
+ protected abstract String getGroup(IBreakpoint breakpoint);
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java
index e96bab6..c4d4a0f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java
@@ -52,11 +52,11 @@
public List chooseSimilarBreakpoints() {
Set breakpointsToSelect= new HashSet();
IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
- for (int i = 0; i < fBreakpoints.length; i++) {
- IBreakpoint selected = fBreakpoints[i];
- for (int j = 0; j < breakpoints.length; j++) {
- IBreakpoint breakpoint = breakpoints[j];
- if (breakpointsMatch(selected, breakpoint)) {
+ for (int i = 0; i < breakpoints.length; i++) {
+ IBreakpoint breakpoint = breakpoints[i];
+ for (int j = 0; j < fBreakpoints.length; j++) {
+ IBreakpoint selected = fBreakpoints[j];
+ if (breakpointsMatch(breakpoint, selected)) {
breakpointsToSelect.add(breakpoint);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupAllByFileAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupAllByFileAction.java
new file mode 100644
index 0000000..9d9e1ba
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupAllByFileAction.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 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 implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.actions.breakpointGroups;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.core.model.IBreakpoint;
+
+/**
+ * An action which groups all breakpoints according to their resource
+ */
+public class GroupAllByFileAction extends AbstractGroupBreakpointsAction {
+
+ /**
+ * @param breakpoint
+ * @return
+ */
+ protected String getGroup(IBreakpoint breakpoint) {
+ String group= null;
+ IMarker marker = breakpoint.getMarker();
+ if (marker != null) {
+ IResource resource = marker.getResource();
+ group= resource.getName();
+ }
+ return group;
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupAllByProjectAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupAllByProjectAction.java
new file mode 100644
index 0000000..4bbd34e
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupAllByProjectAction.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 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 implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.actions.breakpointGroups;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.debug.core.model.IBreakpoint;
+
+/**
+ * An action which groups all breakpoints according to their project
+ */
+public class GroupAllByProjectAction extends AbstractGroupBreakpointsAction {
+
+ /**
+ * @param breakpoint
+ * @return
+ */
+ protected String getGroup(IBreakpoint breakpoint) {
+ String group= null;
+ IMarker marker = breakpoint.getMarker();
+ if (marker != null) {
+ IProject project = marker.getResource().getProject();
+ if (project != null) {
+ group = project.getName();
+ }
+ }
+ return group;
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
index 8e359cd..7ba3d74 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
@@ -737,21 +737,43 @@
* @see Comparator#compare(Object, Object)
*/
public int compare(Object a, Object b) {
- String labelA = ((LaunchShortcutExtension)a).getLabel();
- String labelB = ((LaunchShortcutExtension)b).getLabel();
+ LaunchShortcutExtension shorcutA = (LaunchShortcutExtension)a;
+ String labelA = shorcutA.getLabel();
+ String pathA = shorcutA.getMenuPath();
+ LaunchShortcutExtension shortcutB = (LaunchShortcutExtension)b;
+ String labelB = shortcutB.getLabel();
+ String pathB = shortcutB.getMenuPath();
- // null labels sort last (i.e. highest)
- if (labelA == labelB) {
- return 0;
+ // group by path, then sort by label
+ // a null path sorts last (i.e. highest)
+ if (nullOrEqual(pathA, pathB)) {
+ // null labels sort last (i.e. highest)
+ if (labelA == labelB) {
+ return 0;
+ }
+ if (labelA == null) {
+ return 1;
+ }
+ if (labelB == null) {
+ return -1;
+ }
+ return labelA.compareToIgnoreCase(labelB);
}
- if (labelA == null) {
+ // compare paths
+ if (pathA == null) {
return 1;
}
- if (labelB == null) {
+ if (pathB == null) {
return -1;
}
-
- return labelA.compareToIgnoreCase(labelB);
+ return pathA.compareToIgnoreCase(pathB);
+ }
+
+ private boolean nullOrEqual(String a, String b) {
+ if (a == null) {
+ return b == null;
+ }
+ return a.equals(b);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
index 483bded..caa975f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
@@ -358,6 +358,16 @@
return fModes;
}
+ /**
+ * Returns the menu path attribute this shortcut, or <code>null</code> if none
+ *
+ * @return the menu path attribute this shortcut, or <code>null</code> if none
+ * @since 3.0.1
+ */
+ public String getMenuPath() {
+ return getConfigurationElement().getAttribute("path"); //$NON-NLS-1$
+ }
+
/*
* Only for debugging
* @see java.lang.Object#toString()
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 081b33d..1bfd5ad 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -17,10 +17,12 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
@@ -34,10 +36,15 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.views.launch.LaunchView;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IPerspectiveDescriptor;
@@ -268,6 +275,18 @@
if (page != null) {
try {
page.showView(IDebugUIConstants.ID_DEBUG_VIEW, null, IWorkbenchPage.VIEW_VISIBLE);
+ final LaunchView view = (LaunchView) page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
+ view.selectionChanged(new SelectionChangedEvent(new ISelectionProvider() {
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+ public ISelection getSelection() {
+ return view.getViewer().getSelection();
+ }
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+ public void setSelection(ISelection selection) {
+ }
+ }, view.getViewer().getSelection()));
} catch (PartInitException e) {
DebugUIPlugin.log(e);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugWorkInProgressPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugWorkInProgressPreferencePage.java
index 09511ab..a87c4a5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugWorkInProgressPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugWorkInProgressPreferencePage.java
@@ -25,7 +25,6 @@
public class DebugWorkInProgressPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IDebugPreferenceConstants {
public static final String WIP_PREF_USE_LAUNCH_WIZARD = DebugUIPlugin.getUniqueIdentifier() + ".WIP_PREF_USE_LAUNCH_WIZARD"; //$NON-NLS-1$
- public static final String WIP_PREF_CONTEXT_LAUNCH = DebugUIPlugin.getUniqueIdentifier() + ".WIP_PREF_CONTEXT_LAUNCH"; //$NON-NLS-1$
public DebugWorkInProgressPreferencePage() {
super(GRID);
@@ -47,7 +46,6 @@
*/
protected void createFieldEditors() {
addField(new BooleanFieldEditor(WIP_PREF_USE_LAUNCH_WIZARD, "Use launch wizard instead of launch dialog", SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
- addField(new BooleanFieldEditor(WIP_PREF_CONTEXT_LAUNCH, "Use contextual launch in top-level run menus", SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/BreakPartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/BreakPartition.java
deleted file mode 100644
index 30a078c..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/BreakPartition.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.debug.internal.ui.views.console;
-
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * A partition in a console document that represents a break after an input
- * partition. This represents a hard break that the user cannot backspace/delete.
- */
-public class BreakPartition extends StreamPartition {
-
- /**
- * Partition type
- */
- public static final String BREAK_PARTITION_TYPE = DebugUIPlugin.getUniqueIdentifier() + ".BREAK_PARTITION_TYPE"; //$NON-NLS-1$
-
-
- public BreakPartition(String streamIdentifier, int offset, int length) {
- super(streamIdentifier, offset, length, BREAK_PARTITION_TYPE);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.console.StreamPartition#createNewPartition(String, int, int)
- */
- public StreamPartition createNewPartition(String streamIdentifier, int offset, int length) {
- return new BreakPartition(streamIdentifier, offset, length);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocument.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocument.java
deleted file mode 100644
index 6b37c3f..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocument.java
+++ /dev/null
@@ -1,43 +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.debug.internal.ui.views.console;
-
-
-import org.eclipse.debug.ui.console.IConsoleColorProvider;
-import org.eclipse.jface.text.AbstractDocument;
-import org.eclipse.jface.text.DefaultLineTracker;
-import org.eclipse.jface.text.ITextStore;
-
-public class ConsoleDocument extends AbstractDocument {
-
- private IConsoleColorProvider fColorProvider;
-
- public ConsoleDocument(IConsoleColorProvider colorProvider) {
- fColorProvider = colorProvider;
- setTextStore(newTextStore());
- setLineTracker(new DefaultLineTracker());
- completeInitialization();
- }
-
- /**
- * Returns whether this document is read-only.
- */
- public boolean isReadOnly() {
- return fColorProvider.isReadOnly();
- }
-
- /**
- * Creates a new text store for this document.
- */
- protected ITextStore newTextStore() {
- return new ConsoleOutputTextStore(2500);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentManager.java
deleted file mode 100644
index 2fa82933..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentManager.java
+++ /dev/null
@@ -1,370 +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.debug.internal.ui.views.console;
-//
-//
-//import java.text.MessageFormat;
-//import java.util.ArrayList;
-//import java.util.HashMap;
-//import java.util.Iterator;
-//import java.util.List;
-//import java.util.Map;
-//
-//import org.eclipse.core.runtime.CoreException;
-//import org.eclipse.core.runtime.IConfigurationElement;
-//import org.eclipse.core.runtime.IExtensionPoint;
-//import org.eclipse.core.runtime.Platform;
-//import org.eclipse.debug.core.DebugPlugin;
-//import org.eclipse.debug.core.ILaunch;
-//import org.eclipse.debug.core.ILaunchListener;
-//import org.eclipse.debug.core.ILaunchManager;
-//import org.eclipse.debug.core.model.IProcess;
-//import org.eclipse.debug.internal.ui.DebugUIPlugin;
-//import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-//import org.eclipse.debug.ui.IDebugUIConstants;
-//import org.eclipse.debug.ui.console.IConsoleColorProvider;
-//import org.eclipse.debug.ui.console.IConsoleLineTracker;
-//import org.eclipse.jface.text.IDocument;
-//import org.eclipse.ui.console.ConsolePlugin;
-//import org.eclipse.ui.console.IConsole;
-//import org.eclipse.ui.console.IConsoleManager;
-//import org.eclipse.ui.texteditor.IDocumentProvider;
-//
-///**
-// * Creates documents for processes as they are registered with a launch.
-// * The singleton manager is accessible from the debug UI plugin.
-// */
-//public class ConsoleDocumentManager implements ILaunchListener {
-//
-// /**
-// * Console document content provider extensions, keyed by extension id
-// */
-// private Map fColorProviders;
-//
-// /**
-// * Console line trackers; keyed by process type to list of trackers (1:N)
-// */
-// private Map fLineTrackers;
-//
-// /**
-// * Default document provider.
-// */
-// protected IDocumentProvider fDefaultDocumentProvider = null;
-//
-// /**
-// * Map of processes for a launch to compute removed processes
-// */
-// private Map fProcesses;
-//
-// /**
-// * @see ILaunchListener#launchRemoved(ILaunch)
-// */
-// public void launchRemoved(ILaunch launch) {
-// removeLaunch(launch);
-// }
-//
-// protected void removeLaunch(ILaunch launch) {
-// IProcess[] processes= launch.getProcesses();
-// for (int i= 0; i < processes.length; i++) {
-// IProcess iProcess = processes[i];
-// removeProcess(iProcess);
-// }
-// if (fProcesses != null) {
-// fProcesses.remove(launch);
-// }
-// }
-//
-// /**
-// * Removes the console and document associated with the given process.
-// *
-// * @param iProcess process to clean up
-// */
-// private void removeProcess(IProcess iProcess) {
-// IConsole console = getConsole(iProcess);
-// if (console != null) {
-// IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
-// manager.removeConsoles(new IConsole[]{console});
-// }
-// IDocumentProvider provider = getDocumentProvider();
-// provider.disconnect(iProcess);
-// }
-//
-// /**
-// * Returns the console for the given process, or <code>null</code> if none.
-// *
-// * @param process
-// * @return the console for the given process, or <code>null</code> if none
-// */
-// public IConsole getConsole(IProcess process) {
-// IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
-// IConsole[] consoles = manager.getConsoles();
-// for (int i = 0; i < consoles.length; i++) {
-// IConsole console = consoles[i];
-// if (console instanceof ProcessConsole) {
-// ProcessConsole pc = (ProcessConsole)console;
-// if (pc.getProcess().equals(process)) {
-// return pc;
-// }
-// }
-// }
-// return null;
-// }
-//
-// /**
-// * @see ILaunchListener#launchAdded(ILaunch)
-// */
-// public void launchAdded(ILaunch launch) {
-// launchChanged(launch);
-// }
-//
-// /**
-// * @see ILaunchListener#launchChanged(ILaunch)
-// */
-// public void launchChanged(final ILaunch launch) {
-// DebugUIPlugin.getStandardDisplay().syncExec(new Runnable () {
-// public void run() {
-// IProcess[] processes= launch.getProcesses();
-// for (int i= 0; i < processes.length; i++) {
-// if (getConsoleDocument(processes[i]) == null) {
-// // create new document
-// IProcess process = processes[i];
-// IDocumentProvider provider = getDocumentProvider();
-// try {
-// provider.connect(process);
-// } catch (CoreException e) {
-// }
-// ProcessConsole pc = new ProcessConsole(process);
-// ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{pc});
-// }
-// }
-// List removed = getRemovedProcesses(launch);
-// if (removed != null) {
-// Iterator iterator = removed.iterator();
-// while (iterator.hasNext()) {
-// IProcess p = (IProcess) iterator.next();
-// removeProcess(p);
-// }
-// }
-// }
-// });
-// }
-//
-// /**
-// * Returns the document for the process, or <code>null</code>
-// * if none.
-// */
-// public IDocument getConsoleDocument(IProcess process) {
-// IDocumentProvider provider = getDocumentProvider();
-// return provider.getDocument(process);
-// }
-//
-// /**
-// * Returns the document provider.
-// *
-// * @return document provider
-// */
-// private IDocumentProvider getDocumentProvider() {
-// if (fDefaultDocumentProvider == null) {
-// fDefaultDocumentProvider = new ConsoleDocumentProvider();
-// }
-// return fDefaultDocumentProvider;
-// }
-//
-// /**
-// * Called by the debug ui plug-in on startup.
-// * The console document manager starts listening for
-// * launches to be registered and initializes if any launches
-// * already exist.
-// */
-// public void startup() {
-// ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
-// launchManager.addLaunchListener(this);
-//
-// //set up the docs for launches already registered
-// ILaunch[] launches= launchManager.getLaunches();
-// for (int i = 0; i < launches.length; i++) {
-// launchAdded(launches[i]);
-// }
-// }
-//
-// /**
-// * Called by the debug ui plug-in on shutdown.
-// * The console document manager de-registers as a
-// * launch listener and kills all existing console documents.
-// */
-// public void shutdown() {
-// ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
-// ILaunch[] launches = launchManager.getLaunches();
-// for (int i = 0; i < launches.length; i++) {
-// ILaunch launch = launches[i];
-// removeLaunch(launch);
-// }
-// launchManager.removeLaunchListener(this);
-// if (fProcesses != null) {
-// fProcesses.clear();
-// }
-// }
-//
-// /**
-// * Notifies the console document manager that system err is about to be written
-// * to the console. The manager will open the console if the preference is
-// * set to show the console on system err.
-// */
-// protected void aboutToWriteSystemErr(IProcess process) {
-// if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR)) {
-// showConsole(process);
-// }
-// }
-//
-// /**
-// * Notifies the console document manager that system out is about to be written
-// * to the console. The manager will open the console if the preference is
-// * set to show the console on system out and the console document being written
-// * is associated with the current process.
-// */
-// protected void aboutToWriteSystemOut(IProcess process) {
-// if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT)) {
-// showConsole(process);
-// }
-// }
-//
-// /**
-// * Opens the console view. If the view is already open, it is brought to the front.
-// */
-// protected void showConsole(final IProcess process) {
-// ConsolePlugin.getDefault().getConsoleManager().showConsoleView(getConsole(process));
-// }
-//
-// /**
-// * Returns a new console document color provider extension for the given
-// * process type, or <code>null</code> if none.
-// *
-// * @param type corresponds to <code>IProcess.ATTR_PROCESS_TYPE</code>
-// * @return IConsoleColorProvider
-// */
-// public IConsoleColorProvider getColorProvider(String type) {
-// if (fColorProviders == null) {
-// fColorProviders = new HashMap();
-// IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_COLOR_PROVIDERS);
-// IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
-// for (int i = 0; i < elements.length; i++) {
-// IConfigurationElement extension = elements[i];
-// fColorProviders.put(extension.getAttributeAsIs("processType"), extension); //$NON-NLS-1$
-// }
-// }
-// IConfigurationElement extension = (IConfigurationElement)fColorProviders.get(type);
-// if (extension != null) {
-// try {
-// Object colorProvider = extension.createExecutableExtension("class"); //$NON-NLS-1$
-// if (colorProvider instanceof IConsoleColorProvider) {
-// return (IConsoleColorProvider)colorProvider;
-// }
-// DebugUIPlugin.logErrorMessage(MessageFormat.format(ConsoleMessages.getString("ConsoleDocumentManager.1"),new String[]{extension.getDeclaringExtension().getUniqueIdentifier()} )); //$NON-NLS-1$
-// } catch (CoreException e) {
-// DebugUIPlugin.log(e);
-// }
-// }
-// return null;
-// }
-//
-// /**
-// * Creates and retuns a new line notifier for the given type of process, or
-// * <code>null</code> if none. The notifier will be seeded with new console
-// * line listeners registered for the given process type.
-// *
-// * @param type process type
-// * @return line notifier or <code>null</code>
-// */
-// public ConsoleLineNotifier newLineNotifier(String type) {
-// if (fLineTrackers == null) {
-// fLineTrackers = new HashMap();
-// IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_LINE_TRACKERS);
-// IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
-// for (int i = 0; i < elements.length; i++) {
-// IConfigurationElement extension = elements[i];
-// String processType = extension.getAttributeAsIs("processType"); //$NON-NLS-1$
-// List list = (List)fLineTrackers.get(processType);
-// if (list == null) {
-// list = new ArrayList();
-// fLineTrackers.put(processType, list);
-// }
-// list.add(extension);
-// }
-// }
-// List extensions = (List)fLineTrackers.get(type);
-// ConsoleLineNotifier lineNotifier = null;
-// if (extensions != null) {
-// lineNotifier = new ConsoleLineNotifier();
-// Iterator iter = extensions.iterator();
-// while (iter.hasNext()) {
-// IConfigurationElement extension = (IConfigurationElement)iter.next();
-// try {
-// Object tracker = extension.createExecutableExtension("class"); //$NON-NLS-1$
-// if (tracker instanceof IConsoleLineTracker) {
-// lineNotifier.addConsoleListener((IConsoleLineTracker)tracker);
-// } else {
-// DebugUIPlugin.logErrorMessage(MessageFormat.format(ConsoleMessages.getString("ConsoleDocumentManager.2"),new String[]{extension.getDeclaringExtension().getUniqueIdentifier()})); //$NON-NLS-1$
-// }
-// } catch (CoreException e) {
-// DebugUIPlugin.log(e);
-// }
-// }
-// }
-// return lineNotifier;
-// }
-//
-// /**
-// * Returns the processes that have been removed from the given
-// * launch, or <code>null</code> if none.
-// *
-// * @param launch launch that has changed
-// * @return removed processes or <code>null</code>
-// */
-// private List getRemovedProcesses(ILaunch launch) {
-// List removed = null;
-// if (fProcesses == null) {
-// fProcesses = new HashMap();
-// }
-// IProcess[] old = (IProcess[]) fProcesses.get(launch);
-// IProcess[] curr = launch.getProcesses();
-// if (old != null) {
-// for (int i = 0; i < old.length; i++) {
-// IProcess process = old[i];
-// if (!contains(curr, process)) {
-// if (removed == null) {
-// removed = new ArrayList();
-// }
-// removed.add(process);
-// }
-// }
-// }
-// // update cache with current processes
-// fProcesses.put(launch, curr);
-// return removed;
-// }
-//
-// /**
-// * Returns whether the given object is contained in the list.
-// *
-// * @param list list to search
-// * @param object object to search for
-// * @return whether the given object is contained in the list
-// */
-// private boolean contains(Object[] list, Object object) {
-// for (int i = 0; i < list.length; i++) {
-// Object object2 = list[i];
-// if (object2.equals(object)) {
-// return true;
-// }
-// }
-// return false;
-// }
-//}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentPartitioner.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentPartitioner.java
deleted file mode 100644
index ab6d5b9..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentPartitioner.java
+++ /dev/null
@@ -1,1003 +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.debug.internal.ui.views.console;
-
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.IStreamListener;
-import org.eclipse.debug.core.model.IFlushableStreamMonitor;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamMonitor;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.console.IConsole;
-import org.eclipse.debug.ui.console.IConsoleColorProvider;
-import org.eclipse.debug.ui.console.IConsoleHyperlink;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.BadPositionCategoryException;
-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.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IPatternMatchListener;
-
-/**
- * Default console document partitioner. Partitions a document into
- * color regions for standard in, out, err.
- */
-public class ConsoleDocumentPartitioner implements IDocumentPartitioner, IDocumentPartitionerExtension, IPropertyChangeListener, IConsole, IDebugEventSetListener {
-
- protected IProcess fProcess;
- protected IConsoleColorProvider fColorProvider;
- private IStreamsProxy fProxy;
- protected List fStreamListeners = new ArrayList(2);
-
- private String[] fSortedLineDelimiters;
-
- // high and low water marks for buffering output
- private boolean fUpdatingBuffer = false;
- private int fLowWaterMark;
- private int fHighWaterMark;
-
- // max amount of output (characters) processed per poll
- private int fMaxAppendSize;
-
- class StreamEntry {
- /**
- * Identifier of the stream written to.
- */
- private String fStreamIdentifier;
- /**
- * The text written
- */
- private String fText = null;
-
- StreamEntry(String text, String streamIdentifier) {
- fText = text;
- fStreamIdentifier = streamIdentifier;
- }
-
- /**
- * Returns the stream identifier
- */
- public String getStreamIdentifier() {
- return fStreamIdentifier;
- }
-
- /**
- * Returns the text written
- */
- public String getText() {
- return fText;
- }
-
- public boolean isClosedEntry() {
- return false;
- }
- }
-
- /**
- * A stream entry representing stream closure
- */
- class StreamsClosedEntry extends StreamEntry {
- StreamsClosedEntry() {
- super("", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public boolean isClosedEntry() {
- return true;
- }
- }
-
- class StreamListener implements IStreamListener {
-
- private String fStreamIdentifier;
- private IStreamMonitor fStreamMonitor;
- private boolean fIsSystemOut = false;
- private boolean fIsSystemErr = false;
-
- public StreamListener(String streamIdentifier, IStreamMonitor streamMonitor) {
- fStreamIdentifier = streamIdentifier;
- fStreamMonitor = streamMonitor;
- fIsSystemOut = IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM.equals(streamIdentifier);
- fIsSystemErr = IDebugUIConstants.ID_STANDARD_ERROR_STREAM.equals(streamIdentifier);
- }
-
- public void streamAppended(String newText, IStreamMonitor monitor) {
- if (fIsSystemOut) {
- DebugUIPlugin.getDefault().getProcessConsoleManager().aboutToWriteSystemOut(getProcess());
- } else if (fIsSystemErr) {
- DebugUIPlugin.getDefault().getProcessConsoleManager().aboutToWriteSystemErr(getProcess());
- }
- ConsoleDocumentPartitioner.this.streamAppended(newText, fStreamIdentifier);
- }
-
- public void streamClosed(IStreamMonitor monitor) {
- //ConsoleDocumentPartitioner.this.streamClosed(fStreamIdentifier);
- }
-
- public void connect() {
- fStreamMonitor.addListener(this);
- String contents= fStreamMonitor.getContents();
- if (fStreamMonitor instanceof IFlushableStreamMonitor) {
- // flush the underlying buffer and do not duplicate storage
- IFlushableStreamMonitor flushableStreamMonitor = (IFlushableStreamMonitor)fStreamMonitor;
- flushableStreamMonitor.flushContents();
- flushableStreamMonitor.setBuffered(false);
- }
- if (contents.length() > 0) {
- streamAppended(contents, fStreamMonitor);
- }
- }
-
- public void disconnect() {
- fStreamMonitor.removeListener(this);
- }
- }
-
-
- /**
- * A queue of stream entries written to standard out and standard err.
- * Entries appended to the end of the queue and removed from the front.
- * Intentionally a vector to obtain synchronization as entries are
- * added and removed.
- */
- private Vector fQueue = new Vector(10);
-
- /**
- * Thread that polls the queue for new output
- */
- private Thread fPollingThread = null;
-
- /**
- * Whether an append is still in progress or to be run
- */
- private boolean fAppending = false;
-
- /**
- * Whether the console has been killed/disconnected
- */
- private boolean fKilled = false;
-
- /**
- * Whether to keep polling
- */
- private boolean fPoll = false;
-
- /**
- * Whether the streams coonnected to the associated process are closed
- */
- private boolean fClosed= false;
-
- /**
- * The associated document
- */
- private IDocument fDocument = null;
-
- /**
- * The length of the current line
- */
- private int fLineLength = 0;
-
- /**
- * Maximum line length before wrapping.
- */
- private int fMaxLineLength = 80;
-
- /**
- * Whether using auto-wrap mode
- */
- private boolean fWrap = false;
-
- /**
- * List of partitions
- */
- private List fPartitions = new ArrayList(5);
-
- /**
- * The base number of milliseconds to pause
- * between polls.
- */
- private static final long BASE_DELAY= 100L;
-
- /**
- * The identifier of the stream that was last appended to
- */
- private String fLastStreamIdentifier= null;
-
- /**
- * Keyboard input buffer
- */
- private StringBuffer fInputBuffer = new StringBuffer();
-
- /**
- * Queue of hyperlinks to be added to the console
- */
- private Vector fPendingLinks = new Vector();
-
- /**
- * The line notifier associated with this partitioner or <code>null</code> if none
- */
- private ConsoleLineNotifier fLineNotifier = null;
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#connect(org.eclipse.jface.text.IDocument)
- */
- public void connect(IDocument document) {
- fDocument = document;
- fDocument.addPositionCategory(HyperlinkPosition.HYPER_LINK_CATEGORY);
- document.setDocumentPartitioner(this);
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- fWrap = store.getBoolean(IDebugPreferenceConstants.CONSOLE_WRAP);
- fMaxLineLength = store.getInt(IDebugPreferenceConstants.CONSOLE_WIDTH);
- store.addPropertyChangeListener(this);
- fColorProvider.connect(fProcess, this);
- DebugPlugin.getDefault().addDebugEventListener(this);
- if (fProcess.isTerminated()) {
- // it is possible the terminate event will have been fired before the
- // document is connected - in this case, ensure we have closed the streams
- // and notified the line tracker
- streamsClosed();
- }
- }
-
- /**
- * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
- */
- public void disconnect() {
- kill();
- if (fLineNotifier != null) {
- fLineNotifier.disconnect();
- }
- fColorProvider.disconnect();
- fDocument.setDocumentPartitioner(null);
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- /**
- * @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[] {InputPartition.INPUT_PARTITION_TYPE, OutputPartition.OUTPUT_PARTITION_TYPE, BreakPartition.BREAK_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) {
- if (fUpdatingBuffer) {
- return new Region(0, fDocument.getLength());
- }
- addPendingLinks();
- String text = event.getText();
- if (isAppendInProgress()) {
- // stream input
- addPartition(new OutputPartition(fLastStreamIdentifier, event.getOffset(), text.length()));
-// if (fLineNotifier != null) {
-// fLineNotifier.consoleChanged(event);
-// }
- } else {
- // console keyboard input
- int amountDeleted = event.getLength() - text.length();
- int docLength = fDocument.getLength();
- int bufferStartOffset = docLength + amountDeleted - fInputBuffer.length();
- int bufferModifyOffset = event.getOffset() - bufferStartOffset;
- int bufferModifyOffsetEnd = bufferModifyOffset + event.getLength();
-
- if (docLength == 0) {
- // cleared
- fQueue.clear();
- fInputBuffer.setLength(0);
- fPartitions.clear();
- // reset lines processed to 0
-// if (fLineNotifier != null) {
-// fLineNotifier.setLinesProcessed(0);
-// }
- // remove existing positions
- try {
- Position[] positions = fDocument.getPositions(HyperlinkPosition.HYPER_LINK_CATEGORY);
- for (int i = 0; i < positions.length; i++) {
- Position position = positions[i];
- fDocument.removePosition(HyperlinkPosition.HYPER_LINK_CATEGORY, position);
- }
- } catch (BadPositionCategoryException e) {
- }
- return new Region(0,0);
- }
-
- if (amountDeleted > 0) {
- // deletion
- fInputBuffer.replace(bufferModifyOffset, bufferModifyOffsetEnd, text);
- // replace the last partition
- InputPartition partition = new InputPartition(IDebugUIConstants.ID_STANDARD_INPUT_STREAM, bufferStartOffset, fInputBuffer.length());
- fPartitions.set(fPartitions.size() - 1, partition);
- } else {
- // insert/replace - must process entire buffer in case of
- // line delimiter insertion in middle of buffer
-
- // parse for line delimiters (indicate chunks to write to standard in)
- String[] lineDelimiters= getLegalLineDelimiters();
- StringBuffer temp =new StringBuffer(fInputBuffer.toString());
- temp.replace(bufferModifyOffset, bufferModifyOffsetEnd, text);
- String remaining = temp.toString();
- int partitionOffset = bufferStartOffset;
- fInputBuffer.setLength(0);
- boolean includesLF = false;
- // line delimiters are sorted by length (compare longest ones first)
- for (int i= lineDelimiters.length - 1; i >= 0; i--) {
- int lf = remaining.indexOf(lineDelimiters[i]);
- while (lf >= 0) {
- includesLF = true;
- int split = lf + lineDelimiters[i].length();
- fInputBuffer.append(remaining.substring(0, split));
- remaining = remaining.substring(split);
- String buffer = fInputBuffer.toString();
- fInputBuffer.setLength(0);
- InputPartition written = (InputPartition)addPartition(new InputPartition(IDebugUIConstants.ID_STANDARD_INPUT_STREAM, partitionOffset, split));
- written.setReadOnly(true);
- partitionOffset += split;
- addPartition(new InputPartition(IDebugUIConstants.ID_STANDARD_INPUT_STREAM, partitionOffset, 0));
- if (fProxy != null) {
- try {
- fProxy.write(buffer);
- } catch (IOException ioe) {
- DebugUIPlugin.log(ioe);
- }
- }
- lf = remaining.indexOf(lineDelimiters[i]);
- }
- if (includesLF) {
- break;
- }
- }
- if (remaining.length() > 0) {
- fInputBuffer.append(remaining);
- addPartition(new InputPartition(IDebugUIConstants.ID_STANDARD_INPUT_STREAM, partitionOffset, remaining.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);
- }
-
- /**
- * Adds a new colored input partition, combining with the previous partition if
- * possible.
- */
- protected StreamPartition addPartition(StreamPartition partition) {
- if (fPartitions.isEmpty()) {
- fPartitions.add(partition);
- } else {
- int index = fPartitions.size() - 1;
- StreamPartition last = (StreamPartition)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;
- }
-
- /**
- * Add any pending links to the document that are now within the document's
- * bounds.
- */
- protected void addPendingLinks() {
- synchronized (fPendingLinks) {
- if (fPendingLinks.isEmpty()) {
- return;
- }
- Iterator links = fPendingLinks.iterator();
- while (links.hasNext()) {
- HyperlinkPosition link = (HyperlinkPosition)links.next();
- if ((link.getOffset() + link.getLength()) <= fDocument.getLength()) {
- links.remove();
- addLink(link.getHyperLink(), link.getOffset(), link.getLength());
- }
- }
- }
- }
-
- public ConsoleDocumentPartitioner(IProcess process, IConsoleColorProvider colorProvider) {
- fProcess= process;
- fColorProvider = colorProvider;
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- boolean limit = store.getBoolean(IDebugPreferenceConstants.CONSOLE_LIMIT_CONSOLE_OUTPUT);
- if (limit) {
- fLowWaterMark = store.getInt(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK);
- fHighWaterMark = store.getInt(IDebugPreferenceConstants.CONSOLE_HIGH_WATER_MARK);
- fMaxAppendSize = fLowWaterMark;
- } else {
- fLowWaterMark = -1;
- fHighWaterMark = -1;
- fMaxAppendSize = 80000;
- }
- }
-
- /**
- * Stops reading/polling immediately
- */
- public synchronized void kill() {
- if (!fKilled) {
- fKilled = true;
- if (fPollingThread != null && fPollingThread.isAlive()) {
- fPollingThread.interrupt();
- }
- fPoll = false;
- Iterator iter = fStreamListeners.iterator();
- while (iter.hasNext()) {
- StreamListener listener = (StreamListener)iter.next();
- listener.disconnect();
- }
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- }
- }
-
- public synchronized void startReading() {
- if (fPollingThread != null) {
- // already polling
- return;
- }
- Runnable r = new Runnable() {
- public void run() {
- pollAndSleep();
- }
- };
- fPoll = true;
- fPollingThread = new Thread(r, "Console Polling Thread"); //$NON-NLS-1$
- fPollingThread.start();
- }
-
- /**
- * Polls and sleeps until closed or the associated
- * process terminates
- */
- protected void pollAndSleep() {
- while (!fKilled && fPoll && (!isClosed() || !fQueue.isEmpty())) {
- poll();
- try {
- Thread.sleep(BASE_DELAY);
- } catch (InterruptedException e) {
- }
- }
- }
-
- /**
- * Polls the queue for new output and updates this document
- */
- protected void poll() {
- if (isAppendInProgress()) {
- return;
- }
- synchronized(fQueue) {
- StringBuffer buffer = null;
- StreamEntry prev = null;
- int processed = 0;
- int amount = 0;
- String[] lds = fDocument.getLegalLineDelimiters();
- boolean closed= false;
- while (!fKilled && !closed && processed < fQueue.size() && amount < fMaxAppendSize) {
- StreamEntry entry = (StreamEntry)fQueue.get(processed);
- if (entry.isClosedEntry()) {
- closed = true;
- processed++;
- } else if (prev == null || prev.getStreamIdentifier().equals(entry.getStreamIdentifier())) {
- String text = entry.getText();
- if (buffer == null) {
- buffer = new StringBuffer(text.length());
- }
- if (isWrap()) {
- for (int i = 0; i < text.length(); i++) {
- if (fLineLength >= fMaxLineLength) {
- String d = getLineDelimiter(text, i, lds);
- if (d == null) {
- buffer.append(lds[0]);
- } else {
- buffer.append(d);
- i = i + d.length();
- }
- fLineLength = 0;
- }
- if (i < text.length()) {
- String lineDelimiter = getLineDelimiter(text, i, lds);
- if (lineDelimiter == null) {
- buffer.append(text.charAt(i));
- fLineLength++;
- } else {
- buffer.append(lineDelimiter);
- fLineLength = 0;
- i = i + lineDelimiter.length() - 1;
- }
- }
- }
- } else {
- buffer.append(text);
- }
- prev = entry;
- processed++;
- amount+= entry.getText().length();
- } else {
- // change streams - write the contents of the current stream
- // and start processing the next stream
- if (buffer != null) {
- appendToDocument(buffer.toString(), prev.getStreamIdentifier());
- buffer.setLength(0);
- prev = null;
- }
- }
- }
- if (buffer != null) {
- appendToDocument(buffer.toString(), prev.getStreamIdentifier());
- }
- if (closed) {
- Display display= DebugUIPlugin.getStandardDisplay();
- if (display != null) {
- display.asyncExec(new Runnable() {
- public void run() {
- if (fLineNotifier != null) {
- fLineNotifier.streamsClosed();
- }
- }
- });
- }
- }
- for (int i = 0; i < processed; i++) {
- fQueue.remove(0);
- }
- }
- }
-
- /**
- * Returns the longest line delimiter at the given position in the given text,
- * or <code>null</code> if none.
- *
- * @param text the text in which to look for a line delimiter
- * @param pos the position at which to look for a line delimiter
- * @param lineDelimiters the line delimiters to look for
- */
- protected String getLineDelimiter(String text, int pos, String[] lineDelimiters) {
- String ld = null;
- for (int i = 0; i < lineDelimiters.length; i++) {
- if (text.regionMatches(pos, lineDelimiters[i], 0, lineDelimiters[i].length())) {
- if (ld == null) {
- ld = lineDelimiters[i];
- } else {
- if (ld.length() < lineDelimiters[i].length()) {
- ld = lineDelimiters[i];
- }
- }
- }
- }
- return ld;
- }
-
- /**
- * Returns whether this console document is performing auto-wrap
- */
- protected boolean isWrap() {
- return fWrap;
- }
-
- /**
- * The stream with the given identifier has had text appended to it.
- * Adds the new text to the document.
- *
- * @see IStreamListener#streamAppended(String, IStreamMonitor)
- */
- protected void appendToDocument(final String text, final String streamIdentifier) {
- Runnable r = new Runnable() {
- public void run() {
- setAppendInProgress(true);
- fLastStreamIdentifier = streamIdentifier;
- try {
- fDocument.replace(fDocument.getLength(), 0, text);
- warnOfContentChange();
- } catch (BadLocationException e) {
- }
- setAppendInProgress(false);
- checkOverflow();
- }
- };
- Display display = DebugUIPlugin.getStandardDisplay();
- if (display != null) {
- display.asyncExec(r);
- }
- }
-
- /**
- * Checks to see if the console buffer has overflowed, and empties the
- * overflow if needed, updating partitions and hyperlink positions.
- */
- protected void checkOverflow() {
- if (fHighWaterMark >= 0) {
- if (fDocument.getLength() > fHighWaterMark) {
-// int lineDifference = 0;
- if (fLineNotifier != null) {
-// int processed = fLineNotifier.getLinesProcessed();
-// int numLines = fDocument.getNumberOfLines();
-// lineDifference = numLines - processed;
- }
- int overflow = fDocument.getLength() - fLowWaterMark;
- fUpdatingBuffer = true;
- try {
- // update partitions
- List newParitions = new ArrayList(fPartitions.size());
- Iterator partitions = fPartitions.iterator();
- while (partitions.hasNext()) {
- ITypedRegion region = (ITypedRegion)partitions.next();
- if (region instanceof StreamPartition) {
- StreamPartition streamPartition = (StreamPartition)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 = streamPartition.createNewPartition(streamPartition.getStreamIdentifier(), 0, length);
- }
- } else {
- // modify parition offset
- newPartition = streamPartition.createNewPartition(streamPartition.getStreamIdentifier(), streamPartition.getOffset() - overflow, streamPartition.getLength());
- }
- if (newPartition != null) {
- newParitions.add(newPartition);
- }
- }
- }
- fPartitions = newParitions;
- // update hyperlinks
- try {
- Position[] hyperlinks = fDocument.getPositions(HyperlinkPosition.HYPER_LINK_CATEGORY);
- for (int i = 0; i < hyperlinks.length; i++) {
- HyperlinkPosition position = (HyperlinkPosition)hyperlinks[i];
- // remove old the position
- fDocument.removePosition(HyperlinkPosition.HYPER_LINK_CATEGORY, position);
- if (position.getOffset() >= overflow) {
- // add new poisition
- try {
- fDocument.addPosition(HyperlinkPosition.HYPER_LINK_CATEGORY, new HyperlinkPosition(position.getHyperLink(), position.getOffset() - overflow, position.getLength()));
- } catch (BadLocationException e) {
- }
- }
- }
- } catch (BadPositionCategoryException e) {
- }
- synchronized (fPendingLinks) {
- // update pending hyperlinks
- Vector newPendingLinks = new Vector(fPendingLinks.size());
- Iterator pendingLinks = fPendingLinks.iterator();
- while (pendingLinks.hasNext()) {
- HyperlinkPosition position = (HyperlinkPosition)pendingLinks.next();
- if (position.getOffset() >= overflow) {
- newPendingLinks.add(new HyperlinkPosition(position.getHyperLink(), position.getOffset() - overflow, position.getLength()));
- }
- }
- fPendingLinks = newPendingLinks;
- }
-
- // remove overflow text
- try {
- fDocument.replace(0, overflow, ""); //$NON-NLS-1$
- } catch (BadLocationException e) {
- DebugUIPlugin.log(e);
- }
- } finally {
- // update number of lines processed
- if (fLineNotifier != null) {
-// fLineNotifier.setLinesProcessed(fDocument.getNumberOfLines() - lineDifference);
- }
- fUpdatingBuffer = false;
- }
- }
- }
- }
-
- /**
- * The stream with the given identifier has had text appended to it.
- * Adds a new entry to the queue.
- */
- protected void streamAppended(String text, String streamIdentifier) {
- synchronized (fQueue) {
- if (fClosed) {
- // ERROR - attempt to append after console is closed
- DebugUIPlugin.logErrorMessage("An attempt was made to append text to the console, after it was closed."); //$NON-NLS-1$
- } else {
- fQueue.add(new StreamEntry(text, streamIdentifier));
- }
- }
- }
-
- /**
- * The streams associated with this process have been closed.
- * Adds a new "stream closed" entry to the queue.
- */
- protected void streamsClosed() {
- synchronized (fQueue) {
- if (!fClosed) {
- fQueue.add(new StreamsClosedEntry());
- fClosed = true;
- }
- }
- }
-
- /**
- * Sets whether a runnable has been submitted to update the console
- * document.
- */
- protected void setAppendInProgress(boolean appending) {
- fAppending = appending;
- }
-
- /**
- * Returns whether a runnable has been submitted to update the console
- * document.
- */
- protected boolean isAppendInProgress() {
- return fAppending;
- }
-
- /**
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IDebugPreferenceConstants.CONSOLE_WRAP)) {
- fWrap = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.CONSOLE_WRAP);
- } else if (event.getProperty().equals(IDebugPreferenceConstants.CONSOLE_WIDTH)) {
- fMaxLineLength = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.CONSOLE_WIDTH);
- }
- }
-
- /**
- * Returns a collection of legal line delimiters for this partitioner's
- * associated document, sorted by length in descending order.
- */
- protected String[] getLegalLineDelimiters() {
- if (fSortedLineDelimiters == null) {
- String[] lineDelimiters = fDocument.getLegalLineDelimiters();
- List list = new ArrayList(lineDelimiters.length);
- for (int i = 0; i < lineDelimiters.length; i++) {
- list.add(lineDelimiters[i]);
- }
- Comparator comparator = new Comparator() {
- /**
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object a, Object b) {
- String s1 = (String)a;
- String s2 = (String)b;
- return s2.length() - s1.length();
- }
-
- };
- Collections.sort(list, comparator);
- fSortedLineDelimiters = (String[])list.toArray(new String[lineDelimiters.length]);
- }
- return fSortedLineDelimiters;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#connect(org.eclipse.debug.core.model.IStreamMonitor, java.lang.String)
- */
- public void connect(IStreamMonitor streamMonitor, String streamIdentifer) {
- if (streamMonitor != null) {
- StreamListener listener = new StreamListener(streamIdentifer, streamMonitor);
- fStreamListeners.add(listener);
- listener.connect();
- // ensure we start polling for output
- startReading();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#connect(org.eclipse.debug.core.model.IStreamsProxy)
- */
- public void connect(IStreamsProxy streamsProxy) {
- fProxy = streamsProxy;
- connect(streamsProxy.getOutputStreamMonitor(), IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
- connect(streamsProxy.getErrorStreamMonitor(), IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
- }
-
- /**
- * Returns whether the streams assocaited with this console's process
- * have been closed.
- */
- protected boolean isClosed() {
- return fClosed;
- }
-
- protected IConsoleColorProvider getColorProvider() {
- return fColorProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#addLink(org.eclipse.debug.ui.console.IConsoleHyperlink, int, int)
- */
- public void addLink(IConsoleHyperlink link, int offset, int length) {
- HyperlinkPosition hyperlinkPosition = new HyperlinkPosition(link, offset, length);
- try {
- fDocument.addPosition(HyperlinkPosition.HYPER_LINK_CATEGORY, hyperlinkPosition);
- } catch (BadPositionCategoryException e) {
- // internal error
- DebugUIPlugin.log(e);
- } catch (BadLocationException e) {
- // queue the link
- fPendingLinks.add(hyperlinkPosition);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#getDocument()
- */
- public IDocument getDocument() {
- return fDocument;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#getProcess()
- */
- public IProcess getProcess() {
- return fProcess;
- }
-
- /**
- * Connects the given line notifier to this console document partitioner
- *
- * @param lineNotifier
- */
- public void connectLineNotifier(ConsoleLineNotifier lineNotifier) {
- fLineNotifier = lineNotifier;
- lineNotifier.connect(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#getRegion(org.eclipse.debug.ui.console.IConsoleHyperlink)
- */
- public IRegion getRegion(IConsoleHyperlink link) {
- try {
- Position[] positions = getDocument().getPositions(HyperlinkPosition.HYPER_LINK_CATEGORY);
- for (int i = 0; i < positions.length; i++) {
- HyperlinkPosition position = (HyperlinkPosition)positions[i];
- if (position.getHyperLink().equals(link)) {
- return new Region(position.getOffset(), position.getLength());
- }
- }
- } catch (BadPositionCategoryException e) {
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getKind() == DebugEvent.TERMINATE && event.getSource().equals(getProcess())) {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- streamsClosed();
- }
- }
-
- }
-
- private void warnOfContentChange() {
- ConsolePlugin.getDefault().getConsoleManager().warnOfContentChange(DebugUITools.getConsole(fProcess));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsole#addPatternMatchHandler(org.eclipse.ui.console.IPatternMatchListener)
- */
- public void addPatternMatchListener(IPatternMatchListener matchHandler) {
- //
- }
- public void removePatternMatchListener(IPatternMatchListener matchHandler) {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentProvider.java
deleted file mode 100644
index f102a0f..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleDocumentProvider.java
+++ /dev/null
@@ -1,129 +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.debug.internal.ui.views.console;
-
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.console.ConsoleColorProvider;
-import org.eclipse.debug.ui.console.IConsoleColorProvider;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-
-/**
- * Default document provider for the processes. By default a document is created
- * which is connected to the streams proxy of the associated process.
- */
-public class ConsoleDocumentProvider extends AbstractDocumentProvider {
-
- /**
- * The runnable context for that provider.
- * @since 3.0
- */
- private WorkspaceOperationRunner fOperationRunner;
-
- /**
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createDocument(java.lang.Object)
- */
- protected IDocument createDocument(Object element) {
- if (element instanceof IProcess) {
- IProcess process = (IProcess)element;
- IConsoleColorProvider colorProvider = getColorProvider(process);
- ConsoleDocument doc= new ConsoleDocument(colorProvider);
- ConsoleDocumentPartitioner partitioner = new ConsoleDocumentPartitioner(process, colorProvider);
- ConsoleLineNotifier lineNotifier = getLineNotifier(process);
- partitioner.connect(doc);
- if (lineNotifier != null) {
- partitioner.connectLineNotifier(lineNotifier);
- }
- return doc;
- }
- return null;
- }
-
- /**
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createAnnotationModel(java.lang.Object)
- */
- protected IAnnotationModel createAnnotationModel(Object element) {
- return null;
- }
-
- /**
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) {
- }
-
- /**
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#disposeElementInfo(java.lang.Object, org.eclipse.ui.texteditor.AbstractDocumentProvider.ElementInfo)
- */
- protected void disposeElementInfo(Object element, ElementInfo info) {
- ConsoleDocument document = (ConsoleDocument)info.fDocument;
- document.getDocumentPartitioner().disconnect();
- super.disposeElementInfo(element, info);
- }
-
- /**
- * Returns a color provider for the given process.
- *
- * @param process
- * @return IConsoleColorProvider
- */
- protected IConsoleColorProvider getColorProvider(IProcess process) {
- String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE);
- IConsoleColorProvider colorProvider = null;
- if (type != null) {
- colorProvider = getProcessConsoleManager().getColorProvider(type);
- }
- if (colorProvider == null) {
- colorProvider = new ConsoleColorProvider();
- }
- return colorProvider;
- }
-
- /**
- * Returns the line notifier for this console, or <code>null</code> if none.
- *
- * @param process
- * @return line notifier, or <code>null</code>
- */
- protected ConsoleLineNotifier getLineNotifier(IProcess process) {
- String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE);
- if (type != null) {
- return getProcessConsoleManager().newLineNotifier(type);
- }
- return null;
- }
-
- /**
- * Convenience accessor
- *
- * @return ConsoleDocumentManager
- */
- private ProcessConsoleManager getProcessConsoleManager() {
- return DebugUIPlugin.getDefault().getProcessConsoleManager();
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getOperationRunner(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- if (fOperationRunner == null)
- fOperationRunner = new WorkspaceOperationRunner();
- fOperationRunner.setProgressMonitor(monitor);
- return fOperationRunner;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
index 1622a7a..cf82c6d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
@@ -11,22 +11,26 @@
package org.eclipse.debug.internal.ui.views.console;
-import org.eclipse.debug.ui.console.IConsole;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.console.IConsoleLineTracker;
import org.eclipse.debug.ui.console.IConsoleLineTrackerExtension;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
+import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.ListenerList;
-import org.eclipse.ui.console.IPatternMatchListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IOConsole;
+import org.eclipse.ui.console.IPatternMatchListenerDelegate;
import org.eclipse.ui.console.PatternMatchEvent;
/**
* Tracks text appended to the console and notifies listeners in terms of whole
* lines.
*/
-public class ConsoleLineNotifier implements IPatternMatchListener {
+public class ConsoleLineNotifier implements IPatternMatchListenerDelegate, IPropertyChangeListener {
/**
* Console listeners
*/
@@ -35,7 +39,7 @@
/**
* The console this notifier is tracking
*/
- private IConsole fConsole = null;
+ private ProcessConsole fConsole = null;
/**
* Connects this notifier to the given console.
@@ -43,13 +47,17 @@
* @param console
*/
public void connect(IConsole console) {
- fConsole = console;
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- IConsoleLineTracker listener = (IConsoleLineTracker)listeners[i];
- listener.init(console);
- }
- fConsole.addPatternMatchListener(this);
+ if (console instanceof ProcessConsole) {
+ fConsole = (ProcessConsole)console;
+
+ IConsoleLineTracker[] lineTrackers = DebugUIPlugin.getDefault().getProcessConsoleManager().getLineTrackers(fConsole.getProcess());
+ for (int i = 0; i < lineTrackers.length; i++) {
+ lineTrackers[i].init(fConsole);
+ addConsoleListener(lineTrackers[i]);
+ }
+
+ fConsole.addPropertyChangeListener(this);
+ }
}
/**
@@ -59,12 +67,15 @@
if (fConsole == null) {
return; //already disconnected
}
- fConsole.removePatternMatchListener(this);
+
Object[] listeners = fListeners.getListeners();
for (int i = 0; i < listeners.length; i++) {
IConsoleLineTracker listener = (IConsoleLineTracker)listeners[i];
listener.dispose();
}
+
+ fConsole.removePropertyChangeListener(this);
+
fListeners = null;
fConsole = null;
}
@@ -106,20 +117,6 @@
public void addConsoleListener(IConsoleLineTracker listener) {
fListeners.add(listener);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#getPattern()
- */
- public String getPattern() {
- return ".*\r(\n?)|.*\n"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#getModifiers()
- */
- public int getCompilerFlags() {
- return 0;
- }
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#matchFound(org.eclipse.ui.console.PatternMatchEvent)
@@ -152,5 +149,13 @@
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ if(event.getProperty().equals(IOConsole.P_CONSOLE_OUTPUT_COMPLETE)) {
+ streamsClosed();
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties
index d6d5d3a..726bfa1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties
@@ -9,9 +9,6 @@
# IBM Corporation - initial API and implementation
###############################################################################
-ConsoleDocumentManager.1=Invalid extension {0} - class must be an instance of IConsoleColorProvider.
-ConsoleDocumentManager.2=Invalid extension {0} - class must be an instance of IConsoleLineTracker
-
ConsoleRemoveAllTerminatedAction.0=&Remove All Terminated
ConsoleRemoveAllTerminatedAction.1=Remove All Terminated Launches
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleOutputTextStore.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleOutputTextStore.java
deleted file mode 100644
index c98fb89..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleOutputTextStore.java
+++ /dev/null
@@ -1,68 +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.debug.internal.ui.views.console;
-
-
-import org.eclipse.jface.text.ITextStore;
-
-public class ConsoleOutputTextStore implements ITextStore {
-
- private StringBuffer fBuffer;
-
- public ConsoleOutputTextStore(int bufferSize) {
- fBuffer= new StringBuffer(bufferSize);
- }
-
- /**
- * @see ITextStore#get(int)
- */
- public char get(int pos) {
- return fBuffer.charAt(pos);
- }
-
- /**
- * @see ITextStore#get(int, int)
- */
- public String get(int pos, int length) {
- return fBuffer.substring(pos, pos + length);
- }
-
- /**
- * @see ITextStore#getLength()
- */
- public int getLength() {
- return fBuffer.length();
- }
-
- /**
- * @see ITextStore#replace(int, int, String)
- */
- public void replace(int pos, int length, String text) {
- if (text == null) {
- text= ""; //$NON-NLS-1$
- }
- fBuffer.replace(pos, pos + length, text);
- }
-
- /**
- * @see ITextStore#set(String)
- */
- public void set(String text) {
- fBuffer= new StringBuffer(text);
- }
-
- /**
- * @see StringBuffer#ensureCapacity(int)
- */
- public void setMinimalBufferSize(int bufferSize) {
- fBuffer.ensureCapacity(bufferSize);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java
deleted file mode 100644
index a6fc968..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java
+++ /dev/null
@@ -1,489 +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.debug.internal.ui.views.console;
-//
-//
-//import org.eclipse.debug.internal.ui.DebugUIPlugin;
-//import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-//import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-//import org.eclipse.debug.ui.console.IConsoleColorProvider;
-//import org.eclipse.debug.ui.console.IConsoleHyperlink;
-//import org.eclipse.jface.resource.JFaceResources;
-//import org.eclipse.jface.text.BadLocationException;
-//import org.eclipse.jface.text.BadPositionCategoryException;
-//import org.eclipse.jface.text.DocumentEvent;
-//import org.eclipse.jface.text.IDocument;
-//import org.eclipse.jface.text.IDocumentListener;
-//import org.eclipse.jface.text.IDocumentPartitioner;
-//import org.eclipse.jface.text.IRegion;
-//import org.eclipse.jface.text.ITypedRegion;
-//import org.eclipse.jface.text.Position;
-//import org.eclipse.jface.text.TextViewer;
-//import org.eclipse.jface.util.IPropertyChangeListener;
-//import org.eclipse.jface.util.PropertyChangeEvent;
-//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.events.MouseEvent;
-//import org.eclipse.swt.events.MouseListener;
-//import org.eclipse.swt.events.MouseMoveListener;
-//import org.eclipse.swt.events.MouseTrackListener;
-//import org.eclipse.swt.events.PaintEvent;
-//import org.eclipse.swt.events.PaintListener;
-//import org.eclipse.swt.events.VerifyEvent;
-//import org.eclipse.swt.graphics.Color;
-//import org.eclipse.swt.graphics.Cursor;
-//import org.eclipse.swt.graphics.FontMetrics;
-//import org.eclipse.swt.graphics.Point;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.swt.widgets.Control;
-//import org.eclipse.swt.widgets.Event;
-//import org.eclipse.swt.widgets.Listener;
-//import org.eclipse.ui.console.IConsoleConstants;
-//
-//public class ConsoleViewer extends TextViewer implements IPropertyChangeListener, MouseTrackListener, MouseMoveListener, MouseListener, PaintListener, LineStyleListener, Listener {
-//
-// /**
-// * Hand cursor
-// */
-// private Cursor fHandCursor;
-//
-// /**
-// * Text cursor
-// */
-// private Cursor fTextCursor;
-//
-// /**
-// * The active hyperlink, or <code>null</code>
-// */
-// private IConsoleHyperlink fHyperLink = null;
-//
-// protected InternalDocumentListener fInternalDocumentListener= new InternalDocumentListener();
-//
-// /**
-// * Whether the console scrolls as output is appended.
-// */
-// private boolean fAutoScroll = true;
-//
-// /**
-// * Internal document listener.
-// */
-// class InternalDocumentListener implements IDocumentListener {
-// /**
-// * @see IDocumentListener#documentAboutToBeChanged(DocumentEvent)
-// */
-// public void documentAboutToBeChanged(DocumentEvent e) {
-// }
-//
-// /**
-// * @see IDocumentListener#documentChanged(DocumentEvent)
-// */
-// public void documentChanged(DocumentEvent e) {
-// ConsoleDocument doc= (ConsoleDocument)getDocument();
-// if (doc == null) {
-// getTextWidget().setEditable(false);
-// return;
-// }
-// getTextWidget().setEditable(!doc.isReadOnly());
-// 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 ConsoleViewer(Composite parent) {
-// super(parent, getSWTStyles());
-//
-// getTextWidget().setDoubleClickEnabled(true);
-//
-// DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
-// JFaceResources.getFontRegistry().addListener(this);
-//
-// getTextWidget().setFont(JFaceResources.getFont(IConsoleConstants.CONSOLE_FONT));
-// getTextWidget().addMouseTrackListener(this);
-// getTextWidget().addPaintListener(this);
-// getTextWidget().addLineStyleListener(this);
-// getTextWidget().addListener(SWT.KeyUp, this);
-// getTextWidget().setTabs(DebugUIPlugin.getDefault().getPluginPreferences().getInt(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH));
-// }
-//
-// /**
-// * 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() {
-// if (isAutoScroll()) {
-// 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) {
-// }
-// }
-// }
-//
-// /**
-// * @see ITextViewer#setDocument(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);
-// }
-// }
-//
-// /**
-// * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
-// */
-// public void propertyChange(PropertyChangeEvent event) {
-// String propertyName= event.getProperty();
-// if (propertyName.equals(IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR) ||
-// propertyName.equals(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR) ||
-// propertyName.equals(IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR)) {
-// getTextWidget().redraw();
-// } else if (propertyName.equals(IConsoleConstants.CONSOLE_FONT)) {
-// getTextWidget().setFont(JFaceResources.getFont(IConsoleConstants.CONSOLE_FONT));
-// } else if (propertyName.equals(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH)) {
-// getTextWidget().setTabs(DebugUIPlugin.getDefault().getPluginPreferences().getInt(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH));
-// } else if (propertyName.equals(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK)) {
-// setAutoScroll(!DebugUIPlugin.getDefault().getPluginPreferences().getBoolean(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK));
-// }
-// }
-//
-// /**
-// * Dispose this viewer and resources
-// */
-// public void dispose() {
-// Control control = getTextWidget();
-// if (control != null) {
-// control.removeMouseTrackListener(this);
-// control.removePaintListener(this);
-// }
-// if (fHandCursor != null) {
-// fHandCursor.dispose();
-// }
-// if (fTextCursor != null) {
-// fTextCursor.dispose();
-// }
-// DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
-// JFaceResources.getFontRegistry().removeListener(this);
-// }
-//
-// /**
-// * Only allow text to be typed at the end of the document.
-// *
-// * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
-// */
-// protected void handleVerifyEvent(VerifyEvent e) {
-// ConsoleDocument doc= (ConsoleDocument)getDocument();
-// if (doc != null) {
-// if (doc.isReadOnly()) {
-// e.doit = false;
-// return;
-// }
-// IDocumentPartitioner partitioner = doc.getDocumentPartitioner();
-// if (partitioner != null) {
-// int length = doc.getLength();
-// ITypedRegion[] partitions = partitioner.computePartitioning(length, 0);
-// if (partitions.length == 0) {
-// } else {
-// ITypedRegion partition = partitions[partitions.length - 1];
-// if (partition.getType().equals(InputPartition.INPUT_PARTITION_TYPE)) {
-// // > 1 char in the input buffer
-// e.doit = (e.start >= partition.getOffset()) && (e.end <= (partition.getLength() + partition.getOffset()));
-// } else {
-// // first character in the input buffer
-// e.doit = length == e.start;
-// }
-// }
-// }
-// }
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseEnter(MouseEvent e) {
-// getTextWidget().addMouseMoveListener(this);
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseTrackListener#mouseExit(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseExit(MouseEvent e) {
-// getTextWidget().removeMouseMoveListener(this);
-// if (fHyperLink != null) {
-// linkExited(fHyperLink);
-// }
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseTrackListener#mouseHover(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseHover(MouseEvent e) {
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseMove(MouseEvent e) {
-// int offset = -1;
-// try {
-// Point p = new Point(e.x, e.y);
-// offset = getTextWidget().getOffsetAtLocation(p);
-// } catch (IllegalArgumentException ex) {
-// // out of the document range
-// }
-// updateLinks(offset);
-// }
-//
-// public IConsoleHyperlink getHyperlink(int offset) {
-// if (offset >= 0 && getDocument() != null) {
-// Position[] positions = null;
-// try {
-// positions = getDocument().getPositions(HyperlinkPosition.HYPER_LINK_CATEGORY);
-// } catch (BadPositionCategoryException ex) {
-// // no links have been added
-// return null;
-// }
-// for (int i = 0; i < positions.length; i++) {
-// Position position = positions[i];
-// if (offset >= position.getOffset() && offset <= (position.getOffset() + position.getLength())) {
-// return ((HyperlinkPosition)position).getHyperLink();
-// }
-// }
-// }
-// return null;
-// }
-//
-// protected void linkEntered(IConsoleHyperlink link) {
-// Control control = getTextWidget();
-// control.setRedraw(false);
-// if (fHyperLink != null) {
-// linkExited(fHyperLink);
-// }
-// fHyperLink = link;
-// fHyperLink.linkEntered();
-// control.setCursor(getHandCursor());
-// control.setRedraw(true);
-// control.redraw();
-// control.addMouseListener(this);
-// }
-//
-// protected void linkExited(IConsoleHyperlink link) {
-// link.linkExited();
-// fHyperLink = null;
-// Control control = getTextWidget();
-// control.setCursor(getTextCursor());
-// control.redraw();
-// control.removeMouseListener(this);
-// }
-// /**
-// * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent)
-// */
-// public void paintControl(PaintEvent e) {
-// if (fHyperLink != null) {
-// IDocument doc = getDocument();
-// if (doc == null) {
-// return;
-// }
-// ConsoleDocumentPartitioner partitioner = (ConsoleDocumentPartitioner)doc.getDocumentPartitioner();
-// if (partitioner == null) {
-// return;
-// }
-// IRegion linkRegion = partitioner.getRegion(fHyperLink);
-// if (linkRegion != null) {
-// int start = linkRegion.getOffset();
-// int end = start + linkRegion.getLength();
-// IConsoleColorProvider colorProvider = partitioner.getColorProvider();
-// try {
-// ITypedRegion partition = doc.getPartition(start);
-// Color fontColor = e.gc.getForeground();
-// if (partition instanceof StreamPartition) {
-// StreamPartition streamPartition = (StreamPartition)partition;
-// fontColor = colorProvider.getColor(streamPartition.getStreamIdentifier());
-// }
-// int startLine = doc.getLineOfOffset(start);
-// int endLine = doc.getLineOfOffset(end);
-// for (int i = startLine; i <= endLine; i++) {
-// IRegion lineRegion = doc.getLineInformation(i);
-// int lineStart = lineRegion.getOffset();
-// int lineEnd = lineStart + lineRegion.getLength();
-// Color color = e.gc.getForeground();
-// e.gc.setForeground(fontColor);
-// if (lineStart < end) {
-// lineStart = Math.max(start, lineStart);
-// lineEnd = Math.min(end, lineEnd);
-// Point p1 = getTextWidget().getLocationAtOffset(lineStart);
-// Point p2 = getTextWidget().getLocationAtOffset(lineEnd);
-// FontMetrics metrics = e.gc.getFontMetrics();
-// int height = metrics.getHeight();
-// e.gc.drawLine(p1.x, p1.y + height, p2.x, p2.y + height);
-// }
-// e.gc.setForeground(color);
-// }
-// } catch (BadLocationException ex) {
-// }
-// }
-// }
-// }
-//
-// protected Cursor getHandCursor() {
-// if (fHandCursor == null) {
-// fHandCursor = new Cursor(DebugUIPlugin.getStandardDisplay(), SWT.CURSOR_HAND);
-// }
-// return fHandCursor;
-// }
-//
-// protected Cursor getTextCursor() {
-// if (fTextCursor == null) {
-// fTextCursor = new Cursor(DebugUIPlugin.getStandardDisplay(), SWT.CURSOR_IBEAM);
-// }
-// return fTextCursor;
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseDoubleClick(MouseEvent e) {
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseDown(MouseEvent e) {
-// }
-//
-// /**
-// * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
-// */
-// public void mouseUp(MouseEvent e) {
-// if (fHyperLink != null) {
-// String selection = getTextWidget().getSelectionText();
-// if (selection.length() <= 0) {
-// if (e.button == 1) {
-// fHyperLink.linkActivated();
-// }
-// }
-// }
-// }
-//
-// /**
-// * @see org.eclipse.swt.custom.LineStyleListener#lineGetStyle(org.eclipse.swt.custom.LineStyleEvent)
-// */
-// public void lineGetStyle(LineStyleEvent event) {
-// IDocument document = getDocument();
-// if (document != null) {
-// ConsoleDocumentPartitioner partitioner = (ConsoleDocumentPartitioner)document.getDocumentPartitioner();
-// if (partitioner != null) {
-// IConsoleColorProvider colorProvider = partitioner.getColorProvider();
-// 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++) {
-// StreamPartition partition = (StreamPartition)regions[i];
-// Color color = colorProvider.getColor(partition.getStreamIdentifier());
-// styles[i] = new StyleRange(partition.getOffset(), partition.getLength(), color, null);
-// }
-// event.styles = styles;
-// }
-// }
-// }
-//
-// /**
-// * Sets whether this viewer should auto-scroll as output is appended to the
-// * document.
-// *
-// * @param scroll
-// */
-// public void setAutoScroll(boolean scroll) {
-// fAutoScroll = scroll;
-// }
-//
-// /**
-// * Returns whether this viewer should auto-scroll as output is appended to
-// * the document.
-// */
-// public boolean isAutoScroll() {
-// return fAutoScroll;
-// }
-//
-// /**
-// * On KeyUp events, see if we need to enter/exit a link.
-// *
-// * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
-// */
-// public void handleEvent(Event event) {
-// int offset = getTextWidget().getCaretOffset();
-// updateLinks(offset);
-// }
-//
-// /**
-// * The cursor has just be moved to the given offset, the mouse has
-// * hovered over the given offset. Update link rendering.
-// *
-// * @param offset
-// */
-// protected void updateLinks(int offset) {
-// if (offset >= 0) {
-// IConsoleHyperlink link = getHyperlink(offset);
-// if (link != null) {
-// if (link.equals(fHyperLink)) {
-// return;
-// }
-// linkEntered(link);
-// return;
-// }
-// }
-// if (fHyperLink != null) {
-// linkExited(fHyperLink);
-// }
-// }
-//
-//}
-//
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/HyperlinkPosition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/HyperlinkPosition.java
deleted file mode 100644
index 1d2dce4..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/HyperlinkPosition.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.debug.internal.ui.views.console;
-
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.console.IConsoleHyperlink;
-import org.eclipse.jface.text.Position;
-
-/**
- */
-public class HyperlinkPosition extends Position {
-
- public static final String HYPER_LINK_CATEGORY = DebugUIPlugin.getUniqueIdentifier() + ".HYPER_LINK"; //$NON-NLS-1$
-
- private IConsoleHyperlink fLink = null;
-
- /**
- *
- */
- public HyperlinkPosition(IConsoleHyperlink link, int offset, int length) {
- super(offset, length);
- fLink = link;
- }
-
- public IConsoleHyperlink getHyperLink() {
- return fLink;
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object arg) {
- return arg instanceof HyperlinkPosition && super.equals(arg) && getHyperLink().equals(((HyperlinkPosition)arg).getHyperLink());
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return super.hashCode() + getHyperLink().hashCode();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/InputPartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/InputPartition.java
deleted file mode 100644
index 3d6f8f0..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/InputPartition.java
+++ /dev/null
@@ -1,72 +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.debug.internal.ui.views.console;
-
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * A partition in a console document that contains input from the keyboard.
- */
-public class InputPartition extends StreamPartition {
-
- /**
- * Once an input partition has been written to standard-in, it cannot
- * be modified.
- */
- private boolean fReadOnly = false;
-
- /**
- * Partition type
- */
- public static final String INPUT_PARTITION_TYPE = DebugUIPlugin.getUniqueIdentifier() + ".INPUT_PARTITION_TYPE"; //$NON-NLS-1$
-
-
- public InputPartition(String streamIdentifier, int offset, int length) {
- super(streamIdentifier, offset, length, INPUT_PARTITION_TYPE);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.console.StreamPartition#createNewPartition(String, int, int)
- */
- public StreamPartition createNewPartition(String streamIdentifier, int offset, int length) {
- return new InputPartition(streamIdentifier, offset, length);
- }
-
- /**
- * Sets whether this partition is read-only.
- *
- * @param readOnly whether this partition is read-only
- */
- public void setReadOnly(boolean readOnly) {
- fReadOnly = readOnly;
- }
-
- /**
- * Returns whether this partition is read-only.
- *
- * @return whether this partition is read-only
- */
- public boolean isReadOnly() {
- return fReadOnly;
- }
-
- /**
- * Returns whether this partition is allowed to be combined with the
- * given partition. Once read-only, this partition cannot be combined.
- *
- * @param partition
- * @return boolean
- */
- public boolean canBeCombinedWith(StreamPartition partition) {
- return (!isReadOnly() && super.canBeCombinedWith(partition));
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/OutputPartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/OutputPartition.java
deleted file mode 100644
index ed8ad1f..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/OutputPartition.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.debug.internal.ui.views.console;
-
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * A partition in a console document that contains output from a process.
- */
-public class OutputPartition extends StreamPartition {
-
- /**
- * Partition type
- */
- public static final String OUTPUT_PARTITION_TYPE = DebugUIPlugin.getUniqueIdentifier() + ".OUTPUT_PARTITION_TYPE"; //$NON-NLS-1$
-
-
- public OutputPartition(String streamIdentifier, int offset, int length) {
- super(streamIdentifier, offset, length, OUTPUT_PARTITION_TYPE);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.console.StreamPartition#createNewPartition(String, int, int)
- */
- public StreamPartition createNewPartition(String streamIdetifier, int offset, int length) {
- return new OutputPartition(streamIdetifier, offset, length);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
index d69b03d..2407b15 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
@@ -47,11 +47,10 @@
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.console.IHyperlink;
import org.eclipse.ui.console.IOConsole;
import org.eclipse.ui.console.IOConsoleInputStream;
import org.eclipse.ui.console.IOConsoleOutputStream;
-import org.eclipse.ui.part.IPageBookViewPage;
/**
* A console for a system process
@@ -62,18 +61,17 @@
* @since 3.0
*/
public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSetListener, IPropertyChangeListener {
-
private IProcess fProcess = null;
private List streamListeners = new ArrayList();
private IConsoleColorProvider fColorProvider;
private IOConsoleInputStream in;
- private ConsoleLineNotifier fLineNotifier;
+
/**
* Proxy to a console document
*/
public ProcessConsole(IProcess process, IConsoleColorProvider colorProvider) {
- super("", null); //$NON-NLS-1$
+ super("", IDebugUIConstants.ID_PROCESS_CONSOLE_TYPE, null); //$NON-NLS-1$
fProcess = process;
fColorProvider = colorProvider;
@@ -87,14 +85,6 @@
in.setColor(color);
}
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView)
- */
- public IPageBookViewPage createPage(IConsoleView view) {
- return new ProcessConsolePage(view, this);
- }
/**
* Computes and returns the image descriptor for this console.
@@ -245,6 +235,8 @@
protected void dispose() {
super.dispose();
+ fColorProvider.disconnect();
+
synchronized(streamListeners) {
for(Iterator i = streamListeners.iterator(); i.hasNext(); ) {
StreamListener listener = (StreamListener) i.next();
@@ -281,36 +273,27 @@
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource().equals(getProcess())) {
-
- if (event.getKind() == DebugEvent.TERMINATE) {
- setFinished();
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- Runnable r = new Runnable() {
- public void run() {
- setName(computeName());
- warnOfContentChange();
- }
- };
- DebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IOConsole#partitionerFinished()
- */
- public void partitionerFinished() {
- super.partitionerFinished();
- if (fLineNotifier != null) {
- fLineNotifier.streamsClosed();
+ for (int i = 0; i < events.length; i++) {
+ DebugEvent event = events[i];
+ if (event.getSource().equals(getProcess())) {
+
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ setFinished();
+ DebugPlugin.getDefault().removeDebugEventListener(this);
+ }
+
+ Runnable r = new Runnable() {
+ public void run() {
+ setName(computeName());
+ warnOfContentChange();
+ }
+ };
+ DebugUIPlugin.getStandardDisplay().asyncExec(r);
+ }
}
}
+
private void warnOfContentChange() {
ConsolePlugin.getDefault().getConsoleManager().warnOfContentChange(DebugUITools.getConsole(fProcess));
}
@@ -360,6 +343,16 @@
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.ui.console.IConsole#addLink(org.eclipse.ui.console.IHyperlink, int, int)
+ */
+ public void addLink(IHyperlink link, int offset, int length) {
+ try {
+ addHyperlink(link, offset, length);
+ } catch (BadLocationException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsole#getRegion(org.eclipse.debug.ui.console.IConsoleHyperlink)
@@ -435,17 +428,4 @@
return Status.OK_STATUS;
}
}
-
-
- /**
- * @param lineNotifier
- */
- public void setLineNotifier(ConsoleLineNotifier lineNotifier) {
- fLineNotifier = lineNotifier;
- fLineNotifier.connect(this);
- if (fProcess.isTerminated()) {
- setFinished();
- }
- }
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
index 30884a4..094c6c8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
@@ -50,7 +50,8 @@
private Map fColorProviders;
/**
- *
+ * The default color provider. Used if no color provider is contributed
+ * for the given process type.
*/
private IConsoleColorProvider fDefaultColorProvider;
@@ -92,11 +93,6 @@
private void removeProcess(IProcess iProcess) {
IConsole console = getConsole(iProcess);
- ConsoleLineNotifier lineNotifier = getLineNotifier(iProcess);
- if (lineNotifier != null) {
- lineNotifier.disconnect();
- }
-
if (console != null) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
manager.removeConsoles(new IConsole[]{console});
@@ -141,14 +137,13 @@
for (int i= 0; i < processes.length; i++) {
if (getConsoleDocument(processes[i]) == null) {
IProcess process = processes[i];
+ if (process.getStreamsProxy() == null) {
+ continue;
+ }
//create a new console.
IConsoleColorProvider colorProvider = getColorProvider(process.getAttribute(IProcess.ATTR_PROCESS_TYPE));
ProcessConsole pc = new ProcessConsole(process, colorProvider);
- //connect Line Notifier
- ConsoleLineNotifier lineNotifier = getLineNotifier(process);
- if(lineNotifier != null) {
- pc.setLineNotifier(lineNotifier);
- }
+ pc.setAttribute(IDebugUIConstants.ATTR_CONSOLE_PROCESS, process);
//add new console to console manager.
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{pc});
}
@@ -275,30 +270,14 @@
return fDefaultColorProvider;
}
-
/**
- * Returns the line notifier for this console, or <code>null</code> if none.
- *
- * @param process
- * @return line notifier, or <code>null</code>
+ * Returns the Line Trackers for a given process type.
+ * @param process The process for which line trackers are required.
+ * @return An array of line trackers which match the given process type.
*/
- protected ConsoleLineNotifier getLineNotifier(IProcess process) {
+ public IConsoleLineTracker[] getLineTrackers(IProcess process) {
String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE);
- if (type != null) {
- return newLineNotifier(type);
- }
- return null;
- }
-
- /**
- * Creates and retuns a new line notifier for the given type of process, or
- * <code>null</code> if none. The notifier will be seeded with new console
- * line listeners registered for the given process type.
- *
- * @param type process type
- * @return line notifier or <code>null</code>
- */
- public ConsoleLineNotifier newLineNotifier(String type) {
+
if (fLineTrackers == null) {
fLineTrackers = new HashMap();
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_LINE_TRACKERS);
@@ -314,26 +293,22 @@
list.add(extension);
}
}
- List extensions = (List)fLineTrackers.get(type);
- ConsoleLineNotifier lineNotifier = null;
- if (extensions != null) {
- lineNotifier = new ConsoleLineNotifier();
- Iterator iter = extensions.iterator();
- while (iter.hasNext()) {
- IConfigurationElement extension = (IConfigurationElement)iter.next();
- try {
- Object tracker = extension.createExecutableExtension("class"); //$NON-NLS-1$
- if (tracker instanceof IConsoleLineTracker) {
- lineNotifier.addConsoleListener((IConsoleLineTracker)tracker);
- } else {
- DebugUIPlugin.logErrorMessage(MessageFormat.format(ConsoleMessages.getString("ConsoleDocumentManager.2"),new String[]{extension.getDeclaringExtension().getUniqueIdentifier()})); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
+
+ ArrayList trackers = new ArrayList();
+ if (type != null) {
+ List lineTrackerExtensions = (List) fLineTrackers.get(type);
+ if(lineTrackerExtensions != null) {
+ for(Iterator i = lineTrackerExtensions.iterator(); i.hasNext(); ) {
+ IConfigurationElement element = (IConfigurationElement) i.next();
+ try {
+ trackers.add(element.createExecutableExtension("class")); //$NON-NLS-1$
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ }
}
- return lineNotifier;
+ return (IConsoleLineTracker[]) trackers.toArray(new IConsoleLineTracker[0]);
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java
deleted file mode 100644
index 7c7c6f3..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java
+++ /dev/null
@@ -1,199 +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.debug.internal.ui.views.console;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleView;
-import org.eclipse.ui.internal.console.IOConsolePage;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.ShowInContext;
-
-/**
- * A page for a console connected to I/O streams of a process
- *
- * @since 3.0
- */
-public class ProcessConsolePage extends IOConsolePage implements IShowInSource, IShowInTargetList, IDebugEventSetListener, ISelectionListener {
-
- // scroll lock
- private boolean fIsLocked = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK);
-
- // actions
- private ConsoleTerminateAction fTerminate;
- private ConsoleRemoveAllTerminatedAction fRemoveTerminated;
-
-
-
- /**
- * Constructs a new process page
- */
- public ProcessConsolePage(IConsoleView view, ProcessConsole console) {
- super(console, view);
- setAutoScroll(!fIsLocked);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- getSite().getPage().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- }
-
- /**
- * Fill the context menu
- *
- * @param menu menu
- */
- protected void contextMenuAboutToShow(IMenuManager menu) {
- super.contextMenuAboutToShow(menu);
- menu.add(fTerminate);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IPage#dispose()
- */
- public void dispose() {
- super.dispose();
- DebugPlugin.getDefault().removeDebugEventListener(this);
- getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
-
- if (fRemoveTerminated != null) {
- fRemoveTerminated.dispose();
- }
- }
-
- protected void createActions() {
- super.createActions();
- fRemoveTerminated = new ConsoleRemoveAllTerminatedAction();
- ProcessConsole console = (ProcessConsole) getConsole();
- fTerminate = new ConsoleTerminateAction(console);
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
-
- protected void configureToolBar(IToolBarManager mgr) {
- super.configureToolBar(mgr);
- mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fTerminate);
- mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fRemoveTerminated);
- }
-
- /**
- * Returns the process associated with this page
- *
- * @return the process associated with this page
- */
- protected IProcess getProcess() {
- return ((ProcessConsole)getConsole()).getProcess();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (getProcess().equals(DebugUITools.getCurrentProcess())) {
- getConsoleView().display(getConsole());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class required) {
- Object adapter = super.getAdapter(required);
- if (adapter == null) {
- if (IShowInSource.class.equals(required)) {
- return this;
- }
- if (IShowInTargetList.class.equals(required)) {
- return this;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInSource#getShowInContext()
- */
- public ShowInContext getShowInContext() {
- IProcess process = getProcess();
- if (process == null) {
- return null;
- }
- IDebugTarget target = (IDebugTarget)process.getAdapter(IDebugTarget.class);
- ISelection selection = null;
- if (target == null) {
- selection = new StructuredSelection(process);
- } else {
- selection = new StructuredSelection(target);
- }
- return new ShowInContext(null, selection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
- */
- public String[] getShowInTargetIds() {
- return new String[] {IDebugUIConstants.ID_DEBUG_VIEW};
- }
-
- /**
- * Update terminate action.
- *
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource().equals(getProcess())) {
- Runnable r = new Runnable() {
- public void run() {
- if (isAvailable()) {
- fTerminate.update();
- }
- }
- };
- if (isAvailable()) {
- getControl().getDisplay().asyncExec(r);
- }
- }
- }
- }
-
- /**
- * Returns whether this page's controls are available.
- *
- * @return whether this page's controls are available
- */
- protected boolean isAvailable() {
- return getControl() != null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ScrollLockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ScrollLockAction.java
deleted file mode 100644
index c42f199..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ScrollLockAction.java
+++ /dev/null
@@ -1,67 +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.debug.internal.ui.views.console;
-
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Toggles console auto-scroll
- */
-public class ScrollLockAction extends Action implements IPropertyChangeListener {
-
- private IPreferenceStore fStore = DebugUIPlugin.getDefault().getPreferenceStore();
-
- public ScrollLockAction() {
- super(ActionMessages.getString("ScrollLockAction.Scroll_Lock_1")); //$NON-NLS-1$
- setToolTipText(ActionMessages.getString("ScrollLockAction.Scroll_Lock_1")); //$NON-NLS-1$
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_LOCK));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_LOCK));
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_LOCK));
- WorkbenchHelp.setHelp(
- this,
- IDebugHelpContextIds.CONSOLE_SCROLL_LOCK_ACTION);
- setChecked(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK));
- fStore.addPropertyChangeListener(this);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fStore.setValue(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK, isChecked());
- }
-
- public void dispose() {
- fStore.removePropertyChangeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK)) {
- setChecked(fStore.getBoolean(IInternalDebugUIConstants.PREF_CONSOLE_SCROLL_LOCK));
- }
-
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/StreamPartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/StreamPartition.java
deleted file mode 100644
index b121244..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/StreamPartition.java
+++ /dev/null
@@ -1,101 +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.debug.internal.ui.views.console;
-
-
-import org.eclipse.jface.text.TypedRegion;
-
-/**
- * A partition from an input/output stream connected to the console.
- */
-public abstract class StreamPartition extends TypedRegion {
-
- /**
- * Stream identifier
- */
- private String fStreamIdentifier;
-
- public StreamPartition(String streamIdentifier, int offset, int length, String type) {
- super(offset, length, type);
- fStreamIdentifier = streamIdentifier;
- }
-
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object partition) {
- if (super.equals(partition)) {
- fStreamIdentifier.equals(((StreamPartition)partition).getStreamIdentifier());
- }
- return false;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return super.hashCode() + fStreamIdentifier.hashCode();
- }
-
- /**
- * Returns this partition's stream identifier
- *
- * @return this partition's stream identifier
- */
- public String getStreamIdentifier() {
- return fStreamIdentifier;
- }
-
- /**
- * Returns whether this partition is allowed to be combined with the
- * given partition.
- *
- * @param partition
- * @return boolean
- */
- public boolean canBeCombinedWith(StreamPartition 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()) && getStreamIdentifier().equals(partition.getStreamIdentifier());
- }
-
- /**
- * Returns a new partition representing this and the given parition
- * combined.
- *
- * @param partition
- * @return partition
- */
- public StreamPartition combineWith(StreamPartition 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(getStreamIdentifier(), theStart, theEnd - theStart);
- }
-
- /**
- * Creates a new patition of this type with the given color, offset,
- * and length.
- *
- * @param streamIdentifer
- * @param offset
- * @param length
- * @return ColorPartition
- */
- public abstract StreamPartition createNewPartition(String streamIdentifier, int offset, int length);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/WorkspaceOperationRunner.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/WorkspaceOperationRunner.java
deleted file mode 100644
index e8a97ab..0000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/WorkspaceOperationRunner.java
+++ /dev/null
@@ -1,75 +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.debug.internal.ui.views.console;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-import org.eclipse.ui.texteditor.ISchedulingRuleProvider;
-
-/**
- * @since 3.0
- */
-class WorkspaceOperationRunner implements IRunnableContext {
-
- private IProgressMonitor fProgressMonitor;
-
- public WorkspaceOperationRunner() {
- }
-
- /**
- * Sets the progress monitor.
- *
- * @param progressMonitor the progress monitor to set
- */
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
- fProgressMonitor= progressMonitor;
- }
-
- /**
- * Returns the progress monitor. It there is no progress monitor the monitor\
- * is set to the <code>NullProgressMonitor</code>.
- *
- * @return the progress monitor
- */
- public IProgressMonitor getProgressMonitor() {
- if (fProgressMonitor == null)
- fProgressMonitor= new NullProgressMonitor();
- return fProgressMonitor;
- }
-
- /*
- * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- if (runnable instanceof ISchedulingRuleProvider)
- run(fork, cancelable, runnable, ((ISchedulingRuleProvider)runnable).getSchedulingRule());
- else
- run(fork, cancelable, runnable, ResourcesPlugin.getWorkspace().getRoot());
- }
-
- /*
- * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable, ISchedulingRule schedulingRule) throws InvocationTargetException, InterruptedException {
- WorkspaceModifyDelegatingOperation operation= new WorkspaceModifyDelegatingOperation(runnable, schedulingRule);
- operation.run(getProgressMonitor());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/PopupInformationControl.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/PopupInformationControl.java
index d3b6be9..b0580bf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/PopupInformationControl.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/PopupInformationControl.java
@@ -21,7 +21,6 @@
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlExtension;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.graphics.Color;
@@ -121,12 +120,6 @@
shell.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
shell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- dispose();
- }
- });
-
GridLayout layout= new GridLayout(1, false);
layout.marginHeight= 0;
layout.marginWidth= 0;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlockViewSynchronizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlockViewSynchronizer.java
index c9b51ef..ce83f5b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlockViewSynchronizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlockViewSynchronizer.java
@@ -167,11 +167,11 @@
{
if (fSynchronizeInfo != null)
{
- Enumeration enum = fSynchronizeInfo.elements();
+ Enumeration enumeration = fSynchronizeInfo.elements();
// clean up all synchronize info objects
- while (enum.hasMoreElements()){
- SynchronizeInfo info = (SynchronizeInfo)enum.nextElement();
+ while (enumeration.hasMoreElements()){
+ SynchronizeInfo info = (SynchronizeInfo)enumeration.nextElement();
info.delete();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
index fd19f75..b8aa799 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
@@ -561,10 +561,10 @@
// find memory from other folder and dispose the view tab
if (!foundTab)
{
- Enumeration enum = tabFolderHashtable.elements();
- while (enum.hasMoreElements())
+ Enumeration enumeration = tabFolderHashtable.elements();
+ while (enumeration.hasMoreElements())
{
- tabFolder = (TabFolder) enum.nextElement();
+ tabFolder = (TabFolder) enumeration.nextElement();
tabs = tabFolder.getItems();
IMemoryViewTab viewTab = null;
for (int i = 0; i < tabs.length; i++)
@@ -629,11 +629,11 @@
try {
if (tabFolderHashtable != null) {
- Enumeration enum = tabFolderHashtable.elements();
+ Enumeration enumeration = tabFolderHashtable.elements();
- while (enum.hasMoreElements())
+ while (enumeration.hasMoreElements())
{
- TabFolder tabFolder = (TabFolder)enum.nextElement();
+ TabFolder tabFolder = (TabFolder)enumeration.nextElement();
if (tabFolder.isDisposed())
continue;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewContentProvider.java
index db8d595..6dbf9cb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewContentProvider.java
@@ -767,11 +767,11 @@
*/
public void resetDeltas()
{
- Enumeration enum = contentCache.elements();
+ Enumeration enumeration = contentCache.elements();
- while (enum.hasMoreElements())
+ while (enumeration.hasMoreElements())
{
- MemoryViewLine line = (MemoryViewLine)enum.nextElement();
+ MemoryViewLine line = (MemoryViewLine)enumeration.nextElement();
line.unmarkDeltas();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
index f78e895..269e1b4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
@@ -216,11 +216,11 @@
Object value = fProperties.get(propertyId);
if (value != null)
{
- Enumeration enum = fPropertyListeners.elements();
+ Enumeration enumeration = fPropertyListeners.elements();
- while(enum.hasMoreElements())
+ while(enumeration.hasMoreElements())
{
- PropertyListener listener = (PropertyListener)enum.nextElement();
+ PropertyListener listener = (PropertyListener)enumeration.nextElement();
ISynchronizedMemoryBlockView view = listener.getView();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
index 6f28597..1db945a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
@@ -112,7 +112,12 @@
* Debug perspective identifier (value <code>"org.eclipse.debug.ui.DebugPerspective"</code>).
*/
public static final String ID_DEBUG_PERSPECTIVE = PLUGIN_ID + ".DebugPerspective"; //$NON-NLS-1$
-
+
+ /**
+ * Console type identifier (value <code>"org.eclipse.debug.ui.ProcessConsoleType"</code>).
+ */
+ public static final String ID_PROCESS_CONSOLE_TYPE = PLUGIN_ID + ".ProcessConsoleType"; //$NON-NLS-1$
+
/**
* Constant for referring to no perspective.
*/
@@ -792,6 +797,13 @@
*/
public static final String ATTR_LAUNCH_IN_BACKGROUND = PLUGIN_ID + ".ATTR_LAUNCH_IN_BACKGROUND"; //$NON-NLS-1$
+ /**
+ * ProcessConsole attribute - references the process that was launched.
+ *
+ * @since 3.1
+ */
+ public static final String ATTR_CONSOLE_PROCESS = PLUGIN_ID + ".ATTR_CONSOLE_PROCESS"; //$NON-NLS-1$
+
// Extension points
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
index e5668c4..b4c310c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
@@ -14,7 +14,6 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.launchConfigurations.OrganizeFavoritesAction;
-import org.eclipse.debug.internal.ui.preferences.DebugWorkInProgressPreferencePage;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -54,16 +53,15 @@
addSeparator(menu);
}
- // TODO: work in progress cleanup
- if (DebugUIPlugin.getDefault().getPluginPreferences().getBoolean(DebugWorkInProgressPreferencePage.WIP_PREF_CONTEXT_LAUNCH)) {
- addToMenu(menu, new LaunchShortcutsAction(getLaunchGroupIdentifier()), -1);
- } else {
- addToMenu(menu, new LaunchAsAction(getLaunchGroupIdentifier()), -1);
- addToMenu(menu, new OpenLaunchDialogAction(getLaunchGroupIdentifier()), -1);
- }
+ addToMenu(menu, new LaunchShortcutsAction(getLaunchGroupIdentifier()), -1);
+ addToMenu(menu, getOpenDialogAction(), -1);
addToMenu(menu, new OrganizeFavoritesAction(getLaunchGroupIdentifier()), -1);
}
+ protected IAction getOpenDialogAction() {
+ return new OpenLaunchDialogAction(getLaunchGroupIdentifier());
+ }
+
/**
* Launch the last launch, or open the launch config dialog if none.
*
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
index ec4562a..2627d36 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
@@ -44,6 +44,9 @@
* launch group.
*
* @since 2.1
+ * @deprecated The use of perspective based launch shorcuts has been deprecated
+ * in the 3.1 release. Instead, selection sensitive launch is supported in the top level
+ * menus. Use <code>LaunchShorcutsAction</code> instead.
*/
public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
index bcac9af..c848523 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
@@ -22,6 +22,7 @@
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
@@ -66,6 +67,11 @@
* Launch group
*/
private ILaunchGroup fGroup;
+
+ /**
+ * Whether this actions enablement has been initialized
+ */
+ private boolean fInitialized = false;
/**
* Creates a cascading menu action to populate with shortcuts in the given
@@ -78,6 +84,7 @@
fGroup = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier);
setText(DebugPlugin.getDefault().getLaunchManager().getLaunchMode(fGroup.getMode()).getLabel());
setMenuCreator(this);
+ setEnabled(existsConfigTypesForMode());
}
/**
@@ -279,9 +286,6 @@
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
-// if (window instanceof WorkbenchWindow) {
-// fKeyBindingService= ((WorkbenchWindow)window).getKeyBindingService();
-// }
}
/**
@@ -295,8 +299,28 @@
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
- // nothing to do
+ if (!fInitialized) {
+ action.setEnabled(existsConfigTypesForMode());
+ fInitialized = true;
+ }
}
+ /**
+ * Return whether there are any registered launch configuration types for
+ * the mode of this action.
+ *
+ * @return whether there are any registered launch configuration types for
+ * the mode of this action
+ */
+ private boolean existsConfigTypesForMode() {
+ ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
+ for (int i = 0; i < configTypes.length; i++) {
+ ILaunchConfigurationType configType = configTypes[i];
+ if (configType.supportsMode(getMode())) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
index 4b259d5..d648b0e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
@@ -24,6 +24,7 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.console.IHyperlink;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -36,7 +37,7 @@
* </p>
* @since 2.1
*/
-public class FileLink implements IConsoleHyperlink {
+public class FileLink implements IHyperlink {
private IFile fFile;
private int fFileOffset;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
index aac360a..b4e11dd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
@@ -16,6 +16,7 @@
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.ui.console.IHyperlink;
import org.eclipse.ui.console.IPatternMatchListener;
/**
@@ -61,8 +62,25 @@
* @param offset the character offset within the console document where the
* text assoicated with the hyperlink begins
* @param length the length of the associated hyperlink text
+ * @deprecated replaced with addLink(IHyperlink link, int offset, int length)
*/
public void addLink(IConsoleHyperlink link, int offset, int length);
+
+ /**
+ * Adds the given hyperlink to this console. The link will be notified when
+ * entered, exited, and activated.
+ * <p>
+ * If the link's region (offset/length) is within the console's document
+ * current bounds, it is added immediately. Otherwise, the link is added
+ * when the console's document grows to contain the link's region.
+ * </p>
+ * @param link the hyperlink to add
+ * @param offset the character offset within the console document where the
+ * text assoicated with the hyperlink begins
+ * @param length the length of the associated hyperlink text
+ * @ since 3.1
+ */
+ public void addLink(IHyperlink link, int offset, int length);
/**
* Returns the region of text associated with the given hyperlink, or
@@ -71,10 +89,22 @@
*
* @param link a console hyperlink
* @return region of text associated with the hyperlink, or <code>null</code>
+ * @deprecated replaced with getRegion(IHyperlink link) instead
*/
public IRegion getRegion(IConsoleHyperlink link);
/**
+ * Returns the region of text associated with the given hyperlink, or
+ * <code>null</code> if the given hyperlink is not contained in this
+ * console.
+ *
+ * @param link a console hyperlink
+ * @return region of text associated with the hyperlink, or <code>null</code>
+ * @since 3.1
+ */
+ public IRegion getRegion(IHyperlink link);
+
+ /**
* Returns the document associated with this console.
*
* @return document
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
index b85284b..672ffa5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * 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
@@ -19,7 +19,7 @@
* Clients may implement this interface.
* </p>
* @since 2.1
- * @deprecated replaced by org.eclipse.ui.console.IConsoleHyperlink
+ * @deprecated replaced by org.eclipse.ui.console.IHyperlink
*/
public interface IConsoleHyperlink extends IHyperlink {
}