public TextBoxWithPopupEditorFw(FDesc fielddescriptor, WidgetRDesc wrDesc) { super(fielddescriptor); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); textBox = new TextBox(); updateWidth(wrDesc); panel.add(textBox); panel.add(showPopupLabel); initWidget(panel); showPopupLabel.getElement().getStyle().setCursor(Cursor.POINTER); showPopupLabel.getElement().getStyle().setTextDecoration(TextDecoration.UNDERLINE); showPopupLabel.getElement().getStyle().setMarginLeft(6, Unit.PX); showPopupLabel.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP); showPopupLabel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { showPopup(); } }); }
private void updateTableRow(final PlayerErrorInfo item, int row) { bodyFlexTable.setText(row, 0, item.getTimestamp()); bodyFlexTable.getFlexTable().getCellFormatter().getElement(row, 0).getStyle().setVerticalAlign(VerticalAlign.TOP); bodyFlexTable.getFlexTable().getCellFormatter().getElement(row, 0).getStyle().setLineHeight(16, Unit.PX); String errorString = // Integer.toString(item.getStatusCode()) + " - " + item.getErrorMessage(); if (item.getStatusCode() != 0 && (errorRow == -1 || (item.getStatusCode() == 1 && row == 0))) { errorString += " Click <a href='" + item.getHelpLink() + "' target='_blank'>here</a> for details on this error."; } bodyFlexTable.setHTML(row, 1, errorString); // if (errorRow == -1 || (item.getStatusCode() == 1 && row == 0)) { // bodyFlexTable.getFlexTable().getCellFormatter().getElement(row, 1).getStyle().setColor("red"); // } bodyFlexTable.getFlexTable().getCellFormatter().getElement(row, 1).getStyle().setWhiteSpace(WhiteSpace.NORMAL); bodyFlexTable.getFlexTable().getCellFormatter().getElement(row, 1).getStyle().setLineHeight(16, Unit.PX); }
private void populate(GwtRpcResponseList<ChangeLogInterface> logs) { List<UniTimeTableHeader> header = new ArrayList<UniTimeTableHeader>(); header.add(new UniTimeTableHeader(MESSAGES.colDate(), clickHandler(0))); header.add(new UniTimeTableHeader(MESSAGES.colAcademicSession(), clickHandler(1))); header.add(new UniTimeTableHeader(MESSAGES.colManager(), clickHandler(2))); header.add(new UniTimeTableHeader(MESSAGES.colNote(), clickHandler(3))); iChanges.addRow(null, header); for (ChangeLogInterface log: logs) { List<Widget> line = new ArrayList<Widget>(); line.add(new Label(sDateFormat.format(log.getDate()), false)); line.add(new Label(log.getSession(), false)); line.add(new HTML(log.getManager() == null ? "<i>" + MESSAGES.notApplicable() + "</i>" : log.getManager(), false)); HTML note = new HTML(log.getObject() == null || log.getObject().isEmpty() || "-".equals(log.getObject()) ? "<i>" + MESSAGES.emptyNote() + "</i>" : log.getObject()); note.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP); line.add(note); iChanges.addRow(log, line); iChanges.getRowFormatter().setVerticalAlign(iChanges.getRowCount() - 1, HasVerticalAlignment.ALIGN_TOP); } if (LastChangesCookie.getInstance().getSortColumn() >= 0) { iChanges.sort((UniTimeTableHeader)null, comparator(LastChangesCookie.getInstance().getSortColumn(), LastChangesCookie.getInstance().getSortOrder())); header.get(LastChangesCookie.getInstance().getSortColumn()).setOrder(LastChangesCookie.getInstance().getSortOrder()); } iChanges.setColumnVisible(1, iMultiSessionToggle.getValue()); }
private Meeting(TimetableGridCell cell, boolean showRoom, boolean showInstructor, boolean showTime, boolean showPreference, boolean showDate) { super(); iCell = cell; setStyleName("meeting"); if (cell.hasBackground()) getElement().getStyle().setBackgroundColor(cell.getBackground()); P header = new P("header", "label"); header.setHeight(sLineHeight * cell.getNrNames()); header.setHTML(cell.getName("<br>")); header.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP); if (cell.isItalics()) header.getElement().getStyle().setFontStyle(FontStyle.ITALIC); add(header); P footer = new P("footer"); String notes = ""; if (showTime && cell.hasTime()) notes += (notes.isEmpty() ? "" : "<br>") + cell.getTime(); if (showDate && cell.hasDate()) notes += (notes.isEmpty() ? "" : "<br>") + cell.getDate(); if (showRoom && cell.getNrRooms() > 0) notes += (notes.isEmpty() ? "" : "<br>") + cell.getRoom("<br>"); if (showInstructor && cell.getNrInstructors() > 0) notes += (notes.isEmpty() ? "" : "<br>") + cell.getInstructor("<br>"); if (showPreference && cell.hasPreference()) notes += (notes.isEmpty() ? "" : "<br>") + "<span style='color:rgb(200,200,200)'>" + cell.getPreference() + "</span>"; footer.setHTML(notes); footer.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP); add(footer); sinkEvents(Event.ONCLICK); sinkEvents(Event.ONMOUSEOVER); sinkEvents(Event.ONMOUSEOUT); getElement().getStyle().setPosition(Position.ABSOLUTE); }
/** * Instantiates a new MessageDialog. */ public MessageDialog(Listener listener, AlertPanel.Type type, String title, String message) { super(false, true); setTitle(title); this.listener = listener; VerticalPanel dialogContents = new VerticalPanel(); dialogContents.setSpacing(4); setWidget(dialogContents); AlertPanel messageLabel = new AlertPanel(type); messageLabel.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP); messageLabel.getElement().getStyle().setProperty("maxHeight", "400px"); messageLabel.getElement().getStyle() .setProperty("maxWidth", Window.getClientWidth() * 2 / 3 + "px"); messageLabel.getElement().getStyle().setOverflowY(Overflow.AUTO); messageLabel.setMessage(message); dialogContents.add(messageLabel); okButton = new Button(Utils.constants.ok(), new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); } }); addButton(okButton); this.addCloseHandler(new CloseHandler<PopupPanel>() { @Override public void onClose(CloseEvent<PopupPanel> event) { if (MessageDialog.this.listener != null) { MessageDialog.this.listener.onOk(); } } }); }
@Override public boolean getWordWrap() { return !WhiteSpace.NOWRAP.getCssName().equals(getElement().getStyle().getWhiteSpace()); }
@Override public void setWordWrap(boolean wrap) { getElement().getStyle().setWhiteSpace(wrap ? WhiteSpace.NORMAL : WhiteSpace.NOWRAP); }