Package com.dci.intellij.dbn.data.editor.ui

Examples of com.dci.intellij.dbn.data.editor.ui.TextFieldWithPopup


            DBNativeDataType nativeDataType = dataType.getNativeDataType();
            DataTypeDefinition dataTypeDefinition = nativeDataType.getDataTypeDefinition();
            GenericDataType genericDataType = dataTypeDefinition.getGenericDataType();

            if (genericDataType == GenericDataType.DATE_TIME) {
                TextFieldWithPopup inputField = new TextFieldWithPopup(argument.getProject());
                inputField.setPreferredSize(new Dimension(200, -1));
                inputField.createCalendarPopup(false);
                inputComponent  = inputField;
                inputTextField = inputField.getTextField();

            } else {
                inputTextField = new JTextField();
                inputTextField.setPreferredSize(new Dimension(200, -1));
                inputComponent = inputTextField;
View Full Code Here


        dataTypeComboBox.addItem(GenericDataType.NUMERIC);
        dataTypeComboBox.addItem(GenericDataType.DATE_TIME);
        dataTypeComboBox.setRenderer(new DataTypeCellRenderer());
        dataTypeComboBox.setSelectedItem(variable.getDataType());

        final TextFieldWithPopup textFieldWithPopup = new TextFieldWithPopup(variable.getProject());
        textFieldWithPopup.createCalendarPopup(false);
        textFieldWithPopup.setPopupEnabled(TextFieldPopupType.CALENDAR, variable.getDataType() == GenericDataType.DATE_TIME);
        valueFieldPanel.add(textFieldWithPopup, BorderLayout.CENTER);
        editorComponent = textFieldWithPopup;
        final JTextField textField = editorComponent.getTextField();
        textField.setText(variable.getValue());

        textField.addKeyListener(ComboBoxSelectionKeyListener.create(dataTypeComboBox, false));

        variable.setTemporaryValueProvider(new StatementExecutionVariable.TemporaryValueProvider() {
            public String getValue() { return textField.getText().trim(); }
            public GenericDataType getDataType() { return (GenericDataType) dataTypeComboBox.getSelectedItem();}
        });

        dataTypeComboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                textFieldWithPopup.setPopupEnabled(TextFieldPopupType.CALENDAR, dataTypeComboBox.getSelectedItem() == GenericDataType.DATE_TIME);
            }
        });

        textField.setToolTipText("<html>While editing variable value, press <b>Up/Down</b> keys to change data type");
    }
View Full Code Here

            DataEditorSettings dataEditorSettings = DataEditorSettings.getInstance(project);

            long dataLength = dataType.getLength();

            if (genericDataType.is(GenericDataType.DATE_TIME, GenericDataType.LITERAL)) {
                TextFieldWithPopup textFieldWithPopup = new TextFieldWithPopup(project);

                textFieldWithPopup.setPreferredSize(new Dimension(200, -1));
                JTextField valueTextField = textFieldWithPopup.getTextField();
                valueTextField.getDocument().addDocumentListener(documentListener);
                valueTextField.addKeyListener(keyAdapter);
                valueTextField.addFocusListener(focusListener);

                if (cell.getRow().getModel().isEditable()) {
                    if (genericDataType == GenericDataType.DATE_TIME) {
                        textFieldWithPopup.createCalendarPopup(false);
                    }

                    if (genericDataType == GenericDataType.LITERAL) {
                        if (dataLength > 20 && !column.isPrimaryKey() && !column.isForeignKey())
                            textFieldWithPopup.createTextAreaPopup(false);
                        DataEditorValueListPopupSettings valueListPopupSettings = dataEditorSettings.getValueListPopupSettings();

                        if (column.isForeignKey() || (dataLength <= valueListPopupSettings.getDataLengthThreshold() &&
                                (!column.isSinglePrimaryKey() || valueListPopupSettings.isActiveForPrimaryKeyColumns()))) {
                            ListPopupValuesProvider valuesProvider = new ListPopupValuesProvider() {
                                public List<String> getValues() {
                                    return columnInfo.getPossibleValues();
                                }
                            };
                            textFieldWithPopup.createValuesListPopup(valuesProvider, false);
                        }
                    }
                }
                editorComponent = textFieldWithPopup;
            } else if (genericDataType.is(GenericDataType.BLOB, GenericDataType.CLOB)) {
View Full Code Here

        DataTypeDefinition dataTypeDefinition = nativeDataType.getDataTypeDefinition();
        GenericDataType genericDataType = dataTypeDefinition.getGenericDataType();


        if (genericDataType == GenericDataType.DATE_TIME) {
            TextFieldWithPopup inputField = new TextFieldWithPopup(argument.getProject());
            inputField.setPreferredSize(new Dimension(200, -1));
            inputField.createCalendarPopup(false);
            inputComponent  = inputField;
            inputTextField = inputField.getTextField();

        } else {
            inputTextField = new JTextField();
            inputTextField.setPreferredSize(new Dimension(200, -1));
            inputComponent = inputTextField;
View Full Code Here

        ConditionOperator selectedOperator = ConditionOperator.get(condition.getOperator());
        operatorSelector = new OperatorSelector(selectedOperator);
        operatorPanel.add(operatorSelector, BorderLayout.CENTER);

        editorComponent = new TextFieldWithPopup(dataset.getProject());
        editorComponent.createCalendarPopup(false);
        editorComponent.setPopupEnabled(TextFieldPopupType.CALENDAR, dataType == GenericDataType.DATE_TIME);
       
        valueFieldPanel.add(editorComponent, BorderLayout.CENTER);
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.data.editor.ui.TextFieldWithPopup

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.