Skip to content

Commit

Permalink
added copy to prompt in chat dialog. close #2591
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 3, 2024
1 parent 4779539 commit 6aabcd3
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<NonVisualComponents>
<Container class="javax.swing.JPopupMenu" name="popInputText">

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
<Property name="useNullLayout" type="boolean" value="true"/>
</Layout>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="mnuPromptAll">
<Properties>
<Property name="text" type="java.lang.String" value="in Prompt &#xfc;bernehmen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuPromptAllActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="mnuPromptSelection">
<Properties>
<Property name="text" type="java.lang.String" value="Auswahl in Prompt &#xfc;bernehmen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mnuPromptSelectionActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Container>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Assistent Ingo"/>
Expand Down Expand Up @@ -331,6 +357,9 @@
<Property name="rows" type="int" value="5"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="taInputStringMousePressed"/>
</Events>
</Component>
</SubComponents>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -874,6 +875,9 @@ public AssistantGenericDialog(ArchiveFileBean selectedCase, AssistantConfig conf
// <editor-fold defaultstate="collapsed" desc="Generated Code">//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();
Expand All @@ -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() {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -1362,8 +1401,11 @@ public void windowClosing(java.awt.event.WindowEvent e) {
private javax.swing.JLabel lblRequestType;
private javax.swing.JList<String> lstInputFiles;
private javax.swing.JList<String> 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;
Expand Down

0 comments on commit 6aabcd3

Please sign in to comment.