Package com.smartgwt.client.widgets

Examples of com.smartgwt.client.widgets.Canvas


                if (!topLevelViewId.equals(this.currentViewId)) {
                    // Destroy the current canvas before creating the new one. This helps prevent locator
                    // conflicts if the old and new content share (logical) widgets.  A call to destroy (e.g. certain
                    // IFrames/FullHTMLPane) can actually remove multiple children of the contentCanvas. As such, we
                    // need to query for the children after each destroy to ensure only valid children are in the array.
                    final Canvas contentCanvas = Canvas.getById(CONTENT_CANVAS_ID);
                    Canvas[] children;
                    while ((children = contentCanvas.getChildren()).length > 0) {
                        children[0].destroy();
                    }

                    // Set the new content and redraw
                    this.currentViewId = topLevelViewId;

                    // Using GWT Code Splitting feature to decrease the size of generated JS code using lazy
                    // fetching. Each view built in createContent method has its Java Script code in a separate
                    // file.
                    final long startTime = System.currentTimeMillis();
                    GWT.runAsync(new RunAsyncCallback() {
                        public void onFailure(Throwable caught) {
                          Window.alert("Code download failed");
                          Log.error("Code download failed");
                        }

                        public void onSuccess() {
                            RootCanvas.this.currentCanvas = createContent(RootCanvas.this.currentViewId.getPath());
                            if (null != RootCanvas.this.currentCanvas) {
                                contentCanvas.addChild(RootCanvas.this.currentCanvas);
                            }
                            contentCanvas.markForRedraw();
                            render(viewPath);
                            Log.info("Time to Load first codesplit fragment: "+(System.currentTimeMillis() - startTime) + " ms.");
                        }
                      });
                } else {
View Full Code Here


            + StringUtility.escapeHtml(bundle.getName()), "Bundles/Bundle/" + bundle.getId());

        HeaderLabel header = new HeaderLabel(Canvas.getImgURL(IconEnum.BUNDLE_DESTINATION.getIcon24x24Path()),
            StringUtility.escapeHtml(destination.getName()));

        Canvas detail = new Canvas();
        detail.setHeight("50%");
        detail.hide();

        addMember(backButton);
        addMember(header);

        //conditionally add tags. Defaults to true, not available in JON builds.
View Full Code Here

     * Switches to viewing the details canvas, hiding the table. This does not
     * do anything with reloading data or switching to the selected row in the table;
     * this only changes the visibility of canvases.
     */
    protected void switchToDetailsView() {
        Canvas contents = getTableContents();

        // If the Table has not yet been initialized then ignore
        if (contents != null) {
            // If the table view is visible then gracefully switch to the details view.
            if (contents.isVisible()) {
                contents.animateHide(AnimationEffect.WIPE, new AnimationCallback() {
                    @Override
                    public void execute(boolean b) {
                        buildDetailsView();
                    }
                });
            } else {
                // Even if the table view is not visible, it may not be hidden. Instead, it may be the
                // case that its parent (the encompassing Table/HLayout) may not be visible.  This is unusual
                // because typically we switch between the table and detail view while under the subtab, but
                // if we navigate to the detail view from another subtab (for example, the drift tree context
                // menu) the Table may not be visible and the table view may not be hidden.  To make a long
                // story short, ensure the table view is hidden when displaying the details view.
                contents.hide();

                /*
                 * if the programmer chooses to go directly from the detailView in create-mode to the
                 * detailsView in edit-mode, the content canvas will already be hidden, which means the
                 * animateHide would be a no-op (the event won't fire).  this causes the detailsHolder
View Full Code Here

    /**
     * Switches to viewing the table, hiding the details canvas.
     */
    protected void switchToTableView() {
        final Canvas contents = getTableContents();
        if (contents != null) {
            // If this is not the initial display of the table, refresh the table's data. Otherwise, a refresh would be
            // redundant, since the data was just loaded when the table was drawn.
            if (this.initialDisplay) {
                this.initialDisplay = false;
            } else {
                Log.debug("Refreshing data for Table [" + getClass().getName() + "]...");
                refresh();
            }
            // if the detailsHolder is visible then gracefully switch views, otherwise just
            // clean up any lingering details holder and show the table view.
            if (detailsHolder != null && detailsHolder.isVisible()) {
                detailsHolder.animateHide(AnimationEffect.WIPE, new AnimationCallback() {
                    @Override
                    public void execute(boolean b) {
                        EnhancedUtility.destroyMembers(detailsHolder);

                        contents.animateShow(AnimationEffect.WIPE);
                    }
                });
            } else {
                if (detailsHolder != null) {
                    EnhancedUtility.destroyMembers(detailsHolder);
                }
                contents.animateShow(AnimationEffect.WIPE);
            }
        }
    }
View Full Code Here

            @Override
            public void onClick(ClickEvent clickEvent) {
                VLayout layout = new VLayout();
                final PopupWindow w = new PopupWindow(null);

                Canvas nowCanvas = new Canvas();
                nowCanvas.setWidth(1);
                nowCanvas.setHeight(1);


                DynamicForm delayForm = new DynamicForm();
                delayForm.setTitleOrientation(TitleOrientation.TOP);
                TreeSet<TimeUnit> timeUnits = new TreeSet<TimeUnit>();
View Full Code Here

                button.setShowTitle(false);
                button.setStartRow(true);
                button.setValueMap(label.getTitle());
                items.add(button);

                Canvas value = valueMap.get(label);
                CanvasItem ci = new CanvasItem();
                ci.setShowTitle(false);
                if (value != null) {
                    ci.setCanvas(value);
                }
View Full Code Here

        }

        public void updateEnablement() {
            for (NameAndTitle key : canvasItems.keySet()) {
                CanvasItem canvasItem = canvasItems.get(key);
                Canvas nestedCanvas = canvasItem.getCanvas();
                boolean disabled = !selected.equals(key.getTitle());
                if (disabled) {
                    canvasItem.disable();
                    clearValues(nestedCanvas);
                    canvas.getItem(key.getName()).clearValue();
                    if (nestedCanvas != null) {
                        nestedCanvas.markForRedraw();
                    }
                } else {
                    canvasItem.enable();
                }
            }
View Full Code Here

        setHeight100();

        treeView = new ResourceGroupTreeView();
        addMember(treeView);

        contentCanvas = new Canvas();
        addMember(contentCanvas);
    }
View Full Code Here

            tabSet.selectTab(generalPropertiesTab);
        }
    }

    private void setBackButtonDisabled(boolean enabled) {
        Canvas layoutCandidate = getParentElement();
        if (layoutCandidate instanceof EnhancedVLayout) {
            EnhancedVLayout parentLayout = (EnhancedVLayout) getParentElement();
            Canvas backButton = parentLayout.getMember("backButton");
            if (backButton != null) {
                backButton.setDisabled(enabled);
            }
        }
    }
View Full Code Here

    @Override
    protected void onInit() {
        super.onInit();

        Canvas c = view.getHelpCanvas();

        VLayout layout = new VLayout();
        layout.setWidth100();
        layout.setHeight100();
        layout.setPadding(15);
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.Canvas

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.