Lines 7-25
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation |
9 |
* Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation |
|
|
10 |
* IBM Corporation - ongoing enhancements and bug fixing |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.pde.internal.ui.util; |
12 |
package org.eclipse.pde.internal.ui.util; |
12 |
|
13 |
|
13 |
import java.io.InputStream; |
14 |
import java.io.*; |
14 |
import java.io.OutputStream; |
|
|
15 |
import org.eclipse.core.runtime.Platform; |
15 |
import org.eclipse.core.runtime.Platform; |
16 |
import org.eclipse.osgi.framework.console.ConsoleSession; |
16 |
import org.eclipse.osgi.framework.console.ConsoleSession; |
17 |
import org.eclipse.osgi.util.NLS; |
17 |
import org.eclipse.osgi.util.NLS; |
18 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
18 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
19 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
19 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
20 |
import org.eclipse.ui.console.IOConsole; |
20 |
import org.eclipse.ui.console.IOConsole; |
|
|
21 |
import org.eclipse.ui.console.IOConsoleOutputStream; |
21 |
import org.osgi.framework.BundleContext; |
22 |
import org.osgi.framework.BundleContext; |
22 |
|
23 |
|
|
|
24 |
/** |
25 |
* OSGi console connected to the Host/Running Eclipse. |
26 |
* |
27 |
* @since 3.6 |
28 |
*/ |
23 |
public class OSGiConsole extends IOConsole { |
29 |
public class OSGiConsole extends IOConsole { |
24 |
|
30 |
|
25 |
public final static String TYPE = "osgiConsole"; //$NON-NLS-1$ |
31 |
public final static String TYPE = "osgiConsole"; //$NON-NLS-1$ |
Lines 47-52
Link Here
|
47 |
BundleContext context = PDEPlugin.getDefault().getBundle().getBundleContext(); |
53 |
BundleContext context = PDEPlugin.getDefault().getBundle().getBundleContext(); |
48 |
context.registerService(ConsoleSession.class.getName(), session, null); |
54 |
context.registerService(ConsoleSession.class.getName(), session, null); |
49 |
super.init(); |
55 |
super.init(); |
|
|
56 |
IOConsoleOutputStream info = newOutputStream(); // create a stream to write info message to |
57 |
try { |
58 |
info.write(PDEUIMessages.OSGiConsoleFactory_title); |
59 |
} catch (IOException e) { |
60 |
} |
50 |
} |
61 |
} |
51 |
|
62 |
|
52 |
protected void dispose() { |
63 |
protected void dispose() { |