Package org.jitterbit.ui.widget.overlay

Examples of org.jitterbit.ui.widget.overlay.OverlayDecorator$CancelAction


    }

    private OverlayDecorator createOverlay() {
        BorderLayoutBuilder cp = new BorderLayoutBuilder(getUi());
        cp.withEmptyBorder(10, 10, 10, 10);
        OverlayDecorator overlay = new OverlayDecorator(cp, getSuggestedTitle()) {

            @Override
            protected void onCancel() {
                handleCancel();
            }

            @Override
            protected void onHidden() {
                undoRedo.dispose();
                visible = false;
            }

            @Override
            protected void onDisplayed() {
                installUndoRedo();
            }

            private void installUndoRedo() {
                // TODO(?): Hook into the page's undo-redo system? If we do that we must
                // remember to clear all edits originating from the formula builder when
                // the formula builder is closed.
                TextUndoRedoControllerFactory f = UndoRedoControllers.textFactory();
                undoRedo = f.newController(getUi().getExpressionArea().getTextPane());
                undoRedo.alwaysConsumeKeyboardTriggers();
            }
        };
        overlay.setFillOut();
        overlay.setTitleStyle(TextStyles.DefaultBold);
        Action okAction = new OkAction();
        overlay.setOkAction(okAction);
        JComponent buttons = createOverlayButtons(overlay, okAction);
        getUi().setButtonPanel(buttons);
        overlay.setOkAsDefault(true);
        overlay.setBlocking(true);
        overlay.setFocusReceiverWhenClosed(getTreeMapper());
        installShortcuts(overlay);
        return overlay;
    }
View Full Code Here


            table.setVisibleRows(16);
        }

        @Override
        public void show(String title, String caption) {
            OverlayDecorator overlay = createOverlay(title, caption);
            overlay.show(container, new OverlayCenterPositioner());
            table.requestFocus();
        }
View Full Code Here

        private OverlayDecorator createOverlay(String title, String caption) {
            BorderLayoutBuilder layout = new BorderLayoutBuilder(0, 5);
            FilterField filterField = new FilterField(table);
            layout.northToSouth(caption, table, filterField).setBorder(Empty.border(10));
            OverlayDecorator decorator = new OverlayDecorator(layout, title) {

                @Override
                protected void onOk() {
                    Set<CROM> selected = Sets.newHashSet(table.getSelectedObjects());
                    applySelection(selected);
                }

                @Override
                protected void onHidden() {
                    giveFocusToTree();
                }
            };
            decorator.setFocusReceiverWhenClosed(node.getTreeMapper());
            decorator.setFadeIn(AnimationPreference.get());
            decorator.setAlpha(0.8f);
            decorator.useOkAndCancel();
            decorator.setBlocking(true);
            return decorator;
        }
View Full Code Here

        @Override
        public void display(final String title, final ActivityEntryFilterUi<E> filter, final FilterListener listener) {
            final String originalFilter = filter.getFilterString();
            BorderLayoutBuilder layout = new BorderLayoutBuilder(filter).setBorder(Empty.border(10));
            OverlayDecorator decorator = new OverlayDecorator(layout, title) {

                @Override
                protected void onOk() {
                    filter.apply();
                    notifyListeners(filter, listener, originalFilter);
                }
            };
            decorator.setFadeIn(AnimationPreference.get());
            decorator.setBlocking(true);
            decorator.useOkAndCancel();
            decorator.setAlpha(0.8f);
            decorator.show(container, getPositioner());
            filter.requestFocus();
        }
View Full Code Here

    }

    private OverlayDecorator createOverlay(UiProvider selector) {
        JComponent ui = layout(selector);
        ui.setBorder(Empty.border(10, 10, 0, 10));
        OverlayDecorator overlay = new OverlayDecorator(ui, null);
        overlay.setBlocking(true);
        overlay.setAlpha(0.5f);
        return overlay;
    }
View Full Code Here

    private void showWarning(Warning w) {
        if (isShowing) {
            queue.add(w);
        } else {
            OverlayDecorator overlay = createOverlay(w);
            overlay.show(container, new OverlayCenterPositioner());
            isShowing = true;
        }
    }
View Full Code Here

            isShowing = true;
        }
    }
   
    private OverlayDecorator createOverlay(Warning w) {
        OverlayDecorator decorator = new OverlayDecorator(w.getViewer(), w.title) {

            @Override
            protected void onHidden() {
                isShowing = false;
                showNextWarning();
            }
        };
        decorator.setTitleIcon(CommonIcons.WARNING_24);
        decorator.setBlocking(true);
        decorator.useCloseOnly();
        return decorator;
    }
View Full Code Here

    public void confirmOpeningOfLargeTestFile(final Receiver<Boolean> callback) {
        JLabel message = new JLabel("<html>This Transformation has test data available for display. " +
            "The test data is large,<br>and displaying it may affect performance." +
            "<br><br>Do you want to display the test data?</html>");
        message.setBorder(Empty.border(10));
        OverlayDecorator alert = new OverlayDecorator(message, "Display Test Data?") {

            @Override
            protected void onOk() {
                callback.handle(true);
            }

            @Override
            protected void onCancel() {
                callback.handle(false);
            }
        };
        alert.setTitleIcon(CommonIcons.WARNING_24);
        alert.setBlocking(true);
        alert.useOkAndCancel();
        alert.installOkAndCancelShortCuts();
        alert.getOkAction().putValue(Action.NAME, "&Yes");
        alert.getCancelAction().putValue(Action.NAME, "&No");
        alert.show(getOverlayContainer(), new OverlayCenterPositioner());
        askForAttention();
    }
View Full Code Here

    protected void overlayRemoved() {
        // Default does nothing
    }

    private OverlayDecorator createOverlay(final HttpPropertiesPanel panel) {
        OverlayDecorator decorator = new InputPanelOverlay(panel, getTitle()) {

            @Override
            protected void onOk() {
                updateProperties(panel);
            }

            @Override
            protected void onHidden() {
                overlayRemoved();
            }
        };
        decorator.setFadeIn(AnimationPreference.get());
        decorator.setAlpha(0.8f);
        decorator.setBlocking(true);
        decorator.useOkAndCancel();
        return decorator;
    }
View Full Code Here

        if (this.container != null) {
            // Already showing
            return;
        }
        this.container = container;
        OverlayDecorator decorator = new OverlayDecorator(panel, "Expanded Operation Options") {

            @Override
            protected void onHidden() {
                panel.dispose();
            }

            @Override
            protected void onOk() {
                panel.apply();
            }
        };
        decorator.setBlocking(true);
        decorator.useOkAndCancel();
        decorator.show(container, new OverlayCenterPositioner());
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.ui.widget.overlay.OverlayDecorator$CancelAction

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.