diff options
author | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2009-08-27 12:26:49 +0000 |
---|---|---|
committer | Jouni Koivuviita <jouni.koivuviita@itmill.com> | 2009-08-27 12:26:49 +0000 |
commit | ad101f842727ca84a184f1bf1ad7c5e63878302b (patch) | |
tree | b636516fa19ef5dab996c9160e576e3169e50f7b /src/com/vaadin/ui | |
parent | 7072fbb2f053ab9a390ee5e004d65e465c7b93e7 (diff) | |
download | vaadin-framework-ad101f842727ca84a184f1bf1ad7c5e63878302b.tar.gz vaadin-framework-ad101f842727ca84a184f1bf1ad7c5e63878302b.zip |
The Button Component Strikes Back
Fixes many theme issues with Button (mostly Reindeer theme), including #3110, #3193, #3194, #3180 and 3079.
Default button is now rendered on the client side with a DIV. Disabled buttons can now have descriptions, which fixes #2085.
Added a "new" component, NativeButton, which uses native BUTTON element rendering on the client side.
Theme compilation script now understands simple @import statements, which help keep things more organized in theme development.
svn changeset:8558/svn branch:6.1
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r-- | src/com/vaadin/ui/Button.java | 34 | ||||
-rw-r--r-- | src/com/vaadin/ui/NativeButton.java | 51 |
2 files changed, 51 insertions, 34 deletions
diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index df40aeb018..e4ca734d34 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -28,8 +28,6 @@ public class Button extends AbstractField { boolean switchMode = false; - private String primaryStyleName; - /** * Creates a new push button. The value of the push button is false and it * is immediate by default. @@ -137,9 +135,6 @@ public class Button extends AbstractField { public void paintContent(PaintTarget target) throws PaintException { super.paintContent(target); - if (primaryStyleName != null) { - target.addAttribute("primarystyle", primaryStyleName); - } if (isSwitchMode()) { target.addAttribute("type", "switch"); } @@ -352,33 +347,4 @@ public class Button extends AbstractField { super.setInternalValue(newValue); } - /** - * - * <i><b>EXPERIMENTAL FEATURE</b> Use with caution, the method signature - * might change in following releases.</i> - * <p> - * Sets the components primary style name. - * <p> - * The primary style name is usually used on the client-side as the prefix - * for widget CSS classnames (this depends on the terminal implementation). - * The default primary styles are usually prefixed with Vaadin proprietary - * "v-" string, e.g. the primary style name for a default Vaadin button is - * "v-button". - * <p> - * With this method, you can change the primary style name to "mybutton", - * and then on the client-side you would have "mybutton" as the CSS - * classname. After that, all other style names you set for the component - * will be prefixed with the new primary style name, i.e. setting an - * additional style name "red" for the same button would result in a CSS - * classname "mybutton-red" on the client-side. - */ - public void setPrimaryStyleName(String primary) { - primaryStyleName = primary; - requestRepaint(); - } - - public String getPrimaryStyleName() { - return primaryStyleName; - } - } diff --git a/src/com/vaadin/ui/NativeButton.java b/src/com/vaadin/ui/NativeButton.java new file mode 100644 index 0000000000..4df771d054 --- /dev/null +++ b/src/com/vaadin/ui/NativeButton.java @@ -0,0 +1,51 @@ +package com.vaadin.ui; + +import com.vaadin.data.Property; + +@SuppressWarnings("serial") +public class NativeButton extends Button { + + public NativeButton() { + super(); + } + + public NativeButton(String caption) { + super(caption); + } + + public NativeButton(String caption, ClickListener listener) { + super(caption, listener); + } + + public NativeButton(String caption, Object target, String methodName) { + super(caption, target, methodName); + } + + /** + * Creates a new switch button with initial value. + * + * @param state + * the Initial state of the switch-button. + * @param initialState + */ + public NativeButton(String caption, boolean initialState) { + super(caption, initialState); + } + + /** + * Creates a new switch button that is connected to a boolean property. + * + * @param state + * the Initial state of the switch-button. + * @param dataSource + */ + public NativeButton(String caption, Property dataSource) { + super(caption, dataSource); + } + + @Override + public String getTag() { + return "nativebutton"; + } + +}
\ No newline at end of file |