Package org.rat.free.security.makifx.base

Examples of org.rat.free.security.makifx.base.EncryptedNode


        if (editor == null) {
            return;
        }

        String tit = editor.__tab.getText();
        EncryptedNode node = editor.getNode();

        if (node == null) {
            UtilityFX.log("node is null for " + editor + " editor: " + tit);
        }

        if (!isValidTitle(editor)) {

            evt.consume();

            showMessage("close_editor_invalid_title_message", "Invalid Title.",
                    "Press Ok to delete the account or Cancel to edit it.",
                    "Ok", "Cancel", false, new AnswarePopupMessage() {
                        @Override
                        public void onOkAnsware() {

                            UtilityFX.log("INVALID TITLE REMOVE! tit:" + tit);
                            deleteAccount(editor);
                        }

                        @Override
                        public void onCancelAnsware() {
                            editor.__tab_edit_title_txt.requestFocus();
                            EffectFX.arrowIndicationError(editor.__tab_edit_title_txt);
                        }
                    });
            return;
        }

        /**
         * Se il titolo era valido e i valori sono diversi da quelli salvati
         * allora si sta chiudendo un tab prima di salvare, mostro un mess
         * di avviso.
         * node.getProperties().put("url_value", "");
         * node.getProperties().put("comment_value", "");
         * node.getProperties().put("email_value", "");
         */
        boolean show_warning = false;

        String title_saved = editor.getNode().getProperties().get("title");
        String title_present = editor.__tab_edit_title_txt.getText();

        String url_value_saved = editor.getNode().getProperties().get("url_value");
        String url_value_present = editor.__tab_edit_url_txt.getText();

        String comment_value_saved = editor.getNode().getProperties().get("comment_value");
        String comment_value_present = editor.__tab_edit_area_comment.getText();

        String email_value_saved = editor.getNode().getProperties().get("email_value");
        String email_value_present = editor.__tab_edit_email_txt.getText();

        String val_saved_book = editor.getNode().getProperties().get("bookmark_value");
        String val_present_book = editor.__combo_book.getSelectionModel().getSelectedItem().toString();

        if ((val_present_book != null && !val_present_book.equals(val_saved_book))) {

            editor.getNode().getProperties().put("bookmark_value", Constants.NO_BOOKMARK);
            editor.__combo_book.getSelectionModel().selectFirst();

            show_warning = true;
        }

        if ((title_present != null && !title_present.equals(title_saved))
                || (url_value_present != null && !url_value_present.equals(url_value_saved))
                || (comment_value_present != null && !comment_value_present.equals(comment_value_saved))
                || (email_value_present != null && !email_value_present.equals(email_value_saved))) {

            show_warning = true;
        }

        if (show_warning) {
            manager.setStatusMessage(RBLoader.ll("Please, remember to save before close the editor."), 5000);
            EffectFX.beep();
        }

        UtilityFX.log("CLOSE TAB.");
        editor.resetEditor();
        node.getProperties().put("is_open", "false");
        list_editors.remove(editor);
        updateTable();
    }
