Java Code Examples for com.smartgwt.client.widgets.form.fields.ButtonItem#setStartRow()

The following examples show how to use com.smartgwt.client.widgets.form.fields.ButtonItem#setStartRow() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SendToArchiveDialog.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Constructor
 * 
 * @param ids Identifiers of the elements that have to be archived
 * @param document True if the ids refers to documents, False in case of
 *        folders
 */
public SendToArchiveDialog(final long[] ids, final boolean document) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);

	setTitle(I18N.message("sendtoexparchive"));
	setWidth(380);
	setHeight(100);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	SelectItem archive = ItemFactory.newArchiveSelector(GUIArchive.MODE_EXPORT, GUIArchive.STATUS_OPENED);
	archive.setTitle(I18N.message("selectopenarchive"));
	archive.setWrapTitle(false);
	archive.setRequired(true);

	ButtonItem send = new ButtonItem();
	send.setStartRow(false);
	send.setTitle(I18N.message("sendtoexparchive"));
	send.setAutoFit(true);
	send.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			onSend(ids, document);
		}
	});

	form.setFields(archive, send);
	addItem(form);
}
 
Example 2
Source File: ConversionDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ConversionDialog(GUIDocument document) {
	this.document = document;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);

	setTitle(I18N.message("convert") + " - " + document.getFileName());
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);

	final RadioGroupItem action = ItemFactory.newRadioGroup("action", I18N.message("action"));
	action.setRequired(true);
	action.setEndRow(true);

	final SelectItem format = ItemFactory.newConversionFormatItem(document.getFileName());
	format.setEndRow(true);
	format.setRequired(true);

	final ButtonItem convert = new ButtonItem();
	convert.setStartRow(false);
	convert.setTitle(I18N.message("convert"));
	convert.setAutoFit(true);
	convert.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			onConvert();
		}
	});

	FolderService.Instance.get().getFolder(document.getFolder().getId(), false, false, false, 
			new AsyncCallback<GUIFolder>() {

				@Override
				public void onFailure(Throwable caught) {
					Log.serverError(caught);
				}

				@Override
				public void onSuccess(GUIFolder folder) {
					convert.setDisabled(!folder.isDownload() && !folder.isWrite());

					LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
					if (folder.isDownload())
						map.put("download", I18N.message("download"));
					if (folder.isWrite())
						map.put("save", I18N.message("save"));
					action.setValueMap(map);
					action.setValue("download");

					form.setFields(format, action, convert);
					addItem(form);
				}
			});
}