|
|
SOURCE CONTROLL INTERFACE
The following is the code for the SourceControl interface that you can implement to create your
own source control drivers for zBlueStudio. This interface is located in the zBlueStudio.jar file.
Once you have created your implementing class, place the .class file in zBlueStudio's sourcecontrol
folder and you will be able to select your driver from the preferences dialog.
|
package com.zbluesoftware.zbs.sourcecontrol;
import java.awt.Font;
import java.awt.Frame;
import java.io.File;
import java.util.ArrayList;
/**
* This is the base interface for any source control class that is intended to work with zBlueStudio.
* In order to create your own source control implementation, or to rewrite the CVS implementation
* that comes with zBlueStudio, you'll need to implement this interface.
*
* Your class should implement this interface and then be placed in the sourcecontrol directory within
* the zBlueStudio directory. This directory is scanned during the program startup for the current
* source control option, and during when the preferences dialog is displayed for any classes
* that implement the SourceControl interface. Any classes that are found are then included in the
* preferences source control options and may be selected.
*
* Obviously, your class may contain as many methods as are necessary to provide for a complete
* source control implementation.
*
* Your class must have a public no argument constructor.
*/
public interface SourceControl {
/**
* This is the font that all labels should use.
*/
public static final Font LABEL_FONT = new Font("Arial", Font.PLAIN, 10);
/**
* This is the font that all text fields should use.
*/
public static final Font TEXT_FIELD_FONT = new Font("Arial", Font.PLAIN, 10);
/**
* This is the font that all buttons should use.
*/
public static final Font BUTTON_FONT = new Font("Arial", Font.PLAIN, 10);
// Trus if debug information should go to printStackTrace
public static final boolean DEBUG = false;
/**
* This method sets a parent frame that can be used to display dialogs against. It will be
* called right after the constructor returns.
*/
public void setParent(Frame parent);
/**
* This method should return the name of source control being use. For CVS, this method would
* return 'CVS'.
*/
public String getName();
/**
* This method should return an ArrayList of the menu items that should appear under the
* Source Control menu in zBlueStudio. Each item in the ArrayList must be either a JMenuItem
* or a JSeparator. The order in which they exist in the ArrayList is the order they will
* be displayed in the menu.
*
* You may use any mnemonics and accelerators you wish for the menu items. However, make sure
* that the ones you use do not conflict with other mnemonics or accelerators use in zBlueStudio.
* The font of the menu item will automatically be set to the defauklt zBlueStudio menu font.
*/
public ArrayList getMenuItems();
/**
* This is the method that is called when a source control menu item is selected. The intended
* way for this method to execute is for it to act as a dispatcher and call another method that
* is designated to execute a specific menu item.
*
* @param menuItem The string name of the menu item that was selected
* @param file The project's base directory. If the null poject is being used, then
* this will be null. If it is null you will probably have to display a
* dialog asking the user where their files are.
*/
public void executeMenuItem(String menuItem, File file);
}
|