Java Code Examples for com.smartgwt.client.widgets.layout.VLayout#setMembersMargin()

The following examples show how to use com.smartgwt.client.widgets.layout.VLayout#setMembersMargin() . 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: PopupMessage.java    From document-management-software with GNU Lesser General Public License v3.0 6 votes vote down vote up
public PopupMessage(String title, String messageText) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(title);
	setAlign(Alignment.CENTER);
	setAutoSize(true);
	centerInPage();
	
	Label label=new Label(messageText);
	label.setMinWidth(350);
	
	VLayout layout= new VLayout();
	layout.setMembersMargin(2);
	layout.setMembers(label);
	
	addItem(layout);
	
	Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

		@Override
		public boolean execute() {
			PopupMessage.this.destroy();
			return false;
		}
	}, Session.get().getConfigAsInt("gui.popup.timeout") * 1000);
}
 
Example 2
Source File: CatalogBrowser.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createAdvancedOptions() {
        formCatalog = createCatalogForm();

        lgResult = new ListGrid();
        lgResult.setDataSource(BibliographyQueryDataSource.getInstance());
//        lgResult.setUseAllDataSourceFields(true);
        ListGridField preview = new ListGridField(BibliographyQueryDataSource.FIELD_PREVIEW,
                i18n.CatalogBrowser_HeaderPreview_Title());
        ListGridField title = new ListGridField(BibliographyQueryDataSource.FIELD_TITLE,
                i18n.CatalogBrowser_HeaderTitle_Title());
        lgResult.setDetailField(BibliographyQueryDataSource.FIELD_PREVIEW);
        lgResult.setFields(title, preview);
//        lgResult.setAutoFetchData(true);
        lgResult.setHeight100();
        lgResult.setWidth100();
        lgResult.setCanExpandRecords(true);
        lgResult.setCanExpandMultipleRecords(false);
        lgResult.setExpansionMode(ExpansionMode.DETAIL_FIELD);
        lgResult.setSelectionType(SelectionStyle.SINGLE);
//        lgResult.setSelectionAppearance(SelectionAppearance.CHECKBOX);
        lgResult.setAlternateRecordStyles(true);
        lgResult.addDataArrivedHandler(new DataArrivedHandler() {

            @Override
            public void onDataArrived(DataArrivedEvent event) {
                if (event.getStartRow() == 0 && event.getEndRow() > 0) {
                    lgResult.focus();
                    lgResult.selectSingleRecord(0);
                }
            }
        });

        VLayout layout = new VLayout();
        layout.setMembers(formCatalog, lgResult);
        layout.setMargin(4);
        layout.setMembersMargin(4);
        layout.setOverflow(Overflow.AUTO);
        return layout;
    }
 
Example 3
Source File: ContactingServer.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private ContactingServer() {
	setHeaderControls(HeaderControls.HEADER_LABEL);
	setTitle(" ");
	setCanDragResize(false);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);
	setShowStatusBar(false);
	setBodyColor("white");
	setMembersMargin(0);

	HTMLFlow message = new HTMLFlow(AwesomeFactory.getSpinnerIconHtml("pulse", I18N.message("contactingserver")));
	message.setAlign(Alignment.CENTER);
	message.setStyleName("contactingserver");
	message.setLayoutAlign(Alignment.CENTER);
	message.setLayoutAlign(VerticalAlignment.CENTER);
	message.setBackgroundColor("white");
	message.setHeight(50);
	
	
	VLayout container = new VLayout();
	container.setWidth100();
	container.setMembersMargin(5);
	container.setMargin(3);
	container.setAlign(Alignment.CENTER);
	container.setDefaultLayoutAlign(Alignment.CENTER);
	container.setMembers(message);
	
	addItem(container);
}
 
