Commit fb1a4f0d authored by Martin Quinson's avatar Martin Quinson

Imported Upstream version 0.9.6~r156

parent 7a43a90b
This diff is collapsed.
# Java Regex Lexer:
COMMENT=/\\*(?:.|[\\n\\r])*?\\*/|//.*
STRING=\"((?:\\\")|.*)?\"
IDENTIFIER=[a-z][a-zA-Z0-9_]*
TYPE=[A-Z_]\\w*
KEYWORD=abstract|boolean|break|byte|case|catch|char|class|const|continue|\
do|double|enum|else|extends|final|finally|float|for|default|implements|import|\
instanceof|int|interface|long|native|new|goto|if|public|short|super|switch|\
synchronized|package|private|protected|transient|return|void|static|while|this|\
throw|throws|try|volatile|strictfp|true|false|null
TYPE3=@\\w+
\ No newline at end of file
......@@ -33,7 +33,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>RELEASE</version>
<version>2.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
......@@ -75,4 +75,8 @@
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
......@@ -659,7 +659,8 @@ public class DefaultSyntaxKit extends DefaultEditorKit implements ViewFactory {
String url = kit.getName().replace(".", "/") + "/config";
Properties p = JarServiceProvider.readProperties(url, Locale.getDefault());
if (p.size() == 0) {
LOG.info("unable to load configuration for: " + kit + " from: " + url + ".properties");
LOG.log(Level.INFO, "unable to load configuration for: {0} from: {1}.properties",
new Object[]{kit, url});
} else {
conf.putAll(p);
}
......
......@@ -13,7 +13,6 @@
*/
package jsyntaxpane;
import java.awt.Color;
import java.awt.event.ItemEvent;
import java.io.IOException;
import java.io.StringReader;
......
......@@ -138,7 +138,7 @@ public class SyntaxView extends PlainView {
}
/**
* Sets the Rendering Hints of the Graphics. This is used so that
* Sets the Rendering Hints o nthe Graphics. This is used so that
* any painters can set the Rendering Hits to match the view.
* @param g2d
*/
......
......@@ -54,7 +54,7 @@ public class ComboCompletionDialog
* @param target
*/
public ComboCompletionDialog(JTextComponent target) {
super(ActionUtils.getFrameFor(target), true);
super(SwingUtilities.getWindowAncestor(target), ModalityType.APPLICATION_MODAL);
initComponents();
jTxtItem.getDocument().addDocumentListener(new DocumentListener() {
......@@ -226,13 +226,16 @@ public class ComboCompletionDialog
}
}//GEN-LAST:event_jTxtItemKeyPressed
private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked
if(evt.getClickCount() == 2) {
String selected = jLstItems.getSelectedValue().toString();
target.replaceSelection(selected);
setVisible(false);
}
}//GEN-LAST:event_jLstItemsMouseClicked
private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked
if(evt.getClickCount() == 2) {
Object selectedValue = jLstItems.getSelectedValue();
if(selectedValue != null){
String selected = selectedValue.toString();
target.replaceSelection(selected);
}
setVisible(false);
}
}//GEN-LAST:event_jLstItemsMouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JList jLstItems;
......
......@@ -16,6 +16,7 @@ package jsyntaxpane.actions.gui;
import java.lang.ref.WeakReference;
import jsyntaxpane.actions.*;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.text.JTextComponent;
import jsyntaxpane.util.SwingUtils;
......@@ -34,7 +35,7 @@ public class GotoLineDialog
* @param text
*/
private GotoLineDialog(JTextComponent text) {
super(ActionUtils.getFrameFor(text), false);
super(SwingUtilities.getWindowAncestor(text), ModalityType.APPLICATION_MODAL);
initComponents();
this.text = new WeakReference<JTextComponent>(text);
setLocationRelativeTo(text.getRootPane());
......
......@@ -63,7 +63,7 @@ public class QuickFindDialog extends javax.swing.JDialog
* @param data search data
*/
public QuickFindDialog(final JTextComponent target, DocumentSearchData data) {
super(ActionUtils.getFrameFor(target), false);
super(SwingUtilities.getWindowAncestor(target), ModalityType.MODELESS.MODELESS);
initComponents();
SwingUtils.addEscapeListener(this);
dsd = new WeakReference<DocumentSearchData>(data);
......
......@@ -17,8 +17,10 @@ import jsyntaxpane.actions.*;
import jsyntaxpane.components.Markers;
import java.awt.Color;
import java.awt.HeadlessException;
import java.util.regex.Matcher;
import java.util.regex.PatternSyntaxException;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.JTextComponent;
......@@ -45,7 +47,7 @@ public class ReplaceDialog extends javax.swing.JDialog
*/
public ReplaceDialog(JTextComponent text,
DocumentSearchData dsd) {
super(ActionUtils.getFrameFor(text), false);
super(SwingUtilities.getWindowAncestor(text), ModalityType.MODELESS.MODELESS);
initComponents();
textComponent = text;
this.dsd = dsd;
......@@ -253,6 +255,9 @@ public class ReplaceDialog extends javax.swing.JDialog
try {
updateFinder();
String replacement = (String) jCmbReplace.getSelectedItem();
if(!jChkRegex.isSelected()) {
replacement = Matcher.quoteReplacement(replacement);
}
ActionUtils.insertIntoCombo(jCmbReplace, replacement);
jTglHighlight.setSelected(false);
dsd.doReplaceAll(textComponent, replacement);
......
......@@ -17,7 +17,7 @@ package jsyntaxpane.actions.gui;
import java.util.Arrays;
import java.util.Map;
import javax.swing.JEditorPane;
import jsyntaxpane.actions.ActionUtils;
import javax.swing.SwingUtilities;
import jsyntaxpane.util.SwingUtils;
/**
......@@ -34,7 +34,7 @@ public class ShowAbbsDialog
* @param abbs
*/
public ShowAbbsDialog(JEditorPane parent, Map<String, String> abbs) {
super(ActionUtils.getFrameFor(parent), true);
super(SwingUtilities.getWindowAncestor(parent), ModalityType.APPLICATION_MODAL);
initComponents();
Object[] abbsList = abbs.keySet().toArray();
Arrays.sort(abbsList);
......
......@@ -71,7 +71,7 @@ public class LineNumbersRuler extends JPanel
public static final int DEFAULT_R_MARGIN = 5;
public static final int DEFAULT_L_MARGIN = 5;
private Status status;
private final static int HEIGHT = Integer.MAX_VALUE - 1000000;
private final static int MAX_HEIGHT = Integer.MAX_VALUE - 1000000;
// Text component this TextTextLineNumber component is in sync with
private JEditorPane editor;
private int minimumDisplayDigits = 2;
......@@ -137,6 +137,7 @@ public class LineNumbersRuler extends JPanel
};
addMouseListener(mouseListener);
status = Status.INSTALLING;
documentChanged();
}
@Override
......@@ -192,7 +193,7 @@ public class LineNumbersRuler extends JPanel
int preferredWidth = insets.left + insets.right + width;
Dimension d = getPreferredSize();
d.setSize(preferredWidth, HEIGHT);
d.setSize(preferredWidth, MAX_HEIGHT);
setPreferredSize(d);
setSize(d);
......@@ -221,7 +222,10 @@ public class LineNumbersRuler extends JPanel
int maxLines = ActionUtils.getLineCount(editor);
SyntaxView.setRenderingHits((Graphics2D) g);
for (int line = 1; line <= maxLines; line++) {
int topLine = (int) (g.getClip().getBounds().getY() / lh) + 1;
int bottomLine = (int) (g.getClip().getBounds().getHeight()) + topLine;
for (int line = topLine; line <= bottomLine; line++) {
String lineNumber = String.format(numbersFormat, line);
int y = line * lh;
if (line == currentLine) {
......
......@@ -8,7 +8,7 @@ TokenMarker.TokenTypes = IDENTIFIER, TYPE, TYPE2, TYPE3
#
# Performs single color selection (Default = false)
#
#SingleColorSelect = true
SingleColorSelect = true
RightMarginColumn = 80
RightMarginColor = 0xdddddd
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment