Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ToolBar tb;
- private ToolItem itemDropDown;
- @Override
- public void addToolItem(final ToolBar tb) {
- this.tb = tb;
- itemDropDown = new ToolItem(tb, SWT.PUSH);
- itemDropDown.setToolTipText("SoulWars Settings");
- itemDropDown.setImage(new org.eclipse.swt.graphics.Image(tb.getDisplay(), "si.png"));
- final org.eclipse.swt.widgets.Menu menu = new org.eclipse.swt.widgets.Menu(tb.getShell(), SWT.POP_UP);
- //Enter Stuff
- MenuItem enterMode = new MenuItem(menu,SWT.CASCADE);
- enterMode.setText("Enter Mode");
- org.eclipse.swt.widgets.Menu enterMenu = new org.eclipse.swt.widgets.Menu(enterMode);
- enterMode.setMenu(enterMenu);
- new MenuItem(enterMenu,SWT.CHECK).setText("Join team with highest player level average");
- new MenuItem(enterMenu,SWT.CHECK).setText("Join team with highest player level average (100+)");
- new MenuItem(enterMenu,SWT.CHECK).setText("Join team with most players");
- new MenuItem(enterMenu,SWT.CHECK).setText("Join using balance portal");
- new MenuItem(enterMenu,SWT.CHECK).setText("Red team ONLY");
- new MenuItem(enterMenu,SWT.CHECK).setText("Blue team ONLY");
- new MenuItem(enterMenu,SWT.CHECK).setText("Last Lost");
- new MenuItem(enterMenu,SWT.CHECK).setText("Clan Chat");
- new MenuItem(enterMenu,SWT.CHECK).setText("Highest Clan Member Count");
- new MenuItem(enterMenu,SWT.CHECK).setText("Last Won");
- new MenuItem(enterMenu,SWT.CHECK).setText("Most Summoning Monsters");
- //Activity Mode Stuff
- MenuItem activityMode = new MenuItem(menu,SWT.CASCADE);
- activityMode.setText("Activity Mode");
- org.eclipse.swt.widgets.Menu activityMenu = new org.eclipse.swt.widgets.Menu(activityMode);
- activityMode.setMenu(activityMenu);
- new MenuItem(activityMenu,SWT.CHECK).setText("Attack Players");
- new MenuItem(activityMenu,SWT.CHECK).setText("Bandage Players");
- new MenuItem(activityMenu,SWT.CHECK).setText("Attack Pyrefiends");
- new MenuItem(activityMenu,SWT.CHECK).setText("Attack Jellies");
- //Misc Stuff
- MenuItem otherOptions = new MenuItem(menu,SWT.CASCADE);
- otherOptions.setText("Other Options");
- org.eclipse.swt.widgets.Menu otherMenu = new org.eclipse.swt.widgets.Menu(otherOptions);
- otherOptions.setMenu(otherMenu);
- new MenuItem(otherMenu,SWT.CHECK).setText("Quick-Prayer");
- new MenuItem(otherMenu,SWT.CHECK).setText("Walk To Random Tile In Waiting Room");
- new MenuItem(otherMenu,SWT.CHECK).setText("Timed Switch Team");
- new MenuItem(otherMenu,SWT.CHECK).setText("Use Special Attack With Wielded Weapon");
- new MenuItem(otherMenu,SWT.CHECK).setText("Use Special Attack With Weapon In First Inventory Slot");
- itemDropDown.addListener(SWT.Selection, new org.eclipse.swt.widgets.Listener() {
- public void handleEvent(Event event) {
- org.eclipse.swt.graphics.Rectangle bounds = itemDropDown.getBounds();
- org.eclipse.swt.graphics.Point point = tb.toDisplay(bounds.x, bounds.y + bounds.height);
- menu.setLocation(point);
- menu.setVisible(true);
- }
- });
- org.eclipse.swt.graphics.Point oldSize = tb.getShell().getSize();
- tb.getShell().pack(false);
- tb.getShell().setSize(oldSize);
- }
- @Override
- public void removeToolItem() {
- itemDropDown.dispose();
- org.eclipse.swt.graphics.Point oldSize = tb.getShell().getSize();
- tb.getShell().pack(false);
- tb.getShell().setSize(oldSize);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement