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

The following examples show how to use com.smartgwt.client.widgets.layout.VLayout#setWidth100() . 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: DesaExportAction.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public ExportResultWidget() {
    i18n = GWT.create(ClientMessages.class);
    VLayout vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setHeight100();
    grid = new ListGrid();
    grid.setSelectionType(SelectionStyle.SINGLE);
    grid.setFixedRecordHeights(false);
    grid.setWrapCells(true);
    ListGridField pidField = new ListGridField(ExportResourceApi.RESULT_ERROR_PID,
            i18n.ExportResultWidget_PID_Title());

    ListGridField errorField = new ListGridField(ExportResourceApi.RESULT_ERROR_MESSAGE,
            i18n.ExportResultWidget_Message_Title());
    grid.setFields(pidField, errorField);
    grid.addSelectionUpdatedHandler(new SelectionUpdatedHandler() {

        @Override
        public void onSelectionUpdated(SelectionUpdatedEvent event) {
            logForm.editSelectedData(grid);
        }
    });
    logForm = createLogForm();
    vLayout.setMembers(grid, logForm);
    this.widget = vLayout;
}
 
Example 2
Source File: ProgressTracker.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public ProgressTracker(ClientMessages i18n) {
    this.i18n = i18n;
    widget = new VLayout(4);
    label = new Label();
    label.setWidth100();
    label.setAutoHeight();
    progressbar = new Progressbar();
    progressbar.setVertical(false);
    progressbar.setLength(400);
    progressbar.setBreadth(24);

    widget.setMembers(label, progressbar);
    widget.setWidth100();
    widget.setAutoHeight();
    progressPrefix = i18n.ProgressTracker_Progress_0();

    closeBtn = new IButton(i18n.ProgressTracker_CloseBtn_Title(), new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            stop();
        }
    });
    closeBtn.setTooltip(i18n.ProgressTracker_CloseBtn_Hint());
    closeBtn.setAutoFit(true);

}
 
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: TaskEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private VLayout prepareAutomationPanel() {
	VLayout automationPanel = new VLayout();
	automationPanel.setWidth100();
	automationPanel.setHeight100();

	DynamicForm automationForm = new DynamicForm();
	automationForm.setTitleOrientation(TitleOrientation.TOP);
	automationForm.setNumCols(1);
	automationForm.setValuesManager(vm);

	TextAreaItem onCreation = ItemFactory.newTextAreaItemForAutomation("onCreation",
			state.getType() == GUIWFState.TYPE_TASK ? "execscriptontaskreached" : "execscriptonenstatusreached",
			state.getOnCreation(), null, false);
	onCreation.setWidth("*");
	onCreation.setHeight(200);
	onCreation.setWrapTitle(false);

	TextAreaItem onAssignment = ItemFactory.newTextAreaItemForAutomation("onAssignment",
			"execscriptontaskassignment", state.getOnAssignment(), null, false);
	onAssignment.setWidth("*");
	onAssignment.setHeight(200);
	onAssignment.setWrapTitle(false);

	if (state.getType() == GUIWFState.TYPE_TASK)
		automationForm.setItems(onCreation, onAssignment);
	else {
		onCreation.setHeight(400);
		automationForm.setItems(onCreation);
	}

	automationPanel.addMember(automationForm);

	return automationPanel;
}
 
Example 5
Source File: FormEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public FormEditor(GUIDocument form) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("form") + " " + form.getFileName());

	this.form = form;

	setWidth(com.google.gwt.user.client.Window.getClientWidth());
	setHeight(com.google.gwt.user.client.Window.getClientHeight());
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			destroy();
		}
	});

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

	prepareBody();

	addItem(layout);
}
 
Example 6
Source File: ZohoEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ZohoEditor(final GUIDocument document) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("editdoc") + ": " + document.getFileName());

	this.document = document;

	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setAutoSize(true);
	centerInPage();
	setMargin(2);

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			onCancel();
		}
	});

	layout = new VLayout();
	layout.setMargin(1);
	layout.setWidth100();
	layout.setHeight100();
	addItem(layout);

	prepareBody();
}
 
Example 7
Source File: WebcontentEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public WebcontentEditor(final GUIDocument document) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	if (document.getId() > 0)
		setTitle(I18N.message("editdoc") + ": " + document.getFileName());
	else
		setTitle(I18N.message("createdoc") + ": " + document.getFileName());

	this.document = document;

	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setWidth100();
	setHeight100();
	centerInPage();

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			unlockAndClose();
		}
	});

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

	prepareBody();

	addItem(layout);
}
 
