Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6fda82bef53047acf61ec4f474d7629a36b7fb0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*****************************************************************************
 * Copyright (c) 2010 CEA LIST.
 *
 *
 * 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:
 *  Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.editor.perspectiveconfiguration;

import java.util.List;

import org.eclipse.jface.action.CoolBarManager;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.StatusLineManager;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.internal.provisional.action.IToolBarContributionItem;
import org.eclipse.jface.internal.provisional.action.ToolBarContributionItem2;
import org.eclipse.ui.IActionBars2;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.internal.provisional.application.IActionBarConfigurer2;
import org.eclipse.ui.internal.registry.IActionSetDescriptor;
import org.eclipse.ui.services.IServiceLocator;


/**
 * this class is used to collection all information about menu, cool bar, statusline...
 *
 */
public class CustomizeActionBars implements IActionBarConfigurer2, IActionBars2 {

	protected List<IActionSetDescriptor> actionSet = null;


	/**
	 * get the list of action set
	 *
	 * @return
	 */
	public List<IActionSetDescriptor> getActionSet() {
		return actionSet;
	}

	/**
	 * set the list of action Set
	 *
	 * @param actionSet
	 */
	public void setActionSet(List<IActionSetDescriptor> actionSet) {
		this.actionSet = actionSet;
	}

	protected MenuManager menuManager = new MenuManager();

	protected CoolBarManager coolBarManager = new CoolBarManager();

	protected StatusLineManager statusLineManager = new StatusLineManager();

	protected ToolBarManager toolBarManager = new ToolBarManager();

	/**
	 * Create a new instance of this class.
	 *
	 * @param configurer
	 *            the configurer
	 */
	public CustomizeActionBars(IWorkbenchWindowConfigurer configurer) {
	}

	/**
	 * do not call this method
	 */
	public IWorkbenchWindowConfigurer getWindowConfigurer() {
		return null;
	}

	/**
	 * get the manager in charge to display all menu
	 */

	public IMenuManager getMenuManager() {
		return menuManager;
	}

	/**
	 * the manager in charge to display the status line
	 */
	public IStatusLineManager getStatusLineManager() {
		return statusLineManager;
	}

	/**
	 * the manager in charge to display the cool bar, this also the tool bar in eclipse
	 */
	public ICoolBarManager getCoolBarManager() {
		return coolBarManager;
	}

	/**
	 * see the getCoolBarManager
	 */
	public IToolBarManager getToolBarManager() {
		return toolBarManager;
	}

	/**
	 * {@inheritDoc}
	 */
	public void setGlobalActionHandler(String actionID, IAction handler) {
	}

	/**
	 * {@inheritDoc}
	 */
	public void updateActionBars() {
	}

	/**
	 * {@inheritDoc}
	 */
	public void clearGlobalActionHandlers() {
	}

	/**
	 * {@inheritDoc}
	 */
	public IAction getGlobalActionHandler(String actionId) {
		return null;
	}

	public void registerGlobalAction(IAction action) {
	}

	/**
	 * Clean up the action bars.
	 */
	public void dispose() {
		coolBarManager.dispose();
		menuManager.dispose();
		statusLineManager.dispose();
		toolBarManager.dispose();
	}

	/**
	 * {@inheritDoc}
	 */
	public final IServiceLocator getServiceLocator() {
		return null;
	}

	/**
	 * {@inheritDoc}
	 */
	public IToolBarManager createToolBarManager() {
		return toolBarManager;
	}

	/**
	 * {@inheritDoc}
	 */
	public IToolBarContributionItem createToolBarContributionItem(IToolBarManager toolBarManager, String id) {
		return new ToolBarContributionItem2(toolBarManager, id);
	}



}

Back to the top