本文整理匯總了Java中com.vaadin.ui.TextField.setCaption方法的典型用法代碼示例。如果您正苦於以下問題:Java TextField.setCaption方法的具體用法?Java TextField.setCaption怎麽用?Java TextField.setCaption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.TextField
的用法示例。
在下文中一共展示了TextField.setCaption方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final TextField name = new TextField();
name.setCaption("Type your name here:");
Button button = new Button("Click Me");
button.addClickListener(e -> {
layout.addComponent(new Label("Thanks " + name.getValue() + ", it works!"));
});
layout.addComponents(name, button);
setContent(layout);
}
示例2: getSecurityTokenLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
private HorizontalLayout getSecurityTokenLayout(final String securityToken) {
final HorizontalLayout securityTokenLayout = new HorizontalLayout();
final Label securityTableLbl = new Label(
SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")),
ContentMode.HTML);
securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
securityTableLbl.addStyleName("label-style");
final TextField securityTokentxt = new TextField();
securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY);
securityTokentxt.addStyleName("targetDtls-securityToken");
securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE);
securityTokentxt.setCaption(null);
securityTokentxt.setNullRepresentation("");
securityTokentxt.setValue(securityToken);
securityTokentxt.setReadOnly(true);
securityTokenLayout.addComponent(securityTableLbl);
securityTokenLayout.addComponent(securityTokentxt);
return securityTokenLayout;
}
示例3: enter
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
final TextField name = new TextField();
name.setCaption("Type your name here:");
Button button = new Button("Click Me");
button.addClickListener(e -> addComponent(new Label("Thanks " + name.getValue() + ", it works!")));
addComponents(name, button);
}
示例4: generateUi
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
/**
* Diese Methode erstellt das UI, bestehend aus Inputfeld für Projektname und
* Projektbeschreibung.
*
* @author Marco Glaser
*/
public void generateUi(){
setWidth(95, UNITS_PERCENTAGE);
setHeight(SIZE_UNDEFINED, 0);
setStyleName("projectCreationLayout");
projectNameInput = new TextField();
projectDescriptionInput = new TextArea();
gap = new Label();
secondGap = new Label();
projectNameInput.setWidth(80, UNITS_PERCENTAGE);
// projectNameInput.setHeight(30, UNITS_PIXELS);
projectNameInput.setStyleName("projectNameInput");
projectDescriptionInput.setWidth(80, UNITS_PERCENTAGE);
projectDescriptionInput.setHeight(300, UNITS_PIXELS);
projectDescriptionInput.setStyleName("projectNameInput");
gap.setHeight("20px");
secondGap.setSizeFull();
projectNameInput.setValue("Geben Sie hier den Projektnamen ein.");
projectDescriptionInput.setValue("Geben Sie hier eine Beschreibung des Projekts ein.");
addComponent(projectNameInput);
addComponent(gap);
addComponent(projectDescriptionInput);
projectNameInput.setCaption("Projektname");
projectNameInput.setValue("Geben Sie hier den Projektnamen ein.");
projectDescriptionInput.setCaption("Projektbeschreibung");
projectDescriptionInput.setValue("Geben Sie hier eine Projektbeschreibung ein");
// addComponent(secondGap);
// setExpandRatio(secondGap, 1.0f);
}
示例5: buildVerticalLayout_2
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
// common part: create layout
verticalLayout_2 = new VerticalLayout();
verticalLayout_2.setImmediate(false);
verticalLayout_2.setWidth("100.0%");
verticalLayout_2.setHeight("100.0%");
verticalLayout_2.setMargin(false);
verticalLayout_2.setSpacing(true);
// textFieldTestInput
textFieldTestInput = new TextField();
textFieldTestInput.setCaption("Value");
textFieldTestInput.setImmediate(true);
textFieldTestInput.setDescription("Enter a value to test against.");
textFieldTestInput.setWidth("-1px");
textFieldTestInput.setHeight("-1px");
textFieldTestInput.setInputPrompt("eg. 50");
verticalLayout_2.addComponent(textFieldTestInput);
// buttonValidate
buttonValidate = new Button();
buttonValidate.setCaption("Test");
buttonValidate.setImmediate(true);
buttonValidate
.setDescription("Click to test if value is within the range.");
buttonValidate.setWidth("-1px");
buttonValidate.setHeight("-1px");
verticalLayout_2.addComponent(buttonValidate);
verticalLayout_2.setComponentAlignment(buttonValidate,
new Alignment(48));
return verticalLayout_2;
}
示例6: buildHorizontalLayout_2
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
// common part: create layout
horizontalLayout_2 = new HorizontalLayout();
horizontalLayout_2.setImmediate(false);
horizontalLayout_2.setWidth("-1px");
horizontalLayout_2.setHeight("-1px");
horizontalLayout_2.setMargin(false);
horizontalLayout_2.setSpacing(true);
// comboBoxMax
comboBoxMax = new ComboBox();
comboBoxMax.setCaption("Maximum Type");
comboBoxMax.setImmediate(true);
comboBoxMax.setDescription("Select the type for the maximum.");
comboBoxMax.setWidth("-1px");
comboBoxMax.setHeight("-1px");
horizontalLayout_2.addComponent(comboBoxMax);
// textFieldMax
textFieldMax = new TextField();
textFieldMax.setCaption("Maximum Value");
textFieldMax.setImmediate(true);
textFieldMax.setDescription("Enter a value for the maxmum.");
textFieldMax.setWidth("-1px");
textFieldMax.setHeight("-1px");
textFieldMax.setInvalidAllowed(false);
textFieldMax.setInputPrompt("eg. 100");
horizontalLayout_2.addComponent(textFieldMax);
return horizontalLayout_2;
}
示例7: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textFieldID
textFieldID = new TextField();
textFieldID.setCaption("Variable ID");
textFieldID.setImmediate(false);
textFieldID.setWidth("-1px");
textFieldID.setHeight("-1px");
textFieldID.setInvalidAllowed(false);
textFieldID.setRequired(true);
textFieldID.setNullRepresentation("");
mainLayout.addComponent(textFieldID);
// buttonSave
buttonSave = new Button();
buttonSave.setCaption("Save and Continue");
buttonSave.setImmediate(false);
buttonSave.setWidth("-1px");
buttonSave.setHeight("-1px");
mainLayout.addComponent(buttonSave);
mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
return mainLayout;
}
示例8: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textFieldFilename
textFieldFilename = new TextField();
textFieldFilename.setCaption("Policy File Name");
textFieldFilename.setImmediate(false);
textFieldFilename.setWidth("-1px");
textFieldFilename.setHeight("-1px");
mainLayout.addComponent(textFieldFilename);
// buttonSave
buttonSave = new Button();
buttonSave.setCaption("Save");
buttonSave.setImmediate(false);
buttonSave.setWidth("-1px");
buttonSave.setHeight("-1px");
mainLayout.addComponent(buttonSave);
mainLayout.setComponentAlignment(buttonSave, new Alignment(24));
return mainLayout;
}
示例9: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textFieldColumn
textFieldColumn = new TextField();
textFieldColumn.setCaption("Column");
textFieldColumn.setImmediate(false);
textFieldColumn.setDescription("0-based index into CSV line");
textFieldColumn.setWidth("-1px");
textFieldColumn.setHeight("-1px");
textFieldColumn.setRequired(true);
textFieldColumn.setInputPrompt("Eg. ‘0'");
mainLayout.addComponent(textFieldColumn);
// buttonSave
buttonSave = new Button();
buttonSave.setCaption("Save");
buttonSave.setImmediate(false);
buttonSave.setWidth("-1px");
buttonSave.setHeight("-1px");
mainLayout.addComponent(buttonSave);
mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
return mainLayout;
}
示例10: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private FormLayout buildMainLayout() {
// common part: create layout
mainLayout = new FormLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textFieldSubdomain
textFieldSubdomain = new TextField();
textFieldSubdomain.setCaption("Enter Sub Domain");
textFieldSubdomain.setImmediate(false);
textFieldSubdomain
.setDescription("You can enter sub domain name - do not use spaces or wildcard characters.");
textFieldSubdomain.setWidth("-1px");
textFieldSubdomain.setHeight("-1px");
textFieldSubdomain.setInvalidAllowed(false);
textFieldSubdomain
.setInputPrompt("Examples: sales hr business marketing.");
mainLayout.addComponent(textFieldSubdomain);
mainLayout.setExpandRatio(textFieldSubdomain, 1.0f);
// buttonSave
buttonSave = new Button();
buttonSave.setCaption("Save");
buttonSave.setImmediate(true);
buttonSave.setWidth("-1px");
buttonSave.setHeight("-1px");
mainLayout.addComponent(buttonSave);
mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
return mainLayout;
}
示例11: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textFieldExpression
textFieldExpression = new TextField();
textFieldExpression.setCaption("Regular Expression");
textFieldExpression.setImmediate(true);
textFieldExpression
.setDescription("Create a regular expression used to constrain attribute values.");
textFieldExpression.setWidth("-1px");
textFieldExpression.setHeight("-1px");
textFieldExpression.setInvalidAllowed(false);
textFieldExpression.setInputPrompt("eg. [a-zA-Z0-9]");
mainLayout.addComponent(textFieldExpression);
mainLayout.setExpandRatio(textFieldExpression, 1.0f);
// panelTester
panelTester = buildPanelTester();
mainLayout.addComponent(panelTester);
mainLayout.setExpandRatio(panelTester, 1.0f);
return mainLayout;
}
示例12: addVoltronCommandsControls
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
private void addVoltronCommandsControls() {
serverControls = new GridLayout();
serverControls.setWidth(50, Unit.PERCENTAGE);
voltronControlLayout.addComponentsAndExpand(serverControls);
HorizontalLayout row1 = new HorizontalLayout();
Button clusterStartBtn = new Button();
clusterStartBtn.setCaption("Start all servers");
clusterStartBtn.addStyleName("align-bottom");
clusterStartBtn.addClickListener(event -> {
for (Component child : serverControls) {
if (child instanceof Button && "START".equals(child.getCaption()) && child.isEnabled()) {
((Button) child).click();
}
}
});
row1.addComponents(clusterStartBtn);
if (kitAwareClassLoaderDelegator.isEEKit()) {
clusterNameTF = new TextField();
clusterNameTF.setCaption("Cluster name");
clusterNameTF.setValue("MyCluster");
Button clusterConfigBtn = new Button();
clusterConfigBtn.addStyleName("align-bottom");
clusterConfigBtn.setCaption("Configure");
clusterConfigBtn.setData("configure");
clusterConfigBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);
Button clusterReConfigBtn = new Button();
clusterReConfigBtn.addStyleName("align-bottom");
clusterReConfigBtn.setCaption("Reconfigure");
clusterReConfigBtn.setData("reconfigure");
clusterReConfigBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);
Button clusterBackupBtn = new Button();
clusterBackupBtn.addStyleName("align-bottom");
clusterBackupBtn.setCaption("Backup");
clusterBackupBtn.setData("backup");
clusterBackupBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);
Button clusterDumpBtn = new Button();
clusterDumpBtn.addStyleName("align-bottom");
clusterDumpBtn.setCaption("Dump");
clusterDumpBtn.setData("dump");
clusterDumpBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);
Button clusterStopBtn = new Button();
clusterStopBtn.addStyleName("align-bottom");
clusterStopBtn.setCaption("Stop cluster");
clusterStopBtn.setData("stop");
clusterStopBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);
row1.addComponents(clusterNameTF, clusterConfigBtn, clusterReConfigBtn, clusterBackupBtn, clusterDumpBtn, clusterStopBtn);
}
voltronControlLayout.addComponentsAndExpand(row1);
consoles = new TabSheet();
mainConsole = addConsole("Main", "main");
voltronControlLayout.addComponentsAndExpand(consoles);
}
示例13: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(false);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// comboBoxConnectionType
comboBoxConnectionType = new ComboBox();
comboBoxConnectionType.setCaption("Type of SQL Connection");
comboBoxConnectionType.setImmediate(false);
comboBoxConnectionType.setWidth("-1px");
comboBoxConnectionType.setHeight("-1px");
mainLayout.addComponent(comboBoxConnectionType);
// textFieldDataSource
textFieldDataSource = new TextField();
textFieldDataSource.setCaption("Data Source");
textFieldDataSource.setImmediate(false);
textFieldDataSource.setWidth("-1px");
textFieldDataSource.setHeight("-1px");
mainLayout.addComponent(textFieldDataSource);
mainLayout.setExpandRatio(textFieldDataSource, 1.0f);
// comboBoxSQLDriver
comboBoxSQLDriver = new ComboBox();
comboBoxSQLDriver.setCaption("JDBC Driver");
comboBoxSQLDriver.setImmediate(false);
comboBoxSQLDriver.setWidth("-1px");
comboBoxSQLDriver.setHeight("-1px");
mainLayout.addComponent(comboBoxSQLDriver);
mainLayout.setExpandRatio(comboBoxSQLDriver, 1.0f);
// textFieldConnectionURL
textFieldConnectionURL = new TextField();
textFieldConnectionURL.setCaption("Connection URL");
textFieldConnectionURL.setImmediate(false);
textFieldConnectionURL.setWidth("-1px");
textFieldConnectionURL.setHeight("-1px");
mainLayout.addComponent(textFieldConnectionURL);
mainLayout.setExpandRatio(textFieldConnectionURL, 1.0f);
// textFieldUser
textFieldUser = new TextField();
textFieldUser.setCaption("User");
textFieldUser.setImmediate(false);
textFieldUser.setWidth("-1px");
textFieldUser.setHeight("-1px");
mainLayout.addComponent(textFieldUser);
mainLayout.setExpandRatio(textFieldUser, 1.0f);
// textFieldPassword
textFieldPassword = new PasswordField();
textFieldPassword.setCaption("Password");
textFieldPassword.setImmediate(false);
textFieldPassword.setWidth("-1px");
textFieldPassword.setHeight("-1px");
mainLayout.addComponent(textFieldPassword);
mainLayout.setExpandRatio(textFieldPassword, 1.0f);
// buttonTest
buttonTest = new Button();
buttonTest.setCaption("Test Connection");
buttonTest.setImmediate(true);
buttonTest.setWidth("-1px");
buttonTest.setHeight("-1px");
mainLayout.addComponent(buttonTest);
mainLayout.setComponentAlignment(buttonTest, new Alignment(48));
return mainLayout;
}
示例14: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textFieldObligationID
textFieldObligationID = new TextField();
textFieldObligationID.setCaption("Obligation ID");
textFieldObligationID.setImmediate(false);
textFieldObligationID.setWidth("-1px");
textFieldObligationID.setHeight("-1px");
textFieldObligationID.setInvalidAllowed(false);
textFieldObligationID.setRequired(true);
textFieldObligationID.setInputPrompt("Eg. urn:com:foo:obligation:sample");
mainLayout.addComponent(textFieldObligationID);
// optionGroupFullfillOn
optionGroupFullfillOn = new OptionGroup();
optionGroupFullfillOn.setCaption("Fulfill On");
optionGroupFullfillOn.setImmediate(false);
optionGroupFullfillOn.setWidth("-1px");
optionGroupFullfillOn.setHeight("-1px");
optionGroupFullfillOn.setInvalidAllowed(false);
optionGroupFullfillOn.setRequired(true);
mainLayout.addComponent(optionGroupFullfillOn);
// buttonSave
buttonSave = new Button();
buttonSave.setCaption("Save");
buttonSave.setImmediate(true);
buttonSave.setWidth("-1px");
buttonSave.setHeight("-1px");
mainLayout.addComponent(buttonSave);
mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
return mainLayout;
}
示例15: buildMainLayout
import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// textAreaSelect
textAreaSelect = new TextArea();
textAreaSelect.setCaption("SQL Select Statement");
textAreaSelect.setImmediate(false);
textAreaSelect.setWidth("100.0%");
textAreaSelect.setHeight("-1px");
textAreaSelect.setInvalidAllowed(false);
textAreaSelect.setRequired(true);
mainLayout.addComponent(textAreaSelect);
mainLayout.setExpandRatio(textAreaSelect, 1.0f);
// textFieldBase
textFieldBase = new TextField();
textFieldBase.setCaption("Base DN");
textFieldBase.setImmediate(false);
textFieldBase.setWidth("-1px");
textFieldBase.setHeight("-1px");
mainLayout.addComponent(textFieldBase);
// textFieldFilter
textFieldFilter = new TextField();
textFieldFilter.setCaption("Filter");
textFieldFilter.setImmediate(false);
textFieldFilter.setWidth("-1px");
textFieldFilter.setHeight("-1px");
mainLayout.addComponent(textFieldFilter);
// checkBoxShortIds
checkBoxShortIds = new CheckBox();
checkBoxShortIds.setCaption("Display short id’s.");
checkBoxShortIds.setImmediate(false);
checkBoxShortIds.setWidth("-1px");
checkBoxShortIds.setHeight("-1px");
mainLayout.addComponent(checkBoxShortIds);
// tableRequiredAttributes
tableRequiredAttributes = new Table();
tableRequiredAttributes.setCaption("Attributes Returned");
tableRequiredAttributes.setImmediate(false);
tableRequiredAttributes.setWidth("-1px");
tableRequiredAttributes.setHeight("-1px");
mainLayout.addComponent(tableRequiredAttributes);
// tableAttributes
tableAttributes = new Table();
tableAttributes.setCaption("Parameters - Attributes Needed (i.e. ?)");
tableAttributes.setImmediate(false);
tableAttributes.setWidth("-1px");
tableAttributes.setHeight("-1px");
tableAttributes.setInvalidAllowed(false);
tableAttributes.setRequired(true);
mainLayout.addComponent(tableAttributes);
return mainLayout;
}