Example 4
Source File: ApplicationRestarting.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private ApplicationRestarting() {
	setHeaderControls(HeaderControls.HEADER_LABEL);
	setTitle(" ");
	setCanDragResize(false);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);
	setShowStatusBar(false);
	setBodyColor("white");
	setMembersMargin(0);

	messageFlow = new HTMLFlow();
	messageFlow.setAlign(Alignment.CENTER);
	messageFlow.setStyleName("contactingserver");
	messageFlow.setLayoutAlign(Alignment.CENTER);
	messageFlow.setLayoutAlign(VerticalAlignment.CENTER);
	messageFlow.setBackgroundColor("white");
	messageFlow.setHeight(50);

	VLayout container = new VLayout();
	container.setWidth100();
	container.setMembersMargin(5);
	container.setMargin(3);
	container.setAlign(Alignment.CENTER);
	container.setDefaultLayoutAlign(Alignment.CENTER);
	container.setMembers(messageFlow);

	addItem(container);
}
 
Example 5
Source File: BarcodeTemplateSettings.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public BarcodeTemplateSettings(BarcodeTemplatesPanel panel, GUIBarcodeTemplate template) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("barcodetemplate"));
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);

	this.panel = panel;
	this.template = template;

	save = new IButton(I18N.message("save"));
	save.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

		@Override
		public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
			onSave();
		}
	});

	prepareForm();

	VLayout layout = new VLayout();
	layout.setMembersMargin(5);
	layout.setWidth100();

	layout.addMember(form);
	layout.addMember(save);

	addItem(layout);
}
 
Example 6
Source File: LoginPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void prepareSwitchViewLink() {
	String url = "mobile".equals(Util.getJavascriptVariable("j_layout")) ? (Util.contextPath() + "login.jsp")
			: (Util.contextPath() + "login-mobile.jsp");
	url += "?tenant=" + Util.detectTenant();
	String label = "mobile".equals(Util.getJavascriptVariable("j_layout")) ? I18N.message("viewclassicweb")
			: I18N.message("viewmobileweb");

	/*
	 * A link to the alternative login page
	 */
	HTMLFlow switchLink = new HTMLFlow("<a href='" + url + "' class='login-switchview'>" + label + "</a>");
	switchLink.setHeight(16);
	switchLink.setWidth(COLUMN_WIDTH + 20);
	switchLink.setStyleName("login-switchview");

	HLayout spacer10 = new HLayout();
	spacer10.setHeight(10);
	spacer10.setWidth(10);

	VLayout link = new VLayout();
	link.setMembersMargin(0);
	link.setMargin(0);
	link.setStyleName("login-switchview");
	link.setMembers(spacer10, switchLink);
	link.setLayoutAlign(VerticalAlignment.TOP);
	link.setLayoutAlign(Alignment.CENTER);
	link.setWidth(COLUMN_WIDTH + 20);
	link.setHeight(18);

	mainPanel.addMember(link);
}
 
Example 7
Source File: FillForm.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public FillForm(GUIDocument frm) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);

	setTitle(I18N.message("form") + " - " + Util.getBaseName(frm.getFileName()));
	setWidth(500);
	setHeight(400);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	
	IButton save = new IButton();
	save.setTitle(I18N.message("save"));
	save.setAutoFit(true);
	save.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
		@Override
		public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
			onSave();
		}
	});

	HLayout buttonsBar = new HLayout();
	buttonsBar.setWidth100();
	buttonsBar.setHeight(25);
	buttonsBar.setMembers(save);
	
	
	propertiesPanel = new ExtendedPropertiesPanel(frm, null, true, true, false);
	
	VLayout layout = new VLayout();
	layout.setMargin(3);
	layout.setMembersMargin(3);
	layout.setMembers(propertiesPanel, buttonsBar);
	
	addItem(layout);
}
 
Example 8
Source File: ZohoDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ZohoDialog(boolean export) {
	super();
	this.export = export;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("zoho"));
	setWidth(350);
	setHeight(300);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(3);

	VLayout content = new VLayout();
	content.setTop(10);
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(3);

	tree = new ZohoTree(export);
	tree.setWidth100();
	tree.setHeight100();

	VLayout buttons = new VLayout();
	buttons.setWidth100();
	buttons.setHeight(30);

	Button select = new Button(I18N.message("select"));
	select.setAutoFit(true);
	select.setMargin(1);
	select.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			if (ZohoDialog.this.export)
				onExport();
			else
				onImport();
		}
	});

	buttons.setMembers(select);

	content.setMembers(tree, buttons);
	addItem(content);
}
 
Example 9
Source File: LoginPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Prepares the panel to show messages
 */
