Skip to content

Commit

Permalink
groovy small upgrades. put note about 1.6.0 beta for mac; needs testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
stan committed Jun 3, 2018
1 parent 096e099 commit 866ce44
Show file tree
Hide file tree
Showing 7 changed files with 4,768 additions and 4,740 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -6,6 +6,8 @@ Place to get the official versions (many sites are behind):

made using Java 8.

1.6.0-beta-xxx are betas because I was not able to test anything on a Mac for this release. I do not have access to one at this time. Any testing info would be appreciated.

Report Issues at: ![github main](https://github.com/stant/jfileprocessorRest/issues)

This is a File and List Manager with search features:
Expand Down
14 changes: 8 additions & 6 deletions groovy/grepThruFiles.groovy
Expand Up @@ -13,16 +13,18 @@ class Test {
System.out.println( "entered grepThruFiles.main()");
// def test = new Test();

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile.txt" );
outFile.write "";

com.towianski.jfileprocessor.CodeProcessorPanel codeProcessorPanel = binding.getVariable( "codeProcessorPanel" );
def defaultComboBoxModel = binding.getVariable( "defaultComboBoxModel" );
System.out.println( "got codeProcessorPanel.jFileFinderWin.getStartingFolder() =" + codeProcessorPanel.jFileFinderWin.getStartingFolder() + "=" );
ResultsData resultsData = binding.getVariable( "resultsData" );

System.out.println( "selected item =" + codeProcessorPanel.listOfLists.getSelectedItem() + "=" );
String winList = codeProcessorPanel.listOfLists.getSelectedItem();
System.out.println( "selected item =" + winList + "=" );

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile-" + winList + ".txt" );
outFile.write "";

int numItems = defaultComboBoxModel.getSize();
System.out.println( "defaultComboBoxModel.getSize() num of items =" + numItems + "=" );
String str = "";
Expand All @@ -36,7 +38,7 @@ class Test {
// String fileContents = new File( str ).text
// outFile << fileContents;
// String cmd = "ls -l " + str;
String cmd = "grep -i sftp " + str;
String cmd = "grep -i ArrayList " + str;
def list = cmd.execute().text
list.eachLine{
outFile << it;
Expand Down
12 changes: 7 additions & 5 deletions groovy/listThruFiles.groovy
Expand Up @@ -13,16 +13,18 @@ class Test {
System.out.println( "entered listThruFiles.main()");
// def test = new Test();

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile.txt" );
outFile.write "";

com.towianski.jfileprocessor.CodeProcessorPanel codeProcessorPanel = binding.getVariable( "codeProcessorPanel" );
def defaultComboBoxModel = binding.getVariable( "defaultComboBoxModel" );
System.out.println( "got codeProcessorPanel.jFileFinderWin.getStartingFolder() =" + codeProcessorPanel.jFileFinderWin.getStartingFolder() + "=" );
ResultsData resultsData = binding.getVariable( "resultsData" );

System.out.println( "selected item =" + codeProcessorPanel.listOfLists.getSelectedItem() + "=" );
String winList = codeProcessorPanel.listOfLists.getSelectedItem();
System.out.println( "selected item =" + winList + "=" );

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile-" + winList + ".txt" );
outFile.write "";

int numItems = defaultComboBoxModel.getSize();
System.out.println( "defaultComboBoxModel.getSize() num of items =" + numItems + "=" );
String str = "";
Expand Down
12 changes: 7 additions & 5 deletions menu-scripts/grepSelectedFiles.groovy
Expand Up @@ -14,16 +14,18 @@ class Test {
System.out.println( "entered listThruFiles.main()");
// def test = new Test();

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile.txt" );
outFile.write "";

com.towianski.jfileprocessor.CodeProcessorPanel codeProcessorPanel = binding.getVariable( "codeProcessorPanel" );
def defaultComboBoxModel = binding.getVariable( "defaultComboBoxModel" );
System.out.println( "got codeProcessorPanel.jFileFinderWin.getStartingFolder() =" + codeProcessorPanel.jFileFinderWin.getStartingFolder() + "=" );
ResultsData resultsData = binding.getVariable( "resultsData" );

// System.out.println( "selected item =" + codeProcessorPanel.listOfLists.getSelectedItem() + "=" );
String winList = codeProcessorPanel.listOfLists.getSelectedItem();
System.out.println( "selected item =" + winList + "=" );

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile-" + winList + ".txt" );
outFile.write "";

int numItems = defaultComboBoxModel.getSize();
System.out.println( "defaultComboBoxModel.getSize() num of items =" + numItems + "=" );

Expand Down
12 changes: 7 additions & 5 deletions menu-scripts/runCommandOnSelectedFiles.groovy
Expand Up @@ -16,16 +16,18 @@ class Test {
System.out.println( "entered listThruFiles.main()");
// def test = new Test();

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile.txt" );
outFile.write "";

com.towianski.jfileprocessor.CodeProcessorPanel codeProcessorPanel = binding.getVariable( "codeProcessorPanel" );
def defaultComboBoxModel = binding.getVariable( "defaultComboBoxModel" );
System.out.println( "got codeProcessorPanel.jFileFinderWin.getStartingFolder() =" + codeProcessorPanel.jFileFinderWin.getStartingFolder() + "=" );
ResultsData resultsData = binding.getVariable( "resultsData" );

// System.out.println( "selected item =" + codeProcessorPanel.listOfLists.getSelectedItem() + "=" );
String winList = codeProcessorPanel.listOfLists.getSelectedItem();
System.out.println( "selected item =" + winList + "=" );

// we are going to write output to this file !
def outFile = new File( System.getProperty("java.io.tmpdir") + System.getProperty( "file.separator") + "NewFile-" + winList + ".txt" );
outFile.write "";

int numItems = defaultComboBoxModel.getSize();
System.out.println( "defaultComboBoxModel.getSize() num of items =" + numItems + "=" );
String baseCmd = null;
Expand Down
38 changes: 28 additions & 10 deletions src/main/java/com/towianski/jfileprocessor/CodeProcessorPanel.java
Expand Up @@ -57,6 +57,7 @@ public class CodeProcessorPanel extends javax.swing.JFrame {
boolean cancelFillFlag = false;
String startingPath = null;
Boolean dataSyncLock = false;
boolean openedAFile = false;


/**
Expand Down Expand Up @@ -237,6 +238,7 @@ public void readFile( File selectedFile )
{
exc.printStackTrace();
}
openedAFile = true;
}

public void saveToFile( File selectedFile )
Expand Down Expand Up @@ -319,7 +321,8 @@ public void actionPerformed(ActionEvent e) {
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
private void initComponents()
{
java.awt.GridBagConstraints gridBagConstraints;

jPanel1 = new javax.swing.JPanel();
Expand Down Expand Up @@ -357,8 +360,10 @@ private void initComponents() {
jPanel1.add(listOfLists, gridBagConstraints);

doCmdBtn.setText("Run");
doCmdBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
doCmdBtn.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
doCmdBtnActionPerformed(evt);
}
});
Expand All @@ -370,8 +375,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jPanel1.add(doCmdBtn, gridBagConstraints);

saveToFile.setText("Save As...");
saveToFile.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveToFile.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
saveToFileActionPerformed(evt);
}
});
Expand All @@ -382,8 +389,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jPanel1.add(saveToFile, gridBagConstraints);

openFile.setText("Open File");
openFile.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
openFile.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
openFileActionPerformed(evt);
}
});
Expand All @@ -405,8 +414,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jPanel1.add(jScrollPane2, gridBagConstraints);

saveBtn.setText("Save");
saveBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveBtn.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
saveBtnActionPerformed(evt);
}
});
Expand Down Expand Up @@ -492,7 +503,14 @@ private void openFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
JFileChooser chooser = new JFileChooser();
chooser.setFileHidingEnabled( true );
chooser.setDialogTitle( "Open File" );
chooser.setCurrentDirectory( new File( jFileFinderWin.JfpHomeDir ) );
if ( ! openedAFile )
{
chooser.setCurrentDirectory( new File( jFileFinderWin.JfpHomeDir ) );
}
else
{
chooser.setCurrentDirectory( new File( currentDirectory ) );
}
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
//
// disable the "All files" option.
Expand Down

0 comments on commit 866ce44

Please sign in to comment.