[sikuli] 211/385: more on IDE add languages
Gilles Filippini
pini at moszumanska.debian.org
Sun Jun 29 19:26:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.
commit 1ab671088e71b8bcf1bb651f13f80196daae16ac
Author: Raimund Hocke <rmhdevelop at me.com>
Date: Fri Feb 14 09:20:44 2014 +0100
more on IDE add languages
---
.../META-INF/services/org.sikuli.basics.IDESupport | 2 ++
IDE/src/main/java/org/sikuli/ide/EditorPane.java | 18 +++++++++++-------
IDE/src/main/java/org/sikuli/ide/SikuliIDE.java | 2 +-
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/Basics/src/main/resources/META-INF/services/org.sikuli.basics.IDESupport b/Basics/src/main/resources/META-INF/services/org.sikuli.basics.IDESupport
new file mode 100644
index 0000000..2840db1
--- /dev/null
+++ b/Basics/src/main/resources/META-INF/services/org.sikuli.basics.IDESupport
@@ -0,0 +1,2 @@
+org.sikuli.idesupport.JythonIDESupport
+org.sikuli.idesupport.JRubyIDESupport
\ No newline at end of file
diff --git a/IDE/src/main/java/org/sikuli/ide/EditorPane.java b/IDE/src/main/java/org/sikuli/ide/EditorPane.java
index 6023c4c..dabe003 100755
--- a/IDE/src/main/java/org/sikuli/ide/EditorPane.java
+++ b/IDE/src/main/java/org/sikuli/ide/EditorPane.java
@@ -25,14 +25,12 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.*;
import org.sikuli.basics.Settings;
-import org.sikuli.idesupport.PythonIndentation;
import org.sikuli.basics.Debug;
import org.sikuli.basics.FileManager;
import org.sikuli.basics.IResourceLoader;
import org.sikuli.basics.IndentationLogic;
import org.sikuli.script.Location;
import org.sikuli.basics.SikuliX;
-import org.sikuli.idesupport.JythonIDESupport;
import org.sikuli.script.Image;
import org.sikuli.script.ImagePath;
@@ -62,9 +60,12 @@ public class EditorPane extends JTextPane implements KeyListener, CaretListener
private int _caret_last_x = -1;
private boolean _can_update_caret_last_x = true;
private SikuliIDEPopUpMenu popMenuImage;
+ private SikuliIDE theIDE;
+
//<editor-fold defaultstate="collapsed" desc="Initialization">
- public EditorPane() {
+ public EditorPane(SikuliIDE ide) {
+ theIDE = ide;
pref = PreferencesUser.getInstance();
showThumbs = !pref.getPrefMorePlainText();
initKeyMap();
@@ -96,9 +97,9 @@ public class EditorPane extends JTextPane implements KeyListener, CaretListener
public void initBeforeLoad(String scriptType) {
//TODO ask for scripttype on new pane
+ String scrType = null;
if (scriptType == null || "py".equals(scriptType)) {
- setEditorKitForContentType("text/python", new EditorKit());
- setContentType("text/python");
+ scrType = "text/python";
_indentationLogic = JythonIDESupport.getIndentationLogic();
_indentationLogic.setTabWidth(pref.getTabWidth());
pref.addPreferenceChangeListener(new PreferenceChangeListener() {
@@ -110,9 +111,12 @@ public class EditorPane extends JTextPane implements KeyListener, CaretListener
}
});
} else if ("rb".equals(scriptType)) {
- setEditorKitForContentType("text/ruby", new EditorKit());
- setContentType("text/ruby");
+ scrType = "text/ruby";
}
+ if (scrType != null) {
+ setEditorKitForContentType(scrType, new EditorKit(this));
+ setContentType(scrType);
+ }
}
public SikuliIDEPopUpMenu getPopMenuImage() {
diff --git a/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java b/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
index 859211f..6eb2362 100755
--- a/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
+++ b/IDE/src/main/java/org/sikuli/ide/SikuliIDE.java
@@ -880,7 +880,7 @@ public class SikuliIDE extends JFrame {
}
public EditorPane doNew(ActionEvent ae, int tabIndex) {
- EditorPane codePane = new EditorPane();
+ EditorPane codePane = new EditorPane(SikuliIDE.getInstance());
JScrollPane scrPane = new JScrollPane(codePane);
lineNumberColumn = new EditorLineNumberView(codePane);
scrPane.setRowHeaderView(lineNumberColumn);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git
More information about the pkg-java-commits
mailing list