Author: echatellier Date: 2015-06-04 12:35:23 +0000 (Thu, 04 Jun 2015) New Revision: 4243 Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/4243 Log: Copy in progress editor modifications in branche Added: branches/isis-fish-4.4.0-editor/ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxConstants.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/LogTokenMarker.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxEditorUI.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxTokenManagerFactory.java Removed: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java Modified: branches/isis-fish-4.4.0-editor/pom.xml branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/EquationEditorPaneUI.jaxx branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationHandler.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationUI.jaxx branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/fisheryregion/FisheryRegionHandler.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/script/ScriptHandler.java branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java branches/isis-fish-4.4.0-editor/src/main/resources/i18n/isis-fish_en_GB.properties branches/isis-fish-4.4.0-editor/src/main/resources/i18n/isis-fish_fr_FR.properties Modified: branches/isis-fish-4.4.0-editor/pom.xml =================================================================== --- trunk/pom.xml 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/pom.xml 2015-06-04 12:35:23 UTC (rev 4243) @@ -112,15 +112,26 @@ <dependency> <groupId>com.fifesoft</groupId> <artifactId>rsyntaxtextarea</artifactId> - <version>2.5.0</version> - <scope>compile</scope> + <version>2.5.6</version> </dependency> <dependency> <groupId>com.fifesoft</groupId> <artifactId>rstaui</artifactId> - <version>2.5.0</version> + <version>2.5.4</version> </dependency> + + <dependency> + <groupId>com.fifesoft</groupId> + <artifactId>autocomplete</artifactId> + <version>2.5.4</version> + </dependency> + + <dependency> + <groupId>com.fifesoft</groupId> + <artifactId>languagesupport</artifactId> + <version>2.6.0-SNAPSHOT</version> + </dependency> <dependency> <groupId>javax.mail</groupId> @@ -595,14 +606,6 @@ <groupId>org.nuiton.jaxx</groupId> <artifactId>jaxx-maven-plugin</artifactId> <version>${jaxxVersion}</version> - <dependencies> - <dependency> - <groupId>com.fifesoft</groupId> - <artifactId>rsyntaxtextarea</artifactId> - <version>2.5.0</version> - <scope>compile</scope> - </dependency> - </dependencies> </plugin> <plugin> Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/EquationEditorPaneUI.jaxx =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/input/equation/EquationEditorPaneUI.jaxx 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/EquationEditorPaneUI.jaxx 2015-06-04 12:35:23 UTC (rev 4243) @@ -49,7 +49,8 @@ <cell> <JSplitPane id='split' orientation='vertical' oneTouchExpandable='true' resizeWeight='0.8'> - <org.nuiton.widget.editor.Editor id="editor" askIfNotSaved="false" /> + <!--org.nuiton.widget.editor.Editor id="editor" askIfNotSaved="false" /--> + <fr.ifremer.isisfish.ui.widget.text.SyntaxEditor id='editor' askIfNotSaved="false" /> <JScrollPane> <JTextArea id="checkWindow" editable="false" /> </JScrollPane> Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationHandler.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationHandler.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationHandler.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -42,7 +42,6 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.topia.TopiaContext; import org.nuiton.util.FileUtil; -import org.nuiton.widget.editor.Editor; import fr.ifremer.isisfish.datastore.FormuleStorage; import fr.ifremer.isisfish.entities.Equation; @@ -50,6 +49,7 @@ import fr.ifremer.isisfish.ui.input.InputContentHandler; import fr.ifremer.isisfish.ui.models.common.GenericComboModel; import fr.ifremer.isisfish.ui.util.ErrorHelper; +import fr.ifremer.isisfish.ui.widget.text.SyntaxEditor; /** * Equation handler. @@ -162,7 +162,7 @@ inputContentUI.setText(t("isisfish.common.equation")); } - inputContentUI.editor.getCurrentEditor().removeDocumentListener(listener); + inputContentUI.editor.removeDocumentListener(listener); try { File equationContentFile = FileUtil.getTempFile("", ".java"); inputContentUI.editor.open(equationContentFile); @@ -184,7 +184,7 @@ // le contenu de l'equation ne doit pas automatiquement // etre sauvé dans l'entité (pas de sens pour un facteur discret de type equation) if (inputContentUI.autoSaveModification) { - inputContentUI.editor.getCurrentEditor().addDocumentListener(listener); + inputContentUI.editor.addDocumentListener(listener); } } @@ -252,7 +252,7 @@ } public void openEditor(InputOneEquationUI ui, String category, String name, Class<?> javaInterface, - String content, Editor editor) { + String content, SyntaxEditor editor) { if (log.isTraceEnabled()) { log.trace("openEditor"); } Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationUI.jaxx =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationUI.jaxx 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/equation/InputOneEquationUI.jaxx 2015-06-04 12:35:23 UTC (rev 4243) @@ -67,7 +67,8 @@ <JButton text="isisfish.common.saveModel" onActionPerformed='handler.saveModel()' enabled='{isActive() && formuleCategory != null}'/> </cell> <cell fill='both' weightx='1.0' weighty='1.0' rows="2"> - <org.nuiton.widget.editor.Editor id='editor' askIfNotSaved="false" enabled='{isActive()}'/> + <!-- org.nuiton.widget.editor.Editor id='editor' askIfNotSaved="false" enabled='{isActive()}'/--> + <fr.ifremer.isisfish.ui.widget.text.SyntaxEditor id='editor' askIfNotSaved="false" enabled='{isActive()}' /> </cell> </row> <row> Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/fisheryregion/FisheryRegionHandler.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/input/fisheryregion/FisheryRegionHandler.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/input/fisheryregion/FisheryRegionHandler.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -40,7 +40,6 @@ import org.apache.commons.logging.LogFactory; import org.nuiton.topia.TopiaContext; import org.nuiton.util.FileUtil; -import org.nuiton.widget.SwingUtil; import fr.ifremer.isisfish.IsisFishDAOHelper; import fr.ifremer.isisfish.datastore.RegionStorage; @@ -252,7 +251,7 @@ CheckRegion.check(fisheryRegion, result); CheckResultFrame dialog = new CheckResultFrame(); dialog.setCheckResult(result); - SwingUtil.center(dialog); + dialog.setLocationByPlatform(true); dialog.setVisible(true); } catch (Exception eee) { if (log.isErrorEnabled()) { Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/logging/LoggingFrame.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -24,16 +24,20 @@ import static org.nuiton.i18n.I18n.t; +import java.awt.Frame; import java.io.File; import java.io.IOException; import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; import org.apache.commons.io.FileUtils; import fr.ifremer.isisfish.datastore.SimulationStorage; -import fr.ifremer.isisfish.ui.widget.text.IsisSyntaxContants; -import fr.ifremer.isisfish.ui.widget.text.IsisSyntaxEditor; +import fr.ifremer.isisfish.ui.widget.text.IsisSyntaxConstants; +import fr.ifremer.isisfish.ui.widget.text.SyntaxEditorUI; /** * Standalone frame to display log file with syntax highlight. @@ -45,18 +49,34 @@ /** serialVersionUID. */ private static final long serialVersionUID = -655585012872692567L; - protected IsisSyntaxEditor editor; + protected SyntaxEditorUI editor; public LoggingFrame() { - editor = new IsisSyntaxEditor(); - editor.setStyle(IsisSyntaxContants.SYNTAX_STYLE_LOG); + editor = new SyntaxEditorUI(); + editor.setStyle(IsisSyntaxConstants.SYNTAX_STYLE_LOG); add(editor); - setJMenuBar(editor.createMenuBar(this)); setSize(800, 600); } + + /** + * Return menu bar configured for {@code textArea} component. + * + * @param parent parent + * @return JMenuBar instance + */ + public JMenuBar createMenuBar(Frame parent) { + JMenuBar mb = new JMenuBar(); + JMenu menu = new JMenu(t("isisfish.script.search")); + menu.add(new JMenuItem(editor.getFindAction())); + menu.add(new JMenuItem(editor.getReplaceAction())); + menu.add(new JMenuItem(editor.getGotoAction())); + mb.add(menu); + return mb; + } + public void loadSimulationLog(String simulationName) throws IOException { setTitle(t("isisfish.simulation.log.console.title", simulationName)); Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/script/ScriptHandler.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptHandler.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/script/ScriptHandler.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -30,6 +30,7 @@ import java.awt.Color; import java.awt.Component; import java.awt.Desktop; +import java.awt.Dimension; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.io.ByteArrayOutputStream; @@ -55,8 +56,6 @@ import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; @@ -107,7 +106,7 @@ * Last update: $Date$ * by : $Author$ */ -public class ScriptHandler implements TreeSelectionListener, CaretListener { +public class ScriptHandler implements TreeSelectionListener { /** to use log facility, just put in your code: log.info(\"...\"); */ private static Log log = LogFactory.getLog(ScriptHandler.class); @@ -145,7 +144,6 @@ // specific template loader to get template from jars (classpath) ClassTemplateLoader templateLoader = new ClassTemplateLoader(ScriptHandler.class, "/"); freemarkerConfiguration.setTemplateLoader(templateLoader); - } /** @@ -157,10 +155,26 @@ // add listeners scriptTree.addTreeSelectionListener(this); - this.scriptUI.getEditor().addCaretListener(this); // expand official VCS tree node scriptTree.expandRow(0); + + // bind actions + scriptUI.getMiSearch().setAction(scriptUI.getEditor().getFindAction()); + scriptUI.getMiReplace().setAction(scriptUI.getEditor().getReplaceAction()); + scriptUI.getMiGoto().setAction(scriptUI.getEditor().getGotoAction()); + scriptUI.getMiSave().setAction(scriptUI.getEditor().getSaveAction()); + scriptUI.getMiCopy().setAction(scriptUI.getEditor().getCopyAction()); + scriptUI.getMiCut().setAction(scriptUI.getEditor().getCutAction()); + scriptUI.getMiPaste().setAction(scriptUI.getEditor().getPasteAction()); + scriptUI.buttonScriptCut.setAction(scriptUI.getEditor().getCutAction()); + scriptUI.buttonScriptCopy.setAction(scriptUI.getEditor().getCopyAction()); + scriptUI.buttonScriptPaste.setAction(scriptUI.getEditor().getPasteAction()); + scriptUI.buttonScriptSave.setAction(scriptUI.getEditor().getSaveAction()); + + // hide check log + scriptUI.getActionLogSplitPane().getBottomComponent().setMinimumSize(new Dimension()); + scriptUI.getActionLogSplitPane().setDividerLocation(1.0d); } /** @@ -184,6 +198,7 @@ WelcomePanelUI parentUI = scriptUI.getParentContainer(WelcomePanelUI.class); parentUI.setStatusMessage(msg); } + protected void setStatusMessage(String msg, boolean running) { // FIXME remove all parent container reference WelcomePanelUI parentUI = scriptUI.getParentContainer(WelcomePanelUI.class); @@ -412,24 +427,16 @@ @Override public void valueChanged(TreeSelectionEvent e) { if (e.getNewLeadSelectionPath() != null) { + Object selectedNode = e.getNewLeadSelectionPath().getLastPathComponent(); if (selectedNode instanceof File && ((File)selectedNode).isFile()) { File selectedFile = (File)selectedNode; // load file into current action codeStorage loadScript(selectedFile); scriptUI.getEditor().open(selectedFile); - // force refresh - scriptUI.getEditor().repaint(); - scriptUI.getEditor().validate(); - setButton(); - } - else { + } else { scriptUI.getEditor().close(); - // force refresh - scriptUI.getEditor().repaint(); - scriptUI.getEditor().validate(); - setButton(); } } @@ -669,27 +676,6 @@ return result; } - /** - * Cut selection in current editor. - */ - public void cut() { - scriptUI.getEditor().cut(); - } - - /** - * Copy selection in current editor. - */ - public void copy() { - scriptUI.getEditor().copy(); - } - - /** - * Paste clipboard content in editor. - */ - public void paste() { - scriptUI.getEditor().paste(); - } - protected static FileFilter scriptFileFilter; public static FileFilter getScriptFileFilter() { @@ -708,6 +694,8 @@ boolean check = false; + resetCheckLogArea(); + // can't compile formule if (codeStorage instanceof FormuleStorage) { return false; @@ -754,12 +742,22 @@ public void checkAllScripts() { new SwingWorker<Void, Void>() { public Void doInBackground() { - checkAllScripts(); + checkAllScriptsAsync(); return null; } }.execute(); } - + + protected void resetCheckLogArea() { + // hidden by default + int maxLocation = scriptUI.getActionLogSplitPane().getMaximumDividerLocation(); + if (scriptUI.getActionLogSplitPane().getBottomComponent().getHeight() == 0) { + scriptUI.getActionLogSplitPane().setDividerLocation((int)(maxLocation * 0.75)); + } + scriptUI.getActionLogArea().setBackground(null); + scriptUI.getActionLogArea().setText(""); + } + protected void checkAllScriptsAsync() { setStatusMessage(t("isisfish.message.check.inprogress"), true); @@ -767,8 +765,7 @@ boolean allSuccess = true; // reste previous state - scriptUI.getActionLogArea().setBackground(null); - scriptUI.getActionLogArea().setText(""); + resetCheckLogArea(); for (ScriptMapping scriptMapping : ScriptMapping.values()) { // normalement ne match pas les formules @@ -1130,15 +1127,6 @@ } } - /* - * @see javax.swing.event.CaretListener#caretUpdate(javax.swing.event.CaretEvent) - */ - @Override - public void caretUpdate(CaretEvent e) { - // selection pas vide si dot = mark - scriptUI.setTextSelected(e.getDot() != e.getMark()); - } - /** * Move files. * (called by drag and drop handler). Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/script/ScriptUI.jaxx 2015-06-04 12:35:23 UTC (rev 4243) @@ -68,19 +68,19 @@ <JMenuItem id="miNewEquationModel" text="isisfish.script.menu.txtNewEquationModel" onActionPerformed='handler.newScript(ScriptHandler.ScriptMapping.CommunityFormule)' icon="script.png" /> </JMenu> - <JMenuItem id="miSave" text="isisfish.script.menu.save" - onActionPerformed="handler.saveScript()" icon="script_save.png" enabled='{isSingleFileSelected()}' /> + <JMenuItem id="miSave" text="isisfish.script.menu.save" enabled='{isSingleFileSelected()}' /> <JSeparator/> <JMenuItem id="miDelete" text="isisfish.script.menu.deleteLocaly" onActionPerformed='handler.deleteScript(false)' icon="script_delete.png" enabled='{isSingleFileSelected()}' /> </JMenu> <JMenu id="scriptTxtEdit" text="isisfish.script.menu.edit"> - <JMenuItem id="miCut" text="isisfish.script.menu.cut" - onActionPerformed="handler.cut()" icon="cut.png" enabled='{isTextSelected()}' /> - <JMenuItem id="miCopy" text="isisfish.script.menu.copy" - onActionPerformed="handler.copy()" icon="page_copy.png" enabled='{isTextSelected()}' /> - <JMenuItem id="miPaste" text="isisfish.script.menu.paste" - onActionPerformed="handler.paste()" icon="page_paste.png" enabled='{isSingleFileSelected()}' /> + <JMenuItem id="miCut" /> + <JMenuItem id="miCopy" /> + <JMenuItem id="miPaste" /> + <JSeparator/> + <JMenuItem id="miSearch" /> + <JMenuItem id="miReplace" /> + <JMenuItem id="miGoto" /> </JMenu> <JMenu id="scriptTxtVCS" text="isisfish.script.menu.txtVCS"> <JMenuItem id="miCommitVCS" text="isisfish.script.menu.commit" icon="database_go.png" @@ -111,18 +111,14 @@ <JPanel id="buttonBar" layout='{new GridLayout()}' constraints='BorderLayout.NORTH'> <JButton id="buttonScriptNew" text="isisfish.script.newplus" toolTipText='isisfish.script.new.tooltip' onMousePressed='handler.newScript(event)' icon="script.png" /> - <JButton id="buttonScriptSave" text="isisfish.script.save" toolTipText="isisfish.script.save.tooltip" - enabled='{isSingleFileSelected()}' onActionPerformed='handler.saveScript()' icon="script_save.png" /> + <JButton id="buttonScriptSave" text="isisfish.script.save" toolTipText="isisfish.script.save.tooltip" /> <JButton id="buttonScriptExport" text="isisfish.script.export" toolTipText="isisfish.script.export.tooltip" enabled='false' onActionPerformed='handler.exportScript()' icon="page_white_compressed.png" /> <JButton id="buttonScriptCommit" text="isisfish.script.commit" toolTipText="isisfish.script.commit.tooltip" enabled='{isSingleFileSelected()}' onActionPerformed='handler.commitScript()' icon="database_go.png" /> - <JButton id="buttonScriptCut" text="isisfish.script.cut" toolTipText="isisfish.script.cut.tooltip" enabled='{isTextSelected()}' - onActionPerformed='handler.cut()' icon="cut.png" /> - <JButton id="buttonScriptCopy" text="isisfish.script.copy" toolTipText="isisfish.script.copy.tooltip" enabled='{isTextSelected()}' - onActionPerformed='handler.copy()' icon="page_copy.png" /> - <JButton id="buttonScriptPaste" text="isisfish.script.paste" toolTipText="isisfish.script.paste.tooltip" enabled='{isSingleFileSelected()}' - onActionPerformed='handler.paste()' icon="page_paste.png" /> + <JButton id="buttonScriptCut" text="isisfish.script.cut" toolTipText="isisfish.script.cut.tooltip" /> + <JButton id="buttonScriptCopy" text="isisfish.script.copy" toolTipText="isisfish.script.copy.tooltip" /> + <JButton id="buttonScriptPaste" text="isisfish.script.paste" toolTipText="isisfish.script.paste.tooltip" enabled='{isSingleFileSelected()}' /> <JButton id="buttonScriptCheck" text="isisfish.script.check" toolTipText="isisfish.script.check.tooltip" enabled='{isJavaFileSelected()}' onActionPerformed='handler.checkScript()' icon="script_code_red.png" /> <JButton id="buttonScriptEval" text="isisfish.script.evaluate" toolTipText="isisfish.script.evaluate.tooltip" enabled='{isJavaFileSelected()}' @@ -135,8 +131,8 @@ rootVisible="false" model='{scriptTreeModel}' cellRenderer='{new fr.ifremer.isisfish.ui.script.model.ScriptTreeCellRenderer()}' /> </JScrollPane> - <JSplitPane oneTouchExpandable="true" resizeWeight="0.75" orientation="VERTICAL"> - <org.nuiton.widget.editor.Editor id='editor'/> + <JSplitPane id="actionLogSplitPane" oneTouchExpandable="true" orientation="VERTICAL"> + <fr.ifremer.isisfish.ui.widget.text.SyntaxEditor id='editor' askIfNotSaved="true" /> <JScrollPane> <JTextArea id="actionLogArea" editable="false" font='{new Font("Monospaced", Font.PLAIN, 12)}' /> </JScrollPane> Modified: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/editor/EquationTableEditor.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -40,8 +40,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.table.TableCellEditor; -import org.nuiton.widget.SwingUtil; - import fr.ifremer.isisfish.IsisFishRuntimeException; import fr.ifremer.isisfish.entities.Equation; import fr.ifremer.isisfish.ui.input.equation.EquationEditorPaneUI; @@ -72,7 +70,7 @@ addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Window editorFrame = getFrame(); - SwingUtil.center(editorFrame); + editorFrame.setLocationByPlatform(true); editorFrame.setVisible(true); } }); Copied: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxConstants.java (from rev 4226, trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java) =================================================================== --- branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxConstants.java (rev 0) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxConstants.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -0,0 +1,36 @@ +/* + * #%L + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ +package fr.ifremer.isisfish.ui.widget.text; + +import org.fife.ui.rsyntaxtextarea.SyntaxConstants; + +/** + * Extends rsyntaxtextarea contantx to add isis specific. + * + * @author Eric Chatellier + */ +public interface IsisSyntaxConstants extends SyntaxConstants { + + public static final String SYNTAX_STYLE_LOG = "isisfish-log"; + +} Deleted: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxContants.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -1,36 +0,0 @@ -/* - * #%L - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ -package fr.ifremer.isisfish.ui.widget.text; - -import org.fife.ui.rsyntaxtextarea.SyntaxConstants; - -/** - * Extends rsyntaxtextarea contantx to add isis specific. - * - * @author Eric Chatellier - */ -public interface IsisSyntaxContants extends SyntaxConstants { - - public static final String SYNTAX_STYLE_LOG = "isisfish-log"; - -} Deleted: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -1,221 +0,0 @@ -/* - * #%L - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ -package fr.ifremer.isisfish.ui.widget.text; - -import static org.nuiton.i18n.I18n.t; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Frame; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; - -import javax.swing.AbstractAction; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.KeyStroke; -import javax.swing.UIManager; -import javax.swing.text.BadLocationException; - -import org.fife.rsta.ui.GoToDialog; -import org.fife.rsta.ui.search.FindDialog; -import org.fife.rsta.ui.search.ReplaceDialog; -import org.fife.rsta.ui.search.SearchDialogSearchContext; -import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; -import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; -import org.fife.ui.rsyntaxtextarea.SyntaxScheme; -import org.fife.ui.rsyntaxtextarea.Token; -import org.fife.ui.rtextarea.RTextScrollPane; -import org.fife.ui.rtextarea.SearchEngine; - -/** - * {@link RSyntaxTextArea} component property configured for isis fish. - * - * @author Eric Chatellier - */ -public class IsisSyntaxEditor extends JPanel implements ActionListener { - - /** serialVersionUID. */ - private static final long serialVersionUID = 1427883892685276516L; - - protected RSyntaxTextArea textArea; - private FindDialog findDialog; - private ReplaceDialog replaceDialog; - - public IsisSyntaxEditor() { - super(new BorderLayout()); - textArea = new RSyntaxTextArea(); - add(new RTextScrollPane(textArea), BorderLayout.CENTER); - setAutoscrolls(false); - } - - /** - * Set highligth style. - * - * @param style new style - * @see IsisSyntaxContants - */ - public void setStyle(String style) { - RSyntaxDocument doc = new RSyntaxDocument(new IsisTokenManagerFactory(), style); - textArea.setDocument(doc); - - // special theme for log - if (IsisSyntaxContants.SYNTAX_STYLE_LOG.equals(style)) { - SyntaxScheme scheme = textArea.getSyntaxScheme(); - scheme.getStyle(Token.RESERVED_WORD_2).foreground = Color.RED; - } - } - - public void setText(String text) { - textArea.setText(text); - textArea.invalidate(); - } - - /** - * Return menu bar configured for {@code textArea} component. - * - * @param parent parent - * @return JMenuBar instance - */ - public JMenuBar createMenuBar(Frame parent) { - JMenuBar mb = new JMenuBar(); - JMenu menu = new JMenu(t("isisfish.script.search")); - menu.add(new JMenuItem(new ShowFindDialogAction())); - menu.add(new JMenuItem(new ShowReplaceDialogAction())); - menu.add(new JMenuItem(new GoToLineAction(parent))); - mb.add(menu); - - initSearchDialogs(parent); - - return mb; - } - - /** - * Creates our Find and Replace dialogs. - */ - protected void initSearchDialogs(Frame parent) { - - findDialog = new FindDialog(parent, this); - replaceDialog = new ReplaceDialog(parent, this); - - // This ties the properties of the two dialogs together (match - // case, regex, etc.). - replaceDialog.setSearchContext(findDialog.getSearchContext()); - - } - - private class GoToLineAction extends AbstractAction { - protected Frame parent; - public GoToLineAction(Frame parent) { - super(t("isisfish.script.gotoline")); - this.parent = parent; - int c = getToolkit().getMenuShortcutKeyMask(); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, c)); - } - - public void actionPerformed(ActionEvent e) { - if (findDialog.isVisible()) { - findDialog.setVisible(false); - } - if (replaceDialog.isVisible()) { - replaceDialog.setVisible(false); - } - GoToDialog dialog = new GoToDialog(this.parent); - dialog.setMaxLineNumberAllowed(textArea.getLineCount()); - dialog.setVisible(true); - int line = dialog.getLineNumber(); - if (line>0) { - try { - textArea.setCaretPosition(textArea.getLineStartOffset(line-1)); - } catch (BadLocationException ble) { // Never happens - UIManager.getLookAndFeel().provideErrorFeedback(textArea); - ble.printStackTrace(); - } - } - } - - } - - private class ShowFindDialogAction extends AbstractAction { - - public ShowFindDialogAction() { - super(t("isisfish.script.find")); - int c = getToolkit().getMenuShortcutKeyMask(); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, c)); - } - - public void actionPerformed(ActionEvent e) { - if (replaceDialog.isVisible()) { - replaceDialog.setVisible(false); - } - findDialog.setVisible(true); - } - - } - - private class ShowReplaceDialogAction extends AbstractAction { - - public ShowReplaceDialogAction() { - super(t("isisfish.script.replace")); - int c = getToolkit().getMenuShortcutKeyMask(); - putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_H, c)); - } - - public void actionPerformed(ActionEvent e) { - if (findDialog.isVisible()) { - findDialog.setVisible(false); - } - replaceDialog.setVisible(true); - } - - } - - /** - * Listens for events from our search dialogs and actually does the dirty - * work. - */ - public void actionPerformed(ActionEvent e) { - - String command = e.getActionCommand(); - SearchDialogSearchContext context = findDialog.getSearchContext(); - - if (FindDialog.ACTION_FIND.equals(command)) { - if (!SearchEngine.find(textArea, context)) { - UIManager.getLookAndFeel().provideErrorFeedback(textArea); - } - } else if (ReplaceDialog.ACTION_REPLACE.equals(command)) { - if (!SearchEngine.replace(textArea, context)) { - UIManager.getLookAndFeel().provideErrorFeedback(textArea); - } - } else if (ReplaceDialog.ACTION_REPLACE_ALL.equals(command)) { - int count = SearchEngine.replaceAll(textArea, context); - JOptionPane.showMessageDialog(null, count - + " occurrences replaced."); - } - - } -} Deleted: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -1,82 +0,0 @@ -package fr.ifremer.isisfish.ui.widget.text; - -/* - * #%L - * ISIS-Fish - * %% - * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory; - -/** - * Extends rsyntaxtextarea factory to add Isis fish specific style. - * - * @author Eric Chatellier - */ -public class IsisTokenManagerFactory extends AbstractTokenMakerFactory implements IsisSyntaxContants { - - @Override - protected void initTokenMakerMap() { - // isis support for log - putMapping(SYNTAX_STYLE_LOG, IsisTokenMarker.class.getName()); - - // default code - String pkg = "org.fife.ui.rsyntaxtextarea.modes."; - - putMapping(SYNTAX_STYLE_NONE, pkg + "PlainTextTokenMaker"); - putMapping(SYNTAX_STYLE_ACTIONSCRIPT, pkg + "ActionScriptTokenMaker"); - putMapping(SYNTAX_STYLE_ASSEMBLER_X86, pkg + "AssemblerX86TokenMaker"); - putMapping(SYNTAX_STYLE_BBCODE, pkg + "BBCodeTokenMaker"); - putMapping(SYNTAX_STYLE_C, pkg + "CTokenMaker"); - putMapping(SYNTAX_STYLE_CLOJURE, pkg + "ClojureTokenMaker"); - putMapping(SYNTAX_STYLE_CPLUSPLUS, pkg + "CPlusPlusTokenMaker"); - putMapping(SYNTAX_STYLE_CSHARP, pkg + "CSharpTokenMaker"); - putMapping(SYNTAX_STYLE_CSS, pkg + "CSSTokenMaker"); - putMapping(SYNTAX_STYLE_DELPHI, pkg + "DelphiTokenMaker"); - putMapping(SYNTAX_STYLE_DTD, pkg + "DtdTokenMaker"); - putMapping(SYNTAX_STYLE_FORTRAN, pkg + "FortranTokenMaker"); - putMapping(SYNTAX_STYLE_GROOVY, pkg + "GroovyTokenMaker"); - putMapping(SYNTAX_STYLE_HTACCESS, pkg + "HtaccessTokenMaker"); - putMapping(SYNTAX_STYLE_HTML, pkg + "HTMLTokenMaker"); - putMapping(SYNTAX_STYLE_JAVA, pkg + "JavaTokenMaker"); - putMapping(SYNTAX_STYLE_JAVASCRIPT, pkg + "JavaScriptTokenMaker"); - putMapping(SYNTAX_STYLE_JSON, pkg + "JsonTokenMaker"); - putMapping(SYNTAX_STYLE_JSP, pkg + "JSPTokenMaker"); - putMapping(SYNTAX_STYLE_LATEX, pkg + "LatexTokenMaker"); - putMapping(SYNTAX_STYLE_LISP, pkg + "LispTokenMaker"); - putMapping(SYNTAX_STYLE_LUA, pkg + "LuaTokenMaker"); - putMapping(SYNTAX_STYLE_MAKEFILE, pkg + "MakefileTokenMaker"); - putMapping(SYNTAX_STYLE_MXML, pkg + "MxmlTokenMaker"); - putMapping(SYNTAX_STYLE_NSIS, pkg + "NSISTokenMaker"); - putMapping(SYNTAX_STYLE_PERL, pkg + "PerlTokenMaker"); - putMapping(SYNTAX_STYLE_PHP, pkg + "PHPTokenMaker"); - putMapping(SYNTAX_STYLE_PROPERTIES_FILE,pkg + "PropertiesFileTokenMaker"); - putMapping(SYNTAX_STYLE_PYTHON, pkg + "PythonTokenMaker"); - putMapping(SYNTAX_STYLE_RUBY, pkg + "RubyTokenMaker"); - putMapping(SYNTAX_STYLE_SAS, pkg + "SASTokenMaker"); - putMapping(SYNTAX_STYLE_SCALA, pkg + "ScalaTokenMaker"); - putMapping(SYNTAX_STYLE_SQL, pkg + "SQLTokenMaker"); - putMapping(SYNTAX_STYLE_TCL, pkg + "TclTokenMaker"); - putMapping(SYNTAX_STYLE_UNIX_SHELL, pkg + "UnixShellTokenMaker"); - putMapping(SYNTAX_STYLE_VISUAL_BASIC, pkg + "VisualBasicTokenMaker"); - putMapping(SYNTAX_STYLE_WINDOWS_BATCH, pkg + "WindowsBatchTokenMaker"); - putMapping(SYNTAX_STYLE_XML, pkg + "XMLTokenMaker"); - } - -} Deleted: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -1,266 +0,0 @@ -package fr.ifremer.isisfish.ui.widget.text; - -/* - * #%L - * ISIS-Fish - * %% - * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import javax.swing.text.Segment; - -import org.fife.ui.rsyntaxtextarea.AbstractTokenMaker; -import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities; -import org.fife.ui.rsyntaxtextarea.Token; -import org.fife.ui.rsyntaxtextarea.TokenMap; - -public class IsisTokenMarker extends AbstractTokenMaker { - - private int currentTokenStart; - private int currentTokenType; - - @Override - public Token getTokenList(Segment text, int initialTokenType, int startOffset) { - resetTokenList(); - - char[] array = text.array; - int offset = text.offset; - int count = text.count; - int end = offset + count; - - // See, when we find a token, its starting position is always of the form: - // 'startOffset + (currentTokenStart-offset)'; but since startOffset and - // offset are constant, tokens' starting positions become: - // 'newStartOffset+currentTokenStart' for one less subtraction operation. - int newStartOffset = startOffset - offset; - - currentTokenStart = offset; - currentTokenType = initialTokenType; - -//beginning: - for (int i=offset; i<end; i++) { - - char c = array[i]; - - switch (currentTokenType) { - - case Token.NULL: - - currentTokenStart = i; // Starting a new token here. - - switch (c) { - - case ' ': - case '\t': - currentTokenType = Token.WHITESPACE; - break; - - case '"': - currentTokenType = Token.ERROR_STRING_DOUBLE; - break; - - // The "separators". - case '|': - addToken(text, currentTokenStart,i, Token.SEPARATOR, newStartOffset+currentTokenStart); - currentTokenType = Token.NULL; - break; - - default: - - // Just to speed things up a tad, as this will usually be the case (if spaces above failed). - if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') { - currentTokenType = Token.IDENTIFIER; - break; - } - - - currentTokenType = Token.IDENTIFIER; - break; - - } // End of switch (c). - - break; - - case Token.WHITESPACE: - - switch (c) { - - case ' ': - case '\t': - break; // Still whitespace. - - case '"': - addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); - currentTokenStart = i; - currentTokenType = Token.ERROR_STRING_DOUBLE; - break; - - // The "separators". - case '|': - addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); - addToken(text, i,i, Token.SEPARATOR, newStartOffset+i); - currentTokenType = Token.NULL; - break; - - default: // Add the whitespace token and start anew. - - addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); - currentTokenStart = i; - - // Just to speed things up a tad, as this will usually be the case (if spaces above failed). - if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') { - currentTokenType = Token.IDENTIFIER; - break; - } - - - currentTokenType = Token.IDENTIFIER; - - } // End of switch (c). - - break; - - default: // Should never happen - case Token.IDENTIFIER: - - switch (c) { - - case ' ': - case '\t': - // Check for REM comments. - if (i-currentTokenStart==3 && - (array[i-3]=='r' || array[i-3]=='R') && - (array[i-2]=='e' || array[i-2]=='E') && - (array[i-1]=='m' || array[i-1]=='M')) { - currentTokenType = Token.COMMENT_EOL; - break; - } - addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); - currentTokenStart = i; - currentTokenType = Token.WHITESPACE; - break; - - case '"': - addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); - currentTokenStart = i; - currentTokenType = Token.ERROR_STRING_DOUBLE; - break; - - // The "separators". - case '|': - addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); - addToken(text, i,i, Token.SEPARATOR, newStartOffset+i); - currentTokenType = Token.NULL; - break; - - - default: - - // Just to speed things up a tad, as this will usually be the case. - if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') { - break; - } - - // Otherwise, fall through and assume we're still okay as an IDENTIFIER... - - } // End of switch (c). - - break; - - case Token.COMMENT_EOL: - i = end - 1; - addToken(text, currentTokenStart,i, Token.COMMENT_EOL, newStartOffset+currentTokenStart); - // We need to set token type to null so at the bottom we don't add one more token. - currentTokenType = Token.NULL; - break; - - case Token.PREPROCESSOR: // Used for labels - i = end - 1; - addToken(text, currentTokenStart,i, Token.PREPROCESSOR, newStartOffset+currentTokenStart); - // We need to set token type to null so at the bottom we don't add one more token. - currentTokenType = Token.NULL; - break; - - case Token.ERROR_STRING_DOUBLE: - - if (c=='"') { - addToken(text, currentTokenStart,i, Token.LITERAL_STRING_DOUBLE_QUOTE, newStartOffset+currentTokenStart); - currentTokenStart = i + 1; - currentTokenType = Token.NULL; - } - // Otherwise, we're still an unclosed string... - - break; - - } // End of switch (currentTokenType). - - } // End of for (int i=offset; i<end; i++). - - // Deal with the (possibly there) last token. - if (currentTokenType != Token.NULL) { - - // Check for REM comments. - if (end-currentTokenStart==3 && - (array[end-3]=='r' || array[end-3]=='R') && - (array[end-2]=='e' || array[end-2]=='E') && - (array[end-1]=='m' || array[end-1]=='M')) { - currentTokenType = Token.COMMENT_EOL; - } - - addToken(text, currentTokenStart,end-1, currentTokenType, newStartOffset+currentTokenStart); - } - - addNullToken(); - - // Return the first token in our linked list. - return firstToken; - - } - - @Override - public TokenMap getWordsToHighlight() { - TokenMap tokenMap = new TokenMap(); - - tokenMap.put("FATAL", Token.RESERVED_WORD_2); - tokenMap.put("ERROR", Token.RESERVED_WORD_2); - tokenMap.put("INFO", Token.RESERVED_WORD); - tokenMap.put("DEBUG", Token.RESERVED_WORD); - tokenMap.put("TRACE", Token.RESERVED_WORD); - - return tokenMap; - } - - @Override - public void addToken(Segment segment, int start, int end, int tokenType, int startOffset) { - - switch (tokenType) { - // Since reserved words, functions, and data types are all passed - // into here as "identifiers," we have to see what the token - // really is... - case Token.IDENTIFIER: - int value = wordsToHighlight.get(segment, start,end); - if (value!=-1) - tokenType = value; - break; - } - - super.addToken(segment, start, end, tokenType, startOffset); - - } - -} Copied: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/LogTokenMarker.java (from rev 4226, trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenMarker.java) =================================================================== --- branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/LogTokenMarker.java (rev 0) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/LogTokenMarker.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -0,0 +1,271 @@ +/* + * #%L + * ISIS-Fish + * %% + * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +package fr.ifremer.isisfish.ui.widget.text; + +import javax.swing.text.Segment; + +import org.fife.ui.rsyntaxtextarea.AbstractTokenMaker; +import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities; +import org.fife.ui.rsyntaxtextarea.Token; +import org.fife.ui.rsyntaxtextarea.TokenMap; + +/** + * Token marker for Isis Log files. + * + * @author Eric Chatellier + */ +public class LogTokenMarker extends AbstractTokenMaker { + + private int currentTokenStart; + private int currentTokenType; + + @Override + public Token getTokenList(Segment text, int initialTokenType, int startOffset) { + resetTokenList(); + + char[] array = text.array; + int offset = text.offset; + int count = text.count; + int end = offset + count; + + // See, when we find a token, its starting position is always of the form: + // 'startOffset + (currentTokenStart-offset)'; but since startOffset and + // offset are constant, tokens' starting positions become: + // 'newStartOffset+currentTokenStart' for one less subtraction operation. + int newStartOffset = startOffset - offset; + + currentTokenStart = offset; + currentTokenType = initialTokenType; + +//beginning: + for (int i=offset; i<end; i++) { + + char c = array[i]; + + switch (currentTokenType) { + + case Token.NULL: + + currentTokenStart = i; // Starting a new token here. + + switch (c) { + + case ' ': + case '\t': + currentTokenType = Token.WHITESPACE; + break; + + case '"': + currentTokenType = Token.ERROR_STRING_DOUBLE; + break; + + // The "separators". + case '|': + addToken(text, currentTokenStart,i, Token.SEPARATOR, newStartOffset+currentTokenStart); + currentTokenType = Token.NULL; + break; + + default: + + // Just to speed things up a tad, as this will usually be the case (if spaces above failed). + if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') { + currentTokenType = Token.IDENTIFIER; + break; + } + + + currentTokenType = Token.IDENTIFIER; + break; + + } // End of switch (c). + + break; + + case Token.WHITESPACE: + + switch (c) { + + case ' ': + case '\t': + break; // Still whitespace. + + case '"': + addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); + currentTokenStart = i; + currentTokenType = Token.ERROR_STRING_DOUBLE; + break; + + // The "separators". + case '|': + addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); + addToken(text, i,i, Token.SEPARATOR, newStartOffset+i); + currentTokenType = Token.NULL; + break; + + default: // Add the whitespace token and start anew. + + addToken(text, currentTokenStart,i-1, Token.WHITESPACE, newStartOffset+currentTokenStart); + currentTokenStart = i; + + // Just to speed things up a tad, as this will usually be the case (if spaces above failed). + if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') { + currentTokenType = Token.IDENTIFIER; + break; + } + + + currentTokenType = Token.IDENTIFIER; + + } // End of switch (c). + + break; + + default: // Should never happen + case Token.IDENTIFIER: + + switch (c) { + + case ' ': + case '\t': + // Check for REM comments. + if (i-currentTokenStart==3 && + (array[i-3]=='r' || array[i-3]=='R') && + (array[i-2]=='e' || array[i-2]=='E') && + (array[i-1]=='m' || array[i-1]=='M')) { + currentTokenType = Token.COMMENT_EOL; + break; + } + addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); + currentTokenStart = i; + currentTokenType = Token.WHITESPACE; + break; + + case '"': + addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); + currentTokenStart = i; + currentTokenType = Token.ERROR_STRING_DOUBLE; + break; + + // The "separators". + case '|': + addToken(text, currentTokenStart,i-1, Token.IDENTIFIER, newStartOffset+currentTokenStart); + addToken(text, i,i, Token.SEPARATOR, newStartOffset+i); + currentTokenType = Token.NULL; + break; + + + default: + + // Just to speed things up a tad, as this will usually be the case. + if (RSyntaxUtilities.isLetterOrDigit(c) || c=='\\') { + break; + } + + // Otherwise, fall through and assume we're still okay as an IDENTIFIER... + + } // End of switch (c). + + break; + + case Token.COMMENT_EOL: + i = end - 1; + addToken(text, currentTokenStart,i, Token.COMMENT_EOL, newStartOffset+currentTokenStart); + // We need to set token type to null so at the bottom we don't add one more token. + currentTokenType = Token.NULL; + break; + + case Token.PREPROCESSOR: // Used for labels + i = end - 1; + addToken(text, currentTokenStart,i, Token.PREPROCESSOR, newStartOffset+currentTokenStart); + // We need to set token type to null so at the bottom we don't add one more token. + currentTokenType = Token.NULL; + break; + + case Token.ERROR_STRING_DOUBLE: + + if (c=='"') { + addToken(text, currentTokenStart,i, Token.LITERAL_STRING_DOUBLE_QUOTE, newStartOffset+currentTokenStart); + currentTokenStart = i + 1; + currentTokenType = Token.NULL; + } + // Otherwise, we're still an unclosed string... + + break; + + } // End of switch (currentTokenType). + + } // End of for (int i=offset; i<end; i++). + + // Deal with the (possibly there) last token. + if (currentTokenType != Token.NULL) { + + // Check for REM comments. + if (end-currentTokenStart==3 && + (array[end-3]=='r' || array[end-3]=='R') && + (array[end-2]=='e' || array[end-2]=='E') && + (array[end-1]=='m' || array[end-1]=='M')) { + currentTokenType = Token.COMMENT_EOL; + } + + addToken(text, currentTokenStart,end-1, currentTokenType, newStartOffset+currentTokenStart); + } + + addNullToken(); + + // Return the first token in our linked list. + return firstToken; + + } + + @Override + public TokenMap getWordsToHighlight() { + TokenMap tokenMap = new TokenMap(); + + tokenMap.put("FATAL", Token.RESERVED_WORD_2); + tokenMap.put("ERROR", Token.RESERVED_WORD_2); + tokenMap.put("INFO", Token.RESERVED_WORD); + tokenMap.put("DEBUG", Token.RESERVED_WORD); + tokenMap.put("TRACE", Token.RESERVED_WORD); + + return tokenMap; + } + + @Override + public void addToken(Segment segment, int start, int end, int tokenType, int startOffset) { + + switch (tokenType) { + // Since reserved words, functions, and data types are all passed + // into here as "identifiers," we have to see what the token + // really is... + case Token.IDENTIFIER: + int value = wordsToHighlight.get(segment, start,end); + if (value!=-1) + tokenType = value; + break; + } + + super.addToken(segment, start, end, tokenType, startOffset); + + } + +} Copied: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxEditorUI.java (from rev 4226, trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisSyntaxEditor.java) =================================================================== --- branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxEditorUI.java (rev 0) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxEditorUI.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -0,0 +1,316 @@ +/* + * #%L + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ +package fr.ifremer.isisfish.ui.widget.text; + +import static org.nuiton.i18n.I18n.t; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.KeyStroke; +import javax.swing.UIManager; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.text.BadLocationException; + +import org.fife.rsta.ui.CollapsibleSectionPanel; +import org.fife.rsta.ui.GoToDialog; +import org.fife.rsta.ui.search.FindDialog; +import org.fife.rsta.ui.search.ReplaceDialog; +import org.fife.rsta.ui.search.SearchEvent; +import org.fife.rsta.ui.search.SearchListener; +import org.fife.ui.rsyntaxtextarea.ErrorStrip; +import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; +import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; +import org.fife.ui.rsyntaxtextarea.SyntaxScheme; +import org.fife.ui.rsyntaxtextarea.Token; +import org.fife.ui.rtextarea.RTextScrollPane; +import org.fife.ui.rtextarea.SearchContext; +import org.fife.ui.rtextarea.SearchEngine; +import org.fife.ui.rtextarea.SearchResult; + +/** + * {@link RSyntaxTextArea} component property configured for isis fish. + * + * An intermediate panel is used here to allow displaying user action panel to user. + * + * @author Eric Chatellier + */ +public class SyntaxEditorUI extends CollapsibleSectionPanel implements SearchListener, CaretListener { + + /** serialVersionUID. */ + private static final long serialVersionUID = 1427883892685276516L; + + protected RTextScrollPane textScrollpane; + protected RSyntaxTextArea textArea; + + protected FindDialog findDialog; + protected ReplaceDialog replaceDialog; + + protected Action findAction; + protected Action replaceAction; + protected Action gotoAction; + protected Action cutAction; + protected Action pasteAction; + protected Action copyAction; + + public SyntaxEditorUI() { + super(true); + + textArea = new RSyntaxTextArea(); + textScrollpane = new RTextScrollPane(textArea); + add(textScrollpane); + + // for error/warning markers + ErrorStrip errorStrip = new ErrorStrip(textArea); + add(errorStrip, BorderLayout.LINE_END); + + // highlight marked occurence after small period of time + textArea.setMarkOccurrences(true); + + // display line number + textScrollpane.setLineNumbersEnabled(true); + + // tab is evil + textArea.setTabsEmulated(true); + textArea.setTabSize(4); + + initActions(); + } + + protected void initActions() { + Frame parent = null; + + findDialog = new FindDialog(parent, this); + replaceDialog = new ReplaceDialog(parent, this); + + findAction = new ShowFindDialogAction(); + replaceAction = new ShowReplaceDialogAction(); + gotoAction = new GoToLineAction(parent); + + // caret update will update setEnabled state + textArea.addCaretListener(this); + cutAction = new AbstractAction(t("isisfish.editor.cut"), new ImageIcon(getClass().getResource("/icons/cut.png"))) { + @Override + public void actionPerformed(ActionEvent e) { + textArea.cut(); + } + }; + cutAction.setEnabled(false); + pasteAction = new AbstractAction(t("isisfish.editor.paste"), new ImageIcon(getClass().getResource("/icons/page_paste.png"))) { + @Override + public void actionPerformed(ActionEvent e) { + textArea.paste(); + } + }; + copyAction = new AbstractAction(t("isisfish.editor.copy"), new ImageIcon(getClass().getResource("/icons/page_copy.png"))) { + @Override + public void actionPerformed(ActionEvent e) { + textArea.copy(); + } + }; + copyAction.setEnabled(false); + } + + + + /** + * Set highligth style. + * + * @param style new style + * @see IsisSyntaxConstants + */ + public void setStyle(String style) { + RSyntaxDocument doc = new RSyntaxDocument(new SyntaxTokenManagerFactory(), style); + textArea.setDocument(doc); + + // special theme for log + if (IsisSyntaxConstants.SYNTAX_STYLE_LOG.equals(style)) { + SyntaxScheme scheme = textArea.getSyntaxScheme(); + scheme.getStyle(Token.RESERVED_WORD_2).foreground = Color.RED; + } + } + + public void setText(String text) { + textArea.setText(text); + textArea.invalidate(); + } + + @Override + public void setEnabled(boolean enabled) { + // workarround for http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4286743 + textScrollpane.getHorizontalScrollBar().setEnabled(enabled); + textScrollpane.getVerticalScrollBar().setEnabled(enabled); + textScrollpane.getViewport().getView().setEnabled(enabled); + textScrollpane.setEnabled(enabled); + } + + private class GoToLineAction extends AbstractAction { + protected Frame parent; + public GoToLineAction(Frame parent) { + super(t("isisfish.script.gotoline")); + this.parent = parent; + int c = getToolkit().getMenuShortcutKeyMask(); + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, c)); + } + + public void actionPerformed(ActionEvent e) { + if (findDialog.isVisible()) { + findDialog.setVisible(false); + } + if (replaceDialog.isVisible()) { + replaceDialog.setVisible(false); + } + GoToDialog dialog = new GoToDialog(this.parent); + dialog.setMaxLineNumberAllowed(textArea.getLineCount()); + dialog.setVisible(true); + int line = dialog.getLineNumber(); + if (line>0) { + try { + textArea.setCaretPosition(textArea.getLineStartOffset(line-1)); + } catch (BadLocationException ble) { // Never happens + UIManager.getLookAndFeel().provideErrorFeedback(textArea); + ble.printStackTrace(); + } + } + } + + } + + private class ShowFindDialogAction extends AbstractAction { + + public ShowFindDialogAction() { + super(t("isisfish.script.find")); + int c = getToolkit().getMenuShortcutKeyMask(); + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, c)); + } + + public void actionPerformed(ActionEvent e) { + if (replaceDialog.isVisible()) { + replaceDialog.setVisible(false); + } + findDialog.setVisible(true); + } + + } + + private class ShowReplaceDialogAction extends AbstractAction { + + public ShowReplaceDialogAction() { + super(t("isisfish.script.replace")); + int c = getToolkit().getMenuShortcutKeyMask(); + putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_H, c)); + } + + public void actionPerformed(ActionEvent e) { + if (findDialog.isVisible()) { + findDialog.setVisible(false); + } + replaceDialog.setVisible(true); + } + + } + + public Action getFindAction() { + return findAction; + } + + public Action getReplaceAction() { + return replaceAction; + } + + public Action getGotoAction() { + return gotoAction; + } + + public Action getPasteAction() { + return pasteAction; + } + + public Action getCopyAction() { + return copyAction; + } + + public Action getCutAction() { + return cutAction; + } + + @Override + public String getSelectedText() { + return textArea.getSelectedText(); + } + + /** + * Listens for events from our search dialogs and actually does the dirty + * work. + */ + @Override + public void searchEvent(SearchEvent e) { + + SearchEvent.Type type = e.getType(); + SearchContext context = e.getSearchContext(); + SearchResult result = null; + + switch (type) { + default: // Prevent FindBugs warning later + case MARK_ALL: + result = SearchEngine.markAll(textArea, context); + break; + case FIND: + result = SearchEngine.find(textArea, context); + if (!result.wasFound()) { + UIManager.getLookAndFeel().provideErrorFeedback(textArea); + } + break; + case REPLACE: + result = SearchEngine.replace(textArea, context); + if (!result.wasFound()) { + UIManager.getLookAndFeel().provideErrorFeedback(textArea); + } + break; + case REPLACE_ALL: + result = SearchEngine.replaceAll(textArea, context); + JOptionPane.showMessageDialog(null, result.getCount() + + " occurrences replaced."); + break; + } + } + + /* + * @see javax.swing.event.CaretListener#caretUpdate(javax.swing.event.CaretEvent) + */ + @Override + public void caretUpdate(CaretEvent e) { + // selection pas vide si dot = mark + boolean selected = e.getDot() != e.getMark(); + cutAction.setEnabled(selected); + copyAction.setEnabled(selected); + } +} Copied: branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxTokenManagerFactory.java (from rev 4226, trunk/src/main/java/fr/ifremer/isisfish/ui/widget/text/IsisTokenManagerFactory.java) =================================================================== --- branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxTokenManagerFactory.java (rev 0) +++ branches/isis-fish-4.4.0-editor/src/main/java/fr/ifremer/isisfish/ui/widget/text/SyntaxTokenManagerFactory.java 2015-06-04 12:35:23 UTC (rev 4243) @@ -0,0 +1,82 @@ +/* + * #%L + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2015 Ifremer, Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ +package fr.ifremer.isisfish.ui.widget.text; + +import org.fife.ui.rsyntaxtextarea.AbstractTokenMakerFactory; + +/** + * Extends rsyntaxtextarea factory to add Isis fish specific style. + * + * @author Eric Chatellier + */ +public class SyntaxTokenManagerFactory extends AbstractTokenMakerFactory implements IsisSyntaxConstants { + + @Override + protected void initTokenMakerMap() { + // isis support for log + putMapping(SYNTAX_STYLE_LOG, LogTokenMarker.class.getName()); + + // default code + String pkg = "org.fife.ui.rsyntaxtextarea.modes."; + + putMapping(SYNTAX_STYLE_NONE, pkg + "PlainTextTokenMaker"); + putMapping(SYNTAX_STYLE_ACTIONSCRIPT, pkg + "ActionScriptTokenMaker"); + putMapping(SYNTAX_STYLE_ASSEMBLER_X86, pkg + "AssemblerX86TokenMaker"); + putMapping(SYNTAX_STYLE_BBCODE, pkg + "BBCodeTokenMaker"); + putMapping(SYNTAX_STYLE_C, pkg + "CTokenMaker"); + putMapping(SYNTAX_STYLE_CLOJURE, pkg + "ClojureTokenMaker"); + putMapping(SYNTAX_STYLE_CPLUSPLUS, pkg + "CPlusPlusTokenMaker"); + putMapping(SYNTAX_STYLE_CSHARP, pkg + "CSharpTokenMaker"); + putMapping(SYNTAX_STYLE_CSS, pkg + "CSSTokenMaker"); + putMapping(SYNTAX_STYLE_DELPHI, pkg + "DelphiTokenMaker"); + putMapping(SYNTAX_STYLE_DTD, pkg + "DtdTokenMaker"); + putMapping(SYNTAX_STYLE_FORTRAN, pkg + "FortranTokenMaker"); + putMapping(SYNTAX_STYLE_GROOVY, pkg + "GroovyTokenMaker"); + putMapping(SYNTAX_STYLE_HTACCESS, pkg + "HtaccessTokenMaker"); + putMapping(SYNTAX_STYLE_HTML, pkg + "HTMLTokenMaker"); + putMapping(SYNTAX_STYLE_JAVA, pkg + "JavaTokenMaker"); + putMapping(SYNTAX_STYLE_JAVASCRIPT, pkg + "JavaScriptTokenMaker"); + putMapping(SYNTAX_STYLE_JSON, pkg + "JsonTokenMaker"); + putMapping(SYNTAX_STYLE_JSP, pkg + "JSPTokenMaker"); + putMapping(SYNTAX_STYLE_LATEX, pkg + "LatexTokenMaker"); + putMapping(SYNTAX_STYLE_LISP, pkg + "LispTokenMaker"); + putMapping(SYNTAX_STYLE_LUA, pkg + "LuaTokenMaker"); + putMapping(SYNTAX_STYLE_MAKEFILE, pkg + "MakefileTokenMaker"); + putMapping(SYNTAX_STYLE_MXML, pkg + "MxmlTokenMaker"); + putMapping(SYNTAX_STYLE_NSIS, pkg + "NSISTokenMaker"); + putMapping(SYNTAX_STYLE_PERL, pkg + "PerlTokenMaker"); + putMapping(SYNTAX_STYLE_PHP, pkg + "PHPTokenMaker"); + putMapping(SYNTAX_STYLE_PROPERTIES_FILE,pkg + "PropertiesFileTokenMaker"); + putMapping(SYNTAX_STYLE_PYTHON, pkg + "PythonTokenMaker"); + putMapping(SYNTAX_STYLE_RUBY, pkg + "RubyTokenMaker"); + putMapping(SYNTAX_STYLE_SAS, pkg + "SASTokenMaker"); + putMapping(SYNTAX_STYLE_SCALA, pkg + "ScalaTokenMaker"); + putMapping(SYNTAX_STYLE_SQL, pkg + "SQLTokenMaker"); + putMapping(SYNTAX_STYLE_TCL, pkg + "TclTokenMaker"); + putMapping(SYNTAX_STYLE_UNIX_SHELL, pkg + "UnixShellTokenMaker"); + putMapping(SYNTAX_STYLE_VISUAL_BASIC, pkg + "VisualBasicTokenMaker"); + putMapping(SYNTAX_STYLE_WINDOWS_BATCH, pkg + "WindowsBatchTokenMaker"); + putMapping(SYNTAX_STYLE_XML, pkg + "XMLTokenMaker"); + } + +} Modified: branches/isis-fish-4.4.0-editor/src/main/resources/i18n/isis-fish_en_GB.properties =================================================================== --- trunk/src/main/resources/i18n/isis-fish_en_GB.properties 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/resources/i18n/isis-fish_en_GB.properties 2015-06-04 12:35:23 UTC (rev 4243) @@ -250,7 +250,16 @@ isisfish.config.vcs.userName.description=Official VCS user name isisfish.config.vcs.userPassword.description=Official VCS password isisfish.date.toString=%1$s %2$s +isisfish.editor.cancel=Cancel +isisfish.editor.copy=Copy +isisfish.editor.cut=Cut isisfish.editor.parametersnameandtypes=Parameters (name and type) +isisfish.editor.paste=Paste +isisfish.editor.reload=Reload +isisfish.editor.reloadExternal=File has been modified by external application +isisfish.editor.save=Save +isisfish.editor.saveorcancel.message=File '%s' has been modified, do you want to save file ? +isisfish.editor.saveorcancel.title=Save file isisfish.effortDescription.crewFoodCost=Crew food cost isisfish.effortDescription.crewShareRate=Crew share rate isisfish.effortDescription.crewSize=Crew size @@ -794,7 +803,7 @@ isisfish.script.export.tooltip.checkAll=(Un)Check all scripts to export isisfish.script.export.tooltip.chooseDir=Choose directory to export script to isisfish.script.find=Find... -isisfish.script.gotoline=Got to line... +isisfish.script.gotoline=Go to line... isisfish.script.import=Import scripts from archive isisfish.script.import.cancel=Cancel isisfish.script.import.checkAll=(Un)Check all script to import Modified: branches/isis-fish-4.4.0-editor/src/main/resources/i18n/isis-fish_fr_FR.properties =================================================================== --- trunk/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-06-04 12:33:54 UTC (rev 4242) +++ branches/isis-fish-4.4.0-editor/src/main/resources/i18n/isis-fish_fr_FR.properties 2015-06-04 12:35:23 UTC (rev 4243) @@ -250,7 +250,16 @@ isisfish.config.vcs.userName.description=le login de l'utilisateur sur le serveur vcs isisfish.config.vcs.userPassword.description=le mot de passe de l'utilsateur sur le serveur vcs isisfish.date.toString=%1$s %2$s +isisfish.editor.cancel=Annuler +isisfish.editor.copy=Copier +isisfish.editor.cut=Couper isisfish.editor.parametersnameandtypes=Paramètres (nom et type) +isisfish.editor.paste=Coller +isisfish.editor.reload=Recharger +isisfish.editor.reloadExternal=Le fichier a été modifié par une autre application +isisfish.editor.save=Sauvegarder +isisfish.editor.saveorcancel.message=Le fichier '%s' a été modifié, voulez-vous le sauvegarder ? +isisfish.editor.saveorcancel.title=Sauvegarder le fichier isisfish.effortDescription.crewFoodCost=Coût de l'alimentation pour l'équipage isisfish.effortDescription.crewShareRate=Taux de partage de l'équipage isisfish.effortDescription.crewSize=Taille de l'équipage