net.sf.doolin.gui.action.util
Class ActionAbout

java.lang.Object
  extended by net.sf.doolin.gui.action.AbstractGUIAction
      extended by net.sf.doolin.gui.action.AbstractSimpleGUIAction
          extended by net.sf.doolin.gui.action.util.ActionAbout
All Implemented Interfaces:
GUIAction, org.springframework.beans.factory.BeanNameAware

public class ActionAbout
extends AbstractSimpleGUIAction

Standard action for displaying an "About..." dialog box.

The displayed dialog's title is set according to the key defined by the title property.

The displayed dialog's text is set according to the key defined by the text property. If html is set to true, the text is rendered as HTML and any link is made active.

An image is put in the dialog is logo is not null. The image is looked using the IconService and the requested size is IconSize.BIG.

The position of the logo relatively to the text is set using the layout property.

Author:
Damien Coraboeuf

Nested Class Summary
static class ActionAbout.ImagePosition
          Positions for the image.
 
Field Summary
protected  JDialog dialog
          Displayed dialog
 
Constructor Summary
ActionAbout()
           
 
Method Summary
protected  Component createHTML(ActionContext context, String dialogText)
          Creates an HTML container for the text.
protected  void doExecute(ActionContext context)
          Executes the action and throws any kind of error.
 ActionAbout.ImagePosition getLayout()
          Gets the layout.
 String getLogo()
          Gets the logo.
 String getText()
          Gets the text.
 String getTitle()
          Gets the title.
 boolean isHtml()
          Checks if is html.
 void setHtml(boolean html)
          Defines if the content is HTML"
 void setLayout(ActionAbout.ImagePosition layout)
          Position of the image
 void setLogo(String logo)
          ID for the logo image
 void setText(String text)
          Expression for the text
 void setTitle(String title)
          Sets the title.
 
Methods inherited from class net.sf.doolin.gui.action.AbstractSimpleGUIAction
getIconId, getIconIDExpression, getId, getShortcut, getShortcutExpression, getTextExpression, getTip, getTipExpression, init, setBeanName, setIconId, setShortcut, setTip, toString
 
Methods inherited from class net.sf.doolin.gui.action.AbstractGUIAction
execute, getActionContextData, getActionContextDataExtractor, getDisplayStateHandler, getIcon, getIconService, setActionContextDataExtractor, setDisplayStateHandler, setIconService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dialog

protected JDialog dialog
Displayed dialog

Constructor Detail

ActionAbout

public ActionAbout()
Method Detail

getLayout

public ActionAbout.ImagePosition getLayout()
Gets the layout.

Returns:
the layout

getLogo

public String getLogo()
Gets the logo.

Returns:
the logo

getText

public String getText()
Gets the text.

Returns:
the text

getTitle

public String getTitle()
Gets the title.

Overrides:
getTitle in class AbstractSimpleGUIAction
Returns:
the title

isHtml

public boolean isHtml()
Checks if is html.

Returns:
true, if is html

setHtml

public void setHtml(boolean html)
Defines if the content is HTML"

Parameters:
html - the new html

setLayout

public void setLayout(ActionAbout.ImagePosition layout)
Position of the image

Parameters:
layout - the new layout

setLogo

public void setLogo(String logo)
ID for the logo image

Parameters:
logo - the new logo

setText

public void setText(String text)
Expression for the text

Parameters:
text - the new text

setTitle

public void setTitle(String title)
Description copied from class: AbstractSimpleGUIAction
Sets the title.

Overrides:
setTitle in class AbstractSimpleGUIAction
Parameters:
title - the new title

createHTML

protected Component createHTML(ActionContext context,
                               String dialogText)
Creates an HTML container for the text.

Parameters:
context - Action context
dialogText - Text to display
Returns:
Component to be displayed for the text

doExecute

protected void doExecute(ActionContext context)
                  throws Exception
Description copied from class: AbstractGUIAction
Executes the action and throws any kind of error.

Specified by:
doExecute in class AbstractGUIAction
Parameters:
context - the context
Throws:
Exception - the exception


Copyright © 2011. All Rights Reserved.