Revision 212 trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/DefaultJScriptingBrowser.java

View differences:

DefaultJScriptingBrowser.java
52 52
	protected ActionListener defaultActionlistener = null;
53 53
	protected ActionListener selectionActionlistener = null;
54 54
	protected ActionListener dropDownActionlistener = null;
55
	private boolean foldersOnly;
55
	private final boolean foldersOnly;
56 56

  
57 57

  
58 58
	public static class BrowserActionEvent extends ActionEvent{
......
85 85
		this.makeUI();	
86 86
	}
87 87
	
88
	public ScriptingManager getManager(){
88
	@Override
89
    public ScriptingManager getManager(){
89 90
		return this.manager;
90 91
	}
91 92
	
92
	public ScriptingFolder getRoot(){
93
	@Override
94
    public ScriptingFolder getRoot(){
93 95
		return this.root;
94 96
	}
95 97
	
......
174 176
			
175 177
	}
176 178
	
177
	public ScriptingUnit getSelectedNode(){
179
	@Override
180
    public ScriptingUnit getSelectedNode(){
178 181
		DefaultMutableTreeNode node;
179 182
		if(tree.getSelectionPath()!=null){
180 183
			node = (DefaultMutableTreeNode)tree.getSelectionPath().getLastPathComponent();
......
206 209
		DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent();
207 210
		ScriptingUnit unit = ((ScriptingUnit)((IconData)(node.getUserObject())).m_data);
208 211
		
209
		List files = null;
212
        List<ScriptingUnit> files = null;
210 213
		
211 214
		// Si es un ScriptingFolder y no hemos obtenido previamente sus hijos
212 215
		if (unit instanceof ScriptingFolder && node.getChildCount() == 0){
......
216 219
			ScriptingUnit subunit = null;
217 220

  
218 221
			for (int i = 0; i < files.size(); i++){
219
				subunit = (ScriptingUnit) files.get(i);
222
				subunit = files.get(i);
220 223
				if((this.foldersOnly && subunit instanceof ScriptingFolder) || !this.foldersOnly){
221 224
					// Obtenemos los iconos específicos para ese tipo de objeto
222 225
					String[] iconNames = subunit.getIconNames();
......
244 247

  
245 248
		ScriptingUnit unit = null;
246 249

  
247
		List files = this.root.getUnits();
250
        List<ScriptingUnit> files = this.root.getUnits();
248 251

  
249 252
		for (int i = 0; i < files.size(); i++){
250
			unit = (ScriptingUnit) files.get(i);
253
			unit = files.get(i);
251 254
			if((this.foldersOnly && unit instanceof ScriptingFolder) || !this.foldersOnly){
252 255
			String[] iconNames = unit.getIconNames();
253 256

  
......
310 313
		protected Icon   m_expandedIcon;
311 314
		protected Object m_data;
312 315

  
313
		public IconData(Icon icon, Object data)
314
		{
315
			m_icon = icon;
316
			m_expandedIcon = null;
317
			m_data = data;
318
		}
319

  
320 316
		public IconData(Icon icon, Icon expandedIcon, Object data)
321 317
		{
322 318
			m_icon = icon;
......
334 330
			return m_expandedIcon!=null ? m_expandedIcon : m_icon;
335 331
		}
336 332

  
337
		public Object getObject() 
333
		@Override
334
        public String toString() 
338 335
		{ 
339
			return m_data;
340
		}
341

  
342
		public String toString() 
343
		{ 
344 336
			return m_data.toString();
345 337
		}
346 338
	}
......
408 400
			return this;
409 401
		}
410 402

  
411
		public void paintComponent(Graphics g) 
403
		@Override
404
        public void paintComponent(Graphics g) 
412 405
		{
413 406
			Color bColor = getBackground();
414 407
			Icon icon = getIcon();

Also available in: Unified diff