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

The following examples show how to use com.smartgwt.client.widgets.layout.VLayout#setShowResizeBar() . 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: WorkflowTaskFormView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createMainLayout() {
    VLayout forms = new VLayout();
    forms.setOverflow(Overflow.AUTO);
    forms.addMember(createForm());
    forms.addMember(createParameterList());
    forms.setShowResizeBar(true);
    forms.setResizeBarTarget("next");

    VLayout main = new VLayout();
    main.addMember(createTaskToolbar());
    main.addMember(forms);
    main.addMember(createMaterialList());
    return main;
}
 
Example 2
Source File: WorkflowJobView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createJobLayout() {
    VLayout left = new VLayout();
    left.addMember(createJobsToolbar());
    left.addMember(createJobList());
    left.addMember(createSubjobList());
    left.setShowResizeBar(true);

    CanvasSizePersistence sizePersistence = new CanvasSizePersistence("WorkflowJobFormView.jobLayout", left);
    left.setWidth(sizePersistence.getWidth());

    HLayout l = new HLayout();
    l.addMember(left);
    l.addMember(createJobFormLayout());
    return l;
}
 
Example 3
Source File: SearchPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onDraw() {
	if (drawn)
		return;
	drawn = true;

	// Prepare the collapsable menu
	SearchMenu searchMenu = SearchMenu.get();
	searchMenu.setWidth(350);
	searchMenu.setShowResizeBar(true);

	// Initialize the listing panel as placeholder
	listingPanel = new HitsListPanel();
	listing.setAlign(Alignment.CENTER);
	listing.setHeight("51%");
	listing.setShowResizeBar(true);
	listing.addMember(listingPanel);

	// Add a details panel under the listing one
	detailPanel = new Label(" " + I18N.message("selectahit"));
	details.setAlign(Alignment.CENTER);
	details.addMember(detailPanel);

	// The two rows: listing and details
	VLayout listingAndDetails = new VLayout();
	listingAndDetails.setMembers(listing, details);
	listingAndDetails.setShowResizeBar(true);
	listingAndDetails.setResizeBarTarget("next");

	previewPanel = new SearchPreviewPanel();
	previewPanel.addVisibilityChangedHandler(new VisibilityChangedHandler() {

		@Override
		public void onVisibilityChanged(VisibilityChangedEvent event) {
			if (detailPanel instanceof DocumentDetailsPanel)
				previewPanel.setDocument(((DocumentDetailsPanel) detailPanel).getDocument());
		}
	});

	// The listing plus the preview
	HLayout bodyPanel = new HLayout();
	bodyPanel.setWidth100();
	bodyPanel.setMembers(listingAndDetails, previewPanel);

	body.setMembers(new SearchToolbar(listingPanel), bodyPanel);

	setMembers(searchMenu, body);
}
 
Example 4
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 5
Source File: DocumentsPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void onDraw() {
	if (initialized)
		return;

	// Register to folders events
	FolderController.get().addObserver(this);

	// Register to documents events
	DocumentController.get().addObserver(this);

	// Initialize the listing panel as placeholder
	listingPanel = new Label(" " + I18N.message("selectfolder"));
	listing.setAlign(Alignment.CENTER);
	listing.setHeight("51%");
	listing.setShowResizeBar(true);
	listing.addMember(listingPanel);

	// Add a details panel under the listing one
	detailPanel = new Label(" " + I18N.message("selectfolderordoc"));
	details.setAlign(Alignment.CENTER);
	details.addMember(detailPanel);

	// The two rows: listing and details
	VLayout listingAndDetails = new VLayout();
	listingAndDetails.setMembers(listing, details);
	listingAndDetails.setShowResizeBar(true);
	listingAndDetails.setResizeBarTarget("next");

	previewPanel = new DocumentsPreviewPanel();

	// The listing plus the preview
	HLayout bodyPanel = new HLayout();
	bodyPanel.setWidth100();
	bodyPanel.setMembers(listingAndDetails, previewPanel);

	body.setMembers(DocumentToolbar.get(), bodyPanel);

	documentsMenu = new DocumentsMenu();

	setMembers(documentsMenu, body);

	previewPanel.addVisibilityChangedHandler(new VisibilityChangedHandler() {

		@Override
		public void onVisibilityChanged(VisibilityChangedEvent event) {
			if (detailPanel instanceof DocumentDetailsPanel)
				previewPanel.setDocument(((DocumentDetailsPanel) detailPanel).getDocument());
		}
	});

	initialized = true;
}
 
Example 6
Source File: DigitalObjectChildrenEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public DigitalObjectChildrenEditor(ClientMessages i18n, PlaceController places, OptionalEditor preview) {
        this.i18n = i18n;
        this.places = places;
        this.preview = preview;
        this.actionSource = new ActionSource(this);
        this.goDownAction = DigitalObjectNavigateAction.child(i18n, places);
        relationDataSource = RelationDataSource.getInstance();
        childrenListGrid = initChildrenListGrid();
        this.selectionCache = SelectionCache.selector(childrenListGrid);
        VLayout childrenLayout = new VLayout();
        childrenLayout.setMembers(childrenListGrid);
        childrenLayout.setWidth("40%");
        childrenLayout.setShowResizeBar(true);

        SimpleEventBus eventBus = new SimpleEventBus();
        childPlaces = new PlaceController(eventBus);
        childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
        ActivityManager activityManager = new ActivityManager(
                new ChildActivities(childEditor), eventBus);

        VLayout editorsLayout = new VLayout();
        VLayout editorsOuterLayout = new VLayout();
//        editorsLayout.setBorder("1px solid grey");
        editorsLayout.addStyleName("defaultBorder");
        editorsOuterLayout.setLayoutLeftMargin(4);
        editorsOuterLayout.setMembers(editorsLayout);
        activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));

        widget = new HLayout();
        widget.setMembers(childrenLayout, editorsOuterLayout);
        relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {

            @Override
            public void onRelationChange(RelationChangeEvent event) {
                // issue 262: isVisible seems to be always true and isAttached is always null.
                // Add test isDrawn that seems to change for dettached widgets.
                if (digitalObject != null && childrenListGrid.isVisible() && childrenListGrid.isDrawn()) {
                    String changedPid = event.getPid();
                    if (changedPid != null) {
                        Record changedRecord = childrenListGrid.getDataAsRecordList()
                                .find(RelationDataSource.FIELD_PID, changedPid);
                        if (changedRecord == null) {
                            // moved object(s)
                            // ListGrid does not remove selection of removed/moved rows
                            // and it does not fire selection change
                            // issue 246: clear selection of moved row
                            childrenListGrid.deselectAllRecords();
                            DigitalObjectCopyMetadataAction.resetSelection();
                            showCopySelection(new Record[0]);
                            return ;
                        }
                    }
                    final ListGridRecord[] selection = childrenListGrid.getSelectedRecords();
                    relationDataSource.updateCaches(digitalObject.getPid(), new BooleanCallback() {

                        @Override
                        public void execute(Boolean value) {
                            // refresh the copy selection as updated records are missing the copy attribute
                            showCopySelection(DigitalObjectCopyMetadataAction.getSelection());
                            // refresh the list selection
                            selectChildren(selection);
                        }
                    });
                }
            }
        });
    }
 
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);
    }