hudson.plugins.jswidgets
Class JsBaseAction

java.lang.Object
  extended by hudson.plugins.jswidgets.JsBaseAction
All Implemented Interfaces:
Action, ModelObject
Direct Known Subclasses:
JsBuildAction, JsJobAction, JsRootAction

public abstract class JsBaseAction
extends Object
implements Action

Implements some basic methods for returning baseUrl and image paths. This is the base class for javascript actions.

Author:
mfriedenhagen

Field Summary
private static Logger LOG
          Our logger.
 
Constructor Summary
JsBaseAction()
           
 
Method Summary
 String getBaseUrl(StaplerRequest req)
          Calculates Hudson's URL including protocol, host and port from the request.
 String getDisplayName()
           Make method final, as we always want the same display name.
 String getIconFileName()
           Make method final, as we always want the same icon file.
 String getImagesUrl(StaplerRequest req)
          Returns the static path for images.
 String getUrlName()
          
 boolean wantHtml(StaplerRequest request)
          Returns whether we want HTML instead of javascript by checking the request for html=true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Our logger.

Constructor Detail

JsBaseAction

public JsBaseAction()
Method Detail

wantHtml

public boolean wantHtml(StaplerRequest request)
Returns whether we want HTML instead of javascript by checking the request for html=true.

Parameters:
request - stapler request
Returns:
true if html is true

getBaseUrl

public String getBaseUrl(StaplerRequest req)
Calculates Hudson's URL including protocol, host and port from the request.

Parameters:
req - request from the jelly page.
Returns:
the baseurl

getImagesUrl

public String getImagesUrl(StaplerRequest req)
Returns the static path for images. TODO: Check how we may get this from injected h-Object.

Parameters:
req - request from the jelly page.
Returns:
static image path

getDisplayName

public final String getDisplayName()
Make method final, as we always want the same display name.

Specified by:
getDisplayName in interface Action
Specified by:
getDisplayName in interface ModelObject

getIconFileName

public final String getIconFileName()
Make method final, as we always want the same icon file.

Specified by:
getIconFileName in interface Action

getUrlName

public String getUrlName()

Specified by:
getUrlName in interface Action


Copyright © 2010. All Rights Reserved.