gui
Class GuiController

java.lang.Object
  extended by gui.GuiController

public class GuiController
extends java.lang.Object

This class is going to be used for implementing the main functions specified in Gui. Currently, the menubar functions are being implemented.

Author:
OZGUR

Field Summary
static java.io.File activeFile
           
static java.io.File curDir
           
 EditorPane editor
           
static java.io.File lastOpen
           
 PFrame p
           
 
Constructor Summary
GuiController()
           
 
Method Summary
 void copy(java.io.File src, java.io.File dst)
          This method copies source file to destination file.
 int newFileMenuItemPressed(PFrame callerFrame, EditorPane editorPane, java.lang.String filename, java.lang.String filePath)
          This method creates a new file dialog.
 int openMenuPressed(PFrame callerFrame, EditorPane editorPane, java.lang.String filePath)
          This method creates an open file dialog.
 int saveAsMenuPressed(javax.swing.JFrame callerFrame, EditorPane editorPane)
          This method saves a file with a different file path.
 int saveMenuPressed(javax.swing.JFrame callerFrame, EditorPane editorPane)
          This method saves a modified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

curDir

public static java.io.File curDir

lastOpen

public static java.io.File lastOpen

activeFile

public static java.io.File activeFile

p

public PFrame p

editor

public EditorPane editor
Constructor Detail

GuiController

public GuiController()
Method Detail

openMenuPressed

public int openMenuPressed(PFrame callerFrame,
                           EditorPane editorPane,
                           java.lang.String filePath)
This method creates an open file dialog. The specified file is opened and editor tab is added into the editor pane.


saveMenuPressed

public int saveMenuPressed(javax.swing.JFrame callerFrame,
                           EditorPane editorPane)
This method saves a modified file. The method creates a save as dialog and prompts the user if necessary.


newFileMenuItemPressed

public int newFileMenuItemPressed(PFrame callerFrame,
                                  EditorPane editorPane,
                                  java.lang.String filename,
                                  java.lang.String filePath)
This method creates a new file dialog. After the file is created, it is added into editor panel.


saveAsMenuPressed

public int saveAsMenuPressed(javax.swing.JFrame callerFrame,
                             EditorPane editorPane)
This method saves a file with a different file path. The method creates a save as dialog and prompts the user if necessary.


copy

public void copy(java.io.File src,
                 java.io.File dst)
          throws java.io.IOException
This method copies source file to destination file. If the dst file does not exist, it is created

Parameters:
src - source file
dst - destination file
Throws:
java.io.IOException