List of usage examples for com.google.gwt.user.client.ui ValueListBox ValueListBox
ValueListBox
From source file:org.jboss.errai.demo.grocery.client.local.ValueListBoxProducer.java
License:Apache License
@Produces public ValueListBox<Integer> createValueListBox() { Collection<Integer> values = new ArrayList<Integer>(); values.add(Integer.valueOf(1)); values.add(Integer.valueOf(2)); values.add(Integer.valueOf(5)); values.add(Integer.valueOf(10)); values.add(Integer.valueOf(25)); final ValueListBox<Integer> radiusPicker = new ValueListBox<Integer>(); radiusPicker.setValue(Integer.valueOf(25)); radiusPicker.setAcceptableValues(values); return radiusPicker; }
From source file:org.kaaproject.kaa.sandbox.web.client.mvp.view.settings.ChangeKaaHostViewImpl.java
License:Apache License
@Override protected void initCenterPanel() { VerticalPanel mainPanel = new VerticalPanel(); mainPanel.getElement().getStyle().setWidth(75, Unit.PCT); CaptionPanel kaaHostPanel = new CaptionPanel(Utils.constants.kaaHostIp()); kaaHostPanel.setWidth(FULL_WIDTH);//from w ww . j a va2 s . com kaaHostPanel.getElement().getStyle().setMarginBottom(20, Unit.PX); changeHostPanel = new FlexTable(); changeHostPanel.setCellSpacing(10); changeHostPanel.getColumnFormatter().setWidth(0, "230px"); changeHostPanel.getColumnFormatter().setWidth(1, "150px"); changeHostPanel.getColumnFormatter().setWidth(2, FULL_WIDTH); int row = 0; String changeHostMessage = "<div>" + Utils.messages.changeKaaHostMessagePt1() + " <b><span id=ip></span></b>" + ".<br>" + Utils.messages.changeKaaHostMessagePt2() + "</div>"; HTMLPanel changeKaaHostHtmlPanel = new HTMLPanel(changeHostMessage); ipSpan = changeKaaHostHtmlPanel.getElementById("ip"); changeKaaHostHtmlPanel.addStyleName(Utils.sandboxStyle.descriptionLabel()); changeKaaHostHtmlPanel.getElement().getStyle().setProperty("textAlign", "justify"); changeKaaHostHtmlPanel.getElement().getStyle().setMarginBottom(20, Unit.PX); changeHostPanel.setWidget(row, 0, changeKaaHostHtmlPanel); changeHostPanel.getFlexCellFormatter().setColSpan(row++, 0, 3); kaaHost = new TextBox(); kaaHost.setWidth("200px"); kaaHost.getElement().getStyle().setMarginRight(20, Unit.PX); changeHostPanel.setWidget(row, 0, kaaHost); changeKaaHostButton = new Button(Utils.constants.update()); changeHostPanel.setWidget(row, 1, changeKaaHostButton); kaaHostPanel.add(changeHostPanel); mainPanel.add(kaaHostPanel); CaptionPanel kaaLogsPanel = new CaptionPanel(Utils.constants.kaaServerLogs()); kaaLogsPanel.setWidth(FULL_WIDTH); logsPanel = new FlexTable(); logsPanel.setCellSpacing(10); logsPanel.getColumnFormatter().setWidth(0, "100px"); logsPanel.getColumnFormatter().setWidth(1, "20px"); logsPanel.getColumnFormatter().setWidth(2, "110px"); logsPanel.getColumnFormatter().setWidth(3, "150px"); logsPanel.getColumnFormatter().setWidth(4, FULL_WIDTH); row = 0; HTML getLogsLabel = new HTML(Utils.messages.logsMessage()); getLogsLabel.addStyleName(Utils.sandboxStyle.descriptionLabel()); getLogsLabel.getElement().getStyle().setProperty("textAlign", "justify"); getLogsLabel.getElement().getStyle().setPaddingBottom(20, Style.Unit.PX); logsPanel.setWidget(row, 0, getLogsLabel); logsPanel.getFlexCellFormatter().setColSpan(row++, 0, 5); levelListBox = new ValueListBox<>(); levelListBox.setWidth("100px"); for (LogLevel level : LogLevel.values()) { levelListBox.setValue(level); } logsPanel.setWidget(row, 0, levelListBox); oldLogsCheckBox = new CheckBox(); oldLogsCheckBox.setWidth("20px"); oldLogsCheckBox.addStyleName(Utils.avroUiStyle.legendCheckBox()); logsPanel.setWidget(row, 1, oldLogsCheckBox); HTML checkBoxLabel = new HTML(Utils.constants.cleanUpOldLogfiles()); checkBoxLabel.addStyleName(Utils.avroUiStyle.legendCheckBox()); checkBoxLabel.setWidth("90px"); logsPanel.setWidget(row, 2, checkBoxLabel); changeLogLevelButton = new Button(Utils.constants.update()); logsPanel.setWidget(row++, 3, changeLogLevelButton); getLogsButton = new Button(Utils.constants.downloadLogs()); getLogsButton.getElement().getStyle().setMarginTop(20, Unit.PX); logsPanel.setWidget(row, 0, getLogsButton); logsPanel.getFlexCellFormatter().setColSpan(row, 0, 5); kaaLogsPanel.add(logsPanel); mainPanel.add(kaaLogsPanel); detailsPanel.add(mainPanel); }
From source file:org.kaaproject.kaa.server.admin.client.mvp.view.application.ApplicationViewImpl.java
License:Apache License
@Override protected void initDetailsTable() { applicationName = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE, editable); applicationName.setWidth("100%"); Label titleLabel = new Label(Utils.constants.title()); if (editable) { titleLabel.addStyleName(avroUiStyle.requiredField()); }//from www .ja v a2 s .com detailsTable.setWidget(0, 0, titleLabel); detailsTable.setWidget(0, 1, applicationName); applicationName.addInputHandler(this); applicationName.setFocus(true); // applicationKey = new SizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, editable); // applicationKey.setWidth("100%"); // // Label keyLabel = new Label(Utils.constants.publicKey()); // detailsTable.setWidget(1, 0, keyLabel); // detailsTable.setWidget(1, 1, applicationKey); if (!create) { applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, editable); applicationToken.setWidth("100%"); applicationToken.setEnabled(false); Label tokenLabel = new Label(Utils.constants.appToken()); detailsTable.setWidget(2, 0, tokenLabel); detailsTable.setWidget(2, 1, applicationToken); } // applicationKey.addInputHandler(this); if (KaaAdmin.isDevMode()) { generateSdkButton = new Button(Utils.constants.generateSdk()); detailsTable.setWidget(3, 0, generateSdkButton); } else { this.credentialsServiceName = new ValueListBox<String>(); this.credentialsServiceName.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { ApplicationViewImpl.this.fireChanged(); } }); this.credentialsServiceName.setWidth("100%"); Label label = new Label(Utils.constants.credentialsService()); label.addStyleName(this.avroUiStyle.requiredField()); this.detailsTable.setWidget(3, 0, label); this.detailsTable.setWidget(3, 1, this.credentialsServiceName); } }
From source file:org.kaaproject.kaa.server.admin.client.mvp.view.event.EventClassViewImpl.java
License:Apache License
@Override protected void initDetailsTable() { super.initDetailsTable(); this.eventClassTypeName = new ValueListBox<String>(); this.eventClassTypeName.addValueChangeHandler(new ValueChangeHandler<String>() { @Override/*from www. j av a2 s. c o m*/ public void onValueChange(ValueChangeEvent<String> event) { EventClassViewImpl.this.fireChanged(); } }); this.eventClassTypeName.setWidth("100%"); Label label = new Label("Class type"); label.addStyleName(this.avroUiStyle.requiredField()); detailsTable.setWidget(4, 0, label); this.detailsTable.setWidget(4, 1, this.eventClassTypeName); }