@include base-orderedlayout;
@include base-panel;
@include base-popupview;
- @include base-progressindicator;
+ @include base-progressindicator(v-progressbar);
+ /* For legacy ProgressIndicator component */
+ @include base-progressindicator(v-progressindicator);
+
@include base-select;
@include base-shadow;
@include base-slider;
@include chameleon-notification;
@include chameleon-panel;
@include chameleon-popupview;
- @include chameleon-progressindicator;
+
+ @include chameleon-progressindicator(v-progressbar);
+ /* For legacy ProgressIndicator component */
+ @include chameleon-progressindicator(v-progressindicator);
+
@include chameleon-slider;
@include chameleon-splitpanel;
@include chameleon-table;
@include liferay-notification;
@include liferay-panel;
@include liferay-popupview;
- @include liferay-progressindicator;
+ @include liferay-progressindicator(v-progressbar);
+ /* For legacy ProgressIndicator component */
+ @include liferay-progressindicator(v-progressindicator);
@include liferay-select;
@include liferay-slider;
@include liferay-splitpanel;
@include reindeer-notification;
@include reindeer-panel;
@include reindeer-popupview;
- @include reindeer-progressindicator;
+ @include reindeer-progressindicator(v-progressbar);
+ /* For legacy ProgressIndicator component */
+ @include reindeer-progressindicator(v-progressindicator);
+
@include reindeer-select;
@include reindeer-slider;
@include reindeer-splitpanel;
@include runo-orderedlayout;
@include runo-panel;
@include runo-popupview;
- @include runo-progressindicator;
+
+ @include runo-progressindicator(v-progressbar);
+ /* For legacy ProgressIndicator component */
+ @include runo-progressindicator(v-progressindicator);
+
@include runo-select;
@include runo-shadow;
@include runo-slider;
import com.google.gwt.user.client.Element;
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;
/**
* Widget for showing the current progress of a long running task.
*/
public class VProgressBar extends Widget implements HasEnabled {
- public static final String CLASSNAME = "v-progressindicator";
Element wrapper = DOM.createDiv();
Element indicator = DOM.createDiv();
- protected boolean indeterminate = false;
- protected float state = 0.0f;
+ private boolean indeterminate = false;
+ private float state = 0.0f;
private boolean enabled;
public VProgressBar() {
setElement(DOM.createDiv());
getElement().appendChild(wrapper);
- setStyleName(CLASSNAME);
wrapper.appendChild(indicator);
- indicator.setClassName(CLASSNAME + "-indicator");
- wrapper.setClassName(CLASSNAME + "-wrapper");
+
+ setStylePrimaryName(ProgressBarState.PRIMARY_STYLE_NAME);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.google.gwt.user.client.ui.UIObject#setStylePrimaryName(java.lang.
+ * String)
+ */
+ @Override
+ public void setStylePrimaryName(String style) {
+ super.setStylePrimaryName(style);
+ indicator.setClassName(getStylePrimaryName() + "-indicator");
+ wrapper.setClassName(getStylePrimaryName() + "-wrapper");
+
}
public void setIndeterminate(boolean indeterminate) {
this.indeterminate = indeterminate;
- setStyleName(CLASSNAME + "-indeterminate", indeterminate);
+ setStyleName(getStylePrimaryName() + "-indeterminate", indeterminate);
}
public void setState(float state) {
@Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
- setStyleName("v-disabled", !enabled);
-
+ setStyleName(ApplicationConnection.DISABLED_CLASSNAME, !enabled);
}
}
package com.vaadin.client.ui;
+import com.vaadin.shared.ui.progressindicator.ProgressIndicatorState;
+
/**
*
* @author Vaadin Ltd
@Deprecated
public class VProgressIndicator extends VProgressBar {
+ public VProgressIndicator() {
+ super();
+ setStylePrimaryName(ProgressIndicatorState.PRIMARY_STYLE_NAME);
+ }
}
* @author Vaadin Ltd
*/
public class ProgressBarState extends AbstractFieldState {
+ public static final String PRIMARY_STYLE_NAME = "v-progressbar";
+ {
+ primaryStyleName = PRIMARY_STYLE_NAME;
+ }
public boolean indeterminate = false;
public Float state = 0.0f;
@Deprecated
public class ProgressIndicatorState extends ProgressBarState {
+ public static final String PRIMARY_STYLE_NAME = "v-progressindicator";
+
+ {
+ primaryStyleName = PRIMARY_STYLE_NAME;
+ }
+
public int pollingInterval = 1000;
}
}
};
+ protected Command<T, String> primaryStyleNameCommand = new Command<T, String>() {
+ @Override
+ public void execute(T c, String value, Object data) {
+ c.setPrimaryStyleName(value);
+ }
+ };
+
@Override
protected String getDescription() {
return "Generic test case for " + getTestClass().getSimpleName();
--- /dev/null
+package com.vaadin.tests.components.progressindicator;
+
+import java.util.LinkedHashMap;
+
+import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
+import com.vaadin.ui.ProgressBar;
+
+public class ProgressBarGenericTest extends AbstractFieldTest<ProgressBar> {
+
+ private Command<ProgressBar, Boolean> indeterminate = new Command<ProgressBar, Boolean>() {
+
+ @Override
+ public void execute(ProgressBar c, Boolean value, Object data) {
+ c.setIndeterminate(value);
+ }
+ };
+
+ @Override
+ protected Class<ProgressBar> getTestClass() {
+ return ProgressBar.class;
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+ createBooleanAction("Indeterminate", CATEGORY_FEATURES, false,
+ indeterminate, null);
+ createValueSelection(CATEGORY_FEATURES);
+ createPrimaryStyleNameSelect();
+ }
+
+ /**
+ * @since
+ */
+ protected void createPrimaryStyleNameSelect() {
+ LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
+ String primaryStyle = getComponent().getPrimaryStyleName();
+ options.put(primaryStyle, primaryStyle);
+ options.put(primaryStyle + "-foo", primaryStyle + "-foo");
+ options.put("foo", "foo");
+ createSelectAction("Primary style name", CATEGORY_DECORATIONS, options,
+ primaryStyle, primaryStyleNameCommand);
+
+ }
+
+ private void createValueSelection(String categorySelection) {
+ LinkedHashMap<String, Object> options = new LinkedHashMap<String, Object>();
+ options.put("null", null);
+ for (float f = 0; f <= 1; f += 0.1) {
+ options.put("" + f, f);
+ }
+ createSelectAction("Value", categorySelection, options, null,
+ setValueCommand);
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.progressindicator.ProgressBarGenericTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent</td>
+ <td>v-progressbar</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]</td>
+ <td>v-progressbar-wrapper</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]/domChild[0]</td>
+ <td>v-progressbar-indicator</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_Smenu#item0</td>
+ <td>36,8</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
+ <td>45,4</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
+ <td>67,10</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
+ <td>37,7</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent</td>
+ <td>v-progressbar</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent</td>
+ <td>foo</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]</td>
+ <td>v-progressbar-wrapper</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]</td>
+ <td>foo-wrapper</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]/domChild[0]</td>
+ <td>v-progressbar-indicator</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]/domChild[0]</td>
+ <td>foo-indicator</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_Smenu#item0</td>
+ <td>20,13</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
+ <td>34,11</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
+ <td>51,4</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::Root/VOverlay[2]/VMenuBar[0]#item0</td>
+ <td>38,6</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent</td>
+ <td>v-progressbar</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]</td>
+ <td>v-progressbar-wrapper</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsprogressindicatorProgressBarGenericTest::PID_StestComponent/domChild[0]/domChild[0]</td>
+ <td>v-progressbar-indicator</td>
+</tr>
+</tbody></table>
+</body>
+</html>