/* (non-Javadoc) * @see gwtupload.client.Uploader#onFinishUpload() */ @Override protected void onFinishUpload() { super.onFinishUpload(); if (getStatus() == Status.REPEATED) { getStatusWidget().setError(getI18NConstants().uploaderAlreadyDone()); } getStatusWidget().setStatus(Status.UNINITIALIZED); reuse(); assignNewNameToFileInput(); for (Widget i : formWidgets) { if (i instanceof Hidden) { Hidden h = (Hidden) i; if (h.getValue().startsWith(fileInputPrefix)) { h.setValue(getInputName()); } } } getFileInput().getWidget().setVisible(true); if (button != null) { setEnabledButton(true); button.removeStyleName("changed"); if (!autoSubmit) { button.setVisible(true); } } if (autoSubmit) { getFileInput().setText(i18nStrs.uploaderBrowse()); } }
/* (non-Javadoc) * @see gwtupload.client.Uploader#onStartUpload() */ @Override protected void onStartUpload() { super.onStartUpload(); if (button != null) { setEnabledButton(false); button.removeStyleName("changed"); button.setVisible(false); } getFileInput().getWidget().setVisible(false); }
void select() { DownloadCommandPanel parent = (DownloadCommandPanel) getParent(); for (Widget w : parent) { if (w != this && w instanceof DownloadCommandLink) { w.removeStyleName(Gerrit.RESOURCES.css().downloadLink_Active()); } } parent.setCurrentCommand(this); addStyleName(Gerrit.RESOURCES.css().downloadLink_Active()); }
private void changeState(String type) { if (type == null) { type = "def"; } MaskedTextBox widget = this.getDateInput(); Widget button = this.getButton(); widget.removeStyleName("warn"); button.removeStyleName("warn"); widget.setStyleName(type, true); button.setStyleName(type, true); }
/** * Sets the content widget which can be opened and closed by this panel. If there is a preexisting * content widget, it will be detached. * * @param content the widget to be used as the content panel */ public void setContent(final Widget content) { final Widget currentContent = this.content; // Remove existing content widget. if (currentContent != null) { mainPanel.remove(currentContent); currentContent.removeStyleName(STYLENAME_CONTENT); } // Add new content widget if != null. this.content = content; if (content != null) { mainPanel.add(content); content.addStyleName(STYLENAME_CONTENT); setContentDisplay(); } }
private void removeErrorHighlight(Widget widget) { widget.removeStyleName(Main.ERROR_HIGHLIGHT); }