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 |
} |