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

Collapse All | Expand All

(-)plugin.xml (-1 / +11 lines)
Lines 1-6 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?eclipse version="3.0"?><!--
2
<?eclipse version="3.0"?><!--
3
     Copyright (c) 2005, 2009 IBM Corporation and others.
3
     Copyright (c) 2005, 2010 IBM Corporation and others.
4
     All rights reserved. This program and the accompanying materials
4
     All rights reserved. This program and the accompanying materials
5
     are made available under the terms of the Eclipse Public License v1.0
5
     are made available under the terms of the Eclipse Public License v1.0
6
     which accompanies this distribution, and is available at
6
     which accompanies this distribution, and is available at
Lines 2087-2090 Link Here
2087
            label="%consoleFactory.label">
2087
            label="%consoleFactory.label">
2088
      </consoleFactory>
2088
      </consoleFactory>
2089
   </extension>
2089
   </extension>
2090
   <extension
2091
         point="org.eclipse.ui.console.consolePageParticipants">
2092
      <consolePageParticipant
2093
            class="org.eclipse.pde.internal.ui.util.OSGiConsolePageParticipant"
2094
            id="org.eclipse.pde.ui.OSGiConsoleParticipant">
2095
         <enablement>
2096
            <test property="org.eclipse.ui.console.consoleTypeTest" value="osgiConsole"/>
2097
         </enablement>
2098
      </consolePageParticipant>
2099
   </extension>
2090
</plugin>
2100
</plugin>
(-)src/org/eclipse/pde/internal/ui/util/OSGiConsole.java (+6 lines)
Lines 7-12 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
Lines 20-25 Link Here
20
import org.eclipse.ui.console.IOConsole;
21
import org.eclipse.ui.console.IOConsole;
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$
(-)src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java (+5 lines)
Lines 14-19 Link Here
14
import org.eclipse.pde.internal.ui.PDEUIMessages;
14
import org.eclipse.pde.internal.ui.PDEUIMessages;
15
import org.eclipse.ui.console.*;
15
import org.eclipse.ui.console.*;
16
16
17
/**
18
 * Console factory extension used to create a "Host OSGi Console".
19
 * 
20
 * @since 3.6
21
 */
17
public class OSGiConsoleFactory implements IConsoleFactory {
22
public class OSGiConsoleFactory implements IConsoleFactory {
18
	private final IConsoleManager fConsoleManager;
23
	private final IConsoleManager fConsoleManager;
19
	private IOConsole fConsole = null;
24
	private IOConsole fConsole = null;
(-)src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java (+63 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 IBM 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.util;
12
13
import org.eclipse.jface.action.IToolBarManager;
14
import org.eclipse.ui.console.*;
15
import org.eclipse.ui.console.actions.CloseConsoleAction;
16
import org.eclipse.ui.part.IPageBookViewPage;
17
18
/**
19
 * Page participant extension for an OSGi console. Contributes a close action.
20
 * 
21
 * @since 3.6
22
 */
23
public class OSGiConsolePageParticipant implements IConsolePageParticipant {
24
25
	private CloseConsoleAction fCloseAction;
26
27
	/* (non-Javadoc)
28
	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
29
	 */
30
	public Object getAdapter(Class adapter) {
31
		return null;
32
	}
33
34
	/* (non-Javadoc)
35
	 * @see org.eclipse.ui.console.IConsolePageParticipant#init(org.eclipse.ui.part.IPageBookViewPage, org.eclipse.ui.console.IConsole)
36
	 */
37
	public void init(IPageBookViewPage page, IConsole console) {
38
		fCloseAction = new CloseConsoleAction(console);
39
		IToolBarManager manager = page.getSite().getActionBars().getToolBarManager();
40
		manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fCloseAction);
41
	}
42
43
	/* (non-Javadoc)
44
	 * @see org.eclipse.ui.console.IConsolePageParticipant#dispose()
45
	 */
46
	public void dispose() {
47
		fCloseAction = null;
48
49
	}
50
51
	/* (non-Javadoc)
52
	 * @see org.eclipse.ui.console.IConsolePageParticipant#activated()
53
	 */
54
	public void activated() {
55
	}
56
57
	/* (non-Javadoc)
58
	 * @see org.eclipse.ui.console.IConsolePageParticipant#deactivated()
59
	 */
60
	public void deactivated() {
61
	}
62
63
}

Return to bug 312677