import java.util.Random; import org.zkoss.zul.Button; import org.zkoss.zul.Combobutton; import org.zkoss.zul.Div; import org.zkoss.zul.Hlayout; public class MyButtonBar extends Hlayout { private static final long serialVersionUID = 1615136375163250967L; private Div moreButtonContainer; private Button moreButton; private Button specialButton; private Combobutton commonActionButton; private Random random = new Random(); public MyButtonBar() { super(); createContents(); initProperties(); } private void initProperties() { moreButton.setDir("reverse"); // moreButton.setImage("~./test/img/button/arrow-up.png"); moreButton.setImage("~./fms/img/button/arrow-up.png"); // moreButton.setVisible(false); } private void createContents() { moreButtonContainer = new Div(); moreButtonContainer.setParent(this); moreButton = new Button("More"); moreButton.setParent(moreButtonContainer); specialButton = new Button("Special Action"); specialButton.setParent(this); commonActionButton = new Combobutton("Open"); commonActionButton.setParent(this); } public void refreshButtons() { // moreButton.setVisible(random.nextBoolean()); // moreButton.setImage("~./fms/img/button/arrow-up.png"); invalidate(); System.out.println("invalidate MyButtonBar"); } }