@Override public void execute(final ActionEvent event) { String selectedOption = (String) dropdown.getSelected(); info.setText(selectedOption); } });
@Override public void execute(final ActionEvent event) { StringBuffer buf = new StringBuffer(preface); buf.append("\n"); for (Object selected : table.getSelectedRows()) { // The Model uses the "bean" as the key PersonBean person = (PersonBean) selected; buf.append(person.toString()).append('\n'); } selectionText.setText(buf.toString()); } };
@Override public void execute(final ActionEvent event) { StringBuffer buf = new StringBuffer(preface); buf.append("\n"); for (Object selected : wTable.getSelectedRows()) { // The Model uses the "bean" as the key PersonBean person = (PersonBean) selected; buf.append(person.toString()).append("\n"); } selectionText.setText(buf.toString()); } };
@Override public void execute(final ActionEvent event) { StringBuffer buf = new StringBuffer("Selection:\n"); for (int row : table.getSelectedRows()) { buf.append(table.getDataModel().getValueAt(row, 0)) .append(' ') .append(table.getDataModel().getValueAt(row, 1)) .append('\n'); } selectionText.setText(buf.toString()); } });
@Override public void execute(final ActionEvent event) { styled.reset(); styled.setType((WStyledText.Type) type.getSelected()); styled.setWhitespaceMode((WStyledText.WhitespaceMode) mode.getSelected()); styled.setText(text.getText()); styled.setHtmlClass(useBigTextClass.isSelected() ? "bigText" : null); styled.setEncodeText(cbEncodeText.isSelected()); // text.setRichTextArea(cbEncodeText.isSelected()); } });
styledText.setText("abc\ndef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\rdef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\r\ndef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\n\rdef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\n\ndef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\r\rdef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\r\n\r\ndef"); assertSchemaMatch(styledText); assertInnerTextEquals("abc<ui:nl/>def", styledText); styledText.setText("abc\n\r\r\ndef");
/** * Builds a panel for the subordinate control, including the rule for that particular option. * * @param dropdown the subordinate trigger. * @param value the dropdown option to be added * @param group the group * @param control the subordinate control */ private void buildSubordinatePanel(final WDropdown dropdown, final String value, final WComponentGroup<SubordinateTarget> group, final WSubordinateControl control) { // create the panel. WPanel panel = new WPanel(); WStyledText subordinateInfo = new WStyledText(); subordinateInfo.setWhitespaceMode(WhitespaceMode.PRESERVE); subordinateInfo.setText(value + " - Subordinate"); panel.add(subordinateInfo); // add the panel to the screen and group. infoPanel.add(panel); group.addToGroup(panel); // create the rule Rule rule = new Rule(); control.addRule(rule); rule.setCondition(new Equal(dropdown, value)); rule.addActionOnTrue(new ShowInGroup(panel, group)); }