protected void prepareAlerts() {
	List<MessageLabel> messages = new ArrayList<MessageLabel>();
	if (info.getAlerts() != null && info.getAlerts().length > 0) {
		for (GUIMessage alert : info.getAlerts()) {
			MessageLabel label = new MessageLabel(alert, info.getTenant().getId() == 1L);
			label.setStyleName("loginMemesage");
			if (alert.isShowInLogin()) {
				messages.add(label);
			}
		}
	}

	if (info.getRunLevel().equals("demo")) {
		GUIMessage demoRunLevelMessage = new GUIMessage();
		demoRunLevelMessage.setMessage(I18N.message("demomode"));
		demoRunLevelMessage.setPriority(GUIMessage.PRIO_INFO);
		MessageLabel demoRunLevel = new MessageLabel(demoRunLevelMessage, info.getTenant().getId() == 1L);
		messages.add(demoRunLevel);
	} else if (info.getRunLevel().equals("updated")) {
		GUIMessage confirmUpdateMessage = new GUIMessage();
		confirmUpdateMessage.setMessage(I18N.message("systemupdatedwarning", info.getRelease()));
		confirmUpdateMessage.setPriority(GUIMessage.PRIO_WARN);
		MessageLabel updatedRunLevel = new MessageLabel(confirmUpdateMessage, info.getTenant().getId() == 1L);
		messages.add(updatedRunLevel);
	}

	HLayout spacer15 = new HLayout();
	spacer15.setHeight(15);
	spacer15.setWidth(15);

	// The messages screen
	VLayout messagesScreen = new VLayout();
	messagesScreen.setMembersMargin(0);
	messagesScreen.setMargin(0);
	messagesScreen.setStyleName("login-screen");
	messagesScreen.setMembers(messages.toArray(new MessageLabel[0]));
	messagesScreen.setLayoutAlign(VerticalAlignment.TOP);
	messagesScreen.setLayoutAlign(Alignment.CENTER);
	messagesScreen.setWidth(COLUMN_WIDTH + 20);
	messagesScreen.setHeight(1);

	mainPanel.addMember(spacer15);

	if (!messages.isEmpty())
		mainPanel.addMember(messagesScreen);
}
 
Example 10
Source File: DropboxDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public DropboxDialog(boolean export) {
	super();
	this.export = export;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("dropbox"));
	setWidth(350);
	setHeight(300);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(3);

	VLayout content = new VLayout();
	content.setTop(10);
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(3);

	tree = new DropboxTree(export);
	tree.setWidth100();
	tree.setHeight100();

	VLayout buttons = new VLayout();
	buttons.setWidth100();
	buttons.setHeight(30);

	Button select = new Button(I18N.message("select"));
	select.setAutoFit(true);
	select.setMargin(1);
	select.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			if (DropboxDialog.this.export)
				onExport();
			else
				onImport();
		}
	});

	buttons.setMembers(select);

	content.setMembers(tree, buttons);
	addItem(content);
}
 
Example 11
Source File: ReplaceVersionFile.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ReplaceVersionFile(GUIDocument document, String fileVersion) {
	this.document = document;
	this.fileVersion = fileVersion;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("replacefile"));
	setWidth(420);
	
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setAutoSize(true);
	centerInPage();

	DynamicForm form = new DynamicForm();
	vm = new ValuesManager();
	form.setValuesManager(vm);

	TextItem commentItem = ItemFactory.newTextItem("comment", "comment", null);
	commentItem.setRequired(true);
	commentItem.setWidth(250);

	form.setItems(commentItem);

	// Create a new uploader panel and attach it to the window
	multiUploader = new MultiUploader();
	multiUploader.setStyleName("upload");
	multiUploader.setWidth("300px");
	multiUploader.setHeight("60px");
	multiUploader.setFileInputPrefix("LDOC");
	multiUploader.setMaximumFiles(1);
	multiUploader.addOnFinishUploadHandler(onFinishUploaderHandler);
	multiUploader.reset();

	saveButton = new IButton(I18N.message("save"));
	saveButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

		@Override
		public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
			onSave();
		}
	});
	saveButton.setDisabled(true);

	VLayout layout = new VLayout();
	layout.setMembersMargin(5);
	layout.setMargin(2);

	layout.addMember(form);
	layout.addMember(multiUploader);
	layout.addMember(saveButton);

	addItem(layout);
}
 
