2
* Created on 02-dic-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.gui.items.menu;
9
import org.eclipse.swt.SWT;
10
import org.eclipse.swt.widgets.Menu;
11
import org.eclipse.swt.widgets.MenuItem;
12
import org.eclipse.swt.widgets.Shell;
13
import org.herac.tuxguitar.gui.TuxGuitar;
14
import org.herac.tuxguitar.gui.items.MenuItems;
15
import org.herac.tuxguitar.gui.system.plugins.TGPlugin;
20
* TODO To change the template for this generated type comment go to
21
* Window - Preferences - Java - Code Style - Code Templates
23
public class PluginMenuItem implements MenuItems{
24
private boolean shouldShow;
25
private MenuItem pluginMenuItem;
28
public PluginMenuItem(Shell shell,Menu parent, int style) {
29
this.shouldShow = !TuxGuitar.instance().getPluginManager().getPluginItems().isEmpty();
31
this.pluginMenuItem = new MenuItem(parent, style);
32
this.menu = new Menu(shell, SWT.DROP_DOWN);
37
public void showItems(){
39
for(int i = 0; i < TuxGuitar.instance().getPluginManager().getPluginItems().size();i ++){
40
final TGPlugin plugin = (TGPlugin)TuxGuitar.instance().getPluginManager().getPluginItems().get(i);
42
MenuItem item = plugin.getItem().getMenuItem(this.menu);
44
this.pluginMenuItem.setMenu(menu);
46
this.loadProperties();
53
public void loadProperties(){
54
if(this.pluginMenuItem != null){
55
this.pluginMenuItem.setText(TuxGuitar.getProperty("plugins"));