summaryrefslogtreecommitdiffstats
path: root/compatibility-client
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2016-08-30 13:42:53 +0300
committerHenri Sara <hesara@vaadin.com>2016-08-30 14:10:21 +0000
commitb31a71ae635d431c258d387a90bacb27d62a6bbf (patch)
tree03a37be3683857243099a399b1517b134ee574de /compatibility-client
parentb965c256e86dd14b8baf607f4456da58f6f1d21a (diff)
downloadvaadin-framework-b31a71ae635d431c258d387a90bacb27d62a6bbf.tar.gz
vaadin-framework-b31a71ae635d431c258d387a90bacb27d62a6bbf.zip
Move and duplicate client side and state to compatibility package
* ProgressBar * ProgressIndicator * OptionGroup * Table * Tree * TreeTable Change-Id: Ie1249631cbdd2721f2c3a36e1b8ffc8160fca6aa
Diffstat (limited to 'compatibility-client')
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/renderers/ProgressBarRenderer.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressBar.java101
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressIndicator.java34
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java4
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTwinColSelect.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupBaseConnector.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressBarConnector.java4
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressIndicatorConnector.java8
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/table/TableConnector.java8
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java6
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/treetable/TreeTableConnector.java4
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/twincolselect/TwinColSelectConnector.java2
15 files changed, 159 insertions, 24 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/renderers/ProgressBarRenderer.java b/compatibility-client/src/main/java/com/vaadin/v7/client/renderers/ProgressBarRenderer.java
index be4a3d0dfb..94e6d82fea 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/renderers/ProgressBarRenderer.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/renderers/ProgressBarRenderer.java
@@ -16,7 +16,7 @@
package com.vaadin.v7.client.renderers;
import com.google.gwt.core.shared.GWT;
-import com.vaadin.client.ui.VProgressBar;
+import com.vaadin.v7.client.ui.VProgressBar;
import com.vaadin.v7.client.widget.grid.RendererCellReference;
/**
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java
index 632944c48b..b67edfe93c 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java
@@ -48,7 +48,7 @@ import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.Icon;
import com.vaadin.client.ui.VCheckBox;
import com.vaadin.shared.EventId;
-import com.vaadin.shared.ui.optiongroup.OptionGroupConstants;
+import com.vaadin.v7.shared.ui.optiongroup.OptionGroupConstants;
public class VOptionGroup extends VOptionGroupBase
implements FocusHandler, BlurHandler {
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressBar.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressBar.java
new file mode 100644
index 0000000000..b4c5f7f0f2
--- /dev/null
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressBar.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.v7.client.ui;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.Style.Unit;
+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.StyleConstants;
+
+/**
+ * Widget for showing the current progress of a long running task.
+ * <p>
+ * The default mode is to show the current progress internally represented by a
+ * floating point value between 0 and 1 (inclusive). The progress bar can also
+ * be in an indeterminate mode showing an animation indicating that the task is
+ * running but without providing any information about the current progress.
+ *
+ * @since 7.1
+ * @author Vaadin Ltd
+ */
+public class VProgressBar extends Widget implements HasEnabled {
+
+ public static final String PRIMARY_STYLE_NAME = "v-progressbar";
+
+ Element wrapper = DOM.createDiv();
+ Element indicator = DOM.createDiv();
+
+ private boolean indeterminate = false;
+ private float state = 0.0f;
+ private boolean enabled;
+
+ public VProgressBar() {
+ setElement(DOM.createDiv());
+ getElement().appendChild(wrapper);
+ wrapper.appendChild(indicator);
+
+ setStylePrimaryName(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(getStylePrimaryName() + "-indeterminate", indeterminate);
+ }
+
+ public void setState(float state) {
+ final int size = Math.round(100 * state);
+ indicator.getStyle().setWidth(size, Unit.PCT);
+ }
+
+ public boolean isIndeterminate() {
+ return indeterminate;
+ }
+
+ public float getState() {
+ return state;
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (this.enabled != enabled) {
+ this.enabled = enabled;
+ setStyleName(StyleConstants.DISABLED, !enabled);
+ }
+ }
+}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressIndicator.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressIndicator.java
new file mode 100644
index 0000000000..8feee02a86
--- /dev/null
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VProgressIndicator.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.v7.client.ui;
+
+import com.vaadin.v7.shared.ui.progressindicator.ProgressIndicatorState;
+
+/**
+ *
+ * @author Vaadin Ltd
+ *
+ * @deprecated as of 7.1, renamed to VProgressBar
+ */
+@Deprecated
+public class VProgressIndicator extends VProgressBar {
+
+ public VProgressIndicator() {
+ super();
+ setStylePrimaryName(ProgressIndicatorState.PRIMARY_STYLE_NAME);
+ }
+}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
index 524e7f88cf..074e8d23da 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
@@ -113,9 +113,9 @@ import com.vaadin.client.ui.dd.VTransferable;
import com.vaadin.shared.AbstractComponentState;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.dd.VerticalDropLocation;
-import com.vaadin.shared.ui.table.CollapseMenuContent;
-import com.vaadin.shared.ui.table.TableConstants;
import com.vaadin.v7.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
+import com.vaadin.v7.shared.ui.table.CollapseMenuContent;
+import com.vaadin.v7.shared.ui.table.TableConstants;
/**
* VScrollTable
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
index cb07c0b8be..80b83c9504 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
@@ -82,8 +82,8 @@ import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.MouseEventDetails.MouseButton;
import com.vaadin.shared.ui.MultiSelectMode;
import com.vaadin.shared.ui.dd.VerticalDropLocation;
-import com.vaadin.shared.ui.tree.TreeConstants;
import com.vaadin.v7.client.ui.tree.TreeConnector;
+import com.vaadin.v7.shared.ui.tree.TreeConstants;
/**
*
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTwinColSelect.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTwinColSelect.java
index c11dd7b569..32bc14d330 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTwinColSelect.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTwinColSelect.java
@@ -42,7 +42,7 @@ import com.vaadin.client.UIDL;
import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.SubPartAware;
import com.vaadin.client.ui.VButton;
-import com.vaadin.shared.ui.twincolselect.TwinColSelectConstants;
+import com.vaadin.v7.shared.ui.twincolselect.TwinColSelectConstants;
public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
MouseDownHandler, DoubleClickHandler, SubPartAware {
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupBaseConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupBaseConnector.java
index fdeb2e08dd..53c0c0d06a 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupBaseConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupBaseConnector.java
@@ -21,10 +21,10 @@ import com.vaadin.client.Paintable;
import com.vaadin.client.StyleConstants;
import com.vaadin.client.UIDL;
import com.vaadin.client.ui.VNativeButton;
-import com.vaadin.shared.ui.select.AbstractSelectState;
import com.vaadin.v7.client.ui.AbstractFieldConnector;
import com.vaadin.v7.client.ui.VOptionGroupBase;
import com.vaadin.v7.client.ui.VTextField;
+import com.vaadin.v7.shared.ui.select.AbstractSelectState;
public abstract class OptionGroupBaseConnector extends AbstractFieldConnector
implements Paintable {
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java
index 172c872772..e88a2070bc 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java
@@ -25,8 +25,8 @@ import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.UIDL;
import com.vaadin.shared.EventId;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.optiongroup.OptionGroupState;
import com.vaadin.v7.client.ui.VOptionGroup;
+import com.vaadin.v7.shared.ui.optiongroup.OptionGroupState;
import com.vaadin.v7.ui.OptionGroup;
@Connect(OptionGroup.class)
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressBarConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressBarConnector.java
index 77602a4974..c98d8acaff 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressBarConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressBarConnector.java
@@ -17,10 +17,10 @@
package com.vaadin.v7.client.ui.progressindicator;
import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.VProgressBar;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.progressindicator.ProgressBarState;
import com.vaadin.v7.client.ui.AbstractFieldConnector;
+import com.vaadin.v7.client.ui.VProgressBar;
+import com.vaadin.v7.shared.ui.progressindicator.ProgressBarState;
import com.vaadin.v7.ui.ProgressBar;
/**
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressIndicatorConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressIndicatorConnector.java
index d70055b3b3..0081ff34f9 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressIndicatorConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/progressindicator/ProgressIndicatorConnector.java
@@ -18,11 +18,11 @@ package com.vaadin.v7.client.ui.progressindicator;
import com.google.gwt.user.client.Timer;
import com.vaadin.client.communication.StateChangeEvent;
-import com.vaadin.client.ui.VProgressBar;
-import com.vaadin.client.ui.VProgressIndicator;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.progressindicator.ProgressIndicatorServerRpc;
-import com.vaadin.shared.ui.progressindicator.ProgressIndicatorState;
+import com.vaadin.v7.client.ui.VProgressBar;
+import com.vaadin.v7.client.ui.VProgressIndicator;
+import com.vaadin.v7.shared.ui.progressindicator.ProgressIndicatorServerRpc;
+import com.vaadin.v7.shared.ui.progressindicator.ProgressIndicatorState;
import com.vaadin.v7.ui.ProgressIndicator;
/**
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/table/TableConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/table/TableConnector.java
index 405fdd1393..8cb408fd7a 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/table/TableConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/table/TableConnector.java
@@ -40,16 +40,16 @@ import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.PostLayoutListener;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.table.TableConstants;
-import com.vaadin.shared.ui.table.TableConstants.Section;
import com.vaadin.v7.client.ui.AbstractFieldConnector;
import com.vaadin.v7.client.ui.VScrollTable;
import com.vaadin.v7.client.ui.VScrollTable.ContextMenuDetails;
import com.vaadin.v7.client.ui.VScrollTable.FooterCell;
import com.vaadin.v7.client.ui.VScrollTable.HeaderCell;
import com.vaadin.v7.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
-import com.vaadin.shared.ui.table.TableServerRpc;
-import com.vaadin.shared.ui.table.TableState;
+import com.vaadin.v7.shared.ui.table.TableConstants;
+import com.vaadin.v7.shared.ui.table.TableServerRpc;
+import com.vaadin.v7.shared.ui.table.TableState;
+import com.vaadin.v7.shared.ui.table.TableConstants.Section;
@Connect(com.vaadin.v7.ui.Table.class)
public class TableConnector extends AbstractFieldConnector
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java
index c9b58da9fc..fd1927e895 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/tree/TreeConnector.java
@@ -35,11 +35,11 @@ import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.MultiSelectMode;
-import com.vaadin.shared.ui.tree.TreeConstants;
-import com.vaadin.shared.ui.tree.TreeServerRpc;
-import com.vaadin.shared.ui.tree.TreeState;
import com.vaadin.v7.client.ui.VTree;
import com.vaadin.v7.client.ui.VTree.TreeNode;
+import com.vaadin.v7.shared.ui.tree.TreeConstants;
+import com.vaadin.v7.shared.ui.tree.TreeServerRpc;
+import com.vaadin.v7.shared.ui.tree.TreeState;
import com.vaadin.v7.ui.Tree;
@Connect(Tree.class)
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/treetable/TreeTableConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/treetable/TreeTableConnector.java
index 5fbdafe1b7..094bbc0e9b 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/treetable/TreeTableConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/treetable/TreeTableConnector.java
@@ -22,13 +22,13 @@ import com.vaadin.client.UIDL;
import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.FocusableScrollPanel;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.treetable.TreeTableConstants;
-import com.vaadin.shared.ui.treetable.TreeTableState;
import com.vaadin.v7.client.ui.VTreeTable;
import com.vaadin.v7.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
import com.vaadin.v7.client.ui.VTreeTable.PendingNavigationEvent;
import com.vaadin.v7.client.ui.VTreeTable.VTreeTableScrollBody.VTreeTableRow;
import com.vaadin.v7.client.ui.table.TableConnector;
+import com.vaadin.v7.shared.ui.treetable.TreeTableConstants;
+import com.vaadin.v7.shared.ui.treetable.TreeTableState;
import com.vaadin.v7.ui.TreeTable;
@Connect(TreeTable.class)
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/twincolselect/TwinColSelectConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/twincolselect/TwinColSelectConnector.java
index 62084366d8..8a8d5559c4 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/twincolselect/TwinColSelectConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/twincolselect/TwinColSelectConnector.java
@@ -20,9 +20,9 @@ import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.DirectionalManagedLayout;
import com.vaadin.client.UIDL;
import com.vaadin.shared.ui.Connect;
-import com.vaadin.shared.ui.twincolselect.TwinColSelectState;
import com.vaadin.v7.client.ui.VTwinColSelect;
import com.vaadin.v7.client.ui.optiongroup.OptionGroupBaseConnector;
+import com.vaadin.v7.shared.ui.twincolselect.TwinColSelectState;
import com.vaadin.v7.ui.TwinColSelect;
@Connect(TwinColSelect.class)