Package org.jitterbit.ui.dialog

Examples of org.jitterbit.ui.dialog.KongaDialog


        return UiThreadSupplier.call(new Supplier<Resolution>() {

            @Override
            public Resolution get() {
                Ui ui = new Ui();
                KongaDialog dialog = createDialog(ui);
                dialog.setLocationRelativeTo(null);
                dialog.setVisible(true);
                if (dialog.wasOkPressed()) {
                    if (ui.isOverwriteSelected()) {
                        model.setFileName(originalFileName);
                        return Resolution.OVERWRITE;
                    }
                    return Resolution.NEW_NAME;


    private class DialogEditor implements Editor {

        @Override
        public void show(NodeRenamerPanel panel) {
            KongaDialog dlg = createDialog(panel);
            dlg.setVisible(true);
            if (dlg.wasOkPressed()) {
                applyNewName(panel.getNewName());
            }
        }

                applyNewName(panel.getNewName());
            }
        }

        private KongaDialog createDialog(final NodeRenamerPanel panel) {
            KongaDialog dlg = new InputPanelDialog(node.getTreeMapper().getOwner(), panel, "Rename Node") {

                @Override
                protected void onDialogOpened() {
                    super.onDialogOpened();
                    panel.requestFocus();

    public void open(Component invoker) {
        String originalRoot = model.getRootName();
        String originalTNS = model.getTargetNamespace();
        boolean originalDefault = model.isIncludeDefaultsSelected();
        KongaDialog dialog = createDialog(invoker);
        dialog.setVisible(true);
        if (dialog.wasCancelled()) {
            model.setRootName(originalRoot);
            model.setTargetNamespace(originalTNS);
            model.setIncludeDefaultsSelected(originalDefault);
        }
        bindings.dispose();

        bindings.dispose();
    }

    private KongaDialog createDialog(Component invoker) {
        UiProvider ui = layoutDialog();
        KongaDialog dialog = new KongaDialog(SwingUtilities.getWindowAncestor(invoker), "XSD Options");
        dialog.standardLayout(ui, KongaDialog.OK_CANCEL);
        dialog.setOkButtonAsDefault();
        dialog.setLocationRelativeTo(null);
        bindOkButton(dialog);
        return dialog;
    }

        this.project = project;
    }

    public void show() {
        IntegrationEntityTree tree = createTree();
        KongaDialog dialog = createDialog(tree);
        dialog.setVisible(true);
    }

    }

    private KongaDialog createDialog(IntegrationEntityTree tree) {
        BorderLayoutBuilder layout = new BorderLayoutBuilder(0, 2);
        layout.north("The following items will be deployed:").center(tree);
        KongaDialog dialog = new KongaDialog(UiUtils.getActiveFrame(), "Items To Deploy", true);
        dialog.standardLayout(layout, KongaDialog.CLOSE_ONLY);
        dialog.setLocationRelativeTo(null);
        dialog.manageLocation(DeployDataPreview.class);
        return dialog;
    }

    }

    private static String askForPassword(Locatable original) {
        KongaPasswordField field = new KongaPasswordField(20);
        OneColumnPanel col = layoutQuestion(original, field);
        KongaDialog dialog = createDialog(field, col);
        dialog.setVisible(true);
        return dialog.wasOkPressed() ? new String(field.getPassword()) : null;
    }

        col.add(field);
        return col;
    }

    private static KongaDialog createDialog(KongaPasswordField field, UiProvider ui) {
        final KongaDialog dialog = new KongaDialog(ApplicationUi.getAppWinFrame(), "Password?", true);
        dialog.setFixedButtonSize(false);
        dialog.standardLayout(ui, KongaDialog.CONTINUE_CANCEL);
        dialog.getCancelButton().setText("I'll provide the password later");
        field.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                dialog.getContinueButton().doClick();
            }
        });
        dialog.setContinueButtonAsDefault();
        dialog.setLocationRelativeTo(null);
        dialog.setResizable(false);
        dialog.setFocusedComponent(field);
        return dialog;
    }

        private void showDialog(String destinationClass, ObjectClassStructure[] structs, NumericOid[] preSelected,
                        AuxiliaryClassSelectorCallback callback) {
            String title = "Select Auxiliary Classes for \"" + destinationClass + "\"";
            AuxiliaryClassSelectionTree tree = new AuxiliaryClassSelectionTree(structs, disableReadOnlyAttrs, title);
            tree.setSelectedClasses(preSelected);
            KongaDialog dialog = new KongaDialog(UiUtils.getActiveWindow(), title);
            dialog.standardLayout(tree, KongaDialog.OK_CANCEL);
            dialog.manageLocation(AuxiliaryClassSelector.class);
            dialog.setVisible(true);
            if (dialog.wasOkPressed()) {
                List<ObjectClassStructure> selected = tree.getSelectedStructures();
                callback.completed(selected.toArray(new ObjectClassStructure[selected.size()]));
            } else {
                callback.cancelled();
            }

TOP

Related Classes of org.jitterbit.ui.dialog.KongaDialog

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.