View Full Code Here


                        String plugin_id = keys.next();
                        Readable item = map_read.get(plugin_id);

                        log("importData - json - plugin_id: " + plugin_id);

                        EncryptedNode root_node = new EncryptedNode();
                        enc_map.getMap().put(plugin_id, root_node);

                        root_node.setId(item.getId());
                        root_node.setDescription(item.getDescription());
                        root_node.setProperties(new HashMap(item.getProperties()));

                        log("importData - json - root_node.getProperties: " + root_node.getProperties());

                        if (item.getChilds() != null && item.getChilds().size() > 0) {
                            for (Readable r : item.getChilds()) {
                                EncryptedNode node = new EncryptedNode();
                                root_node.addChild(node);

                                node.setId(r.getId());
                                node.setDescription(r.getDescription());

                                Map<String, String> map = r.getProperties();

                                if (PluginProvider.DEF_ACCOUNT_TAB_ID.equals(plugin_id)) {

                                    node.getProperties().put("is_open", map.get("is_open"));
                                    node.getProperties().put("comment_value", map.get("comment_value"));
                                    node.getProperties().put("url_value", map.get("url_value"));
                                    node.getProperties().put("bookmark_value", map.get("bookmark_value"));
                                    node.getProperties().put("title", map.get("title"));
                                    node.getProperties().put("email_value", map.get("email_value"));

                                    setSensibleValue(node, "user_type", map.get("user_type"));
                                    setSensibleValue(node, "user_name_value", map.get("user_name_value"));

                                    setSensibleValue(node, "password1_type", map.get("password1_type"));
                                    setSensibleValue(node, "password1_value", map.get("password1_value"));

                                    setSensibleValue(node, "password2_type", map.get("password2_type"));
                                    setSensibleValue(node, "password2_value", map.get("password2_value"));

                                } else {
                                    node.setProperties(new HashMap(map));
                                }

                                log("importData - json - node.getProperties: " + node.getProperties());
                            }
                        }
                    }
                } catch (Exception exc) {
                    exc.printStackTrace();
View Full Code Here

            TableCell cell = new TableCell() {
                @Override
                public void updateItem(Object item, boolean empty) {
                    if (item != null && !empty && item instanceof EncryptedNode) {
                        EncryptedNode node = (EncryptedNode) item;
                        Label label_cell = new Label();
                        label_cell.setId("generic_label");
                        try {
                            switch (column) {
                                case 0: {
                                    label_cell.setId("name_label");
                                    String t = node.getProperties().get("title");
                                    if (_IMPOSSIBLE_TITLE_.equals(t)) {
                                        label_cell.setText("...");
                                    } else {
                                        label_cell.setText(t);
                                    }
                                    break;
                                }
                                case 1: {
                                    sensibleInit(label_cell, node, "user_type", "user_name_value");
                                    break;
                                }
                                case 2: {
                                    label_cell.setText(node.getProperties().get("url_value"));
                                    break;
                                }
                                case 3: {
                                    label_cell.setText(node.getProperties().get("email_value"));
                                    break;
                                }
                                case 4: {
                                    sensibleInit(label_cell, node, "password1_type", "password1_value");
                                    break;
View Full Code Here

            manager.registerToolBarItems(getId(), __btn_new_acc, __btn_home,
                    __btn_edit, __btn_undo, __btn_del_acc, __btn_print, __btn_explore);

            if (root_node == null) {
                root_node = new EncryptedNode();
                root_node.setId(_FIRST_TAB_TITLE_);
                manager.putInStoredData(getId(), root_node);
            }

            __tabbed = new TabPane();
View Full Code Here

        int size = data_table.size();

        for (int i = 0; i < size; i++) {
            CellPropertiesManager cpm = data_table.get(i);
            EncryptedNode node = cpm.getNode();

            if (node == null) {
                continue;
            }

            String t = node.getProperties().get("title");

            if (t != null && t.startsWith(title)) {
                return cpm;
            }
        }
View Full Code Here

    @Deprecated
    private boolean isAlreadyTitlePresent_OLD(String title) {
        if (data_table != null) {
            int size = data_table.size();
            for (int i = 0; i < size; i++) {
                EncryptedNode node = data_table.get(i).getNode();
                if (title.equals(node.getProperties().get("title"))) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        }
    }

    private void makeNewAccount() {

        EncryptedNode node = null;

        int size = data_table.size();
        for (int i = 0; i < size; i++) {
            node = data_table.get(i).getNode();
            if (_IMPOSSIBLE_TITLE_.equals(node.getProperties().get("title"))) {
                openTabbedEditor(data_table.get(i));
                return;
            }
        }

        node = new EncryptedNode();
        node.getProperties().put("title", _IMPOSSIBLE_TITLE_);
        node.getProperties().put("is_open", "false");
        node.getProperties().put("url_value", "");
        node.getProperties().put("comment_value", "");
        node.getProperties().put("email_value", "");

        try {

            manager.setSensibleValue(node, "user_type", String.valueOf(SensibleValueTypeListener.CLEAR_VALUE_TYPE));
            manager.setSensibleValue(node, "password1_type", String.valueOf(SensibleValueTypeListener.PASS_VALUE_TYPE));
View Full Code Here

    }

    private void openTabbedEditor(final CellPropertiesManager EDITOR) {
        try {

            EncryptedNode NODE = EDITOR.getNode();
            String TITLE = NODE.getProperties().get("title");

            ObservableList<Tab> tabs = __tabbed.getTabs();
            if (tabs != null) {
                for (Tab t : tabs) {
                    if (t.getId() != null && t.getId().equals(EDITOR.getInstanceId())) {
                        __tabbed.getSelectionModel().select(t);
                        EDITOR.__tab_edit_title_txt.requestFocus();
                        return;
                    }
                }
            }

            EDITOR.initEditor();

            final Tab TAB = new Tab(!_IMPOSSIBLE_TITLE_.equals(TITLE) ? TITLE : "");

            TAB.setId(EDITOR.getInstanceId());

            BorderPane bpane = new BorderPane();

            SidePane tab_edit_panel = EDITOR.__sider;
            bpane.setCenter(tab_edit_panel);
            TAB.setContent(bpane);

            //****************************************************************//
            //*                  GESTIONE CLOSE TAB                          *//
            //****************************************************************//
            TAB.setOnCloseRequest((javafx.event.Event evt) -> {
                closeEditor(EDITOR, evt, TAB);
            });

            NODE.getProperties().put("is_open", "true");

            //----------------------------------------------------------------//
            //                  SETTO I CAMPI DELLA MASCHERA                  //
            //----------------------------------------------------------------//
            EDITOR.__tab = TAB;

            if (!_IMPOSSIBLE_TITLE_.equals(TITLE)) {
                EDITOR.__tab_edit_title_txt.setText(TITLE);
            } else {
                EDITOR.__tab_edit_title_txt.setPromptText(RBLoader.ll("Please enter your Title here."));
            }

            EDITOR.__tab_edit_email_txt.setText(NODE.getProperties().get("email_value"));
            EDITOR.__tab_edit_url_txt.setText(NODE.getProperties().get("url_value"));
            EDITOR.__tab_edit_area_comment.setText(escaper.unescapeValue(NODE.getProperties().get("comment_value")));

            initSensibleEditor(getSensibleType(NODE, "user_type"), EDITOR.__username_editor, NODE, "user_name_value");
            initSensibleEditor(getSensibleType(NODE, "password1_type"), EDITOR.__pass1_editor, NODE, "password1_value");
            initSensibleEditor(getSensibleType(NODE, "password2_type"), EDITOR.__pass2_editor, NODE, "password2_value");

            //----------------------------------------------------------------//
            //----------------------------------------------------------------//
            //----------------------------------------------------------------//
            EDITOR.__tab_edit_btn_copy_user.setOnAction((ActionEvent e) -> {
                try {
                    EncryptedNode NODE1 = EDITOR.getNode();
                    String value = null;
                    if (SensibleValueTypeListener.HIDDEN_VALUE_TYPE == EDITOR.__username_editor.getType()) {
                        value = getSensibleValue(NODE1, "user_name_value");
                    } else {
                        value = EDITOR.__username_editor.getValue();
                    }
                    manager.copyToScrambledClipboard(value);
                } catch (Exception exc) {
                    exc.printStackTrace();
                }
            });
            EDITOR.__tab_edit_btn_copy_pass1.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent e) {
                    try {

                        EncryptedNode NODE = EDITOR.getNode();

                        String value = null;

                        if (SensibleValueTypeListener.HIDDEN_VALUE_TYPE == EDITOR.__pass1_editor.getType()) {

                            value = getSensibleValue(NODE, "password1_value");

                        } else {
                            value = EDITOR.__pass1_editor.getValue();
                        }

                        manager.copyToScrambledClipboard(value);

                    } catch (Exception exc) {
                        exc.printStackTrace();
                    }
                }
            });
            EDITOR.__tab_edit_btn_copy_pass2.setOnAction((ActionEvent e) -> {
                try {
                    EncryptedNode NODE1 = EDITOR.getNode();
                    String value = null;
                    if (SensibleValueTypeListener.HIDDEN_VALUE_TYPE == EDITOR.__pass2_editor.getType()) {
                        value = getSensibleValue(NODE1, "password2_value");
                    } else {
                        value = EDITOR.__pass2_editor.getValue();
View Full Code Here

        if (editor == null) {
            return;
        }

        String tit = editor.__tab.getText();
        EncryptedNode node = editor.getNode();

        if (node == null) {
            UtilityFX.log("node is null for " + editor + " editor: " + tit);
        }

        if (!isValidTitle(editor)) {

            evt.consume();

            showMessage("close_editor_invalid_title_message", "Invalid Title.",
                    "Press Ok to delete the account or Cancel to edit it.",
                    "Ok", "Cancel", false, new AnswerPopupMessage() {
                        @Override
                        public void onOk() {

                            UtilityFX.log("INVALID TITLE REMOVE! tit:" + tit);
                            deleteAccount(editor);
                        }

                        @Override
                        public void onCancel() {
                            editor.__tab_edit_title_txt.requestFocus();
                            EffectFX.arrowIndicationError(editor.__tab_edit_title_txt);
                        }
                    });
            return;
        }

        /**
         * Se il titolo era valido e i valori sono diversi da quelli salvati
         * allora si sta chiudendo un tab prima di salvare, mostro un mess
         * di avviso.
         * node.getProperties().put("url_value", "");
         * node.getProperties().put("comment_value", "");
         * node.getProperties().put("email_value", "");
         */
        boolean show_warning = false;

        String title_saved = editor.getNode().getProperties().get("title");
        String title_present = editor.__tab_edit_title_txt.getText();

        String url_value_saved = editor.getNode().getProperties().get("url_value");
        String url_value_present = editor.__tab_edit_url_txt.getText();

        String comment_value_saved = editor.getNode().getProperties().get("comment_value");
        String comment_value_present = editor.__tab_edit_area_comment.getText();

        String email_value_saved = editor.getNode().getProperties().get("email_value");
        String email_value_present = editor.__tab_edit_email_txt.getText();

        String val_saved_book = editor.getNode().getProperties().get("bookmark_value");
        String val_present_book = editor.__combo_book.getSelectionModel().getSelectedItem().toString();

        if ((val_present_book != null && !val_present_book.equals(val_saved_book))) {

            editor.getNode().getProperties().put("bookmark_value", Constants.NO_BOOKMARK);
            editor.__combo_book.getSelectionModel().selectFirst();

            show_warning = true;
        }

        if ((title_present != null && !title_present.equals(title_saved))
                || (url_value_present != null && !url_value_present.equals(url_value_saved))
                || (comment_value_present != null && !comment_value_present.equals(comment_value_saved))
                || (email_value_present != null && !email_value_present.equals(email_value_saved))) {

            show_warning = true;
        }

        if (show_warning) {
            manager.setStatusMessage(RBLoader.ll("Please, remember to save before close the editor."), 5000);
            EffectFX.beep();
        }

        UtilityFX.log("CLOSE TAB.");
        editor.resetEditor();
        node.getProperties().put("is_open", "false");
        list_editors.remove(editor);
        updateTable();
    }
View Full Code Here

                        String plugin_id = keys.next();
                        Readable item = map_read.get(plugin_id);

                        log("importData - json - plugin_id: " + plugin_id);

                        EncryptedNode root_node = new EncryptedNode();
                        enc_map.getMap().put(plugin_id, root_node);

                        root_node.setId(item.getId());
                        root_node.setDescription(item.getDescription());
                        root_node.setProperties(new HashMap(item.getProperties()));

                        log("importData - json - root_node.getProperties: " + root_node.getProperties());

                        if (item.getChilds() != null && item.getChilds().size() > 0) {
                            for (Readable r : item.getChilds()) {
                                EncryptedNode node = new EncryptedNode();
                                root_node.addChild(node);

                                node.setId(r.getId());
                                node.setDescription(r.getDescription());

                                Map<String, String> map = r.getProperties();

                                if (PluginProvider.DEF_ACCOUNT_TAB_ID.equals(plugin_id)) {

                                    node.getProperties().put("is_open", map.get("is_open"));
                                    node.getProperties().put("comment_value", map.get("comment_value"));
                                    node.getProperties().put("url_value", map.get("url_value"));
                                    node.getProperties().put("bookmark_value", map.get("bookmark_value"));
                                    node.getProperties().put("title", map.get("title"));
                                    node.getProperties().put("email_value", map.get("email_value"));

                                    setSensibleValue(node, "user_type", map.get("user_type"));
                                    setSensibleValue(node, "user_name_value", map.get("user_name_value"));

                                    setSensibleValue(node, "password1_type", map.get("password1_type"));
                                    setSensibleValue(node, "password1_value", map.get("password1_value"));

                                    setSensibleValue(node, "password2_type", map.get("password2_type"));
                                    setSensibleValue(node, "password2_value", map.get("password2_value"));

                                } else {
                                    node.setProperties(new HashMap(map));
                                }

                                log("importData - json - node.getProperties: " + node.getProperties());
                            }
                        }
                    }
                } catch (Exception exc) {
                    exc.printStackTrace();
View Full Code Here

TOP

Related Classes of org.rat.free.security.makifx.base.EncryptedNode

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.