/** Redraw the icon. */ private void renderImage() { panel.clear(); if (presentation.getImageElement() != null) { ElementWidget image = new ElementWidget(presentation.getImageElement()); image.getElement().setAttribute("class", toolbarResources.toolbar().popupButtonIcon()); panel.add(image); } else if (presentation.getHTMLResource() != null) { FlowPanel icon = new FlowPanel(); icon.setStyleName(toolbarResources.toolbar().iconButtonIcon()); FlowPanel inner = new FlowPanel(); inner.setStyleName(toolbarResources.toolbar().popupButtonIconInner()); inner.getElement().setInnerHTML(presentation.getHTMLResource()); icon.add(inner); panel.add(inner); } InlineLabel caret = new InlineLabel(""); caret.setStyleName(toolbarResources.toolbar().caret()); panel.add(caret); }
private void setupWidgets() { if (!urls.isEmpty()) { urls.select(Gerrit.getUserPreferences().downloadScheme()); FlowPanel p = new FlowPanel(); p.setStyleName(Gerrit.RESOURCES.css().downloadLinkHeader()); p.add(commands); final InlineLabel glue = new InlineLabel(); glue.setStyleName(Gerrit.RESOURCES.css().downloadLinkHeaderGap()); p.add(glue); p.add(urls); add(p); add(copyLabel); } }
private void addOneKey(GpgKeyInfo k) { int row = table.getRowCount(); table.insertRow(row); applyDataRowStyle(row); CheckBox sel = new CheckBox(); sel.addValueChangeHandler(updateDeleteHandler); table.setWidget(row, 0, sel); table.setWidget(row, 1, new CopyableLabel(k.id())); table.setText(row, 2, k.fingerprint()); VerticalPanel userIds = new VerticalPanel(); for (int i = 0; i < k.userIds().length(); i++) { userIds.add(new InlineLabel(k.userIds().get(i))); } table.setWidget(row, 3, userIds); FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 0, Gerrit.RESOURCES.css().iconCell()); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); setRowItem(row, k); }
protected void onInitUI() { final FlowPanel me = (FlowPanel) getWidget(); me.add(header = new Grid(1, Cols.values().length)); me.add(body); headerText = new InlineLabel(); if (titleWidget == null) { titleWidget = headerText; } FlowPanel title = new FlowPanel(); title.add(titleWidget); title.setStyleName(Gerrit.RESOURCES.css().screenHeader()); header.setWidget(0, Cols.Title.ordinal(), title); header.setStyleName(Gerrit.RESOURCES.css().screenHeader()); header .getCellFormatter() .setHorizontalAlignment(0, Cols.FarEast.ordinal(), HasHorizontalAlignment.ALIGN_RIGHT); // force FarEast all the way to the right header.getCellFormatter().setWidth(0, Cols.FarEast.ordinal(), "100%"); }
@UiConstructor public DropDownImageListEditorView() { initWidget(Binder.BINDER.createAndBindUi(this)); currentTypeImage = new Image(); caret = new InlineLabel(); caret.addStyleName( "caret" ); caret.setVisible( true); dropDownAnchor.add( currentTypeImage ); dropDownAnchor.add( caret ); dropDownAnchor.setEnabled( true ); currentTypeImageTooltip = new Tooltip(dropDown); currentTypeImageTooltip.setContainer("body"); currentTypeImageTooltip.setShowDelayMs(100); currentTypeImage.addClickHandler(e -> currentTypeImageTooltip.hide()); caret.addClickHandler(e -> currentTypeImageTooltip.hide()); helpPanel.add(currentTypeImageTooltip); }
@Override public Widget render(Schema property) { HTMLPanel panel = new HTMLPanel(""); panel.getElement().getStyle().setDisplay(Display.INLINE); panel.add(new InlineLabel("\"")); if (property.locked()) { InlineLabel label = new InlineLabel(); panel.add(label); hasText = label; } else { TextArea editor = new TextArea(); panel.add(editor); hasText = editor; } panel.add(new InlineLabel("\"")); if (property.getDefault() != null) { hasText.setText(property.getDefault()); } return panel; }
/** * Complete the partially filled history item with the response data. * * @param response Response data. * @param timeMillis Time that execution took in milliseconds. * @param linkFactory Link factory that is used to generate hyperlink and menu links in the * response view. */ public void complete(ApiResponse response, long timeMillis, PrettifierLinkFactory linkFactory) { executing.setVisible(false); wireContent.addStyleName(style.fadeIn()); time.setInnerText("time to execute: " + timeMillis + " ms"); statusDiv.setInnerText(response.getStatus() + " " + response.getStatusText()); // Headers are hidden by default. UIObject.setVisible(responseHeadersDiv, false); responseHeadersDiv.setInnerText(getResponseHeadersString(response)); try { JsonPrettifier.prettify( request.getService(), requestBodyDiv, request.getRequestBody(), linkFactory); } catch (JsonFormatException e) { // We should only be generating valid requests requestBodyDiv.add(new InlineLabel(request.getRequestBody())); } setResponseContent(request, response, realPathFragment, linkFactory); }
private static Widget inlineWidget( String title, List<Widget> inlineWidgets, int depth, boolean hasSeparator) { FlowPanel inlinePanel = new FlowPanel(); StringBuilder keyText = new StringBuilder(indentation(depth)).append(title); InlineLabel keyLabel = new InlineLabel(keyText.toString()); keyLabel.addStyleName(style.jsonKey()); inlinePanel.add(keyLabel); for (Widget child : inlineWidgets) { inlinePanel.add(child); } if (hasSeparator) { inlinePanel.add(new InlineLabel(SEPARATOR_TEXT)); } return inlinePanel; }
/** * Generate breadcrumbs into the specified container using the format link > link > text where the * last breadcrumb is always plain text. */ private void generateBreadcrumbs(Panel container, List<Title> titles) { container.clear(); // For all of the titles previous to the last, add a link and a separator. for (Title notLast : titles.subList(0, titles.size() - 1)) { container.add(new InlineHyperlink(notLast.getTitle(), notLast.getFragment())); container.add(new InlineLabel(" > ")); } // Append only the text for the last title. Title lastTitle = Iterables.getLast(titles); container.add(new InlineLabel(lastTitle.getTitle())); if (lastTitle.getSubtitle() != null) { Label subtitle = new InlineLabel(" - " + lastTitle.getSubtitle()); subtitle.addStyleName(style.methodSubtitle()); container.add(subtitle); } }
/** * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean) * * <div class="sitwatch-event"> * <div class="icon icon-severity-critical"></div> * <a class="title" href="#">Rate Limit Exceeded</a> * <span class="timestamp">9:16 AM</span> * <span class="subject">{urn:namespace}ImportantService|VeryImportantOperation</span> * </div> */ @Override public void setValue(SituationEventBean value, boolean fireEvents) { clear(); FlowPanel icon = new FlowPanel(); icon.setStyleName("icon"); //$NON-NLS-1$ icon.addStyleName("icon-severity-" + value.getSeverity()); //$NON-NLS-1$ Anchor type = toDetailsPageLinkFactory.get("id", value.getSituationId()); //$NON-NLS-1$ type.setText(value.getType()); type.setStyleName("title"); //$NON-NLS-1$ InlineLabel timestamp = new InlineLabel(ClientMessages.getTimeFormat().format(value.getTimestamp())); timestamp.setStyleName("timestamp"); //$NON-NLS-1$ InlineLabel subject = new InlineLabel(value.getSubject()); subject.setStyleName("subject"); //$NON-NLS-1$ add(icon); add(type); add(timestamp); add(subject); }
/** * Adds a single row to the table. * @param situationSummaryBean */ public void addRow(final SituationSummaryBean situationSummaryBean) { int rowIdx = this.rowElements.size(); DateTimeFormat format = DateTimeFormat.getFormat(i18n.format("dateTime-format")); //$NON-NLS-1$ FlowPanel icon = new FlowPanel(); icon.getElement().setClassName("icon"); //$NON-NLS-1$ icon.getElement().addClassName("icon-severity-" + situationSummaryBean.getSeverity()); //$NON-NLS-1$ Anchor type = toDetailsPageLinkFactory.get("id", situationSummaryBean.getSituationId()); //$NON-NLS-1$ type.setText(situationSummaryBean.getType()); InlineLabel resolutionState = new InlineLabel(situationSummaryBean.getResolutionState()); InlineLabel subject = new InlineLabel(situationSummaryBean.getSubject()); InlineLabel description = new InlineLabel(situationSummaryBean.getDescription()); InlineLabel timestamp = new InlineLabel(format.format(situationSummaryBean.getTimestamp())); Widget infoIcons = createInfoPanel(situationSummaryBean); add(rowIdx, 0, icon); add(rowIdx, 1, type); add(rowIdx, 2, resolutionState); add(rowIdx, 3, subject); add(rowIdx, 4, timestamp); add(rowIdx, 5, description); add(rowIdx, 6, infoIcons); }
/** * {@inheritDoc} */ @Override public void initialize() { usernamePanel = new FlowPanel(); usernamePanel.getElement().setId("username"); usernameLabel = new HTML(); usernamePanel.add(usernameLabel); changePasswordHandler = new InlineLabel(I18N.CONSTANTS.changePassword()); changePasswordHandler.setVisible(false); usernamePanel.add(changePasswordHandler); logoutPanel = new SimplePanel(); logoutPanel.getElement().setId("userlogout"); logoutHandler = new Anchor(I18N.CONSTANTS.logout()); logoutPanel.add(logoutHandler); // initWidget(); Useless. }
public PhoneFW(FDesc fielddescriptor) { super(fielddescriptor); mainPanel.add(new InlineLabel("(+")); mainPanel.add(country); mainPanel.add(new InlineLabel(") - ")); mainPanel.add(area); mainPanel.add(new InlineLabel(" - ")); mainPanel.add(local); initWidget(mainPanel); country.setWidth(COUNTRY_WIDTH); country.getElement().getStyle().setMarginLeft(5, Unit.PX); country.getElement().getStyle().setMarginRight(5, Unit.PX); area.setWidth(AREA_WIDTH); area.getElement().getStyle().setMarginLeft(5, Unit.PX); area.getElement().getStyle().setMarginRight(5, Unit.PX); local.setWidth(LOCAL_WIDTH); local.getElement().getStyle().setMarginLeft(5, Unit.PX); local.getElement().getStyle().setMarginRight(5, Unit.PX); country.setMaxLength(PhoneNumberLogic.MAX_COUNTRY_LENGTH); area.setMaxLength(PhoneNumberLogic.MAX_AREA_LENGTH); local.setMaxLength(PhoneNumberLogic.MAX_LOCAL_LENGTH); }
public ButtonCaption(String label) { super(); setWidth("100%"); setStyleName("Caption"); closeImage = new Image(images.closeIconImageData().getSafeUri()); closeImage.setSize("16px","16px"); closeDialog = new PushButton(closeImage); closeDialog.setStyleName(css.closeIconStyle()); add(text = new InlineLabel(label)); add(closeDialog); setCellHorizontalAlignment(getElement(),ALIGN_RIGHT); setCellWidth(closeDialog,"1px"); setCellHeight(closeDialog,"1px"); }
/** * Adds a single row to the table. * @param taskSummaryBean */ public void addRow(final TaskSummaryBean taskSummaryBean) { int rowIdx = this.rowElements.size(); DateTimeFormat format = DateTimeFormat.getFormat(i18n.format("date-format")); //$NON-NLS-1$ Anchor name = toDetailsPageLinkFactory.get("id", taskSummaryBean.getId()); //$NON-NLS-1$ name.setText(taskSummaryBean.getName()); InlineLabel priority = new InlineLabel(String.valueOf(taskSummaryBean.getPriority())); InlineLabel owner = new InlineLabel(taskSummaryBean.getOwner()); InlineLabel status = new InlineLabel(taskSummaryBean.getStatus()); InlineLabel dueOn = new InlineLabel(taskSummaryBean.getDueDate() != null ? format.format(taskSummaryBean.getDueDate()) : ""); //$NON-NLS-1$ add(rowIdx, 0, name); add(rowIdx, 1, priority); add(rowIdx, 2, owner); add(rowIdx, 3, status); add(rowIdx, 4, dueOn); }
/** * Adds a single row to the table. * @param summaryBean */ public void addRow(final DerivedArtifactSummaryBean summaryBean) { int rowIdx = this.rowElements.size(); Anchor name = new Anchor(); String href = configService.getUiConfig().createSrampUiUrl("details", "uuid", summaryBean.getUuid()); //$NON-NLS-1$ //$NON-NLS-2$ name.setHref(href); name.setText(summaryBean.getName()); name.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { event.stopPropagation(); } }); InlineLabel type = new InlineLabel(summaryBean.getType()); add(rowIdx, 0, name); add(rowIdx, 1, type); }
/** * Shows the details in the UI. * @param data */ protected void showDetails(DerivedArtifactsBean data) { detailsPanel.clear(); if (data.getDerivedArtifacts().isEmpty()) { InlineLabel label = new InlineLabel(i18n.format("expanded-artifact-item.none-found")); //$NON-NLS-1$ detailsPanel.add(label); } else { ExpandedArtifactSummary summaryInfo = summaryFactory.get(); summaryInfo.setValue(data); detailsPanel.add(summaryInfo); DerivedArtifactsTable table = derivedArtifactsTableFactory.get(); for (DerivedArtifactSummaryBean row : data.getDerivedArtifacts()) { table.addRow(row); } detailsPanel.add(table); } }
/** * Adds a single row to the table. * * @param workflow * the workflow */ public void addRow(final Workflow workflow) { int rowIdx = this.rowElements.size(); Anchor artifact_name = new Anchor(); artifact_name.setText(workflow.getName()); String url = _srampUIBaseUrl; if (!url.endsWith("/")) { //$NON-NLS-1$ url += "/"; //$NON-NLS-1$ } url += "#details;uuid=" + workflow.getUuid(); //$NON-NLS-1$ artifact_name.setHref(url); InlineLabel description = new InlineLabel(workflow.getDescription()); add(rowIdx, 0, artifact_name); add(rowIdx, 1, description); }
@Inject public ResultCellTable(final @Assisted int pageSize, final @NotNull CellTableResourcesQueryResults cellTableResources, final @NotNull SqlRequestLauncherConstants constants) { super(pageSize, cellTableResources); final InlineLabel emptyWidget = new InlineLabel(constants.emptyResult()); setEmptyTableWidget(emptyWidget); emptyWidget.setStyleName(cellTableResources.cellTableStyle().emptyTableWidget()); addCellPreviewHandler(new CellPreviewEvent.Handler<List<String>>() { @Override public void onCellPreview(CellPreviewEvent<List<String>> event) { if ("click".equals(event.getNativeEvent().getType())) { TableCellElement cellElement = getRowElement(event.getIndex()).getCells().getItem(event.getColumn()); cellElement.setTitle(cellElement.getInnerText()); } } }); }
/** * Called when a progress style notification has error'd out. * @param notificationBean */ private void onProgressError(NotificationBean notificationBean) { Notification notification = getNotification(notificationBean.getUuid()); if (notification != null) { notification.getData().setTitle(notificationBean.getTitle()); notification.getData().setMessage(notificationBean.getMessage()); notification.getData().setMessageWidget(notificationBean.getMessageWidget()); notification.getData().setType(NotificationType.error); notification.getData().setException(notificationBean.getException()); notification.getWidget().setNotificationTitle(notificationBean.getTitle()); if (notificationBean.getMessageWidget() != null) { notification.getWidget().setNotificationMessage((Widget) notificationBean.getMessageWidget()); } else { FlowPanel errorDetails = new FlowPanel(); if (notification.getData().getMessage() != null) { errorDetails.add(new InlineLabel(notification.getData().getMessage())); } if (notification.getData().getException() != null) { // TODO handle exceptions - need to create an exception dialog errorDetails.add(new InlineLabel(notification.getData().getException().getMessage())); } notification.getWidget().setNotificationMessage(errorDetails); } notification.getWidget().removeStyleName("growl-dialog-progress"); //$NON-NLS-1$ notification.getWidget().addStyleName("growl-dialog-error"); //$NON-NLS-1$ resizeNotification(notification.getIndex() + 1); } }
/** * Sets the notification message. * @param message * @param notificationType */ public void setNotificationMessage(String message, NotificationType notificationType) { this.body.clear(); InlineLabel msg = new InlineLabel(message); if (notificationType == NotificationType.notification) { this.body.add(msg); } else if (notificationType == NotificationType.error) { this.body.add(msg); } else if (notificationType == NotificationType.progress) { msg.addStyleName("spinner"); //$NON-NLS-1$ this.body.add(msg); } }
/** * Shows notification when upload is complete * @param resultStr the servlet response text */ public void uploadComplete(String resultStr) { ImportResult results = ImportResult.fromResult(resultStr); if (results.isError()) { if (results.getError() != null) { notificationService.completeProgressNotification( notification.getUuid(), i18n.format("import-datasource-type-submit.upload-error.title"), //$NON-NLS-1$ results.getError()); } else { notificationService.completeProgressNotification( notification.getUuid(), i18n.format("import-datasource-type-submit.upload-error.title"), //$NON-NLS-1$ i18n.format("import-datasource-type-submit.upload-error.msg")); //$NON-NLS-1$ } } else { Widget ty = new InlineLabel(i18n.format("import-datasource-type-submit.upload-complete.msg")); //$NON-NLS-1$ FlowPanel body = new FlowPanel(); body.add(ty); notificationService.completeProgressNotification( notification.getUuid(), i18n.format("import-datasource-type-submit.upload-complete.title"), //$NON-NLS-1$ body); uiEvent.fire(new UiEvent(UiEventType.UPLOAD_DRIVER_COMPLETE)); this.close(); } }
private LabelWidget createLabel(String forId, String label) { LabelWidget labelWidget = new LabelWidget(); labelWidget.add(new InlineLabel(label)); labelWidget.setHtmlFor(forId); return labelWidget; }
RpcStatus() { loading = new InlineLabel(); loading.setText(Gerrit.C.rpcStatusWorking()); loading.setStyleName(Gerrit.RESOURCES.css().rpcStatus()); loading.setVisible(false); RootPanel.get().add(loading); }
private void insertPatch() { String id = revision.substring(0, 7); Anchor patchBase64 = new Anchor(id + ".diff.base64"); patchBase64.setHref( new RestApi("/changes/") .id(psId.getParentKey().get()) .view("revisions") .id(revision) .view("patch") .addParameterTrue("download") .url()); Anchor patchZip = new Anchor(id + ".diff.zip"); patchZip.setHref( new RestApi("/changes/") .id(psId.getParentKey().get()) .view("revisions") .id(revision) .view("patch") .addParameterTrue("zip") .url()); HorizontalPanel p = new HorizontalPanel(); p.add(patchBase64); InlineLabel spacer = new InlineLabel("|"); spacer.setStyleName(Gerrit.RESOURCES.css().downloadBoxSpacer()); p.add(spacer); p.add(patchZip); insertCommand("Patch-File", p); }
private void insertArchive() { List<String> activated = Gerrit.info().download().archives(); if (activated.isEmpty()) { return; } List<Anchor> anchors = new ArrayList<>(activated.size()); for (String f : activated) { Anchor archive = new Anchor(f); archive.setHref( new RestApi("/changes/") .id(psId.getParentKey().get()) .view("revisions") .id(revision) .view("archive") .addParameter("format", f) .url()); anchors.add(archive); } HorizontalPanel p = new HorizontalPanel(); Iterator<Anchor> it = anchors.iterator(); while (it.hasNext()) { Anchor a = it.next(); p.add(a); if (it.hasNext()) { InlineLabel spacer = new InlineLabel("|"); spacer.setStyleName(Gerrit.RESOURCES.css().downloadBoxSpacer()); p.add(spacer); } } insertCommand("Archive", p); }
private static void populateBottomMenu(RootPanel btmmenu, HostPageData hpd) { String vs = hpd.version; if (vs == null || vs.isEmpty()) { vs = "dev"; } btmmenu.add(new InlineHTML(M.poweredBy(vs))); if (info().gerrit().webUis().contains(UiType.POLYGERRIT)) { btmmenu.add(new InlineLabel(" | ")); uiSwitcherLink = new Anchor(C.newUi(), getUiSwitcherUrl(History.getToken())); uiSwitcherLink.setStyleName(""); btmmenu.add(uiSwitcherLink); } String reportBugUrl = info().gerrit().reportBugUrl(); if (reportBugUrl != null) { String reportBugText = info().gerrit().reportBugText(); Anchor a = new Anchor(reportBugText == null ? C.reportBug() : reportBugText, reportBugUrl); a.setTarget("_blank"); a.setStyleName(""); btmmenu.add(new InlineLabel(" | ")); btmmenu.add(a); } btmmenu.add(new InlineLabel(" | ")); btmmenu.add(new InlineLabel(C.keyHelp())); }
/** * Denotes that this is an object whose definition is in another Schema, and * that it should be filled in with the correct fields when expanded. */ void setRef(final String ref) { final InlineLabel expando = new InlineLabel("+"); add(expando); expando.addStyleName(Resources.INSTANCE.style().clickable()); expando.setTitle("Click to show more fields"); expando.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Schema sch = service.getSchemas().get(ref); setProperties(sch.getProperties()); remove(expando); } }); }
/** * Entry point for the formatter. * * @param destination Destination GWT object where the results will be placed * @param jsonString String to format * @param linkFactory Which links factory should be used when generating links and navigation * menus. * @throws JsonFormatException when parsing the Json causes an error */ public static void prettify( ApiService service, Panel destination, String jsonString, PrettifierLinkFactory linkFactory) throws JsonFormatException { // Make sure the user set a style before invoking prettify. Preconditions.checkState(style != null, "Must call setStyle before using."); Preconditions.checkNotNull(service); Preconditions.checkNotNull(destination); // Don't bother syntax highlighting empty text. boolean empty = Strings.isNullOrEmpty(jsonString); destination.setVisible(!empty); if (empty) { return; } if (!GWT.isScript()) { // Syntax highlighting is *very* slow in Development Mode (~30s for large // responses), but very fast when compiled and run as JS (~30ms). For the // sake of my sanity, syntax highlighting is disabled in Development destination.add(new InlineLabel(jsonString)); } else { try { DynamicJso root = JsonUtils.<DynamicJso>safeEval(jsonString); Collection<ApiMethod> compatibleMethods = computeCompatibleMethods(root, service); Widget menuForMethods = createRequestMenu(compatibleMethods, service, root, linkFactory); JsObjectIterable rootObject = new JsObjectIterable(service, root, 1, linkFactory); Widget object = formatGroup(rootObject, "", 0, "{", "}", false, menuForMethods); destination.add(object); } catch (IllegalArgumentException e) { // JsonUtils will throw an IllegalArgumentException when it gets invalid // Json data. Rewrite as a checked exception and throw. throw new JsonFormatException("Invalid json.", e); } } }
/** * Adds a single row to the table. */ public void addRow(String name, String value) { int rowIdx = this.rowElements.size(); InlineLabel nameLabel = new InlineLabel(name); InlineLabel valueLabel = new InlineLabel(value); add(rowIdx, 0, nameLabel); add(rowIdx, 1, valueLabel); }
/** * Adds a single row to the table. * @param serviceSummaryBean */ public void addRow(final ServiceSummaryBean serviceSummaryBean) { int rowIdx = this.rowElements.size(); Anchor name = toDetailsPageLinkFactory.get("id", serviceSummaryBean.getServiceId()); //$NON-NLS-1$ name.setText(serviceSummaryBean.getName()); InlineLabel application = new InlineLabel(serviceSummaryBean.getApplication()); InlineLabel interf4ce = new InlineLabel(serviceSummaryBean.getIface()); InlineLabel bindings = new InlineLabel(serviceSummaryBean.getBindings()); add(rowIdx, 0, name); add(rowIdx, 1, application); add(rowIdx, 2, interf4ce); add(rowIdx, 3, bindings); }
/** * Adds a single row to the table. * @param summaryBean */ public void addRow(final ReferenceSummaryBean summaryBean) { int rowIdx = this.rowElements.size(); Anchor name = toDetailsPageLinkFactory.get("id", summaryBean.getReferenceId()); //$NON-NLS-1$ name.setText(summaryBean.getName()); InlineLabel interf4ce = new InlineLabel(summaryBean.getIface()); InlineLabel bindings = new InlineLabel(summaryBean.getBindings()); add(rowIdx, 0, name); add(rowIdx, 1, interf4ce); add(rowIdx, 2, bindings); }
/** * Called when a progress style notification has error'd out. * @param notificationBean */ private void onProgressError(NotificationBean notificationBean) { Notification notification = getNotification(notificationBean.getUuid()); if (notification != null) { notification.getData().setTitle(notificationBean.getTitle()); notification.getData().setMessage(notificationBean.getMessage()); notification.getData().setMessageWidget(notificationBean.getMessageWidget()); notification.getData().setType(NotificationType.error); notification.getData().setException(notificationBean.getException()); notification.getWidget().setNotificationTitle(notificationBean.getTitle()); if (notificationBean.getMessageWidget() != null) { notification.getWidget().setNotificationMessage((Widget) notificationBean.getMessageWidget()); } else { FlowPanel errorDetails = new FlowPanel(); // if (notification.getData().getMessage() != null) { // errorDetails.add(new InlineLabel(notification.getData().getMessage())); // } if (notification.getData().getException() != null) { // TODO handle exceptions better - need to create an exception dialog errorDetails.add(new InlineLabel(notification.getData().getException().getMessage())); } notification.getWidget().setNotificationMessage(errorDetails); } notification.getWidget().removeStyleName("growl-dialog-progress"); //$NON-NLS-1$ notification.getWidget().addStyleName("growl-dialog-error"); //$NON-NLS-1$ resizeNotification(notification.getIndex() + 1); } }
private void setUpdateDate(Date date, InlineLabel label) { if(date != null) { label.setText(DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_SHORT).format(date)); } else { label.setText(I18N.CONSTANTS.offlineDatabaseLastCompleteUpdateNever()); } }
public AlertPanel(Type type) { setStylePrimaryName(avroUiStyle.uiMessage()); addStyleName(type.labelStyleName); InlineLabel icon = new InlineLabel(); icon.setStylePrimaryName(avroUiStyle.uiIcon()); icon.addStyleName(type.iconStyleName); getElement().appendChild(icon.getElement()); textNode = Document.get().createDivElement(); textNode.getStyle().setWidth(100, Unit.PCT); getElement().appendChild(textNode); }
private void setupUi() { setupChangeHandlers(); final HorizontalPanel hbox = new HorizontalPanel(); hbox.setSpacing(5); hbox.add(new InlineLabel("From")); hbox.add(start_datebox); // If we're not trying to see anything already, look at some recent // traces by default. if (History.getToken().isEmpty()) { final long now = System.currentTimeMillis(); start_datebox.setValue(new Date(now - 600000), false); end_datebox.setValue(new Date(now), true); } hbox.add(new InlineLabel("To")); hbox.add(end_datebox); hbox.add(new InlineLabel("Query")); hbox.add(esquery); hbox.add(new InlineLabel("Sort by")); sortby.addItem("Request timestamp", "request_ts"); // 1st is default. sortby.addItem("End-to-end latency", "end_to_end"); sortby.addItem("Slowest system call", "slowest_syscall.duration"); sortby.addItem("Number of system calls", "num_syscalls"); hbox.add(sortby); root.add(hbox); traces.setAnimationEnabled(true); root.add(traces); }
@Override public void initBreadcrumbs(int breadcrumbSize, String _heading) { breadCrumbPanel.setVisible(true); breadcrumbs.clear(); heading.setHTML("<h1>" + _heading + "</h1>"); for (int i = 0; i < breadcrumbSize; ++i) { if (i > 0) { breadcrumbs.add(new InlineLabel(" > ")); } breadcrumbs.add(new InlineHyperlink("Loading title...", placeManager.buildRelativeHistoryToken(i + 1))); } }
/** * On submit click. * * @param event * the event */ @EventHandler("btn-save") public void onSubmitClick(ClickEvent event) { final NotificationBean notification = _notificationService.startProgressNotification( _i18n.format("workflowQuery-submit.save"), //$NON-NLS-1$ _i18n.format("workflowQuery-submit.save-msg")); //$NON-NLS-1$ final WorkflowQueryBean query = this.createWorkflowQueryBean(); _validation_errors.clear(); _workflowQueryService.save(query, new IRpcServiceInvocationHandler<String>() { @Override public void onError(Throwable error) { if (error instanceof DtgovFormValidationException) { List<ValidationError> errors = ((DtgovFormValidationException) error).getErrors(); for (ValidationError err : errors) { _validation_errors.add(new InlineLabel(_i18n.format(err.getErrorLabel()))); } _formValidationErrorDiv.getElement().removeClassName("hide"); //$NON-NLS-1$ _notificationService.removeNotification(notification.getUuid()); Window.scrollTo(0, 0); } else { _notificationService.completeProgressNotification(notification.getUuid(), _i18n.format("workflowQuery-submit.error-saving"), //$NON-NLS-1$ error); } } @Override public void onReturn(String data) { _notificationService.completeProgressNotification(notification.getUuid(), _i18n.format("workflowQuery-submit.successfully-saved"), //$NON-NLS-1$ _i18n.format("workflowQuery-submit.successfully-saved-message", query.getName())); //$NON-NLS-1$ } }); }