Exemple #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);
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #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;
 }