View | Details | Raw Unified | Return to bug 162420 | Differences between
and this patch

Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-2 / +3 lines)
Lines 99-112 Link Here
99
 org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)",
99
 org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)",
100
 org.eclipse.equinox.p2.engine;bundle-version="[2.0.0,3.0.0)",
100
 org.eclipse.equinox.p2.engine;bundle-version="[2.0.0,3.0.0)",
101
 org.eclipse.equinox.p2.core;bundle-version="[2.0.0,3.0.0)",
101
 org.eclipse.equinox.p2.core;bundle-version="[2.0.0,3.0.0)",
102
 org.eclipse.equinox.p2.director;bundle-version="[2.0.0, 3.0.0)",
102
 org.eclipse.equinox.p2.director;bundle-version="[2.0.0,3.0.0)",
103
 org.eclipse.equinox.p2.artifact.repository;bundle-version="[1.0.100,2.0.0)",
103
 org.eclipse.equinox.p2.artifact.repository;bundle-version="[1.0.100,2.0.0)",
104
 org.eclipse.equinox.p2.metadata.repository;bundle-version="[1.0.100,2.0.0)",
104
 org.eclipse.equinox.p2.metadata.repository;bundle-version="[1.0.100,2.0.0)",
105
 org.eclipse.equinox.p2.operations;bundle-version="[2.0.0,3.0.0)",
105
 org.eclipse.equinox.p2.operations;bundle-version="[2.0.0,3.0.0)",
106
 org.eclipse.equinox.p2.repository;bundle-version="[2.0.0,3.0.0)",
106
 org.eclipse.equinox.p2.repository;bundle-version="[2.0.0,3.0.0)",
107
 org.eclipse.equinox.frameworkadmin;bundle-version="[2.0.0,3.0.0)",
107
 org.eclipse.equinox.frameworkadmin;bundle-version="[2.0.0,3.0.0)",
108
 org.eclipse.equinox.frameworkadmin.equinox;bundle-version="[1.0.100,2.0.0)",
108
 org.eclipse.equinox.frameworkadmin.equinox;bundle-version="[1.0.100,2.0.0)",
109
 org.eclipse.pde.launching;bundle-version="[3.6.0,4.0.0)";visibility:=reexport
109
 org.eclipse.pde.launching;bundle-version="[3.6.0,4.0.0)";visibility:=reexport,
110
 org.eclipse.ui.console;bundle-version="[3.5.0,4.0.0)"
110
Eclipse-LazyStart: true
111
Eclipse-LazyStart: true
111
Import-Package: com.ibm.icu.text,
112
Import-Package: com.ibm.icu.text,
112
 org.eclipse.jdt.debug.core
113
 org.eclipse.jdt.debug.core
(-)plugin.properties (-1 / +2 lines)
Lines 257-260 Link Here
257
contentMergeViewers.plugin.label=Plug-in Source Compare
257
contentMergeViewers.plugin.label=Plug-in Source Compare
258
structureMergeViewers.manifest.label=Manifest Structure Compare
258
structureMergeViewers.manifest.label=Manifest Structure Compare
259
structureMergeViewers.plugin.label=Plug-in Structure Compare
259
structureMergeViewers.plugin.label=Plug-in Structure Compare
260
commandParameter.name = The initial search pattern for the artifact search dialog
260
commandParameter.name = The initial search pattern for the artifact search dialog
261
consoleFactory.label = OSGi Console
(-)plugin.xml (-1 / +8 lines)
Lines 2065-2069 Link Here
2065
          class="org.eclipse.pde.internal.ui.wizards.imports.CVSBundleImportPage"
2065
          class="org.eclipse.pde.internal.ui.wizards.imports.CVSBundleImportPage"
2066
          id="org.eclipse.pde.ui.cvs.import.page">
2066
          id="org.eclipse.pde.ui.cvs.import.page">
2067
    </page>
2067
    </page>
2068
 </extension>	
2068
 </extension>
2069
 <extension
2070
         point="org.eclipse.ui.console.consoleFactories">
2071
      <consoleFactory
2072
            class="org.eclipse.pde.internal.ui.util.OSGiConsoleFactory"
2073
            label="%consoleFactory.label">
2074
      </consoleFactory>
2075
   </extension>
2069
</plugin>
2076
</plugin>
(-)src/org/eclipse/pde/internal/ui/util/OSGiConsole.java (+52 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 EclipseSource Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     EclipseSource Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.util;
12
13
import java.io.InputStream;
14
import java.io.OutputStream;
15
import org.eclipse.osgi.framework.console.ConsoleSession;
16
import org.eclipse.pde.internal.ui.PDEPlugin;
17
import org.eclipse.ui.console.IOConsole;
18
19
public class OSGiConsole extends IOConsole {
20
21
	public final static String TYPE = "osgiConsole"; //$NON-NLS-1$
22
	private final ConsoleSession session;
23
24
	public OSGiConsole(final OSGiConsoleFactory factory) {
25
		super("OSGi Console", TYPE, null, true); // TODO set image
26
		session = new ConsoleSession() {
27
28
			public OutputStream getOutput() {
29
				return newOutputStream();
30
			}
31
32
			public InputStream getInput() {
33
				return getInputStream();
34
			}
35
36
			protected void doClose() {
37
				factory.closeConsole(OSGiConsole.this);
38
			}
39
		};
40
	}
41
42
	protected void init() {
43
		PDEPlugin.getDefault().getBundle().getBundleContext().registerService(ConsoleSession.class.getName(), session, null);
44
		super.init();
45
	}
46
47
	protected void dispose() {
48
		// TODO remove service
49
		super.dispose();
50
	}
51
52
}
(-)src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java (+41 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 EclipseSource Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     EclipseSource Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.util;
12
13
import org.eclipse.ui.console.*;
14
15
public class OSGiConsoleFactory implements IConsoleFactory {
16
	private IConsoleManager fConsoleManager = null;
17
18
	public OSGiConsoleFactory() {
19
		fConsoleManager = ConsolePlugin.getDefault().getConsoleManager();
20
	}
21
22
	/* (non-Javadoc)
23
	 * @see org.eclipse.ui.console.IConsoleFactory#openConsole()
24
	 */
25
	public void openConsole() {
26
		openConsole(null);
27
	}
28
29
	public void openConsole(String initialText) {
30
		IOConsole fConsole = new OSGiConsole(this);
31
		fConsoleManager.addConsoles(new IConsole[] {fConsole});
32
		if (initialText != null) {
33
			fConsole.getDocument().set(initialText);
34
		}
35
		fConsoleManager.showConsoleView(fConsole);
36
	}
37
38
	void closeConsole(OSGiConsole console) {
39
		fConsoleManager.removeConsoles(new IConsole[] {console});
40
	}
41
}

Return to bug 162420