Change-Id: I12236a856403942382633aad5992467576baa7fctags/8.0.0.alpha1
@@ -17,18 +17,19 @@ | |||
package com.vaadin.client.ui; | |||
import com.google.gwt.user.client.DOM; | |||
import com.vaadin.client.v7.ui.VLegacyTextField; | |||
/** | |||
* This class represents a password field. | |||
* | |||
* @author Vaadin Ltd. | |||
* | |||
*/ | |||
public class VPasswordField extends VLegacyTextField { | |||
public class VPasswordField extends VTextField { | |||
public static final String CLASSNAME = "v-passwordfield"; | |||
public VPasswordField() { | |||
super(DOM.createInputPassword()); | |||
setStyleName(CLASSNAME); | |||
} | |||
} |
@@ -13,16 +13,15 @@ | |||
* License for the specific language governing permissions and limitations under | |||
* the License. | |||
*/ | |||
package com.vaadin.client.ui.passwordfield; | |||
import com.vaadin.client.ui.VPasswordField; | |||
import com.vaadin.client.v7.ui.textfield.LegacyTextFieldConnector; | |||
import com.vaadin.client.ui.textfield.TextFieldConnector; | |||
import com.vaadin.shared.ui.Connect; | |||
import com.vaadin.ui.PasswordField; | |||
@Connect(PasswordField.class) | |||
public class PasswordFieldConnector extends LegacyTextFieldConnector { | |||
public class PasswordFieldConnector extends TextFieldConnector { | |||
@Override | |||
public VPasswordField getWidget() { |
@@ -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.client.v7.ui; | |||
import com.google.gwt.user.client.DOM; | |||
/** | |||
* This class represents a password field. | |||
* | |||
* @author Vaadin Ltd. | |||
* | |||
*/ | |||
@Deprecated | |||
public class VLegacyPasswordField extends VLegacyTextField { | |||
public VLegacyPasswordField() { | |||
super(DOM.createInputPassword()); | |||
} | |||
} |
@@ -0,0 +1,32 @@ | |||
/* | |||
* 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.client.v7.ui.passwordfield; | |||
import com.vaadin.client.v7.ui.VLegacyPasswordField; | |||
import com.vaadin.client.v7.ui.textfield.LegacyTextFieldConnector; | |||
import com.vaadin.shared.ui.Connect; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
@Deprecated | |||
@Connect(LegacyPasswordField.class) | |||
public class LegacyPasswordFieldConnector extends LegacyTextFieldConnector { | |||
@Override | |||
public VLegacyPasswordField getWidget() { | |||
return (VLegacyPasswordField) super.getWidget(); | |||
} | |||
} |
@@ -33,7 +33,7 @@ import com.vaadin.v7.ui.LegacyTextField; | |||
/** | |||
* Login form with auto-completion and auto-fill for all major browsers. You can | |||
* derive from this class and implement the | |||
* {@link #createContent(com.vaadin.v7.ui.LegacyTextField, com.vaadin.ui.PasswordField, com.vaadin.ui.Button)} | |||
* {@link #createContent(com.vaadin.ui.TextField, com.vaadin.ui.PasswordField, com.vaadin.ui.Button)} | |||
* method to build the layout using the text fields and login button that are | |||
* passed to that method. The supplied components are specially treated so that | |||
* they work with password managers. | |||
@@ -41,7 +41,7 @@ import com.vaadin.v7.ui.LegacyTextField; | |||
* If you need to change the URL as part of the login procedure, call | |||
* {@link #setLoginMode(LoginMode)} with the argument {@link LoginMode#DEFERRED} | |||
* in your implementation of | |||
* {@link #createContent(com.vaadin.v7.ui.LegacyTextField, com.vaadin.ui.PasswordField, com.vaadin.ui.Button) | |||
* {@link #createContent(com.vaadin.ui.TextField, com.vaadin.ui.PasswordField, com.vaadin.ui.Button) | |||
* createContent}. | |||
* <p> | |||
* To customize the fields or to replace them with your own implementations, you | |||
@@ -141,9 +141,9 @@ public class LoginForm extends AbstractSingleComponentContainer { | |||
* @return the user name field | |||
* @since 7.7 | |||
*/ | |||
protected LegacyTextField createUsernameField() { | |||
protected TextField createUsernameField() { | |||
checkInitialized(); | |||
LegacyTextField field = new LegacyTextField(getUsernameCaption()); | |||
TextField field = new TextField(getUsernameCaption()); | |||
field.focus(); | |||
return field; | |||
} | |||
@@ -287,7 +287,7 @@ public class LoginForm extends AbstractSingleComponentContainer { | |||
* @return content component | |||
* @since 7.7 | |||
*/ | |||
protected Component createContent(LegacyTextField userNameField, | |||
protected Component createContent(TextField userNameField, | |||
PasswordField passwordField, Button loginButton) { | |||
VerticalLayout layout = new VerticalLayout(); | |||
layout.setSpacing(true); | |||
@@ -327,8 +327,8 @@ public class LoginForm extends AbstractSingleComponentContainer { | |||
getLoginButton())); | |||
} | |||
private LegacyTextField getUsernameField() { | |||
return (LegacyTextField) getState().userNameFieldConnector; | |||
private TextField getUsernameField() { | |||
return (TextField) getState().userNameFieldConnector; | |||
} | |||
private PasswordField getPasswordField() { |
@@ -13,21 +13,20 @@ | |||
* License for the specific language governing permissions and limitations under | |||
* the License. | |||
*/ | |||
package com.vaadin.ui; | |||
import org.jsoup.nodes.Attributes; | |||
import org.jsoup.nodes.Element; | |||
import com.vaadin.data.Property; | |||
import com.vaadin.ui.declarative.DesignAttributeHandler; | |||
import com.vaadin.ui.declarative.DesignContext; | |||
import com.vaadin.v7.ui.LegacyAbstractTextField; | |||
/** | |||
* A field that is used to enter secret text information like passwords. The | |||
* entered text is not displayed on the screen. | |||
*/ | |||
public class PasswordField extends LegacyAbstractTextField { | |||
public class PasswordField extends AbstractTextField { | |||
/** | |||
* Constructs an empty PasswordField. | |||
@@ -36,29 +35,6 @@ public class PasswordField extends LegacyAbstractTextField { | |||
setValue(""); | |||
} | |||
/** | |||
* Constructs a PasswordField with given property data source. | |||
* | |||
* @param dataSource | |||
* the property data source for the field | |||
*/ | |||
public PasswordField(Property dataSource) { | |||
setPropertyDataSource(dataSource); | |||
} | |||
/** | |||
* Constructs a PasswordField with given caption and property data source. | |||
* | |||
* @param caption | |||
* the caption for the field | |||
* @param dataSource | |||
* the property data source for the field | |||
*/ | |||
public PasswordField(String caption, Property dataSource) { | |||
this(dataSource); | |||
setCaption(caption); | |||
} | |||
/** | |||
* Constructs a PasswordField with given value and caption. | |||
* | |||
@@ -94,8 +70,8 @@ public class PasswordField extends LegacyAbstractTextField { | |||
super.readDesign(design, designContext); | |||
Attributes attr = design.attributes(); | |||
if (attr.hasKey("value")) { | |||
setValue(DesignAttributeHandler.readAttribute("value", attr, | |||
String.class), false, true); | |||
doSetValue(DesignAttributeHandler.readAttribute("value", attr, | |||
String.class)); | |||
} | |||
} | |||
@@ -108,16 +84,10 @@ public class PasswordField extends LegacyAbstractTextField { | |||
@Override | |||
public void writeDesign(Element design, DesignContext designContext) { | |||
super.writeDesign(design, designContext); | |||
LegacyAbstractTextField def = (LegacyAbstractTextField) designContext | |||
AbstractTextField def = (AbstractTextField) designContext | |||
.getDefaultInstance(this); | |||
Attributes attr = design.attributes(); | |||
DesignAttributeHandler.writeAttribute("value", attr, getValue(), | |||
def.getValue(), String.class); | |||
} | |||
@Override | |||
public void clear() { | |||
setValue(""); | |||
} | |||
} |
@@ -0,0 +1,123 @@ | |||
/* | |||
* 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.ui; | |||
import org.jsoup.nodes.Attributes; | |||
import org.jsoup.nodes.Element; | |||
import com.vaadin.data.Property; | |||
import com.vaadin.ui.declarative.DesignAttributeHandler; | |||
import com.vaadin.ui.declarative.DesignContext; | |||
/** | |||
* A field that is used to enter secret text information like passwords. The | |||
* entered text is not displayed on the screen. | |||
*/ | |||
@Deprecated | |||
public class LegacyPasswordField extends LegacyAbstractTextField { | |||
/** | |||
* Constructs an empty PasswordField. | |||
*/ | |||
public LegacyPasswordField() { | |||
setValue(""); | |||
} | |||
/** | |||
* Constructs a PasswordField with given property data source. | |||
* | |||
* @param dataSource | |||
* the property data source for the field | |||
*/ | |||
public LegacyPasswordField(Property dataSource) { | |||
setPropertyDataSource(dataSource); | |||
} | |||
/** | |||
* Constructs a PasswordField with given caption and property data source. | |||
* | |||
* @param caption | |||
* the caption for the field | |||
* @param dataSource | |||
* the property data source for the field | |||
*/ | |||
public LegacyPasswordField(String caption, Property dataSource) { | |||
this(dataSource); | |||
setCaption(caption); | |||
} | |||
/** | |||
* Constructs a PasswordField with given value and caption. | |||
* | |||
* @param caption | |||
* the caption for the field | |||
* @param value | |||
* the value for the field | |||
*/ | |||
public LegacyPasswordField(String caption, String value) { | |||
setValue(value); | |||
setCaption(caption); | |||
} | |||
/** | |||
* Constructs a PasswordField with given caption. | |||
* | |||
* @param caption | |||
* the caption for the field | |||
*/ | |||
public LegacyPasswordField(String caption) { | |||
this(); | |||
setCaption(caption); | |||
} | |||
/* | |||
* (non-Javadoc) | |||
* | |||
* @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , | |||
* com.vaadin.ui.declarative.DesignContext) | |||
*/ | |||
@Override | |||
public void readDesign(Element design, DesignContext designContext) { | |||
super.readDesign(design, designContext); | |||
Attributes attr = design.attributes(); | |||
if (attr.hasKey("value")) { | |||
setValue(DesignAttributeHandler.readAttribute("value", attr, | |||
String.class), false, true); | |||
} | |||
} | |||
/* | |||
* (non-Javadoc) | |||
* | |||
* @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element | |||
* , com.vaadin.ui.declarative.DesignContext) | |||
*/ | |||
@Override | |||
public void writeDesign(Element design, DesignContext designContext) { | |||
super.writeDesign(design, designContext); | |||
LegacyAbstractTextField def = (LegacyAbstractTextField) designContext | |||
.getDefaultInstance(this); | |||
Attributes attr = design.attributes(); | |||
DesignAttributeHandler.writeAttribute("value", attr, getValue(), | |||
def.getValue(), String.class); | |||
} | |||
@Override | |||
public void clear() { | |||
setValue(""); | |||
} | |||
} |
@@ -13,7 +13,9 @@ | |||
.v-textarea-focus { | |||
} | |||
input.#{$primaryStyleName}-prompt, | |||
textarea.v-textarea-prompt { | |||
textarea.v-textarea-prompt, | |||
input[placeholder], | |||
textarea[placeholder] { | |||
color: #999; | |||
font-style: italic; | |||
} | |||
@@ -35,18 +37,18 @@ textarea.v-textarea-readonly:focus { | |||
.v-textarea-error, | |||
.#{$primaryStyleName}-error, | |||
.v-richtextarea-error iframe.gwt-RichTextArea { | |||
background: #FFE0E0; | |||
background: #FFE0E0; | |||
} | |||
*/ | |||
/* Disabled by default | |||
.v-textarea-required, | |||
.#{$primaryStyleName}-required, | |||
.v-richtextarea-required iframe.gwt-RichTextArea { | |||
background: #FFE0E0; | |||
background: #FFE0E0; | |||
} | |||
*/ | |||
/* Safari focus glow fix */ | |||
.v-sa & input:focus, | |||
.v-sa & input:focus, | |||
.v-sa & textarea:focus { | |||
outline-width: medium; | |||
} | |||
@@ -106,7 +108,7 @@ textarea.v-textarea-readonly:focus { | |||
} | |||
.v-richtextarea .gwt-RichTextToolbar .gwt-ToggleButton img, | |||
.v-richtextarea .gwt-RichTextToolbar .gwt-PushButton img { | |||
} | |||
.v-richtextarea .gwt-RichTextToolbar .gwt-ListBox { | |||
width: 24.5%; | |||
@@ -117,4 +119,4 @@ textarea.v-textarea-readonly:focus { | |||
border: none; | |||
} | |||
} | |||
} |
@@ -48,7 +48,9 @@ input.v-widget.#{$primaryStyleName}[type="text"], | |||
} | |||
&.v-app input.#{$primaryStyleName}-prompt, | |||
&.v-app textarea.v-textarea-prompt { | |||
&.v-app textarea.v-textarea-prompt, | |||
&.v-app input[placeholder], | |||
&.v-app textarea[placeholder] { | |||
font-style: normal; | |||
color: #999; | |||
} | |||
@@ -128,4 +130,4 @@ input.#{$primaryStyleName}-search[type=text], | |||
padding-left: 17px; | |||
} | |||
} | |||
} |
@@ -54,7 +54,9 @@ | |||
background-color: #fff; | |||
} | |||
input.#{$primaryStyleName}-prompt, | |||
textarea.v-textarea-prompt { | |||
textarea.v-textarea-prompt, | |||
input[placeholder], | |||
textarea[placeholder] { | |||
font-style: normal; | |||
color: #999; | |||
} | |||
@@ -105,7 +107,8 @@ textarea.v-textarea-prompt { | |||
border-bottom-color: #507596; | |||
background-color: #151717; | |||
} | |||
.black input.#{$primaryStyleName}-prompt { | |||
.black input.#{$primaryStyleName}-prompt, | |||
.black input[placeholder] { | |||
color: #5f6366; | |||
} | |||
/* Readonly */ | |||
@@ -117,4 +120,4 @@ textarea.v-textarea-readonly, | |||
background: transparent; | |||
} | |||
} | |||
} |
@@ -25,7 +25,9 @@ textarea.v-textarea { | |||
border-color: #5daee8; | |||
} | |||
input.#{$primaryStyleName}-prompt, | |||
textarea.v-textarea-prompt { | |||
input[placeholder], | |||
textarea.v-textarea-prompt, | |||
textarea[placeholder] { | |||
color: #999; | |||
font-style: normal; | |||
} | |||
@@ -46,4 +48,4 @@ textarea.v-textarea-small { | |||
padding: 1px 2px; | |||
} | |||
} | |||
} |
@@ -211,7 +211,8 @@ $v-textfield-disabled-opacity: $v-disabled-opacity !default; | |||
} | |||
// TODO allow parent selector to be used in interpolation | |||
&[class*="prompt"] { | |||
&[class*="prompt"], | |||
&[placeholder] { | |||
@include valo-textfield-prompt-style($background-color); | |||
} | |||
@@ -308,7 +309,8 @@ $v-textfield-disabled-opacity: $v-disabled-opacity !default; | |||
@include box-shadow(none); | |||
} | |||
&[class*="prompt"] { | |||
&[class*="prompt"], | |||
&[placeholder] { | |||
@include valo-textfield-prompt-style($background-color); | |||
} | |||
} |
@@ -1,4 +1,4 @@ | |||
/* | |||
/* | |||
* Copyright 2000-2016 Vaadin Ltd. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |||
@@ -21,15 +21,15 @@ import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
import com.vaadin.ui.Component.Event; | |||
import com.vaadin.ui.Component.Listener; | |||
import com.vaadin.v7.ui.LegacyField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
import com.vaadin.ui.CustomLayout; | |||
import com.vaadin.ui.Label; | |||
import com.vaadin.ui.LegacyWindow; | |||
import com.vaadin.ui.Panel; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.TextField; | |||
import com.vaadin.ui.Tree; | |||
import com.vaadin.ui.VerticalLayout; | |||
import com.vaadin.v7.ui.LegacyField; | |||
/** | |||
* This example demonstrates custom layout. All components created here are | |||
@@ -51,7 +51,7 @@ public class CustomLayoutDemo extends com.vaadin.server.LegacyApplication | |||
private final Panel bodyPanel = new Panel(); | |||
private final LegacyTextField username = new LegacyTextField("Username"); | |||
private final TextField username = new TextField("Username"); | |||
private final PasswordField loginPwd = new PasswordField("Password"); | |||
@@ -22,13 +22,13 @@ import com.vaadin.ui.AbsoluteLayout; | |||
import com.vaadin.ui.Alignment; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
import com.vaadin.ui.Embedded; | |||
import com.vaadin.ui.GridLayout; | |||
import com.vaadin.ui.HorizontalLayout; | |||
import com.vaadin.ui.Label; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.VerticalLayout; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
public class AbsoluteLayoutHideComponent extends AbstractTestUI { | |||
@@ -36,7 +36,7 @@ public class AbsoluteLayoutHideComponent extends AbstractTestUI { | |||
private VerticalLayout topBar = new VerticalLayout(); | |||
private GridLayout menu; | |||
private LegacyTextField editEmail = new LegacyTextField(); | |||
private PasswordField editPassword = new PasswordField(); | |||
private LegacyPasswordField editPassword = new LegacyPasswordField(); | |||
@Override | |||
protected void setup(VaadinRequest request) { |
@@ -17,7 +17,7 @@ public class AccordionTabIds extends AbstractTestUI { | |||
/* | |||
* (non-Javadoc) | |||
* | |||
* | |||
* @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. | |||
* VaadinRequest) | |||
*/ |
@@ -19,7 +19,7 @@ import com.vaadin.server.VaadinRequest; | |||
import com.vaadin.tests.components.AbstractTestUI; | |||
import com.vaadin.tests.util.PersonContainer; | |||
import com.vaadin.ui.LegacyGrid; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
public class GridEditorUI extends AbstractTestUI { | |||
@@ -39,7 +39,7 @@ public class GridEditorUI extends AbstractTestUI { | |||
grid.setEditorEnabled(true); | |||
grid.getColumn("firstName").setEditorField(new PasswordField()); | |||
grid.getColumn("firstName").setEditorField(new LegacyPasswordField()); | |||
LegacyTextField lastNameField = (LegacyTextField) grid | |||
.getColumn("lastName").getEditorField(); |
@@ -2,15 +2,15 @@ package com.vaadin.tests.components.passwordfield; | |||
import com.vaadin.event.FieldEvents.TextChangeListener; | |||
import com.vaadin.tests.components.abstractfield.LegacyAbstractTextFieldTest; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
public class PasswordFieldTest | |||
extends LegacyAbstractTextFieldTest<PasswordField> | |||
extends LegacyAbstractTextFieldTest<LegacyPasswordField> | |||
implements TextChangeListener { | |||
@Override | |||
protected Class<PasswordField> getTestClass() { | |||
return PasswordField.class; | |||
protected Class<LegacyPasswordField> getTestClass() { | |||
return LegacyPasswordField.class; | |||
} | |||
@Override |
@@ -6,6 +6,7 @@ import com.vaadin.ui.GridLayout; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.RichTextArea; | |||
import com.vaadin.ui.TextArea; | |||
import com.vaadin.ui.TextField; | |||
import com.vaadin.ui.themes.ChameleonTheme; | |||
import com.vaadin.ui.themes.Reindeer; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
@@ -45,7 +46,7 @@ public class TextFieldsCssTest extends GridLayout { | |||
private void createTextFieldWith(String caption, String primaryStyleName, | |||
String inputPrompt) { | |||
LegacyTextField tf = new LegacyTextField(); | |||
TextField tf = new TextField(); | |||
tf.setId("textfield" + debugIdCounter++); | |||
if (caption != null) { | |||
tf.setCaption(caption); | |||
@@ -56,7 +57,7 @@ public class TextFieldsCssTest extends GridLayout { | |||
} | |||
if (inputPrompt != null) { | |||
tf.setInputPrompt(inputPrompt); | |||
tf.setPlaceholder(inputPrompt); | |||
} | |||
addComponent(tf); |
@@ -8,7 +8,6 @@ import com.vaadin.tests.components.AbstractTestUIWithLog; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
import com.vaadin.ui.Button.ClickListener; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
import com.vaadin.ui.CheckBox; | |||
import com.vaadin.ui.ComboBox; | |||
import com.vaadin.ui.Component; | |||
@@ -18,7 +17,6 @@ import com.vaadin.ui.InlineDateField; | |||
import com.vaadin.ui.ListSelect; | |||
import com.vaadin.ui.NativeSelect; | |||
import com.vaadin.ui.OptionGroup; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.PopupDateField; | |||
import com.vaadin.ui.RichTextArea; | |||
import com.vaadin.ui.Slider; | |||
@@ -27,6 +25,8 @@ import com.vaadin.ui.TextArea; | |||
import com.vaadin.ui.Tree; | |||
import com.vaadin.ui.TreeTable; | |||
import com.vaadin.ui.TwinColSelect; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
@SuppressWarnings("rawtypes") | |||
public class TabIndexes extends AbstractTestUIWithLog { | |||
@@ -114,7 +114,7 @@ public class TabIndexes extends AbstractTestUIWithLog { | |||
tree.addItem("Item 1"); | |||
fields.add(tree); | |||
fields.add(new TwinColSelect()); | |||
fields.add(new PasswordField()); | |||
fields.add(new LegacyPasswordField()); | |||
fields.add(new LegacyTextField()); | |||
fields.add(new TextArea()); | |||
fields.add(new RichTextArea()); |
@@ -14,7 +14,6 @@ import com.vaadin.ui.AbstractComponent; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
import com.vaadin.ui.Button.ClickListener; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
import com.vaadin.ui.CheckBox; | |||
import com.vaadin.ui.ComboBox; | |||
import com.vaadin.ui.Component; | |||
@@ -26,9 +25,10 @@ import com.vaadin.ui.HorizontalLayout; | |||
import com.vaadin.ui.Layout; | |||
import com.vaadin.ui.NativeSelect; | |||
import com.vaadin.ui.OptionGroup; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.TextArea; | |||
import com.vaadin.ui.VerticalLayout; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
public class CaptionsInLayoutsWaiAria extends TestBase { | |||
@@ -199,7 +199,7 @@ public class CaptionsInLayoutsWaiAria extends TestBase { | |||
components.add(new LegacyTextField("Default TextBox")); | |||
components.add(new TextArea("Default TextArea.")); | |||
// components.add(new RichTextArea("Default RichtTextArea")); | |||
components.add(new PasswordField("Default Password")); | |||
components.add(new LegacyPasswordField("Default Password")); | |||
components.add(new DateField("Default DateField")); | |||
// PopupDateField popupDateField = new |
@@ -7,11 +7,11 @@ import com.vaadin.ui.Alignment; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
import com.vaadin.ui.CustomComponent; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.VerticalLayout; | |||
import com.vaadin.ui.themes.Reindeer; | |||
import com.vaadin.v7.data.validator.LegacyAbstractValidator; | |||
import com.vaadin.v7.data.validator.LegacyEmailValidator; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
public class SimpleLoginView extends CustomComponent | |||
@@ -21,7 +21,7 @@ public class SimpleLoginView extends CustomComponent | |||
private final LegacyTextField user; | |||
private final PasswordField password; | |||
private final LegacyPasswordField password; | |||
private final Button loginButton; | |||
@@ -38,7 +38,7 @@ public class SimpleLoginView extends CustomComponent | |||
user.setInvalidAllowed(false); | |||
// Create the password input field | |||
password = new PasswordField("Password:"); | |||
password = new LegacyPasswordField("Password:"); | |||
password.setWidth("300px"); | |||
password.addValidator(new PasswordValidator()); | |||
password.setRequired(true); |
@@ -5,13 +5,13 @@ import com.vaadin.navigator.View; | |||
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; | |||
import com.vaadin.ui.Button; | |||
import com.vaadin.ui.Button.ClickEvent; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
import com.vaadin.ui.Layout; | |||
import com.vaadin.ui.Notification; | |||
import com.vaadin.ui.Panel; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.UI; | |||
import com.vaadin.ui.VerticalLayout; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
public class LoginView extends Panel implements View { | |||
@@ -24,7 +24,8 @@ public class LoginView extends Panel implements View { | |||
final LegacyTextField email = new LegacyTextField("Email"); | |||
layout.addComponent(email); | |||
final PasswordField password = new PasswordField("Password"); | |||
final LegacyPasswordField password = new LegacyPasswordField( | |||
"Password"); | |||
layout.addComponent(password); | |||
final Button login = new Button("Login", new Button.ClickListener() { |
@@ -164,20 +164,20 @@ public class TextFields extends VerticalLayout implements View { | |||
row.addComponent(tf); | |||
PasswordField pwf = new PasswordField("Password"); | |||
pwf.setInputPrompt("Secret words"); | |||
pwf.setPlaceholder("Secret words"); | |||
pwf.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); | |||
pwf.setIcon(FontAwesome.LOCK); | |||
row.addComponent(pwf); | |||
pwf = new PasswordField("Password, right-aligned"); | |||
pwf.setInputPrompt("Secret words"); | |||
pwf.setPlaceholder("Secret words"); | |||
pwf.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); | |||
pwf.addStyleName(ValoTheme.TEXTFIELD_ALIGN_RIGHT); | |||
pwf.setIcon(FontAwesome.LOCK); | |||
row.addComponent(pwf); | |||
pwf = new PasswordField("Password, centered"); | |||
pwf.setInputPrompt("Secret words"); | |||
pwf.setPlaceholder("Secret words"); | |||
pwf.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); | |||
pwf.addStyleName(ValoTheme.TEXTFIELD_ALIGN_CENTER); | |||
pwf.setIcon(FontAwesome.LOCK); |
@@ -25,7 +25,6 @@ import com.vaadin.ui.Component; | |||
import com.vaadin.ui.HorizontalLayout; | |||
import com.vaadin.ui.ListSelect; | |||
import com.vaadin.ui.NativeSelect; | |||
import com.vaadin.ui.PasswordField; | |||
import com.vaadin.ui.RichTextArea; | |||
import com.vaadin.ui.TextArea; | |||
import com.vaadin.ui.TwinColSelect; | |||
@@ -34,6 +33,7 @@ import com.vaadin.v7.data.Validator; | |||
import com.vaadin.v7.data.validator.LegacyStringLengthValidator; | |||
import com.vaadin.v7.ui.LegacyAbstractField; | |||
import com.vaadin.v7.ui.LegacyField; | |||
import com.vaadin.v7.ui.LegacyPasswordField; | |||
import com.vaadin.v7.ui.LegacyTextField; | |||
public class FieldErrorIndication extends AbstractTestUI { | |||
@@ -88,7 +88,7 @@ public class FieldErrorIndication extends AbstractTestUI { | |||
Class<? extends LegacyAbstractField>[] textFields = new Class[] { | |||
LegacyTextField.class, TextArea.class, RichTextArea.class, | |||
PasswordField.class }; | |||
LegacyPasswordField.class }; | |||
vl = new VerticalLayout(); | |||
hl.addComponent(vl); | |||
for (Class<? extends LegacyField> fieldClass : textFields) { |
@@ -29,8 +29,8 @@ import com.vaadin.testbench.By; | |||
import com.vaadin.testbench.elements.GridElement; | |||
import com.vaadin.testbench.elements.GridElement.GridCellElement; | |||
import com.vaadin.testbench.elements.NotificationElement; | |||
import com.vaadin.testbench.elements.PasswordFieldElement; | |||
import com.vaadin.testbench.parallel.TestCategory; | |||
import com.vaadin.tests.legacyelements.LegacyPasswordFieldElement; | |||
import com.vaadin.tests.tb3.MultiBrowserTest; | |||
@TestCategory("grid") | |||
@@ -67,7 +67,7 @@ public class GridEditorUITest extends MultiBrowserTest { | |||
@Test | |||
public void testEditor() { | |||
assertFalse("Sanity check", | |||
isElementPresent(PasswordFieldElement.class)); | |||
isElementPresent(LegacyPasswordFieldElement.class)); | |||
openEditor(5); | |||
new Actions(getDriver()).sendKeys(Keys.ESCAPE).perform(); | |||
@@ -75,7 +75,7 @@ public class GridEditorUITest extends MultiBrowserTest { | |||
openEditor(10); | |||
assertTrue("Editor should be opened with a password field", | |||
isElementPresent(PasswordFieldElement.class)); | |||
isElementPresent(LegacyPasswordFieldElement.class)); | |||
assertFalse("Notification was present", | |||
isElementPresent(NotificationElement.class)); |
@@ -1,12 +1,12 @@ | |||
/* | |||
* Copyright 2000-2014 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 |
@@ -0,0 +1,9 @@ | |||
package com.vaadin.tests.legacyelements; | |||
import com.vaadin.testbench.elements.PasswordFieldElement; | |||
import com.vaadin.testbench.elementsbase.ServerClass; | |||
@ServerClass("com.vaadin.v7.ui.LegacyPasswordField") | |||
public class LegacyPasswordFieldElement extends PasswordFieldElement { | |||
} |