Revision 639 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/composer/DefaultJDialogEditor.java
DefaultJDialogEditor.java | ||
---|---|---|
6 | 6 |
import java.beans.PropertyChangeListener; |
7 | 7 |
import java.util.HashSet; |
8 | 8 |
import java.util.Set; |
9 |
import javax.swing.JComponent; |
|
9 | 10 |
|
10 | 11 |
import javax.swing.JPanel; |
11 | 12 |
import javax.swing.JScrollPane; |
12 | 13 |
import javax.swing.JTabbedPane; |
13 | 14 |
import javax.swing.text.JTextComponent; |
15 |
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; |
|
14 | 16 |
|
15 | 17 |
import org.gvsig.scripting.ScriptingDialog; |
16 | 18 |
import org.gvsig.scripting.ScriptingScript; |
... | ... | |
18 | 20 |
import org.gvsig.scripting.swing.api.JThinG; |
19 | 21 |
import org.gvsig.scripting.swing.api.ScriptingUIManager; |
20 | 22 |
|
21 |
public class DefaultJDialogEditor extends JDialogEditor { |
|
23 |
public class DefaultJDialogEditor extends JPanel implements JDialogEditor {
|
|
22 | 24 |
|
23 | 25 |
private static final long serialVersionUID = 5032349017514086800L; |
24 | 26 |
private JThinG thing; |
25 | 27 |
protected ScriptingDialog script; |
26 | 28 |
protected JTabbedPane pestana; |
27 |
private EditorHelper editorHelper; |
|
29 |
private final EditorHelper editorHelper;
|
|
28 | 30 |
private final ScriptingUIManager uimanager; |
29 | 31 |
private boolean modified; |
30 | 32 |
protected Set<PropertyChangeListener> changeListeners; |
... | ... | |
105 | 107 |
} |
106 | 108 |
|
107 | 109 |
@Override |
108 |
public void addDefaultActionListener(ActionListener actionlistener) {
|
|
109 |
this.editorHelper.getCodePanel().addDefaultActionListener(actionlistener);
|
|
110 |
public void addUpdateCaretPositionActionListener(ActionListener actionlistener) {
|
|
111 |
this.editorHelper.getCodePanel().addUpdateCaretPositionActionListener(actionlistener);
|
|
110 | 112 |
} |
111 | 113 |
|
112 | 114 |
@Override |
... | ... | |
133 | 135 |
public boolean isModified() { |
134 | 136 |
return this.modified; |
135 | 137 |
} |
138 |
|
|
139 |
@Override |
|
140 |
public void selectLine(int line) { |
|
141 |
this.editorHelper.getCodePanel().selectLine(line); |
|
142 |
} |
|
143 |
|
|
144 |
@Override |
|
145 |
public int getLineCount() { |
|
146 |
JTextComponent textComponent = this.editorHelper.getCodePanel().getJTextComponent(); |
|
147 |
if( textComponent instanceof RSyntaxTextArea ) { |
|
148 |
return ((RSyntaxTextArea)textComponent).getLineCount(); |
|
149 |
} |
|
150 |
return 0; |
|
151 |
} |
|
152 |
|
|
153 |
@Override |
|
154 |
public JComponent asJComponent() { |
|
155 |
return this; |
|
156 |
} |
|
136 | 157 |
} |
Also available in: Unified diff