本文整理匯總了Java中com.google.gwt.user.client.ui.PasswordTextBox.ensureDebugId方法的典型用法代碼示例。如果您正苦於以下問題:Java PasswordTextBox.ensureDebugId方法的具體用法?Java PasswordTextBox.ensureDebugId怎麽用?Java PasswordTextBox.ensureDebugId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.PasswordTextBox
的用法示例。
在下文中一共展示了PasswordTextBox.ensureDebugId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInitialize
import com.google.gwt.user.client.ui.PasswordTextBox; //導入方法依賴的package包/類
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a panel to layout the widgets
VerticalPanel vpanel = new VerticalPanel();
vpanel.setSpacing(5);
// Add a normal and disabled text box
TextBox normalText = new TextBox();
normalText.ensureDebugId("cwBasicText-textbox");
// Set the normal text box to automatically adjust its direction according
// to the input text. Use the Any-RTL heuristic, which sets an RTL direction
// iff the text contains at least one RTL character.
normalText.setDirectionEstimator(AnyRtlDirectionEstimator.get());
TextBox disabledText = new TextBox();
disabledText.ensureDebugId("cwBasicText-textbox-disabled");
disabledText.setText(constants.cwBasicTextReadOnly());
disabledText.setEnabled(false);
vpanel.add(new HTML(constants.cwBasicTextNormalLabel()));
vpanel.add(createTextExample(normalText, true));
vpanel.add(createTextExample(disabledText, false));
// Add a normal and disabled password text box
PasswordTextBox normalPassword = new PasswordTextBox();
normalPassword.ensureDebugId("cwBasicText-password");
PasswordTextBox disabledPassword = new PasswordTextBox();
disabledPassword.ensureDebugId("cwBasicText-password-disabled");
disabledPassword.setText(constants.cwBasicTextReadOnly());
disabledPassword.setEnabled(false);
vpanel.add(new HTML("<br><br>" + constants.cwBasicTextPasswordLabel()));
vpanel.add(createTextExample(normalPassword, true));
vpanel.add(createTextExample(disabledPassword, false));
// Add a text area
TextArea textArea = new TextArea();
textArea.ensureDebugId("cwBasicText-textarea");
textArea.setVisibleLines(5);
vpanel.add(new HTML("<br><br>" + constants.cwBasicTextAreaLabel()));
vpanel.add(createTextExample(textArea, true));
// Return the panel
return vpanel;
}