Example 8
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 9
Source File: UrnNbnAction.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ExportResultWidget() {
            i18n = GWT.create(ClientMessages.class);
            VLayout vLayout = new VLayout();
            vLayout.setWidth100();
            vLayout.setHeight100();
            grid = new ListGrid();
            grid.setSelectionType(SelectionStyle.SINGLE);
            grid.setFixedRecordHeights(false);
            grid.setWrapCells(true);
            grid.setShowClippedValuesOnHover(true);
            ListGridField pidField = new ListGridField(DigitalObjectResourceApi.DIGITALOBJECT_PID,
                    i18n.ExportResultWidget_PID_Title());

//            ListGridField errorField = new ListGridField(DigitalObjectResourceApi.URNNBN_ITEM_MESSAGE,
//                    i18n.ExportResultWidget_Message_Title());
            ListGridField urnNbnField = new ListGridField(DigitalObjectResourceApi.URNNBN_ITEM_URNNBN,
                    i18n.UrnNbnAction_Result_UrnNbn_Title());
            ListGridField labelField = new ListGridField(DigitalObjectResourceApi.MEMBERS_ITEM_LABEL,
                    i18n.UrnNbnAction_Result_Label_Title());
            ListGridField modelField = new ListGridField(DigitalObjectResourceApi.DIGITALOBJECT_MODEL,
                    i18n.UrnNbnAction_Result_Model_Title());
            ListGridField statusField = new ListGridField(DigitalObjectResourceApi.URNNBN_ITEM_STATUSTYPE,
                    i18n.UrnNbnAction_Result_Error_Title());
            ListGridField warningField = new ListGridField(DigitalObjectResourceApi.URNNBN_ITEM_WARNING,
                    i18n.UrnNbnAction_Result_Status_Title(), 50);
            warningField.setCellAlign(Alignment.CENTER);
            warningField.setEmptyCellValue(":-)");
            HashMap<String, String> statusValues = new HashMap<String, String>();
            statusValues.put("true", ":-|");
            statusValues.put("false", ":-(");
            warningField.setValueMap(statusValues);

            grid.setFields(labelField, modelField, statusField, urnNbnField, warningField, pidField);

            grid.addSelectionUpdatedHandler(new SelectionUpdatedHandler() {

                @Override
                public void onSelectionUpdated(SelectionUpdatedEvent event) {
                    logForm.editSelectedData(grid);
                }
            });
            logForm = createLogForm();
            vLayout.setMembers(grid, logForm);
            this.widget = vLayout;
        }
 
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: SignatureDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public SignatureDialog(long[] docIds) {
	super();

	this.docIds = docIds;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("signature"));
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setAutoSize(true);
	centerInPage();

	VLayout layout = new VLayout();
	layout.setWidth100();
	layout.setHeight(40);

	form.setValuesManager(vm);
	form.setWrapItemTitles(false);
	form.setTitleOrientation(TitleOrientation.TOP);
	form.setNumCols(2);

	TextItem reason = ItemFactory.newTextItem("reason", "reason", null);
	reason.setRequired(true);
	reason.setWrapTitle(false);
	reason.setWidth(250);
	reason.setAutoComplete(AutoComplete.NONE);

	visualPositioning = new CheckboxItem();
	visualPositioning.setName("visualpositioning");
	visualPositioning.setTitle(I18N.message("visualpositioning"));
	visualPositioning.setDisabled(true);

	form.setItems(reason, visualPositioning);

	IButton sign = new IButton(I18N.message("sign"));
	sign.setAutoFit(true);
	sign.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			onSign();
		}
	});

	HLayout buttons = new HLayout();
	buttons.setMembersMargin(5);
	buttons.setMargin(3);
	buttons.addMember(sign);

	layout.addMember(form);
	layout.addMember(buttons);

	addItem(layout);

	SignService.Instance.get().isVisualSignatureEnabled(new AsyncCallback<Boolean>() {

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

		@Override
		public void onSuccess(Boolean enabled) {
			visualPositioning.setDisabled(!enabled);
		}
	});
}
 
Example 12
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 13
Source File: FolderSearchDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public FolderSearchDialog(FolderSelector selector) {
	this.selector = selector;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("folder"));
	setWidth(450);
	setHeight(600);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setMembersMargin(0);

	form = new FolderSearchForm() {
		@Override
		protected void search(GUISearchOptions options) {
			FolderSearchDialog.this.search(options);
		}
	};
	form.setWidth100();
	form.setHeight100();
	

	grid.setWidth100();
	grid.setHeight100();
	grid.setMinHeight(220);
	ListGridField name = new ListGridField("name", I18N.message("name"));
	ListGridField description = new ListGridField("description", I18N.message("description"));
	grid.setFields(name, description);
	grid.setSelectionType(SelectionStyle.SINGLE);
	grid.setEmptyMessage(I18N.message("notitemstoshow"));
	grid.setShowRecordComponents(true);
	grid.setShowRecordComponentsByCell(true);
	grid.setAutoFetchData(true);
	grid.setWrapCells(false);
	grid.setData(lastResult);

	grid.addDoubleClickHandler(new DoubleClickHandler() {
		@Override
		public void onDoubleClick(DoubleClickEvent event) {
			ListGridRecord selection = grid.getSelectedRecord();
			onSelect(selection.getAttributeAsLong("id"), selection.getAttribute("name"));
		}
	});

	VLayout formPanel=new VLayout();
	formPanel.setWidth100();
	formPanel.setHeight(300);
	formPanel.setShowResizeBar(true);
	formPanel.addMember(form);
	
	VLayout gridPanel=new VLayout();
	formPanel.setWidth100();
	gridPanel.setHeight("*");
	gridPanel.addMember(grid);
	
	addItem(formPanel);
	addItem(gridPanel);
}
 
