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

The following examples show how to use com.smartgwt.client.widgets.layout.VLayout#setHeight100() . 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: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public DigitalObjectPreview(ClientMessages i18n) {
    this.i18n = i18n;
    zoomValues = new ValuesManager();
    zoomValues.setValue(FIELD_ZOOM, Zoom.FIT_PANEL);
    VLayout imgContainer = new VLayout();
    imgContainer.setAlign(Alignment.CENTER);

    windowContainer = new VLayout();
    windowContainer.setAlign(Alignment.CENTER);
    windowContainer.setWidth100();
    windowContainer.setHeight100();
    imageWindow = createFullImageWindow(windowContainer);

    previewLayout = new VLayout();
    previewLayout.setBackgroundColor(BACKGROUND_COLOR);
    previewLayout.addMember(imgContainer);
    previewLoadTask = new ImageLoadTask(imgContainer,
            new Zoom(zoomValues.getValueAsString(FIELD_ZOOM)), false, i18n);
}
 
Example 2
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 3
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 4
Source File: UsersView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public UsersView(ClientMessages i18n) {
    this.i18n = i18n;

    ToolStrip toolbar = createToolbar(i18n);
    userGrid = createUserList(toolbar);

    VLayout main = new VLayout();
    main.setWidth100();
    main.setHeight100();
    main.addMember(userGrid);
    this.widget = main;
}
 
Example 5
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 6
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 7
Source File: ImportBatchItemEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ImportBatchItemEditor(ClientMessages i18n) {
        this.i18n = i18n;
        this.setHeight100();
        this.setWidth100();
        this.actionSource = new ActionSource(this);
        
        VLayout layout = new VLayout();
        layout.setShowResizeBar(true);
        layout.setResizeBarTarget("next");

        batchItemGrid = createItemList();
        layout.addMember(batchItemGrid);

        // child editors
        SimpleEventBus eventBus = new SimpleEventBus();
        childPlaces = new PlaceController(eventBus);
        childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
        childDisplay = initDigitalObjectEditor(childEditor, eventBus);
        layout.addMember(childDisplay);

        HLayout editorThumbLayout = new HLayout();
        editorThumbLayout.setHeight100();
        editorThumbLayout.addMember(layout);

        thumbViewer = createThumbViewer();
        editorThumbLayout.addMember(thumbViewer);

        this.selectionCache = new SelectionCache<>(
                Optional.empty(),
                r -> batchItemGrid.getRecordIndex(r));

        VLayout editorThumbToolbarLayout = new VLayout();
        editorThumbToolbarLayout.setShowResizeBar(true);
        editorThumbToolbarLayout.setResizeBarTarget("next");

        createActions();
        ToolStrip editorToolStrip = createEditorToolBar(actionSource);
        editorThumbToolbarLayout.addMember(editorToolStrip);
        editorThumbToolbarLayout.addMember(editorThumbLayout);

        addMember(editorThumbToolbarLayout);

        digitalObjectPreview = new MediaEditor(i18n, MediaEditor.SOURCE_IMPORT_BATCH_ITEM_EDITOR);
        digitalObjectPreview.addBackgroundColorListeners(thumbViewer);
        digitalObjectPreview.setShowRefreshButton(true);
        ToolStrip previewToolbar = Actions.createToolStrip();
        previewToolbar.setMembers(digitalObjectPreview.getToolbarItems());
        VLayout previewLayout = new VLayout();
        previewLayout.setMembers(previewToolbar, digitalObjectPreview.getUI());
        previewLayout.setWidth("40%");
        previewLayout.setHeight100();
//        previewLayout.setShowResizeBar(true);
//        previewLayout.setResizeFrom("L");
        addMember(previewLayout);
        createEditorContextMenu(batchItemGrid.getContextMenu(), this);
        createEditorContextMenu(thumbViewer.getContextMenu(), this);
    }
 
Example 8
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 9
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 10
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 11
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 12
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);
}
 
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: TaskEditor.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private VLayout prepareMessagesPanel() {
	VLayout messagesPanel = new VLayout();
	messagesPanel.setWidth100();
	messagesPanel.setHeight100();

	DynamicForm messagesForm = new DynamicForm();
	messagesForm.setTitleOrientation(TitleOrientation.TOP);
	messagesForm.setNumCols(2);
	messagesForm.setTitleOrientation(TitleOrientation.LEFT);
	messagesForm.setValuesManager(vm);

	SelectItem creationMessageTemplate = ItemFactory.newSelectItem("creationMessageTemplate",
			state.getType() == GUIWFState.TYPE_TASK ? "messageontaskreached" : "messageonendstatusreached");
	creationMessageTemplate.setWrapTitle(false);

	SelectItem assignmentMessageTemplate = ItemFactory.newSelectItem("assignmentMessageTemplate",
			"messageontaskassignment");
	assignmentMessageTemplate.setWrapTitle(false);

	SelectItem reminderMessageTemplate = ItemFactory.newSelectItem("reminderMessageTemplate", "messageonremind");
	reminderMessageTemplate.setWrapTitle(false);

	if (state.getType() == GUIWFState.TYPE_TASK)
		messagesForm.setItems(creationMessageTemplate, assignmentMessageTemplate, reminderMessageTemplate);
	else
		messagesForm.setItems(creationMessageTemplate);

	messagesPanel.addMember(messagesForm);

	MessageService.Instance.get().loadTemplates(I18N.getLocale(), "user",
			new AsyncCallback<GUIMessageTemplate[]>() {

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

				@Override
				public void onSuccess(GUIMessageTemplate[] templates) {
					LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
					map.put("", "");
					for (GUIMessageTemplate t : templates)
						map.put("" + t.getName(), t.getName());

					creationMessageTemplate.setValueMap(map);
					creationMessageTemplate.setValue("");
					creationMessageTemplate.setValue(state.getCreationMessageTemplate());

					assignmentMessageTemplate.setValueMap(map);
					assignmentMessageTemplate.setValue("");
					assignmentMessageTemplate.setValue(state.getAssignmentMessageTemplate());

					reminderMessageTemplate.setValueMap(map);
					reminderMessageTemplate.setValue("");
					reminderMessageTemplate.setValue(state.getReminderMessageTemplate());
				}
			});

	return messagesPanel;
}
 
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);
}