Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.debug.ui/plugin.properties4
-rw-r--r--org.eclipse.ui.console/plugin.properties3
-rw-r--r--org.eclipse.ui.console/plugin.xml9
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java16
4 files changed, 26 insertions, 6 deletions
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index c59b3d8e5..f63ac59b5 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -175,8 +175,8 @@ NoSourceFoundEditor.name= No Source Found
Context.debugging.description= Debugging Programs
Context.debugging.name= Debugging
-Context.console.description= In Console
-Context.console.name= In Console
+Context.console.description= In I/O Console
+Context.console.name= In I/O Console
Context.memoryview.description = In Memory View
Context.memoryview.name = In Memory View
diff --git a/org.eclipse.ui.console/plugin.properties b/org.eclipse.ui.console/plugin.properties
index fe5fdb263..f3757ce82 100644
--- a/org.eclipse.ui.console/plugin.properties
+++ b/org.eclipse.ui.console/plugin.properties
@@ -19,3 +19,6 @@ ConsolePageParticipantName= Console Page Participants
ConsoleFactoryName= Console Factories
consoleViewConsoleFactory.name=New Console View
+
+context.consoleview.name=In Console View
+context.consoleview.description=In Console View \ No newline at end of file
diff --git a/org.eclipse.ui.console/plugin.xml b/org.eclipse.ui.console/plugin.xml
index 37acfae9d..091344eb7 100644
--- a/org.eclipse.ui.console/plugin.xml
+++ b/org.eclipse.ui.console/plugin.xml
@@ -66,5 +66,14 @@ M4 = Platform-specific fourth key
label="%consoleViewConsoleFactory.name"
class="org.eclipse.ui.internal.console.ConsoleViewConsoleFactory"/>
</extension>
+ <extension
+ point="org.eclipse.ui.contexts">
+ <context
+ description="%context.consoleview.description"
+ id="org.eclipse.ui.console.ConsoleView"
+ name="%context.consoleview.name"
+ parentId="org.eclipse.ui.contexts.window">
+ </context>
+ </extension>
</plugin>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
index 139ab6968..61a0c5f4a 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
@@ -18,16 +18,13 @@ import java.util.Map;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
-
-import org.eclipse.swt.widgets.Composite;
-
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
-
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IViewSite;
@@ -42,6 +39,8 @@ import org.eclipse.ui.console.IConsoleListener;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.IConsolePageParticipant;
import org.eclipse.ui.console.IConsoleView;
+import org.eclipse.ui.contexts.IContextActivation;
+import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.MessagePage;
@@ -92,6 +91,11 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
*/
private boolean fActive = false;
+ /**
+ * 'In Console View' context
+ */
+ private IContextActivation fActivatedContext;
+
// actions
private PinConsoleAction fPinAction = null;
private ConsoleDropDownAction fDisplayConsoleAction = null;
@@ -623,6 +627,8 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
public void partActivated(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
fActive = true;
+ IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+ fActivatedContext = contextService.activateContext(IConsoleConstants.ID_CONSOLE_VIEW);
activateParticipants(fActiveConsole);
}
}
@@ -645,6 +651,8 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
public void partDeactivated(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
fActive = false;
+ IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+ contextService.deactivateContext(fActivatedContext);
deactivateParticipants(fActiveConsole);
}
}

Back to the top