Example 14
Source File: Editor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public void onModuleLoad() {
        INSTANCE = this;
        initLogging();
        
        ClientUtils.info(LOG, "onModuleLoad:\n module page: %s\n host page: %s"
                + "\n getModuleName: %s\n getPermutationStrongName: %s\n version: %s"
                + "\n Page.getAppDir: %s, \n Locale: %s",
                GWT.getModuleBaseURL(), GWT.getHostPageBaseURL(),
                GWT.getModuleName(), GWT.getPermutationStrongName(), GWT.getVersion(),
                Page.getAppDir(), LanguagesDataSource.activeLocale()
                );

        // remove the loading wrapper. See index.html
        DOM.getElementById("loadingWrapper").removeFromParent();

        I18nUtil.initMessages(ClientUtils.createSmartGwtMessages());
        i18n = GWT.create(ClientMessages.class);

        errorHandler = new ErrorHandler();
        errorHandler.initTransportErrorHandler();

        LoginWindow.login();

        presenterFactory = new PresenterFactory(i18n);

        editorWorkFlow = new EditorWorkFlow(getDisplay(), presenterFactory, i18n);
        presenterFactory.setPlaceController(editorWorkFlow.getPlaceController());

        final TreeGrid menu = createMenu();

        sweepTask = new SweepTask() {

            @Override
            public void processing() {
                SC.clearPrompt();
                TreeNode[] menuContent = createMenuContent();
                Tree tree = menu.getTree();
                TreeNode root = tree.getRoot();
                tree.addList(menuContent, root);
                tree.openAll();
                editorWorkFlow.init();
            }
        };

        final HLayout mainLayout = new HLayout();
//        mainLayout.setLayoutMargin(5);
        mainLayout.setWidth100();
        mainLayout.setHeight100();
        mainLayout.setMembers(getDisplay());

        Canvas mainHeader = createMainHeader(menu);

        VLayout desktop = new VLayout(0);
        desktop.setWidth100();
        desktop.setHeight100();
        desktop.setMembers(mainHeader, mainLayout);
        desktop.draw();

        SC.showPrompt(i18n.Editor_InitialLoading_Msg());
        LocalizationDataSource.getInstance().initOnStart(sweepTask.expect());
        ValueMapDataSource.getInstance().initOnStart(sweepTask.expect());
        loadPermissions();
    }
 
Example 15
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 16
Source File: ErrorHandler.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
/**
     * Notifies user about error.
     * @param msg simple client message
     * @param detailMsg detail response message; can be HTML
     * @param debugInfo request details, URL, ...
     */
    private void warn(String msg, String detailMsg, String debugInfo) {
        if (msg == null) {
            msg = i18n.ErrorHandler_UnexpectedError_Msg();
        }
        SmartGwtMessages sgi18n = ClientUtils.createSmartGwtMessages();
        boolean allowDetail = !msg.equals(detailMsg);
        final Dialog d = new Dialog();
        d.setTitle(sgi18n.dialog_WarnTitle());
        d.setIsModal(true);
        d.setAutoSize(Boolean.FALSE);
        d.setMessage(msg);
        d.setIcon("[SKIN]warn.png");
        d.setCanDragResize(true);
        d.setCanDragReposition(Boolean.TRUE);
        d.setKeepInParentRect(Boolean.TRUE);
//        d.setShowMaximizeButton(Boolean.TRUE);
        d.setMinMemberSize(50);
        Button details = new Button(i18n.ErrorHandler_ButtonDetalis_Title());
        details.setVisible(allowDetail);
        d.setButtons(Dialog.OK, details);
        if (allowDetail) {
            Canvas errorPane = new Canvas();
            errorPane.setOverflow(Overflow.AUTO);
            errorPane.setWidth100();
            errorPane.setHeight100();
            errorPane.setContents(detailMsg);
            errorPane.setCanSelectText(true);
            Canvas debugInfoPane = new Canvas();
            debugInfoPane.setWidth100();
            debugInfoPane.setAutoHeight();
            debugInfoPane.setContents(debugInfo);
            debugInfoPane.setCanSelectText(true);
            final VLayout detailPane = new VLayout(4);
            detailPane.setLayoutMargin(4);
            detailPane.setGroupTitle(i18n.ErrorHandler_ButtonDetalis_Title());
            detailPane.setIsGroup(true);
            detailPane.setVisible(false);
            detailPane.addMember(errorPane);
            detailPane.addMember(debugInfoPane);
            detailPane.setWidth100();
            detailPane.setHeight100();
            d.addItem(detailPane);
            details.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                    if (detailPane.isVisible()) {
                        d.restore();
                    } else {
                        d.maximize();
                    }
                    detailPane.setVisible(!detailPane.isVisible());
                }
            });
        }
        d.show();
    }
 
Example 17
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 18
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 19
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 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);
}