net.sf.javadocbuilder.ui
Class JavadocBuilderPropertyPage

java.lang.Object
  |
  +--PropertyPage
        |
        +--net.sf.javadocbuilder.ui.JavadocBuilderPropertyPage
All Implemented Interfaces:
Constants

public class JavadocBuilderPropertyPage
extends PropertyPage
implements Constants

Property page implementation for graphically accessing the Javadoc bulder configuration.

Author:
mike
See Also:
Serialized Form

Field Summary
private  java.util.Vector builders
          The BuilderConfiguration instances configured
private  List currentBuildersList
          SWT List of current builders.
private  ILog elog
          Eclipse logger
private static java.util.logging.Logger log
          Development logger
private  IProject project
          The project for which this propery page is.
 
Fields inherited from interface net.sf.javadocbuilder.Constants
ARG_CLASSNAME_FILTER_ENABLED, ARG_CLASSNAME_FILTER_PATTERN, ARG_CUSTOM_TEMPLATE_NAME, ARG_OUT_DIR, ARG_OUT_NAME_PATTERN, ARG_SINGLE_FILE, ARG_SOURCE_DIRECTORIES, ARG_TAG_FILTER_ENABLED, ARG_TAG_FILTER_NAME, ARG_TEMPLATE_NAME, CONFIGURATION_FILENAME
 
Constructor Summary
JavadocBuilderPropertyPage()
           
 
Method Summary
protected  Control createContents(Composite parent)
           
private  void createEditButton(Composite buttons)
          Creates the edit builder button for the property page.
private  void createMoveDownButton(Composite buttons)
          Creates the move down builder button for the property page.
private  void createMoveUpButton(Composite buttons)
          Creates the move up button for the property page.
private  void createNewButton(Composite buttons)
          Creates the new builder button for the property page.
private  void createRebuildButton(Composite buttons)
          Creates the rebuild button.
private  void createRemoveButton(Composite buttons)
          Creates the remove builder button for the property page.
private  void deleteJavadocBuilderConfig()
          Deletes the .javadoc buider file from the project
private  void editBuilder(int selected, ICommand command)
          Updates the build command at specified position.
private  java.lang.String formatBuilderName(net.sf.javadocbuilder.BuilderConfiguration bc)
          Format the build command for printing to the user.
private  java.lang.String[] getBuildersNames()
          Gets a list of the visible names of the builders in the #commands vector.
private  IProject getProject()
          Gets the project we are dealing with.
private  java.lang.String[] getTemplates()
          Get the list of available templates.
private  void handleException(java.lang.String operation, java.lang.Exception e)
          Shows an error to the user and logs it.
private  int javadocBuilderIndex(ICommand[] cmds)
          Gets the index of the first javadoc builder in the commands array or -1 if there's none.
private  void noSelectedBuilder()
          inform the user that there is no builder selected.
protected  void performApply()
           
protected  void performDefaults()
           
 boolean performOk()
           
private  void readBuilders()
          Reads build commands configured in the project into the #commands vector.
private  void refreshBuilders()
          Updates the currentBuildersList The project description is not affected by this operation
private  void removeBuilder(int selected)
          Remove the builder from the commands.
private  void updateProjectBuilders()
          update the project builders putting in the project description the builders defined in this page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

project

private IProject project
The project for which this propery page is.


elog

private ILog elog
Eclipse logger


log

private static java.util.logging.Logger log
Development logger


currentBuildersList

private List currentBuildersList
SWT List of current builders. This list must filter non builders that are not from ours


builders

private java.util.Vector builders
The BuilderConfiguration instances configured

Constructor Detail

JavadocBuilderPropertyPage

public JavadocBuilderPropertyPage()
Method Detail

createContents

protected Control createContents(Composite parent)

createNewButton

private void createNewButton(Composite buttons)
Creates the new builder button for the property page.

Parameters:
buttons -

createEditButton

private void createEditButton(Composite buttons)
Creates the edit builder button for the property page.

Parameters:
buttons -

createRemoveButton

private void createRemoveButton(Composite buttons)
Creates the remove builder button for the property page.

Parameters:
buttons -

createMoveUpButton

private void createMoveUpButton(Composite buttons)
Creates the move up button for the property page.

Parameters:
buttons -

createMoveDownButton

private void createMoveDownButton(Composite buttons)
Creates the move down builder button for the property page.

Parameters:
buttons -

createRebuildButton

private void createRebuildButton(Composite buttons)
Creates the rebuild button.

Parameters:
buttons -

updateProjectBuilders

private void updateProjectBuilders()
update the project builders putting in the project description the builders defined in this page. The commands vector is flushed into the project build specification.


handleException

private final void handleException(java.lang.String operation,
                                   java.lang.Exception e)
Shows an error to the user and logs it.

Parameters:
e -

deleteJavadocBuilderConfig

private void deleteJavadocBuilderConfig()
Deletes the .javadoc buider file from the project


javadocBuilderIndex

private final int javadocBuilderIndex(ICommand[] cmds)
Gets the index of the first javadoc builder in the commands array or -1 if there's none.

Parameters:
cmds -
Returns:

editBuilder

private void editBuilder(int selected,
                         ICommand command)
Updates the build command at specified position.

Parameters:
selected -
command -

removeBuilder

private void removeBuilder(int selected)
Remove the builder from the commands.

Parameters:
selected -

refreshBuilders

private void refreshBuilders()
Updates the currentBuildersList The project description is not affected by this operation


getBuildersNames

private java.lang.String[] getBuildersNames()
Gets a list of the visible names of the builders in the #commands vector.

Returns:

readBuilders

private void readBuilders()
Reads build commands configured in the project into the #commands vector.

Returns:

formatBuilderName

private java.lang.String formatBuilderName(net.sf.javadocbuilder.BuilderConfiguration bc)
Format the build command for printing to the user.

Returns:
a String that the user will be able to interpret

getProject

private IProject getProject()
Gets the project we are dealing with.

Returns:
an IProject

getTemplates

private java.lang.String[] getTemplates()
Get the list of available templates.

Returns:

noSelectedBuilder

private final void noSelectedBuilder()
inform the user that there is no builder selected.


performApply

protected void performApply()

performOk

public boolean performOk()

performDefaults

protected void performDefaults()