KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > gui > swing > EditorScrollPane


1
2 package org.objectweb.jac.aspects.gui.swing;
3
4 import javax.swing.*;
5 import java.io.*;
6
7 public class EditorScrollPane extends JScrollPane
8 {
9    public SHEditor editor;
10    
11    EditorScrollPane() {
12       editor = new SHEditor();
13       this.setViewportView(editor);
14    }
15    
16    public void showLineNumbering(boolean show) {
17    }
18    
19    public void scrollToLine(int line) {
20          editor.scrollToLine(line);
21    }
22    
23    public void loadFromFile(File f) {
24       editor.readFromFile(f);
25    }
26    
27    public void saveToFile(File f) {
28       editor.saveToFile(f);
29    }
30    
31    public boolean isSaved() {
32       return !editor.changed;
33    }
34    
35    public void cut() {
36       editor.cut();
37    }
38    
39    public void copy() {
40       editor.copy();
41    }
42    
43    public void paste() {
44       editor.paste();
45    }
46 }
47
Popular Tags