From c77276ed8e32a8bb27145662d2b22fca5f09f6b2 Mon Sep 17 00:00:00 2001 From: Raphael Jolly Date: Wed, 14 Feb 2024 13:12:53 +0100 Subject: [PATCH 1/5] empty --- src/main/java/linoleum/FileManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/linoleum/FileManager.java b/src/main/java/linoleum/FileManager.java index 1e9eff38..c31c093a 100644 --- a/src/main/java/linoleum/FileManager.java +++ b/src/main/java/linoleum/FileManager.java @@ -578,7 +578,7 @@ public Component getListCellRendererComponent(final JList list, final Object val setForeground(list.getForeground()); } final Path path = (Path)value; - setIcon(getFileIcon(path)); + if (!closing) setIcon(getFileIcon(path)); setText(path.getFileName().toString()); setFont(list.getFont()); return this; From 157ac2886c5192a8be886642499afebd91b244b9 Mon Sep 17 00:00:00 2001 From: Raphael Jolly Date: Tue, 24 Sep 2024 13:11:16 +0200 Subject: [PATCH 2/5] empty --- notepad/src/linoleum/notepad/Frame.form | 3 ++ notepad/src/linoleum/notepad/Frame.java | 38 ++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/notepad/src/linoleum/notepad/Frame.form b/notepad/src/linoleum/notepad/Frame.form index 7b0faf8d..71d5a359 100644 --- a/notepad/src/linoleum/notepad/Frame.form +++ b/notepad/src/linoleum/notepad/Frame.form @@ -73,6 +73,7 @@ + @@ -81,6 +82,7 @@ + @@ -89,6 +91,7 @@ + diff --git a/notepad/src/linoleum/notepad/Frame.java b/notepad/src/linoleum/notepad/Frame.java index e34c8f32..fe2858ab 100644 --- a/notepad/src/linoleum/notepad/Frame.java +++ b/notepad/src/linoleum/notepad/Frame.java @@ -45,6 +45,8 @@ import javax.swing.SwingWorker; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; import javax.swing.event.InternalFrameAdapter; import javax.swing.event.InternalFrameEvent; import javax.swing.event.UndoableEditEvent; @@ -87,6 +89,22 @@ public class Frame extends FileSupport { public Frame() { initComponents(); dialog1.pack(); + jTextField1.getDocument().addDocumentListener(new DocumentListener() { + @Override + public void insertUpdate(final DocumentEvent e) { + changed(); + } + + @Override + public void removeUpdate(final DocumentEvent e) { + changed(); + } + + @Override + public void changedUpdate(final DocumentEvent e) { + changed(); + } + }); chooser.setFileFilter(new FileNameExtensionFilter("Text", "txt")); setIcon(new ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Edit24.gif"))); setMimeType("text/plain:text/*:application/octet-stream:application/*"); @@ -491,18 +509,25 @@ private void openDialog(final String title) { dialog1.setVisible(true); } + private void changed() { + boolean empty = jTextField1.getText().isEmpty(); + jButton1.setEnabled(!empty); + jButton2.setEnabled(!empty && jTextField2.isEnabled()); + jButton3.setEnabled(!empty && jTextField2.isEnabled()); + } + private void find() { openDialog("FindTitle"); jTextField2.setEnabled(false); - jButton2.setEnabled(false); - jButton3.setEnabled(false); + jTextField1.requestFocusInWindow(); + jTextField1.setText(editor.getSelectedText()); } private void replace() { openDialog("ReplaceTitle"); jTextField2.setEnabled(true); - jButton2.setEnabled(true); - jButton3.setEnabled(true); + jTextField1.requestFocusInWindow(); + jTextField1.setText(editor.getSelectedText()); } private void setFile(final Path file) { @@ -733,6 +758,7 @@ private void initComponents() { jLabel2.setText("Replace with :"); jButton1.setText("Next"); + jButton1.setEnabled(false); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); @@ -740,6 +766,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); jButton2.setText("Replace"); + jButton2.setEnabled(false); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); @@ -747,6 +774,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); jButton3.setText("Replace all"); + jButton3.setEnabled(false); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); @@ -866,6 +894,8 @@ private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS dialog1.setVisible(false); try { setSelected(true); + jTextField1.setText(null); + jTextField2.setText(null); } catch (final PropertyVetoException ex) { ex.printStackTrace(); } From 51ce78e80fa174533e2950c0ea542360429b9e76 Mon Sep 17 00:00:00 2001 From: Raphael Jolly Date: Wed, 25 Sep 2024 16:36:07 +0200 Subject: [PATCH 3/5] empty --- src/main/java/linoleum/DesktopPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/linoleum/DesktopPane.java b/src/main/java/linoleum/DesktopPane.java index c81e4ea8..7ad011c7 100644 --- a/src/main/java/linoleum/DesktopPane.java +++ b/src/main/java/linoleum/DesktopPane.java @@ -11,7 +11,6 @@ import java.awt.event.InputEvent; import javax.swing.AbstractAction; import javax.swing.Action; -import javax.swing.ActionMap; import javax.swing.DefaultListModel; import javax.swing.KeyStroke; import javax.swing.Icon; From b6907481b9d2f792a6d34bdc984e3c8c1fd45340 Mon Sep 17 00:00:00 2001 From: Raphael Jolly Date: Wed, 25 Sep 2024 16:16:27 +0200 Subject: [PATCH 4/5] empty --- init.js | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/init.js b/init.js index f1da8eeb..3f064758 100644 --- a/init.js +++ b/init.js @@ -408,7 +408,7 @@ function classpath() { return java.lang.System.getProperty("java.class.path"); } -// require org.scala-lang#scala3-compiler_3;3.3.1 +// require org.scala-lang#scala3-compiler_3;3.5.1 function dotc(srcDir, destDir, options) { if (srcDir == undefined) { @@ -440,48 +440,6 @@ function dottydoc(srcDir, destDir, options) { (new Packages.dotty.tools.scaladoc.Main).run(["-classpath", classpath(), "-d", dir].concat(options).concat(files)); } -// require org.scala-lang#scala-compiler;2.11.0-M6 - -function scalac(srcDir, destDir, options) { - if (srcDir == undefined) { - srcDir = "."; - } - if (destDir == undefined) { - destDir = srcDir; - } - if (options == undefined) { - options = []; - } - files = fileset(srcDir, ".*\.(scala|java)"); - dir = pathToFile(destDir); - Packages.scala.tools.nsc.Main.process(["-classpath", classpath(), "-d", dir].concat(options).concat(files)); -} - -function scaladoc(srcDir, destDir, options) { - if (srcDir == undefined) { - srcDir = "."; - } - if (destDir == undefined) { - destDir = srcDir; - } - if (options == undefined) { - options = []; - } - var files = fileset(srcDir, ".*\.(scala|java)"); - var dir = pathToFile(destDir); - Packages.scala.tools.nsc.ScalaDoc$.MODULE$.process(["-classpath", classpath(), "-d", dir].concat(options).concat(files)); -} - -// requires com.github.rjolly#jarlister_2.11;1.1 - -function jarlister(path, out) { - var opts = []; - if (out != undefined) { - opts = opts.concat(["-o", pathToFile(out)]); - } - Packages.scala.tools.nsc.JarLister$.MODULE$.process(opts.concat([pathToFile(path)])); -} - // requires net.sourceforge.jscl-meditor#txt2xhtml;4.1 function txt2xhtml(srcDir, destDir, stylesheet, feed, icon) { From 8500efd39094129b22c3fd3f3b3cea02e481d4c5 Mon Sep 17 00:00:00 2001 From: Raphael Jolly Date: Tue, 24 Sep 2024 17:08:00 +0200 Subject: [PATCH 5/5] empty --- bin/linoleum | 3 +++ bin/linoleum.bat | 2 ++ src/main/java/linoleum/Desktop.form | 9 +++++++++ src/main/java/linoleum/Desktop.java | 22 ++++++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/bin/linoleum b/bin/linoleum index 86a6bf5a..8395e706 100755 --- a/bin/linoleum +++ b/bin/linoleum @@ -1,4 +1,7 @@ #!/bin/sh LINOLEUM=`readlink -f $0` LINOLEUM_HOME=`dirname $LINOLEUM`/.. +until java -Djava.system.class.loader=linoleum.application.ClassLoader -Dscala.usejavacp=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -jar $LINOLEUM_HOME/linoleum.jar +do : +done diff --git a/bin/linoleum.bat b/bin/linoleum.bat index 60de84c0..c89fd3e3 100644 --- a/bin/linoleum.bat +++ b/bin/linoleum.bat @@ -1,3 +1,5 @@ @echo off set LINOLEUM_HOME=%~dp0.. +:loop java -Dfile.encoding=UTF-8 -Djava.system.class.loader=linoleum.application.ClassLoader -Dscala.usejavacp=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -jar %LINOLEUM_HOME%\linoleum.jar +if %ERRORLEVEL% GTR 0 goto loop diff --git a/src/main/java/linoleum/Desktop.form b/src/main/java/linoleum/Desktop.form index 1034da9c..57870add 100644 --- a/src/main/java/linoleum/Desktop.form +++ b/src/main/java/linoleum/Desktop.form @@ -24,6 +24,15 @@ + + + + + + + + + diff --git a/src/main/java/linoleum/Desktop.java b/src/main/java/linoleum/Desktop.java index e0fceb92..09dfee06 100644 --- a/src/main/java/linoleum/Desktop.java +++ b/src/main/java/linoleum/Desktop.java @@ -51,6 +51,7 @@ public class Desktop extends JFrame { + "%s"; private final Action openAction = new OpenAction(); private final Action saveAction = new SaveAction(); + private final Action restartAction = new RestartAction(); private final Action exitAction = new ExitAction(); private final Action fullScreenAction = new FullScreenAction(); private final Action screenshotAction = new ScreenshotAction(); @@ -106,6 +107,19 @@ public void run() { } } + private class RestartAction extends AbstractAction { + public RestartAction() { + super("Restart"); + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK)); + putValue(MNEMONIC_KEY, (int) 'r'); + } + + @Override + public void actionPerformed(final ActionEvent e) { + System.exit(1); + } + } + private class ExitAction extends AbstractAction { public ExitAction() { super("Exit"); @@ -322,6 +336,8 @@ private void initComponents() { fileMenu = new javax.swing.JMenu(); openMenuItem = new javax.swing.JMenuItem(); saveMenuItem = new javax.swing.JMenuItem(); + jSeparator1 = new javax.swing.JPopupMenu.Separator(); + restartMenuItem = new javax.swing.JMenuItem(); separator = new javax.swing.JPopupMenu.Separator(); exitMenuItem = new javax.swing.JMenuItem(); viewMenu = new javax.swing.JMenu(); @@ -351,6 +367,10 @@ public void componentMoved(java.awt.event.ComponentEvent evt) { saveMenuItem.setAction(saveAction); fileMenu.add(saveMenuItem); + fileMenu.add(jSeparator1); + + restartMenuItem.setAction(restartAction); + fileMenu.add(restartMenuItem); fileMenu.add(separator); exitMenuItem.setAction(exitAction); @@ -420,8 +440,10 @@ public void run() { private javax.swing.JMenu fileMenu; private javax.swing.JCheckBoxMenuItem fullScreenMenuItem; private javax.swing.JMenu helpMenu; + private javax.swing.JPopupMenu.Separator jSeparator1; private javax.swing.JMenuBar menuBar; private javax.swing.JMenuItem openMenuItem; + private javax.swing.JMenuItem restartMenuItem; private javax.swing.JMenuItem saveMenuItem; private javax.swing.JMenuItem screenshotMenuItem; private javax.swing.JPopupMenu.Separator separator;