net.sourceforge.jsxe.gui
Interface DocumentView


public interface DocumentView

The DocumentView class defines the methods that will be implemented by all views in jsXe that provide features for editing XML documents. This is the precursor to jsXe's view/plugin interface.

Version:
$Id: DocumentView.java 780 2006-01-30 22:54:40Z ian_lewis $
Author:
Ian Lewis (IanLewis@member.fsf.org)
See Also:
TabbedView

Method Summary
 boolean close()
          Closes the current view.
 DocumentBuffer getDocumentBuffer()
          Gets the DocumentBuffer that this view is currently using.
 Component getDocumentViewComponent()
          Gets the the Component used to render this view.
 JMenu[] getMenus()
          Gets the menus that this view has associated with it.
 ViewPlugin getViewPlugin()
          Gets view plugin that created this view.
 boolean goToLine(int lineNo)
          Tells the view to attempt to move to the specified line in the document.
 void setDocumentBuffer(DocumentBuffer document)
          Sets the current document.
 

Method Detail

close

public boolean close()
Closes the current view. This method is called whenever the view is being discarded. This is usually used to save properties associated with this view.


getDocumentViewComponent

public Component getDocumentViewComponent()
Gets the the Component used to render this view.

Returns:
the Component used to render this view

getMenus

public JMenu[] getMenus()
Gets the menus that this view has associated with it. This can be used when the view is loaded to add extra menus to the menu bar.

Returns:
the menus for this view

getViewPlugin

public ViewPlugin getViewPlugin()
Gets view plugin that created this view.

Returns:
the view plugin

getDocumentBuffer

public DocumentBuffer getDocumentBuffer()
Gets the DocumentBuffer that this view is currently using.

Returns:
the DocumentBuffer for this view

setDocumentBuffer

public void setDocumentBuffer(DocumentBuffer document)
                       throws IOException
Sets the current document. This method is used when you want to view another document using this view object.

Parameters:
document - the new document to view
Throws:
IOException - if the document cannot be viewed using this view

goToLine

public boolean goToLine(int lineNo)
Tells the view to attempt to move to the specified line in the document. The implementation of this method is not specified.

Returns:
true if the view was able to move to the specified line
Since:
jsXe 0.4beta