private FastStringSet detachedConnectorIds = FastStringSet.create();
}
- public static final String MODIFIED_CLASSNAME = "v-modified";
+ @Deprecated
+ public static final String MODIFIED_CLASSNAME = StyleConstants.MODIFIED;
- public static final String DISABLED_CLASSNAME = "v-disabled";
+ @Deprecated
+ public static final String DISABLED_CLASSNAME = StyleConstants.DISABLED;
- public static final String REQUIRED_CLASSNAME = "v-required";
+ @Deprecated
+ public static final String REQUIRED_CLASSNAME = StyleConstants.REQUIRED;
- public static final String REQUIRED_CLASSNAME_EXT = "-required";
+ @Deprecated
+ public static final String REQUIRED_CLASSNAME_EXT = StyleConstants.REQUIRED_EXT;
- public static final String ERROR_CLASSNAME_EXT = "-error";
+ @Deprecated
+ public static final String ERROR_CLASSNAME_EXT = StyleConstants.ERROR_EXT;
/**
* A string that, if found in a non-JSON response to a UIDL request, will
* Added to all layouts to denote they are layouts
*/
public static final String UI_LAYOUT = "v-layout";
+
+ public static final String MODIFIED = "v-modified";
+ public static final String DISABLED = "v-disabled";
+
+ public static final String REQUIRED = "v-required";
+
+ public static final String REQUIRED_EXT = "-required";
+
+ public static final String ERROR_EXT = "-error";
}
}
}
if (!owner.isEnabled()) {
- style += " " + ApplicationConnection.DISABLED_CLASSNAME;
+ style += " " + StyleConstants.DISABLED;
}
setStyleName(style);
String style = VCaption.CLASSNAME;
if (disabled) {
- style += " " + ApplicationConnection.DISABLED_CLASSNAME;
+ style += " " + StyleConstants.DISABLED;
}
setStyleName(style);
if (hasDescription) {
import com.google.gwt.user.client.ui.Focusable;
import com.google.gwt.user.client.ui.HasEnabled;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.LayoutManager;
@Override
public void setWidgetEnabled(boolean widgetEnabled) {
// add or remove v-disabled style name from the widget
- setWidgetStyleName(ApplicationConnection.DISABLED_CLASSNAME,
- !widgetEnabled);
+ setWidgetStyleName(StyleConstants.DISABLED, !widgetEnabled);
if (getWidget() instanceof HasEnabled) {
// set widget specific enabled state
// add / remove error style name
setWidgetStyleNameWithPrefix(primaryStyleName,
- ApplicationConnection.ERROR_CLASSNAME_EXT,
- null != state.errorMessage);
+ StyleConstants.ERROR_EXT, null != state.errorMessage);
// add additional user defined style names as class names, prefixed with
// component default class name. remove nonexistent style names.
*/
package com.vaadin.client.ui;
-import com.vaadin.client.ApplicationConnection;
+import com.vaadin.client.StyleConstants;
import com.vaadin.shared.AbstractFieldState;
public abstract class AbstractFieldConnector extends AbstractComponentConnector {
super.updateWidgetStyleNames();
// add / remove modified style name to Fields
- setWidgetStyleName(ApplicationConnection.MODIFIED_CLASSNAME,
- isModified());
+ setWidgetStyleName(StyleConstants.MODIFIED, isModified());
// add / remove error style name to Fields
setWidgetStyleNameWithPrefix(getWidget().getStylePrimaryName(),
- ApplicationConnection.REQUIRED_CLASSNAME_EXT, isRequired());
+ StyleConstants.REQUIRED_EXT, isRequired());
- getWidget().setStyleName(ApplicationConnection.REQUIRED_CLASSNAME,
- isRequired());
+ getWidget().setStyleName(StyleConstants.REQUIRED, isRequired());
}
}
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.Focusable;
}
if (!enabled) {
- styles.add(ApplicationConnection.DISABLED_CLASSNAME);
+ styles.add(StyleConstants.DISABLED);
}
return styles.toArray(new String[styles.size()]);
if (styles != null) {
for (String style : styles) {
- if (ApplicationConnection.DISABLED_CLASSNAME.equals(style)) {
+ if (StyleConstants.DISABLED.equals(style)) {
// Add v-disabled also without classname prefix so
// generic v-disabled CSS rules work
styleName += " " + style;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.MouseEventDetailsBuilder;
+import com.vaadin.client.StyleConstants;
import com.vaadin.client.Util;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.button.ButtonServerRpc;
setEnabled(false);
// FIXME: This should be moved to NativeButtonConnector along with
// buttonRpcProxy
- addStyleName(ApplicationConnection.DISABLED_CLASSNAME);
+ addStyleName(StyleConstants.DISABLED);
buttonRpcProxy.disableOnClick();
}
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
+import com.vaadin.client.StyleConstants;
import com.vaadin.client.UIDL;
import com.vaadin.client.Util;
import com.vaadin.client.WidgetUtil;
op.setEnabled(enabled);
optionsEnabled.put(op, optionEnabled);
- setStyleName(op.getElement(),
- ApplicationConnection.DISABLED_CLASSNAME,
+ setStyleName(op.getElement(), StyleConstants.DISABLED,
!(optionEnabled && isEnabled()));
newwidgets.add(op);
Boolean isOptionEnabled = optionsEnabled.get(w);
if (isOptionEnabled == null) {
hasEnabled.setEnabled(optionGroupEnabled);
- setStyleName(w.getElement(),
- ApplicationConnection.DISABLED_CLASSNAME,
+ setStyleName(w.getElement(), StyleConstants.DISABLED,
!isEnabled());
} else {
hasEnabled
.setEnabled(isOptionEnabled && optionGroupEnabled);
- setStyleName(w.getElement(),
- ApplicationConnection.DISABLED_CLASSNAME,
+ setStyleName(w.getElement(), StyleConstants.DISABLED,
!(isOptionEnabled && isEnabled()));
}
}
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.HasEnabled;
import com.google.gwt.user.client.ui.Widget;
-import com.vaadin.client.ApplicationConnection;
-import com.vaadin.shared.ui.progressindicator.ProgressBarState;
+import com.vaadin.client.StyleConstants;
/**
* Widget for showing the current progress of a long running task.
*/
public class VProgressBar extends Widget implements HasEnabled {
+ public static final String PRIMARY_STYLE_NAME = "v-progressbar";
+
Element wrapper = DOM.createDiv();
Element indicator = DOM.createDiv();
getElement().appendChild(wrapper);
wrapper.appendChild(indicator);
- setStylePrimaryName(ProgressBarState.PRIMARY_STYLE_NAME);
+ setStylePrimaryName(PRIMARY_STYLE_NAME);
}
/*
public void setEnabled(boolean enabled) {
if (this.enabled != enabled) {
this.enabled = enabled;
- setStyleName(ApplicationConnection.DISABLED_CLASSNAME, !enabled);
+ setStyleName(StyleConstants.DISABLED, !enabled);
}
}
}
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Panel;
-import com.vaadin.client.ApplicationConnection;
+import com.vaadin.client.StyleConstants;
import com.vaadin.client.UIDL;
import com.vaadin.client.WidgetUtil;
import com.vaadin.shared.ui.twincolselect.TwinColSelectConstants;
selections.setEnabled(enabled);
add.setEnabled(enabled);
remove.setEnabled(enabled);
- add.setStyleName(ApplicationConnection.DISABLED_CLASSNAME, !enabled);
- remove.setStyleName(ApplicationConnection.DISABLED_CLASSNAME, !enabled);
+ add.setStyleName(StyleConstants.DISABLED, !enabled);
+ remove.setStyleName(StyleConstants.DISABLED, !enabled);
}
@Override
import com.google.gwt.user.client.ui.SimplePanel;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
+import com.vaadin.client.StyleConstants;
import com.vaadin.client.VConsole;
import com.vaadin.client.ui.upload.UploadIFrameOnloadStrategy;
private void setEnabledForSubmitButton(boolean enabled) {
submitButton.setEnabled(enabled);
- submitButton.setStyleName(ApplicationConnection.DISABLED_CLASSNAME,
- !enabled);
+ submitButton.setStyleName(StyleConstants.DISABLED, !enabled);
}
/**
import com.vaadin.client.widget.grid.events.ScrollEvent;
import com.vaadin.client.widget.grid.events.ScrollHandler;
import com.vaadin.client.widgets.Escalator.JsniUtil.TouchHandlerBundle;
-import com.vaadin.shared.ui.grid.GridState;
import com.vaadin.shared.ui.grid.HeightMode;
import com.vaadin.shared.ui.grid.Range;
import com.vaadin.shared.ui.grid.ScrollDestination;
private double heightOfEscalator = 0;
/** The height of Escalator in terms of body rows. */
- private double heightByRows = GridState.DEFAULT_HEIGHT_BY_ROWS;
+ private double heightByRows = 10.0d;
/** The height of Escalator, as defined by {@link #setHeight(String)} */
private String heightByCss = "";
* Gets the amount of rows in Escalator's body that are shown, while
* {@link #getHeightMode()} is {@link HeightMode#ROW}.
* <p>
- * By default, it is {@value GridState#DEFAULT_HEIGHT_BY_ROWS}.
+ * By default, it is 10.
*
* @return the amount of rows that are being shown in Escalator's body
* @see #setHeightByRows(double)