diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.form b/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.form index 93194f8a7..b9a63ed3c 100644 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.form +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.form @@ -1,6 +1,32 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -331,6 +357,9 @@ + + + diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.java index 6cb23ded3..0f481e9da 100644 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/assistant/AssistantGenericDialog.java @@ -688,6 +688,7 @@ You should also get your employer (if you work as a programmer) or school, import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; +import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -874,6 +875,9 @@ public AssistantGenericDialog(ArchiveFileBean selectedCase, AssistantConfig conf // //GEN-BEGIN:initComponents private void initComponents() { + popInputText = new javax.swing.JPopupMenu(); + mnuPromptAll = new javax.swing.JMenuItem(); + mnuPromptSelection = new javax.swing.JMenuItem(); jScrollPane1 = new javax.swing.JScrollPane(); taPrompt = new javax.swing.JTextArea(); jScrollPane3 = new javax.swing.JScrollPane(); @@ -897,6 +901,22 @@ private void initComponents() { taResult = new javax.swing.JTextArea(); cmdProcessOutput = new javax.swing.JButton(); + mnuPromptAll.setText("in Prompt übernehmen"); + mnuPromptAll.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + mnuPromptAllActionPerformed(evt); + } + }); + popInputText.add(mnuPromptAll); + + mnuPromptSelection.setText("Auswahl in Prompt übernehmen"); + mnuPromptSelection.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + mnuPromptSelectionActionPerformed(evt); + } + }); + popInputText.add(mnuPromptSelection); + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Assistent Ingo"); addComponentListener(new java.awt.event.ComponentAdapter() { @@ -1016,6 +1036,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { taInputString.setLineWrap(true); taInputString.setRows(5); taInputString.setWrapStyleWord(true); + taInputString.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + taInputStringMousePressed(evt); + } + }); jScrollPane5.setViewportView(taInputString); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); @@ -1306,6 +1331,20 @@ private void cmdInterruptActionPerformed(java.awt.event.ActionEvent evt) {//GEN- this.interrupted=true; }//GEN-LAST:event_cmdInterruptActionPerformed + private void mnuPromptAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuPromptAllActionPerformed + this.taPrompt.insert(this.taInputString.getText(), this.taPrompt.getCaretPosition()); + }//GEN-LAST:event_mnuPromptAllActionPerformed + + private void mnuPromptSelectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuPromptSelectionActionPerformed + this.taPrompt.insert(this.taInputString.getSelectedText(), this.taPrompt.getCaretPosition()); + }//GEN-LAST:event_mnuPromptSelectionActionPerformed + + private void taInputStringMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_taInputStringMousePressed + if(evt.getClickCount()==1 && evt.getButton()==MouseEvent.BUTTON3) { + this.popInputText.show(this.taInputString, evt.getX(), evt.getY()); + } + }//GEN-LAST:event_taInputStringMousePressed + /** * @param args the command line arguments */ @@ -1362,8 +1401,11 @@ public void windowClosing(java.awt.event.WindowEvent e) { private javax.swing.JLabel lblRequestType; private javax.swing.JList lstInputFiles; private javax.swing.JList lstOutputFiles; + private javax.swing.JMenuItem mnuPromptAll; + private javax.swing.JMenuItem mnuPromptSelection; private javax.swing.JPanel pnlParameters; private javax.swing.JPanel pnlTitle; + private javax.swing.JPopupMenu popInputText; private javax.swing.JProgressBar progress; private javax.swing.JSplitPane splitInputOutput; private javax.swing.JTextArea taInputString;