at.spardat.xma.appshell
Interface ITask

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
Task

public interface ITask
extends java.lang.Runnable

Interface for Task. Tasks are java objects which implement a workflow in its method run().

Since:
1.4.0

Method Summary
 void call(ITask subTask)
          Calls a Task as subtask of this Task.
 void callBlocking(at.spardat.xma.boot.component.IXMAControl page)
          Calls a component or page and waits until it is closed.
 void callNonBlocking(at.spardat.xma.boot.component.IXMAControl page)
          Calls a component or page and returns imediately.
 boolean closeRequested()
          Closes the Task.
 boolean closeRequested(boolean show)
          Closes the Task.
 boolean contains(IMenuItem item)
          Determine if the given MenuItem is contained directly in the submenu of the MenuItem of this Task.
 java.lang.String getContextString()
          Get the context string of this task.
 IMenuItem getMenu()
          Get the menu item of this Task.
 IEmbeddable getPage()
          Get the page or component embedded or called by this Task
 ITask getParentTask()
          Get the parent Task of this Task.
 ITask getSubTask()
          Get the direct subtask of this Task.
 boolean isRunfinished()
          Tells if the run()-method of this Task is finished, but the Task is still active.
 void pageClosed(boolean show)
          Removes the component or page on top of the call stack.
 void run()
          This method is called every time the Task is called.
 void setAppShell(IAppShell appShell)
          Set the AppShell of this Task.
 void setMenu(IMenuItem item)
          Set the menu item of this Task.
 void setParentTask(ITask parent)
          Set the parent Task of this Task.
 void setRunfinished()
          Marks the Task after its run()-method has finished.
 void setSubTask(ITask subtask)
          Set the subtask of this Task.
 void showTopPage()
          Refresh the page on top of the call stack to the screen.
 void start(IAppShell appShell)
          Starts the Task by calling it as subtask of the task on top of the callstack of the given appShell.
 void start(ITask parentTask)
          Starts the Task by calling it as subtask of the given parent task.
 

Method Detail

run

public void run()
This method is called every time the Task is called. Implement the work to do here.

Specified by:
run in interface java.lang.Runnable

getContextString

public java.lang.String getContextString()
Get the context string of this task.

Returns:
the string to show as context in the enclosing AppShell or dialog.

call

public void call(ITask subTask)
Calls a Task as subtask of this Task. This attaches it on top of the call stack and calls it run() method.

Parameters:
subTask - to call.

start

public void start(ITask parentTask)
Starts the Task by calling it as subtask of the given parent task.

Parameters:
parentTask -

start

public void start(IAppShell appShell)
Starts the Task by calling it as subtask of the task on top of the callstack of the given appShell.

Parameters:
appShell -

closeRequested

public boolean closeRequested()
Closes the Task.

Returns:
true if the Task is closed successfully false if the Task refuses to close

closeRequested

public boolean closeRequested(boolean show)
Closes the Task.

Parameters:
show - if true refresh the screen if false the screen is not refreshed
Returns:
true if the Task is closed successfully false if the Task refuses to close

callBlocking

public void callBlocking(at.spardat.xma.boot.component.IXMAControl page)
Calls a component or page and waits until it is closed. The component or page is embeded in the client area of the application shell.

Parameters:
page - to embedd

callNonBlocking

public void callNonBlocking(at.spardat.xma.boot.component.IXMAControl page)
Calls a component or page and returns imediately. The component or page is embeded in the client area of the application shell.

Parameters:
page - to embedd

pageClosed

public void pageClosed(boolean show)
Removes the component or page on top of the call stack.

Parameters:
show - if true refresh the screen if false the screen is not refreshed

showTopPage

public void showTopPage()
Refresh the page on top of the call stack to the screen.


contains

public boolean contains(IMenuItem item)
Determine if the given MenuItem is contained directly in the submenu of the MenuItem of this Task.

Parameters:
item - to test
Returns:
true if this Task contains the given item.

getPage

public IEmbeddable getPage()
Get the page or component embedded or called by this Task

Returns:
the active component of this Task or null.

getMenu

public IMenuItem getMenu()
Get the menu item of this Task. The menu item of this Task calls this Task when selected.

Returns:
the menu item of this Task.

setMenu

public void setMenu(IMenuItem item)
Set the menu item of this Task. The menu item of this Task calls this Task when selected.

Parameters:
item - where this Task can add its submenu.

getParentTask

public ITask getParentTask()
Get the parent Task of this Task. The parent Task is the Task that called this.

Returns:
the parent task

setParentTask

public void setParentTask(ITask parent)
Set the parent Task of this Task. The parent Task is the Task that will call this.

Parameters:
parent - task to set.

getSubTask

public ITask getSubTask()
Get the direct subtask of this Task. The subtask is the currently active Task called by this.

Returns:
the direct successor on the call stack

setSubTask

public void setSubTask(ITask subtask)
Set the subtask of this Task. The subtask is the Task that will be called by this.

Parameters:
subtask - to set.

setAppShell

public void setAppShell(IAppShell appShell)
Set the AppShell of this Task.

Parameters:
appShell -

isRunfinished

public boolean isRunfinished()
Tells if the run()-method of this Task is finished, but the Task is still active. This is normal behaviour with nonblocking pages.


setRunfinished

public void setRunfinished()
Marks the Task after its run()-method has finished. This method is resverved for the runtime. Do not call it directly!