org.millstone.base.ui
Class Link

java.lang.Object
  |
  +--org.millstone.base.ui.AbstractComponent
        |
        +--org.millstone.base.ui.Link
All Implemented Interfaces:
Component, java.util.EventListener, MethodEventSource, Paintable, VariableOwner

public class Link
extends AbstractComponent

Link component. Link is used to create external or internal URL links. Internal links can be used to create action items, which change the state to application to one of the predefined states. For example, a link can be created for existing MenuTree items.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes inherited from class org.millstone.base.ui.Component
Component.Event, Component.Listener
 
Nested classes inherited from class org.millstone.base.terminal.Paintable
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener
 
Field Summary
static int TARGET_BORDER_DEFAULT
           
static int TARGET_BORDER_MINIMAL
           
static int TARGET_BORDER_NONE
           
 
Constructor Summary
Link()
          Creates a new link.
Link(java.lang.String caption, Resource resource)
          Creates a new instance of Link
Link(java.lang.String caption, Resource resource, java.lang.String targetName, int width, int height, int border)
          Creates a new instance of Link that opens a new window.
Link(Window window)
          Creates a new link to a window.
 
Method Summary
 Resource getResource()
          Returns the resource this link opens.
 java.lang.String getTag()
          Get component UIDL tag.
 int getTargetBorder()
          Returns the target window border.
 int getTargetHeight()
          Returns the target window height or -1 if not set.
 java.lang.String getTargetName()
          Returns the target window name.
 int getTargetWidth()
          Returns the target window width or -1 if not set.
 Window getWindow()
          Returns the window this link opens.
 void paintContent(PaintTarget target)
          Paint the content of this component.
 void setResource(Resource resource)
          Sets the resource this link opens.
 void setTargetBorder(int targetBorder)
          Sets the border of the target window.
 void setTargetHeight(int targetHeight)
          Sets the target window height.
 void setTargetName(java.lang.String targetName)
          Sets the target window name.
 void setTargetWidth(int targetWidth)
          Sets the target window width.
 void setWindow(Window window)
          Sets the window this link opens.
 
Methods inherited from class org.millstone.base.ui.AbstractComponent
addListener, addListener, addListener, addListener, attach, changeVariables, childRequestedRepaint, dependsOn, detach, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getErrorMessage, getIcon, getLocale, getParent, getStyle, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setReadOnly, setStyle, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_BORDER_NONE

public static final int TARGET_BORDER_NONE
See Also:
Constant Field Values

TARGET_BORDER_MINIMAL

public static final int TARGET_BORDER_MINIMAL
See Also:
Constant Field Values

TARGET_BORDER_DEFAULT

public static final int TARGET_BORDER_DEFAULT
See Also:
Constant Field Values
Constructor Detail

Link

public Link()
Creates a new link.


Link

public Link(Window window)
Creates a new link to a window.


Link

public Link(java.lang.String caption,
            Resource resource)
Creates a new instance of Link


Link

public Link(java.lang.String caption,
            Resource resource,
            java.lang.String targetName,
            int width,
            int height,
            int border)
Creates a new instance of Link that opens a new window.

Parameters:
caption - Link text.
targetName - The name of the target window where the link opens to. Empty name of null implies that the target is opened to the window containing the link.
width - Width of the target window.
height - Height of the target window.
border - Borget style of the target window.
Method Detail

getTag

public java.lang.String getTag()
Get component UIDL tag.

Specified by:
getTag in class AbstractComponent
Returns:
Component UIDL tag as string.

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Paint the content of this component.

Overrides:
paintContent in class AbstractComponent
Parameters:
target - target UIDL stream where the component should paint itself to
Throws:
PaintException - The paint operation failed.

getTargetBorder

public int getTargetBorder()
Returns the target window border.

Returns:
int

getTargetHeight

public int getTargetHeight()
Returns the target window height or -1 if not set.

Returns:
int

getTargetName

public java.lang.String getTargetName()
Returns the target window name. Empty name of null implies that the target is opened to the window containing the link.

Returns:
String

getTargetWidth

public int getTargetWidth()
Returns the target window width or -1 if not set.

Returns:
int

setTargetBorder

public void setTargetBorder(int targetBorder)
Sets the border of the target window.

Parameters:
targetBorder - The targetBorder to set

setTargetHeight

public void setTargetHeight(int targetHeight)
Sets the target window height.

Parameters:
targetHeight - The targetHeight to set

setTargetName

public void setTargetName(java.lang.String targetName)
Sets the target window name.

Parameters:
targetName - The targetName to set

setTargetWidth

public void setTargetWidth(int targetWidth)
Sets the target window width.

Parameters:
targetWidth - The targetWidth to set

getResource

public Resource getResource()
Returns the resource this link opens.

Returns:
Resource

getWindow

public Window getWindow()
Returns the window this link opens.

Specified by:
getWindow in interface Component
Overrides:
getWindow in class AbstractComponent
Returns:
Window

setResource

public void setResource(Resource resource)
Sets the resource this link opens.

Parameters:
resource - The resource to set

setWindow

public void setWindow(Window window)
Sets the window this link opens.

Parameters:
window - The window to set


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.