Revision 368 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/DefaultScriptingUIManager.java

View differences:

DefaultScriptingUIManager.java
12 12
import javax.help.HelpSetException;
13 13
import javax.help.JHelp;
14 14
import javax.swing.ImageIcon;
15
import javax.swing.JEditorPane;
16 15
import javax.swing.JPanel;
17 16

  
18
import org.slf4j.Logger;
19
import org.slf4j.LoggerFactory;
20

  
21 17
import org.gvsig.about.AboutLocator;
22 18
import org.gvsig.about.AboutManager;
23 19
import org.gvsig.scripting.ScriptingDialog;
......
33 29
import org.gvsig.scripting.swing.api.JThinG;
34 30
import org.gvsig.scripting.swing.api.JThinlet;
35 31
import org.gvsig.scripting.swing.api.ScriptingUIManager;
32
import org.gvsig.scripting.swing.api.SyntaxtHighlightTextComponent;
36 33
import org.gvsig.scripting.swing.impl.composer.DefaultJCodeEditor;
37 34
import org.gvsig.scripting.swing.impl.composer.DefaultJDialogEditor;
38 35
import org.gvsig.scripting.swing.impl.composer.DefaultJScriptingComposer;
39 36
import org.gvsig.scripting.swing.impl.syntaxhighlight.JEditorPaneSyntaxHighlighting;
37
import org.gvsig.scripting.swing.impl.syntaxhighlight.JRSyntaxTextArea;
40 38
import org.gvsig.tools.swing.api.ToolsSwingLocator;
41 39
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
40
import org.slf4j.Logger;
41
import org.slf4j.LoggerFactory;
42 42

  
43 43

  
44 44
public class DefaultScriptingUIManager implements ScriptingUIManager{
......
46 46
	private final static Logger logger= LoggerFactory.getLogger(DefaultScriptingUIManager.class);
47 47
;
48 48
	private ScriptingManager manager;
49
//	private WindowManager windowManager;
50 49
	private Map<String,URL> userHelps= new HashMap<String, URL>();
51
//	private JFrame mainFrame = null;
52 50
	
53 51

  
54
//	private class MyWindowManager implements WindowManager, ComponentListener{
55
//		JDialog frame;
56
//		public void showWindow(JPanel panel, String title, int mode) {
57
//			frame = new JDialog(mainFrame,true);
58
//			frame.setAlwaysOnTop(true);
59
//			
60
//			final Dimension s = Toolkit.getDefaultToolkit().getScreenSize();
61
//			frame.setLocation(s.width / 4, s.height / 4);
62
//			
63
//			frame.setLayout(new BorderLayout());
64
//			frame.setTitle(title);
65
//			frame.add(panel, BorderLayout.CENTER);
66
//			
67
//			frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
68
//
69
//			frame.setSize(400,400);
70
//			panel.addComponentListener(this);
71
//			
72
//			frame.pack();
73
//			frame.setVisible(true);
74
//			
75
//		}
76
//				
77
//		public void componentHidden(ComponentEvent arg0) {
78
//			this.frame.dispose();
79
//			
80
//		}
81
//		public void componentMoved(ComponentEvent arg0) {
82
//			// Do nothing
83
//			
84
//		}
85
//		public void componentResized(ComponentEvent arg0) {
86
//			// Do nothing
87
//			
88
//		}
89
//		public void componentShown(ComponentEvent arg0) {
90
//			// Do nothing
91
//			
92
//		}
93
//
94
//	}
95 52

  
96 53
	public DefaultScriptingUIManager(){
97 54
		this.manager =  ScriptingLocator.getManager();
98 55
		this.manager.put("ScriptingUIManager",this);
99
//		this.windowManager = new MyWindowManager();
100 56
	}
101 57
	
102
//	public void setMainFrame(JFrame mainFrame){
103
//		this.mainFrame = mainFrame;
104
//	}
105
	
106 58
	public JScriptingComposer createComposer() {
107 59
		return new DefaultJScriptingComposer(this);
108 60
	}
......
251 203
		return thinlet;
252 204
	}
253 205

  
254
	public JEditorPane createSyntaxHighlightingPanel() {
255
		return new JEditorPaneSyntaxHighlighting();
206
	public SyntaxtHighlightTextComponent createSyntaxHighlightingPanel() {
207
		try {
208
			return new JRSyntaxTextArea();
209
		} catch( Throwable t) {
210
			logger.info("Can't create advanced SyntaxHighlightingPanel.", t);
211
			return new JEditorPaneSyntaxHighlighting();
212
		}
256 213
	}
257 214

  
258
//	public void registerWindowManager(WindowManager manager) {
259
//		this.windowManager=manager;
260
//	}
261

  
262

  
263 215
}

Also available in: Unified diff