Java Code Examples for javax.swing.DefaultCellEditor#setClickCountToStart()

The following examples show how to use javax.swing.DefaultCellEditor#setClickCountToStart() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SynthTreeUI.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 2
Source File: SynthTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 3
Source File: SynthTreeUI.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 4
Source File: SynthTreeUI.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 5
Source File: SynthTreeUI.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 6
Source File: SynthTreeUI.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 7
Source File: SynthTreeUI.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 8
Source File: SynthTreeUI.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 9
Source File: SeaGlassTreeUI.java    From seaglass with Apache License 2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 10
Source File: SynthTreeUI.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    @SuppressWarnings("serial") // anonymous class
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 11
Source File: SynthTreeUI.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 12
Source File: LuceneDataStoreSearchGUI.java    From gate-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void updateAnnotationSetsList() {
  String corpusName =
          (corpusToSearchIn.getSelectedItem()
                  .equals(Constants.ENTIRE_DATASTORE))
                  ? null
                  : (String)corpusIds
                          .get(corpusToSearchIn.getSelectedIndex() - 1);
  TreeSet<String> ts = new TreeSet<String>(stringCollator);
  ts.addAll(getAnnotationSetNames(corpusName));
  DefaultComboBoxModel<String> dcbm = new DefaultComboBoxModel<String>(ts.toArray(new String[ts.size()]));
  dcbm.insertElementAt(Constants.ALL_SETS, 0);
  annotationSetsToSearchIn.setModel(dcbm);
  annotationSetsToSearchIn.setSelectedItem(Constants.ALL_SETS);

  // used in the ConfigureStackViewFrame as Annotation type column
  // cell editor
  TreeSet<String> types = new TreeSet<String>(stringCollator);
  types.addAll(getTypesAndFeatures(null, null).keySet());
  // put all annotation types from the datastore
  // combobox used as cell editor
  JComboBox<String> annotTypesBox = new JComboBox<String>();
  annotTypesBox.setMaximumRowCount(10);
  annotTypesBox.setModel(new DefaultComboBoxModel<String>(types.toArray(new String[types.size()])));
  DefaultCellEditor cellEditor = new DefaultCellEditor(annotTypesBox);
  cellEditor.setClickCountToStart(0);
  configureStackViewFrame.getTable().getColumnModel()
          .getColumn(ANNOTATION_TYPE).setCellEditor(cellEditor);
}
 
Example 13
Source File: TreeAttlistDeclAttributeListCustomizer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public TreeAttlistDeclAttributeListCustomizer() {
    initComponents ();
    attrTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    
    // Cells should become editable on single mouse click
    final JTextField editorComponent = new JTextField();
    editorComponent.getCaret().setVisible(true);
    final DefaultCellEditor singleClickEditor = new DefaultCellEditor(editorComponent);
    singleClickEditor.setClickCountToStart(1);
    attrTable.setDefaultEditor(String.class, singleClickEditor);
    
    
    initAccessibility();
}
 
Example 14
Source File: SynthTreeUI.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 15
Source File: SynthTreeUI.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 16
Source File: SynthTreeUI.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 17
Source File: SynthTreeUI.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 18
Source File: SynthTreeUI.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 19
Source File: SynthTreeUI.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected TreeCellEditor createTreeCellEditor() {
    JTextField tf = new JTextField() {
        @Override
        public String getName() {
            return "Tree.cellEditor";
        }
    };
    DefaultCellEditor editor = new DefaultCellEditor(tf);

    // One click to edit.
    editor.setClickCountToStart(1);
    return editor;
}
 
Example 20
Source File: ActionProviderImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Messages({
    "# {0} - Command Display Name",
    "TIT_BuildParameters={0} Parameters"
})
private static String askInputArgs(String command, String argLine) {
    Matcher m = INPUT_PROP_REGEXP.matcher(argLine);
    List<String> keys = new ArrayList<>();
    List<String> defaults = new ArrayList<>();
    while (m.find()) {
        keys.add(m.group(1));
        defaults.add(m.group(3) != null ? m.group(3) : "");
    }
    String ret = argLine;

    if (!keys.isEmpty()) {
        KeyValueTableModel kvModel = new KeyValueTableModel("input:",
                keys.toArray(new String[keys.size()]),
                defaults.toArray(new String[defaults.size()])
        );
        JPanel panel = new JPanel(new BorderLayout());
        JTable table = new JTable(kvModel);
        table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); //NOI18N
        table.setRowHeight(table.getRowHeight() * 3 / 2);
        panel.add(new JScrollPane(table), BorderLayout.CENTER);

        try {
            //This code might not work on every Look and Feel
            DefaultCellEditor defaultEditor = (DefaultCellEditor) table.getDefaultEditor(String.class);
            defaultEditor.setClickCountToStart(1);
        } catch (ClassCastException ex) {
        }

        DialogDescriptor dlg = new DialogDescriptor(panel, TIT_BuildParameters(command));
        if (DialogDescriptor.OK_OPTION == DialogDisplayer.getDefault().notify(dlg)) {
            ret = replaceTokens(argLine, kvModel.getProperties());
        } else {
            //Mark Cancel is pressed, so build shall be aborted.
            ret = null;
        }
    }
    return ret;
}