Example 12
Source File: Setup.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void initGUI(final GUIInfo info) {
	WindowUtils.setTitle(info.getBranding().getProductName() + " " + info.getRelease()
			+ (info.getLicensee() != null ? " - " + I18N.message("licensedto") + ": " + info.getLicensee() : ""));
	WindowUtils.setFavicon(info);

	// Prepare a value manager that will include all forms spanned in each
	// tab
	vm = new ValuesManager();

	// Create all the tabs each one for a specific setup step
	tabs = new TabSet();
	tabs.setWidth(600);
	tabs.setHeight(250);

	Tab registrationTab = setupRegistration(vm);
	Tab repositoryTab = setupRepository(vm, info);
	Tab databaseTab = setupDatabase(vm, info);
	tabs.setTabs(registrationTab, repositoryTab, databaseTab);

	// This is the button used to confirm each step
	submit = new IButton();
	submit.setTitle(I18N.message("next"));
	submit.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			onSubmit(info);
		}
	});

	// Prepare the heading panel with Logo and Title
	// Prepare the logo image to be shown inside the login form
	Label header = new Label(I18N.message("setup"));
	header.setStyleName("setupHeader");
	header.setIcon(info.getBranding().getLogoSrc());
	header.setIconWidth(205);
	header.setIconHeight(40);
	header.setHeight(45);

	// Prepare a panel to layout setup components
	VLayout layout = new VLayout();
	layout.setHeight(500);
	layout.setWidth(400);
	layout.setMembersMargin(5);
	layout.addMember(header);
	layout.addMember(tabs);
	layout.addMember(submit);

	// Panel for horizontal centering
	VLayout vPanel = new VLayout();
	vPanel.setDefaultLayoutAlign(Alignment.CENTER);
	vPanel.setWidth100();
	vPanel.setHeight(300);
	vPanel.addMember(layout);

	RootPanel.get().add(vPanel);

	// Remove the loading frame
	RootPanel.getBodyElement().removeChild(RootPanel.get("loadingwrapper-setup").getElement());
}
 
Example 13
Source File: ApplyTemplateDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ApplyTemplateDialog() {
	super();
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("applytemplate"));
	setAutoSize(true);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	VLayout content = new VLayout();
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(2);

	final TreeGrid folders = new FolderTree();
	folders.setWidth100();
	folders.setHeight100();

	final boolean inheritOptionEnabled = "true".equals(Session.get().getInfo()
			.getConfig("gui.security.inheritoption"));

	final DynamicForm form = new DynamicForm();

	CheckboxItem inheritSecurity = new CheckboxItem();
	inheritSecurity.setName("inheritSecurity");
	inheritSecurity.setTitle(I18N.message("inheritparentsec"));
	form.setItems(inheritSecurity);

	SelectItem templateSelector = ItemFactory.newFolderTemplateSelector();

	if (inheritOptionEnabled)
		form.setItems(templateSelector, inheritSecurity);

	Button apply = new Button(I18N.message("apply"));
	apply.setAutoFit(true);
	apply.setMargin(1);
	apply.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			if (!form.validate())
				return;

			final TreeNode selectedNode = (TreeNode) FolderNavigator.get().getSelectedRecord();
			final long folderId = Long.parseLong(selectedNode.getAttributeAsString("folderId"));
			long templateId = Long.parseLong(form.getValueAsString("foldertemplate"));

			FolderService.Instance.get().applyTemplate(folderId, templateId,
					inheritOptionEnabled && "true".equals(form.getValueAsString("inheritSecurity")),
					new AsyncCallback<Void>() {

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

						@Override
						public void onSuccess(Void arg0) {
							FolderNavigator.get().getTree().reloadChildren(selectedNode);
							Log.info(I18N.message("templateapplied"), null);
							destroy();
						}
					});
		}
	});

	content.setMembers(form, apply);
	addItem(content);
}
 
