hudson.plugins.jswidgets
Class JsBaseAction

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

public abstract class JsBaseAction
extends java.lang.Object
implements hudson.model.Action

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

Author:
mfriedenhagen

Constructor Summary
JsBaseAction()
           
 
Method Summary
 java.lang.String getBaseUrl(org.kohsuke.stapler.StaplerRequest req)
          Calculates Hudson's URL including protocol, host and port from the request.
 java.lang.String getDisplayName()
           Make method final, as we always want the same display name.
 java.lang.String getIconFileName()
           Make method final, as we always want the same icon file.
 java.lang.String getImagesUrl(org.kohsuke.stapler.StaplerRequest req)
          Returns the static path for images.
 java.lang.String getUrlName()
          
 boolean skipDescription(org.kohsuke.stapler.StaplerRequest request)
          Returns whether we want to skip the description of the job.
 boolean wantHtml(org.kohsuke.stapler.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
 

Constructor Detail

JsBaseAction

public JsBaseAction()
Method Detail

wantHtml

public boolean wantHtml(org.kohsuke.stapler.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

skipDescription

public boolean skipDescription(org.kohsuke.stapler.StaplerRequest request)
Returns whether we want to skip the description of the job.

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

getBaseUrl

public java.lang.String getBaseUrl(org.kohsuke.stapler.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 java.lang.String getImagesUrl(org.kohsuke.stapler.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 java.lang.String getDisplayName()
Make method final, as we always want the same display name.

Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getIconFileName

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

Specified by:
getIconFileName in interface hudson.model.Action

getUrlName

public java.lang.String getUrlName()

Specified by:
getUrlName in interface hudson.model.Action


Copyright © 2010. All Rights Reserved.