- fileOptionsPanel.add(customKeyLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0));
- fileOptionsPanel.add(fileOptionsCustomKeyTextField, new GridBagConstraints(1, 4, 4, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0));
+ fileOptionsPanel.add(fileOptionsInsertRedirectCheckBox, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0));
+ fileOptionsPanel.add(customKeyLabel, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
+ fileOptionsPanel.add(fileOptionsCustomKeyTextField, new GridBagConstraints(2, 5, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0));
+
+ fileOptionsRenameCheckBox = new JCheckBox(I18n.getMessage("jsite.project-files.rename"), false);
+ fileOptionsRenameCheckBox.setToolTipText(I18n.getMessage("jsite.project-files.rename.tooltip"));
+ fileOptionsRenameCheckBox.setName("rename");
+ fileOptionsRenameCheckBox.setMnemonic(KeyEvent.VK_N);
+ fileOptionsRenameCheckBox.addActionListener(this);
+ fileOptionsRenameCheckBox.setEnabled(false);
+
+ fileOptionsRenameTextField = new JTextField();
+ fileOptionsRenameTextField.setEnabled(false);
+ fileOptionsRenameTextField.getDocument().addDocumentListener(new DocumentListener() {
+
+ @SuppressWarnings("synthetic-access")
+ private void storeText(DocumentEvent documentEvent) {
+ FileOption fileOption = getSelectedFile();
+ Document document = documentEvent.getDocument();
+ int documentLength = document.getLength();
+ try {
+ fileOption.setChangedName(document.getText(0, documentLength).trim());
+ } catch (BadLocationException ble1) {
+ /* ignore, it should never happen. */
+ }
+ }
+
+ public void changedUpdate(DocumentEvent documentEvent) {
+ storeText(documentEvent);
+ }
+
+ public void insertUpdate(DocumentEvent documentEvent) {
+ storeText(documentEvent);
+ }
+
+ public void removeUpdate(DocumentEvent documentEvent) {
+ storeText(documentEvent);
+ }
+
+ });
+
+ fileOptionsPanel.add(fileOptionsRenameCheckBox, new GridBagConstraints(0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0));
+ fileOptionsPanel.add(fileOptionsRenameTextField, new GridBagConstraints(2, 6, 3, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0));