示例#1
0
 /**
  * Construct a button with a given css and text
  *
  * @param css the css to use
  * @param text the text to use
  */
 public Button(ButtonCss css, String text) {
   super(css);
   this.css = css;
   css.ensureInjected();
   addStyleName(css.button());
   setText(text);
 }
示例#2
0
 /**
  * Should the button be disabled. By default, the button will be grayed out.
  *
  * @param disabled true if the button should be disabled, otherwise false
  */
 public void setDisabled(boolean disabled) {
   if (disabled) {
     addStyleName(css.disabled());
   } else {
     removeStyleName(css.disabled());
   }
   this.disabled = disabled;
 }
示例#3
0
 /**
  * Should the button be rendered as a confirm button
  *
  * @param confirm true if the button should be rendered as a confirm button, otherwise false
  */
 public void setConfirm(boolean confirm) {
   if (confirm) {
     addStyleName(css.confirm());
   } else {
     removeStyleName(css.confirm());
   }
   this.confirm = confirm;
 }
示例#4
0
 /**
  * Should the button be rendered as important
  *
  * @param important true if the button should be rendered as important, otherwise false
  */
 public void setImportant(boolean important) {
   if (important) {
     addStyleName(css.important());
   } else {
     removeStyleName(css.important());
   }
   this.important = important;
 }
示例#5
0
 /**
  * Should the button be rendered small
  *
  * @param small true if the button should be rendered small, otherwise false
  */
 public void setSmall(boolean small) {
   if (small) {
     addStyleName(css.small());
   } else {
     removeStyleName(css.small());
   }
   this.small = small;
 }
示例#6
0
 /**
  * Should the button have rounded corners
  *
  * @param round true if the button should have rounded corners, otherwise false
  */
 public void setRound(boolean round) {
   if (round) {
     addStyleName(css.round());
   } else {
     removeStyleName(css.round());
   }
   this.round = round;
 }