Example 14
Source File: MoveDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public MoveDialog() {
	super();
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("move"));
	setWidth(250);
	setHeight(270);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(3);

	VLayout content = new VLayout();
	content.setTop(10);
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(3);

	final TreeGrid folders = new FolderTree();
	folders.setWidth100();
	folders.setHeight100();

	VLayout buttons = new VLayout();
	buttons.setWidth100();
	buttons.setHeight(30);

	Button move = new Button(I18N.message("move"));
	move.setAutoFit(true);
	move.setMargin(1);
	move.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			String shownName = FolderNavigator.get().getSelectedRecord().getAttributeAsString("name");
			long[] selection = FolderNavigator.get().getSelectedIds();
			if (selection.length > 1)
				shownName = selection.length + " " + I18N.message("folders").toLowerCase();

			LD.ask(I18N.message("move"),
					I18N.message("moveask", new String[] { shownName,
							folders.getSelectedRecord().getAttributeAsString("name") }), new BooleanCallback() {

						@Override
						public void execute(Boolean value) {
							if (value) {
								FolderNavigator.get()
										.moveTo(Long.parseLong(folders.getSelectedRecord().getAttributeAsString(
												"folderId")));
							}
							destroy();
						}
					});
		}
	});

	buttons.setMembers(move);

	content.setMembers(folders, buttons);
	addItem(content);
}
 
Example 15
Source File: CreateAliasDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public CreateAliasDialog() {
	super();
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("createalias"));
	setWidth(470);
	setHeight(280);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(3);

	VLayout content = new VLayout();
	content.setTop(10);
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(3);

	final TreeGrid folders = new FolderTree();
	folders.setWidth100();
	folders.setHeight100();

	HLayout buttons = new HLayout();
	buttons.setWidth100();
	buttons.setHeight(30);

	Button create = new Button(I18N.message("create"));
	create.setAutoFit(true);
	create.setMargin(1);
	create.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			FolderNavigator.get().createAlias(
					Long.parseLong(folders.getSelectedRecord().getAttributeAsString("folderId")));
			destroy();
		}
	});

	buttons.setMembers(create);
	content.setMembers(folders, buttons);
	addItem(content);
}
 
Example 16
Source File: InheritRightsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public InheritRightsDialog(final FolderSecurityPanel panel) {
	super();
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("inheritrights"));
	setWidth(250);
	setHeight(270);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(3);

	VLayout content = new VLayout();
	content.setTop(10);
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(3);

	final TreeGrid folders = new FolderTree();
	folders.setWidth100();
	folders.setHeight100();

	VLayout buttons = new VLayout();
	buttons.setWidth100();
	buttons.setHeight(30);

	Button inheritRights = new Button(I18N.message("inheritrights"));
	inheritRights.setAutoFit(true);
	inheritRights.setMargin(1);
	inheritRights.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			LD.ask(I18N.message("inheritrights"),
					I18N.message("inheritrightsask", new String[] {
							FolderNavigator.get().getSelectedRecord().getAttributeAsString("name"),
							folders.getSelectedRecord().getAttributeAsString("name") }), new BooleanCallback() {

						@Override
						public void execute(Boolean value) {
							if (value) {
								FolderService.Instance.get()
										.inheritRights(
												panel.getFolder().getId(),
												Long.parseLong(folders.getSelectedRecord().getAttributeAsString(
														"folderId")), new AsyncCallback<GUIFolder>() {

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

													@Override
													public void onSuccess(GUIFolder arg) {
														panel.refresh(arg);
														destroy();
													}
												});
							}
							destroy();
						}
					});
		}
	});

	buttons.setMembers(inheritRights);

	content.setMembers(folders, buttons);
	addItem(content);
}
 
Example 17
Source File: ZoneEditor.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ZoneEditor(GUIZone zone) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("zone") + " - " + zone.getName());
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);

	this.zone = zone;

	IButton save = new IButton(I18N.message("save"));
	save.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

		@Override
		public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
			onSave();
		}
	});

	prepareForm();

	ImageWithCanvases sample = new ImageWithCanvases(zone.getSampleUrl(), 300, null, null);

	HLayout body = new HLayout();
	body.setMembers(form, sample);

	VLayout layout = new VLayout();
	layout.setMembersMargin(5);
	layout.setWidth100();
	layout.setMembers(body, save);

	addItem(layout);

	// Just to clean the upload folder
	DocumentService.Instance.get().cleanUploadedFileFolder(new AsyncCallback<Void>() {

		@Override
		public void onFailure(Throwable caught) {
		}

		@Override
		public void onSuccess(Void result) {
		}
	});
}
 
