Revision 468 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/EditorHelper.java
EditorHelper.java | ||
---|---|---|
53 | 53 |
panel.setLayout(new BorderLayout()); |
54 | 54 |
|
55 | 55 |
editorPanel = (SyntaxtHighlightTextComponent) uimanager.createSyntaxHighlightingPanel(); |
56 |
editorPanel.setContentType("text/" + script.getLangName());
|
|
56 |
editorPanel.setContentType(script.getMimeType());
|
|
57 | 57 |
editorPanel.setText(script.getCode()); |
58 | 58 |
|
59 | 59 |
editorPanel.addKeyListener(new MyKeyListener(this)); |
60 | 60 |
|
61 |
panel.add(editorPanel.getJScrollPane(), BorderLayout.CENTER);
|
|
61 |
panel.add(editorPanel.asJComponent(), BorderLayout.CENTER);
|
|
62 | 62 |
panel.setVisible(true); |
63 | 63 |
|
64 | 64 |
return panel; |
... | ... | |
268 | 268 |
if (keyChar != KeyEvent.CHAR_UNDEFINED) { |
269 | 269 |
JTextArea textArea = (JTextArea) arg0.getSource(); |
270 | 270 |
JEditor editor = getJEditor(arg0); |
271 |
|
|
272 |
doScriptChanged(editor); |
|
271 |
if( editor != null ) { |
|
272 |
doScriptChanged(editor); |
|
273 |
} |
|
273 | 274 |
} |
274 | 275 |
|
275 | 276 |
} |
Also available in: Unified diff