Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 168248 Details for
Bug 312677
Host OSGi console should have close action
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
updated patch
312677.txt (text/plain), 7.08 KB, created by
Thomas Watson
on 2010-05-12 16:17:12 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2010-05-12 16:17:12 EDT
Size:
7.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/plugin.xml,v >retrieving revision 1.481 >diff -u -r1.481 plugin.xml >--- plugin.xml 26 Apr 2010 15:23:37 -0000 1.481 >+++ plugin.xml 12 May 2010 20:15:43 -0000 >@@ -1,6 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <?eclipse version="3.0"?><!-- >- Copyright (c) 2005, 2009 IBM Corporation and others. >+ Copyright (c) 2005, 2010 IBM Corporation and others. > All rights reserved. This program and the accompanying materials > are made available under the terms of the Eclipse Public License v1.0 > which accompanies this distribution, and is available at >@@ -2087,4 +2087,14 @@ > label="%consoleFactory.label"> > </consoleFactory> > </extension> >+ <extension >+ point="org.eclipse.ui.console.consolePageParticipants"> >+ <consolePageParticipant >+ class="org.eclipse.pde.internal.ui.util.OSGiConsolePageParticipant" >+ id="org.eclipse.pde.ui.OSGiConsoleParticipant"> >+ <enablement> >+ <test property="org.eclipse.ui.console.consoleTypeTest" value="osgiConsole"/> >+ </enablement> >+ </consolePageParticipant> >+ </extension> > </plugin> >Index: src/org/eclipse/pde/internal/ui/util/OSGiConsole.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsole.java,v >retrieving revision 1.2 >diff -u -r1.2 OSGiConsole.java >--- src/org/eclipse/pde/internal/ui/util/OSGiConsole.java 11 May 2010 19:58:19 -0000 1.2 >+++ src/org/eclipse/pde/internal/ui/util/OSGiConsole.java 12 May 2010 20:15:43 -0000 >@@ -7,19 +7,25 @@ > * > * Contributors: > * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation >+ * IBM Corporation - ongoing enhancements and bug fixing > *******************************************************************************/ > package org.eclipse.pde.internal.ui.util; > >-import java.io.InputStream; >-import java.io.OutputStream; >+import java.io.*; > import org.eclipse.core.runtime.Platform; > import org.eclipse.osgi.framework.console.ConsoleSession; > import org.eclipse.osgi.util.NLS; > import org.eclipse.pde.internal.ui.PDEPlugin; > import org.eclipse.pde.internal.ui.PDEUIMessages; > import org.eclipse.ui.console.IOConsole; >+import org.eclipse.ui.console.IOConsoleOutputStream; > import org.osgi.framework.BundleContext; > >+/** >+ * OSGi console connected to the Host/Running Eclipse. >+ * >+ * @since 3.6 >+ */ > public class OSGiConsole extends IOConsole { > > public final static String TYPE = "osgiConsole"; //$NON-NLS-1$ >@@ -44,9 +50,14 @@ > } > > protected void init() { >+ super.init(); >+ IOConsoleOutputStream info = newOutputStream(); // create a stream to write info message to >+ try { >+ info.write(PDEUIMessages.OSGiConsoleFactory_title); >+ } catch (IOException e) { >+ } > BundleContext context = PDEPlugin.getDefault().getBundle().getBundleContext(); > context.registerService(ConsoleSession.class.getName(), session, null); >- super.init(); > } > > protected void dispose() { >Index: src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 OSGiConsoleFactory.java >--- src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java 12 May 2010 18:00:52 -0000 1.3 >+++ src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java 12 May 2010 20:15:43 -0000 >@@ -11,9 +11,13 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.ui.util; > >-import org.eclipse.pde.internal.ui.PDEUIMessages; > import org.eclipse.ui.console.*; > >+/** >+ * Console factory extension used to create a "Host OSGi Console". >+ * >+ * @since 3.6 >+ */ > public class OSGiConsoleFactory implements IConsoleFactory { > private final IConsoleManager fConsoleManager; > private IOConsole fConsole = null; >@@ -26,10 +30,6 @@ > * @see org.eclipse.ui.console.IConsoleFactory#openConsole() > */ > public void openConsole() { >- openConsole(PDEUIMessages.OSGiConsoleFactory_title); >- } >- >- public void openConsole(String initialText) { > IOConsole console = getConsole(); > > IConsole[] existing = fConsoleManager.getConsoles(); >@@ -41,7 +41,6 @@ > if (!exists) > fConsoleManager.addConsoles(new IConsole[] {console}); > fConsoleManager.showConsoleView(console); >- console.getDocument().set(initialText); > } > > private synchronized IOConsole getConsole() { >Index: src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java >diff -N src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.ui.util; >+ >+import org.eclipse.jface.action.IToolBarManager; >+import org.eclipse.ui.console.*; >+import org.eclipse.ui.console.actions.CloseConsoleAction; >+import org.eclipse.ui.part.IPageBookViewPage; >+ >+/** >+ * Page participant extension for an OSGi console. Contributes a close action. >+ * >+ * @since 3.6 >+ */ >+public class OSGiConsolePageParticipant implements IConsolePageParticipant { >+ >+ private CloseConsoleAction fCloseAction; >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) >+ */ >+ public Object getAdapter(Class adapter) { >+ return null; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.console.IConsolePageParticipant#init(org.eclipse.ui.part.IPageBookViewPage, org.eclipse.ui.console.IConsole) >+ */ >+ public void init(IPageBookViewPage page, IConsole console) { >+ fCloseAction = new CloseConsoleAction(console); >+ IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); >+ manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fCloseAction); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.console.IConsolePageParticipant#dispose() >+ */ >+ public void dispose() { >+ fCloseAction = null; >+ >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.console.IConsolePageParticipant#activated() >+ */ >+ public void activated() { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.console.IConsolePageParticipant#deactivated() >+ */ >+ public void deactivated() { >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 312677
:
168223
|
168245
| 168248