/** * Add a new row to the sub goals table * * @param integer * @param subGoalsTable the flex table for the sub-goals */ private void addRowToTable( String info, String keyInfo, Integer priority, final FlexTable table, boolean isAsset) { // get the current number of rows so we know where to add the new text box int currentNumberOfRows = table.getRowCount(); // Create and add the textbox and supporting links for the mechanics of the UI final ScrollBarTextBox userInput = new ScrollBarTextBox(); userInput.setWidth("100%"); SquareHyperlink removeLink = new SquareHyperlink(messages.remove()); userInput.setName(String.valueOf(currentNumberOfRows)); userInput.setKey(keyInfo); // For tracking db id userInput.setText(info); userInput.setPriority(priority); table.setWidget(currentNumberOfRows, 0, userInput); table.setWidget(currentNumberOfRows, 1, removeLink); FlexCellFormatter formatter = table.getFlexCellFormatter(); formatter.setHorizontalAlignment(currentNumberOfRows, 0, HasHorizontalAlignment.ALIGN_LEFT); formatter.setHorizontalAlignment(currentNumberOfRows, 1, HasHorizontalAlignment.ALIGN_RIGHT); formatter.setWidth(currentNumberOfRows, 1, "10%"); if (isAsset) { this.addAssetToTable(userInput, removeLink); } else { this.addGoalToTable(userInput, removeLink); } }
@SuppressWarnings("unchecked") public void prepareDataForPostCheck() { FlexTable procsInfoTable = proceduresInfoTable.getFlexTable(); // ArrayList<String> pays = new ArrayList<String>(); // ArrayList<String> copays = new ArrayList<String>(); // ArrayList<String> adjs = new ArrayList<String>(); HashMap<String, String>[] procsMaps = new HashMap[pids.size()]; float amount = 0; for (int i = 1; i < (pids.size() + 1); i++) { procsMaps[i - 1] = new HashMap<String, String>(); // Window.alert(((TextBox)procsInfoTable.getWidget(i, // 6)).getText().toString()); TextBox adjTb = (TextBox) procsInfoTable.getWidget(i, 6); TextBox payTb = (TextBox) procsInfoTable.getWidget(i, 8); TextBox copayTb = (TextBox) procsInfoTable.getWidget(i, 9); procsMaps[i - 1].put("proc", "" + pids.get(i - 1)); if (adjTb.getText().equals("0") || adjTb.getText().equals("")) { procsMaps[i - 1].put("adj", "0"); } else { procsMaps[i - 1].put("adj", adjTb.getText()); } if (payTb.getText().equals("0") || payTb.getText().equals("")) { procsMaps[i - 1].put("pay", "0"); } else { procsMaps[i - 1].put("pay", payTb.getText()); try { float val = Float.parseFloat(payTb.getText()); amount += val; } catch (Exception e) { } } if (copayTb.getText().equals("0") || copayTb.getText().equals("")) { procsMaps[i - 1].put("copay", "0"); } else { procsMaps[i - 1].put("copay", copayTb.getText()); try { float val = Float.parseFloat(copayTb.getText()); amount += val; } catch (Exception e) { } } } float totalAmount = 0; try { totalAmount = Float.parseFloat(tbTotalAmount.getText()); } catch (Exception e) { } if (amount != totalAmount) { Window .alert(_("The total amount entered is not equal to the amounts entered in individual claims")); } else { postCheck(procsMaps); } }
public void updateRoleTotals() { int mint = 0; int maxt = 0; final int rows = roleft.getRowCount() - 2; for (int row = 0; row < rows; ++row) { TextBox minw = (TextBox) roleft.getWidget(row + 1, 1); TextBox maxw = (TextBox) roleft.getWidget(row + 1, 2); mint += Integer.parseInt(minw.getText()); maxt += Integer.parseInt(maxw.getText()); } roleft.setText(rows + 1, 1, "" + mint); roleft.setText(rows + 1, 2, "" + maxt); int size = getRaidSize(); FlexTable.FlexCellFormatter fcf = roleft.getFlexCellFormatter(); if (mint < size) { fcf.addStyleName(rows + 1, 1, "error"); } else { fcf.removeStyleName(rows + 1, 1, "error"); } if (maxt < size) { fcf.addStyleName(rows + 1, 2, "error"); } else { fcf.removeStyleName(rows + 1, 2, "error"); } updateBadgeRoles(); }
@Override public void setCityData(int i, String name, String pop, String lat, String lon) { cg.setText(i, 0, name); cg.setText(i, 1, pop); cg.setText(i, 2, lat); cg.setText(i, 3, lon); }
private void insertTableRows(final Table type, final Integer r) { final int rows = r.intValue(); if (Table.GRID.equals(type)) { final Grid grid = (Grid) table; for (int i = 0; i < rows; i++) { final Number num = new Integer(i); grid.resizeRows(i + 1); for (int j = i; j > 0; j--) { grid.setWidget(j, 0, grid.getWidget(j - 1, 0)); } grid.setWidget(0, 0, makeLabel(num)); } } else if (Table.FLEX_TABLE.equals(type)) { final FlexTable flexTable = (FlexTable) table; for (int i = 0; i < rows; i++) { final Number num = new Integer(i); flexTable.insertRow(0); flexTable.setWidget(0, 0, makeLabel(num)); } } else if (Table.OBJECT_LIST_TABLE.equals(type)) { final ObjectListTable olt = (ObjectListTable) table; for (int i = 0; i < rows; i++) { final Number num = new Integer(i); olt.getObjects().add(0, num); } } }
/** Popup the view source dialog, showing the given content. */ public static void showSource(final String content, String name) { Constants constants = GWT.create(Constants.class); int windowWidth = Window.getClientWidth() / 2; int windowHeight = Window.getClientHeight() / 2; final FormStylePopup pop = new FormStylePopup(images.viewSource(), constants.ViewingSourceFor0(name), windowWidth); String[] rows = content.split("\n"); FlexTable table = new FlexTable(); for (int i = 0; i < rows.length; i++) { table.setHTML(i, 0, "<span style='color:grey;'>" + (i + 1) + ".</span>"); table.setHTML(i, 1, "<span style='color:green;' >|</span>"); table.setHTML(i, 2, addSyntaxHilights(rows[i])); } ScrollPanel scrollPanel = new ScrollPanel(table); scrollPanel.setHeight(windowHeight + "px"); scrollPanel.setWidth(windowWidth + "px"); pop.addRow(scrollPanel); LoadingPopup.close(); pop.show(); }
private void layout(final SearchSummaryItem ssi, final int depth) { final int row = table.getRowCount(); final Image loading = new Image(GwtUtil.LOADING_ICON_URL); ssi.checkUpdate(); table.setWidget(row, iconColIdx, loading); if (ssi.isLoaded()) { ssi.renderItem(table, row, curGroupByName); GwtUtil.setStyles(loading, "visibility", "hidden"); } else { ssi.checkUpdate(); table.setWidget(row, iconColIdx, loading); Timer timer = new Timer() { public void run() { ssi.checkUpdate(); ssi.renderItem(table, row, curGroupByName); if (ssi.isLoaded()) { cancel(); GwtUtil.setStyles(loading, "visibility", "hidden"); } } }; bgList.add(timer); timer.scheduleRepeating(1000); } if (ssi.getChildren() != null && ssi.getChildren().size() > 0) { for (SearchSummaryItem child : ssi.getChildren()) { layout(child, depth + 1); } } }
public LoginViewImpl() { VerticalPanel vp = new VerticalPanel(); this.initWidget(vp); vp.setSize("100%", "100%"); FlexTable grid = new FlexTable(); grid.setStyleName(Adicionais.RESOURCES.css().login()); Label loginLabel = new Label("Login:"******"Senha:"); this.passwordTextBox = new PasswordTextBox(); this.accessButton = new Button("Acessar"); this.accessButton.setWidth("5em"); grid.setCellSpacing(6); grid.setWidget(0, 0, loginLabel); grid.setWidget(0, 1, this.loginTextBox); grid.setWidget(1, 0, passwordLabel); grid.setWidget(1, 1, this.passwordTextBox); grid.setWidget(2, 0, accessButton); grid.getFlexCellFormatter().setColSpan(2, 0, 2); grid.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); vp.add(grid); vp.setCellVerticalAlignment(grid, HasVerticalAlignment.ALIGN_MIDDLE); vp.setCellHorizontalAlignment(grid, HasHorizontalAlignment.ALIGN_CENTER); this.setSize("100%", "100%"); }
/** * Navigation Buttons to browse other pages * * @param layout * @return a table containing navigation buttons */ private FlexTable NavigationButtons(VerticalPanel layout) { FlexTable navigatorLayout = new FlexTable(); FlexCellFormatter formatterNavigator = navigatorLayout.getFlexCellFormatter(); navigatorLayout.setWidth("60%"); Button businessGoalButton = new Button(messages.businessGoalButtonLabel()); Button associateAssetsAndGoalsButton = new Button(messages.associateAssetsAndGoalsButtonLabel()); businessGoalButton.setWidth("180px"); associateAssetsAndGoalsButton.setWidth("180px"); navigatorLayout.setWidget(0, 0, businessGoalButton); navigatorLayout.setWidget(0, 1, associateAssetsAndGoalsButton); formatterNavigator.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); formatterNavigator.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT); businessGoalButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { updateBusinessGoalInformation(null); History.newItem( AssetsAndGoalsPilot.generateNavigationId(AssetsAndGoalsPilot.PageId.start)); } }); associateAssetsAndGoalsButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { updateBusinessGoalInformation(new AssociateAssetsNavigation()); } }); return navigatorLayout; }
/** removeAllRows */ private void removeAllRows() { selectedRow = -1; evaluateEnableAction(); while (folderTable.getRowCount() > 0) { folderTable.removeRow(0); } }
private FlexTable getFooter() { ft = new FlexTable(); ft.addStyleName("perunFooter"); FlexTable.FlexCellFormatter ftf = ft.getFlexCellFormatter(); if (!voContact.getHTML().isEmpty()) { // show only if any contact is present voContact.setHTML( "<strong>" + ApplicationMessages.INSTANCE.supportContact() + "</strong> " + voContact.getHTML()); } ft.setWidget(0, 0, voContact); ft.setWidget(0, 1, new HTML(PerunWebConstants.INSTANCE.footerPerunCopyright())); ftf.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); ftf.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE); ftf.getElement(0, 1).setAttribute("style", "text-wrap: avoid;"); ftf.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT); ftf.setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE); return ft; }
@Test public void click_ClickkListener_NestedWidget() { // Given clicked = false; FlexTable t = new FlexTable(); Button b = new Button("Wide Button"); b.addClickListener( new ClickListener() { public void onClick(Widget sender) { clicked = !clicked; } }); // add the button t.setWidget(0, 0, b); // Preconditions assertThat(clicked).isEqualTo(false); // When Browser.click(t.getWidget(0, 0)); // Then assertThat(clicked).isEqualTo(true); }
public TrustActionEditView( I18NAccount messages, Constants constants, HelpPanel helpPanel, Elements elements) { this.messages = messages; this.constants = constants; this.helpPanel = helpPanel; this.elements = elements; DockPanel dp = new DockPanel(); table = new FlexTable(); table.setStyleName("tableborder"); table.setText(0, 0, elements.trust()); table.setText(0, 1, elements.description()); table.setText(0, 2, elements.trust_default_desc()); table.setText(0, 3, elements.trust_actionclub()); table.setText(0, 4, elements.trust_actiontrust()); table.setText(0, 5, elements.trust_debetpost()); table.setText(0, 6, elements.trust_creditpost()); table.setText(0, 7, ""); table.getRowFormatter().setStyleName(0, "header"); newButton = new NamedButton("new_trust", elements.new_trust()); newButton.addClickHandler(this); dp.add(newButton, DockPanel.NORTH); dp.add(table, DockPanel.NORTH); idHolder = new IdHolder<String, Image>(); initWidget(dp); }
/** This will show a popup of error messages in compilation. */ public static void showBuilderErrors(BuilderResult[] results) { FormStylePopup pop = new FormStylePopup("images/package_builder.png", "Validation results"); if (results == null || results.length == 0) { pop.addRow(new HTML("<img src='images/tick_green.gif'/><i>Item validated.</i>")); } else { FlexTable errTable = new FlexTable(); errTable.setStyleName("build-Results"); for (int i = 0; i < results.length; i++) { int row = i; final BuilderResult res = results[i]; errTable.setWidget(row, 0, new Image("images/error.gif")); if (res.assetFormat.equals("package")) { errTable.setText(row, 1, "[package configuration problem] " + res.message); } else { errTable.setText(row, 1, "[" + res.assetName + "] " + res.message); } } ScrollPanel scroll = new ScrollPanel(errTable); // scroll.setAlwaysShowScrollBars(true); // scroll.setSize("100%","25em"); scroll.setWidth("100%"); // scroll.setScrollPosition( 100 ); // errTable.setWidth( "60%" ); pop.addRow(scroll); // pop.setWidth( "70%" ); // pop.setHeight( "50%" ); } pop.show(); LoadingPopup.close(); }
private void update() { // Update the older/newer buttons & label. int count = MailItems.getMailItemCount(); int max = startIndex + VISIBLE_EMAIL_COUNT; if (max > count) { max = count; } // Update the nav bar. navBar.update(startIndex, count, max); // Show the selected emails. int i = 0; for (; i < VISIBLE_EMAIL_COUNT; ++i) { // Don't read past the end. if (startIndex + i >= MailItems.getMailItemCount()) { break; } MailItem item = MailItems.getMailItem(startIndex + i); // Add a new row to the table, then set each of its columns to the // email's sender and subject values. table.setText(i, 0, item.sender); table.setText(i, 1, item.email); table.setText(i, 2, item.subject); } // Clear any remaining slots. for (; i < VISIBLE_EMAIL_COUNT; ++i) { table.removeRow(table.getRowCount() - 1); } }
public void removeIcon() { center = new Text("Switch"); switchTable.setWidget(1, 1, center); switchTable.addStyleName("screen-btn-cont"); image.setUrl(""); isOn = true; }
private void updateTable(TaskPriority priority) { // Make sure the stock is still in the stock table. if (!tasks.contains(priority.getSymbol())) { return; } int row = tasks.indexOf(priority.getSymbol()) + 1; // Format the data in the Price and Change fields. String priorityText = NumberFormat.getFormat("#,##0.00").format(priority.getPriority()); NumberFormat changeFormat = NumberFormat.getFormat("+#,##0.00;-#,##0.00"); String changeText = changeFormat.format(priority.getChange()); String changePercentText = changeFormat.format(priority.getChangePercent()); // Populate the Price and Change fields with new data. tasksFlexTable.setText(row, 1, priorityText); Label changeWidget = (Label) tasksFlexTable.getWidget(row, 2); changeWidget.setText(changeText + " (" + changePercentText + "%)"); // Change the color of text in the Change field based on its value. String changeStyleName = "noChange"; if (priority.getChangePercent() < -0.1f) { changeStyleName = "negativeChange"; } else if (priority.getChangePercent() > 0.1f) { changeStyleName = "positiveChange"; } changeWidget.setStyleName(changeStyleName); }
private ValueEditor<O> addValueEditor(boolean deleteVisible) { final ValueEditor<O> editor = getFreshValueEditor(); currentEditors.add(editor); final int rowCount = tableField.getRowCount(); tableField.setWidget(rowCount, 0, editor.asWidget()); final DeleteButton deleteButton = new DeleteButton(); deleteButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { handleDelete(editor); } }); tableField.setWidget(rowCount, 1, deleteButton); final FlexTable.FlexCellFormatter formatter = tableField.getFlexCellFormatter(); formatter.setWidth(rowCount, 0, "100%"); formatter.setVerticalAlignment(rowCount, 0, HasVerticalAlignment.ALIGN_TOP); formatter.setWidth(rowCount, 1, "30px"); formatter.getElement(rowCount, 1).getStyle().setPaddingLeft(1, Style.Unit.PX); formatter.setVerticalAlignment(rowCount, 1, HasVerticalAlignment.ALIGN_TOP); editor.addDirtyChangedHandler(dirtyChangedHandler); editor.addValueChangeHandler(valueChangeHandler); deleteButton.setVisible(deleteVisible); return editor; }
public WeeklyRecurrenceEditor() { setStyleName("weeklyRecurrencePanel"); // $NON-NLS-1$ Label l = new Label(Messages.getString("schedule.recurEveryWeek")); everyWeekOnLabel = new ErrorLabel(l); l.setStyleName("startLabel"); // $NON-NLS-1$ add(everyWeekOnLabel); FlexTable gp = new FlexTable(); gp.setCellPadding(0); gp.setCellSpacing(0); // add Sun - Wed final int ITEMS_IN_ROW = 4; for (int ii = 0; ii < ITEMS_IN_ROW; ++ii) { DayOfWeek day = DayOfWeek.get(ii); CheckBox cb = new CheckBox(Messages.getString(day.toString())); cb.setStylePrimaryName(DOW_CHECKBOX); gp.setWidget(0, ii, cb); dayToCheckBox.put(day, cb); } // Add Thur - Sat for (int ii = ITEMS_IN_ROW; ii < DayOfWeek.length(); ++ii) { DayOfWeek day = DayOfWeek.get(ii); CheckBox cb = new CheckBox(Messages.getString(day.toString())); cb.setStylePrimaryName(DOW_CHECKBOX); gp.setWidget(1, ii - 4, cb); dayToCheckBox.put(day, cb); } add(gp); configureOnChangeHandler(); }
public void onClick(ClickEvent e) { Element target = e.getNativeEvent().getEventTarget().cast(); boolean isEditing = assignmentsTable.isVisible(); if (target == btApply.getElement()) { if (isEditing) { hide(); app.getActiveEuclidianView().requestFocusInWindow(); app.storeUndoInfo(); app.getKernel().notifyRepaint(); } else { assignmentsTable.setVisible(true); checkAssignmentsTable.setVisible(false); btTest.setText(app.getPlain("Test")); btApply.setText(app.getPlain("OK")); hide(); setGlassEnabled(true); center(); } } else if (target == btTest.getElement()) { if (isEditing) { assignmentsTable.setVisible(false); checkAssignmentsTable.setVisible(true); check(); btTest.setText(app.getPlain("Check")); btApply.setText(app.getPlain("Back")); hide(); setGlassEnabled(false); center(); } else { check(); } } }
private void initTable() { // Initialize the table. table.getColumnFormatter().setWidth(1, "10em"); table.addClickHandler(this); fetchActions(); }
private void createOutputTableRowFor(FactPort factPort) { TextBox nameBox = CTextChangeHandler.createTextBox(factPort, "name"); SuggestBox typeBox = CTextChangeHandler.createTypeSuggestBox( (ServiceDesigner) factPort.getServiceScreen2().get("serviceDesigner"), factPort, "factType"); int outputNumRows = outputPortTable.getRowCount(); // add the text and suggest boxes outputPortTable.setWidget(outputNumRows, 0, nameBox); outputPortTable.setWidget(outputNumRows, 1, typeBox); // add remove button Button removePortButton = new Button("Remove postcondition"); removePortButton.setStyleName("fastButton"); RemoveOutputPortHandler outputPortHandler = new RemoveOutputPortHandler(); outputPortHandler.setFactPort(factPort); removePortButton.addClickHandler(outputPortHandler); outputPortTable.setWidget(outputNumRows, 3, removePortButton); // updateListener UpdateTransformationTabListener updateTabListener = new UpdateTransformationTabListener(); factPort.addPropertyChangeListener("name", updateTabListener); factPort.addPropertyChangeListener("factType", updateTabListener); }
private void createGUI() { getCaption().setText(app.getMenu("Exercise.CreateNew")); setWidget(mainWidget = new VerticalPanel()); addDomHandlers(mainWidget); assignmentsTable = new FlexTable(); FlexCellFormatter cellFormatter = assignmentsTable.getFlexCellFormatter(); cellFormatter.setColSpan(0, 1, 2); assignmentsTable.setWidget(0, 1, new Label(app.getPlain("Tool"))); assignmentsTable.setWidget(0, 2, new Label(app.getPlain("HintForCorrect"))); assignmentsTable.setWidget(0, 3, new Label(app.getPlain("Fraction"))); createAssignmentsTable(); checkAssignmentsTable = new FlexTable(); checkAssignmentsTable.setVisible(false); mainWidget.add(assignmentsTable); mainWidget.add(checkAssignmentsTable); addList = new UnorderedList(); addDomHandlers(addList); // addIcon = new ListItem(); Image addIcon = new Image(GuiResources.INSTANCE.menu_icon_file_new()); ListItem addListItem = new ListItem(); addListItem.addStyleName("toolbar_item"); addListItem.add(addIcon); addList.add(addListItem); userAddModes = new ToolbarSubemuW(app, 1); userAddModes.addStyleName("toolbar_item"); userAddModes.setVisible(false); for (int i = 0; i < app.getKernel().getMacroNumber(); i++) { if (!exercise.usesMacro(i)) { ListItem item = userAddModes.addItem(i + EuclidianConstants.MACRO_MODE_ID_OFFSET); addDomHandlers(item); } } addList.add(userAddModes); mainWidget.add(addList); mainWidget.add(bottomWidget = new FlowPanel()); bottomWidget.setStyleName("DialogButtonPanel"); btApply = new Button(app.getPlain("OK")); btApply.addClickHandler(this); btApply.getElement().getStyle().setMargin(3, Style.Unit.PX); addCancelButton(); btTest = new Button(app.getPlain("Test")); btTest.addClickHandler(this); btTest.getElement().getStyle().setMargin(3, Style.Unit.PX); bottomWidget.add(btTest); bottomWidget.add(btApply); // bottomWidget.add(btCancel); }
public void setData(List<String> data) { contactsTable.removeAllRows(); for (int i = 0; i < data.size(); ++i) { contactsTable.setWidget(i, 0, new CheckBox()); contactsTable.setText(i, 1, data.get(i)); } }
private void addStylesToElementsInStockList() { stocksFlexTable.getRowFormatter().addStyleName(0, "watchListHeader"); stocksFlexTable.addStyleName("watchList"); stocksFlexTable.getCellFormatter().addStyleName(0, 1, "watchListNumericColumn"); stocksFlexTable.getCellFormatter().addStyleName(0, 2, "watchListNumericColumn"); stocksFlexTable.getCellFormatter().addStyleName(0, 3, "watchListRemoveColumn"); stocksFlexTable.setCellPadding(6); }
@Override public void clear() { super.clear(); table = new FlexTable(); table.addStyleName("property-Table"); table.setCellSpacing(0); addWidget(table); }
public Position getCellPosition(Widget cell) { for (int row = 0; row < table.getRowCount(); row++) { for (int col = 0; col < table.getCellCount(row); col++) { if (cell == table.getWidget(row, col)) return new Position(row, col); } } return null; }
private void setInclude(int row, boolean include) { if (includeTargetColumn) { ((Image) table.getWidget(row, ARROW_COLUMN)) .setResource(include ? Resources.INSTANCE.arrow() : Resources.INSTANCE.arrowDisabled()); widgetProvider.include(table.getWidget(row, TARGET_COLUMN), include); } ((DefinitionPanel) table.getWidget(row, DEFINITION_COLUMN)).setEnabled(include); }
private void addColumn(Object columnHeading) { Widget widget = createCellWidget(columnHeading); int cell = flexTable.getCellCount(HEADER_ROW_INDEX); widget.setWidth("100%"); widget.addStyleName("FlexTable-ColumnLabel"); flexTable.setWidget(HEADER_ROW_INDEX, cell, widget); flexTable.getCellFormatter().addStyleName(HEADER_ROW_INDEX, cell, "FlexTable-ColumnLabelCell"); }
private void createInputTableRowFor(FactPort factPort) { if (longExampleValues) { TextBox nameBox = CTextChangeHandler.createTextBox(factPort, "name"); SuggestBox typeBox = CTextChangeHandler.createTypeSuggestBox( (ServiceDesigner) factPort.getServiceScreen().get("serviceDesigner"), factPort, "factType"); TextArea exampleArea = CTextChangeHandler.createTextArea(factPort, "10cm", "8cm", "exampleValue"); int inputNumRows = inputPortTable.getRowCount(); inputPortTable.getRowFormatter().addStyleName(inputNumRows, "FindStyleForAlignTop"); // add the text and suggest boxes inputPortTable.setWidget(inputNumRows, 0, nameBox); inputPortTable.setWidget(inputNumRows, 1, typeBox); inputPortTable.setWidget(inputNumRows, 2, exampleArea); // add remove button Button removePortButton = new Button("Remove precondition"); removePortButton.setStyleName("fastButton"); RemoveInputPortHandler inputPortHandler = new RemoveInputPortHandler(); inputPortHandler.setFactPort(factPort); removePortButton.addClickHandler(inputPortHandler); inputPortTable.setWidget(inputNumRows, 3, removePortButton); // updateListener UpdateTransformationTabListener updateTabListener = new UpdateTransformationTabListener(); factPort.addPropertyChangeListener("name", updateTabListener); factPort.addPropertyChangeListener("factType", updateTabListener); factPort.addPropertyChangeListener("exampleValue", updateTabListener); } else { TextBox nameBox = CTextChangeHandler.createTextBox(factPort, "name"); SuggestBox typeBox = CTextChangeHandler.createTypeSuggestBox( (ServiceDesigner) factPort.getServiceScreen().get("serviceDesigner"), factPort, "factType"); TextBox exampleBox = CTextChangeHandler.createTextBox(factPort, "exampleValue"); int inputNumRows = inputPortTable.getRowCount(); // add the text and suggest boxes inputPortTable.setWidget(inputNumRows, 0, nameBox); inputPortTable.setWidget(inputNumRows, 1, typeBox); inputPortTable.setWidget(inputNumRows, 2, exampleBox); // add remove button Button removePortButton = new Button("Remove precondition"); removePortButton.setStyleName("fastButton"); RemoveInputPortHandler inputPortHandler = new RemoveInputPortHandler(); inputPortHandler.setFactPort(factPort); removePortButton.addClickHandler(inputPortHandler); inputPortTable.setWidget(inputNumRows, 3, removePortButton); } }