Example 18
Source File: ShareFileDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ShareFileDialog(boolean export) {
	super();
	this.export = export;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("sharefile"));
	setWidth(350);
	setHeight(300);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setPadding(3);

	VLayout content = new VLayout();
	content.setTop(10);
	content.setWidth100();
	content.setHeight100();
	content.setMembersMargin(3);

	tree = new ShareFileTree(export);
	tree.setWidth100();
	tree.setHeight100();

	VLayout buttons = new VLayout();
	buttons.setWidth100();
	buttons.setHeight(30);

	Button select = new Button(I18N.message("select"));
	select.setAutoFit(true);
	select.setMargin(1);
	select.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			if (ShareFileDialog.this.export)
				onExport();
			else
				onImport();
		}
	});

	buttons.setMembers(select);

	content.setMembers(tree, buttons);
	addItem(content);
}
 
Example 19
Source File: PersonalSubscriptions.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public PersonalSubscriptions() {
	super();

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("subscriptions"));
	setWidth(400);
	setHeight(350);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	// Initialize the listing panel as placeholder
	listing.setAlign(Alignment.CENTER);
	listing.setHeight100();
	listing.setWidth100();
	initListGrid();

	ToolStrip toolStrip = new ToolStrip();
	toolStrip.setHeight(20);
	toolStrip.setWidth100();
	toolStrip.addSpacer(2);

	ToolStripButton refresh = new ToolStripButton();
	refresh.setTitle(I18N.message("refresh"));
	toolStrip.addButton(refresh);
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			initListGrid();
		}
	});
	toolStrip.addFill();

	VLayout layout = new VLayout();
	layout.setMembersMargin(5);
	layout.setMargin(2);
	layout.addMember(toolStrip);
	layout.addMember(listing);

	addItem(layout);
}
 
Example 20
Source File: GoogleAuthenticatorSetup.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void init(String account, String key, String qrUrl) {
	// Prepare the form with account informations
	StaticTextItem accountItem = ItemFactory.newStaticTextItem("account", I18N.message("account"), account);
	accountItem.setWrap(false);
	accountItem.setWrapTitle(false);

	StaticTextItem keyItem = ItemFactory.newStaticTextItem("key", I18N.message("key"), key);
	keyItem.setWrap(false);
	keyItem.setWrapTitle(false);

	DynamicForm form = new DynamicForm();
	form.setTitleOrientation(TitleOrientation.LEFT);
	form.setItems(accountItem, keyItem);

	Label formTitle = new Label("<b>" + I18N.message(Constants.TWOFA_GOOGLE_AUTHENTICATOR+".hint1") + "</b>");
	formTitle.setWrap(true);
	formTitle.setMinWidth(250);

	VLayout formLayout = new VLayout();
	formLayout.setMembersMargin(2);
	formLayout.setMembers(formTitle, form);
	formLayout.setAlign(VerticalAlignment.TOP);

	// Prepare the QR Code
	HTMLFlow qrCode = new HTMLFlow("<img width='200' height='200' src='" + qrUrl + "'/>");
	qrCode.setOverflow(Overflow.VISIBLE);

	Label qrCodeTitle = new Label("<b>" + I18N.message(Constants.TWOFA_GOOGLE_AUTHENTICATOR+".hint2") + "</b>");
	qrCodeTitle.setWrap(true);
	qrCodeTitle.setMinWidth(250);

	VLayout qrCodeLayout = new VLayout();
	qrCodeLayout.setWidth100();
	qrCodeLayout.setHeight100();
	qrCodeLayout.setMembers(qrCodeTitle, qrCode);

	VLayout separator = new VLayout();
	separator.setWidth(20);

	HLayout body = new HLayout();
	body.setMembersMargin(2);
	body.setMembers(formLayout, separator, qrCodeLayout);

	setMembers(body);
}