1 package org.catacomb.druid.blocks; 2 3 import org.catacomb.druid.build.Context; 4 import org.catacomb.druid.build.GUIPath; 5 import org.catacomb.druid.gui.base.DruPanel; 6 import org.catacomb.druid.gui.edit.DruMenuButton; 7 8 9 public class MenuButton extends AbstractButton { 10 11 12 public String show; 13 14 public MenuButton() { 15 } 16 17 18 public MenuButton(String s) { 19 label = s; 20 } 21 22 23 public DruPanel instantiatePanel() { 24 return new DruMenuButton(label); 25 } 26 27 28 29 30 public void populatePanel(DruPanel dp, Context ctx, GUIPath gpath) { 31 32 DruMenuButton drum = (DruMenuButton)dp; 33 if (action != null) { 34 drum.setAction(action); 35 } 36 drum.setID(id); 37 38 if (image != null) { 39 drum.setImage(image); 40 } 41 42 applyDefaultRollover(drum); 43 applyPadding(drum); 44 45 if (show != null) { 46 drum.setPopupToShow(show); 47 ctx.getMarketplace().addViewer("TargetStore", drum, "access"); 48 } 49 50 } 51 52 53 54 55 56 }