de.espirit.firstspirit.ui.operations
Interface RequestOperation


public interface RequestOperation

Operation providing means to select from a set of answers.

Since:
4.2.427

Nested Class Summary
static interface RequestOperation.Answer
          Definition of an answer object.
static class RequestOperation.Kind
          The kind of the operation.
 
Field Summary
static OperationType<RequestOperation> TYPE
          The operation's type.
 
Method Summary
 RequestOperation.Answer addAnswer(String label)
          Add an answer with the given label.
 RequestOperation.Answer addCancel()
          Adds an answer with a language dependent label for "cancel".
 RequestOperation.Answer addNo()
          Adds an answer with a language dependent label for "no".
 RequestOperation.Answer addOk()
          Adds an answer with a language dependent label for "ok".
 RequestOperation.Answer addYes()
          Adds an answer with a language dependent label for "yes".
 RequestOperation.Answer perform(String question)
          Asks the given question, returning the selected answer.
 void setInitialAnswer(RequestOperation.Answer answer)
          Defines the answer to be initially selected.
 void setKind(RequestOperation.Kind kind)
          Set the kind of request to be answered.
 void setTitle(String title)
          Set the title of the selection.
 

Field Detail

TYPE

static final OperationType<RequestOperation> TYPE
The operation's type.

Since:
4.2.427
Method Detail

setTitle

void setTitle(String title)
Set the title of the selection.

Parameters:
title - The selection operation's title.
Since:
4.2.427

setKind

void setKind(@NotNull
             RequestOperation.Kind kind)
Set the kind of request to be answered. Defaults to RequestOperation.Kind.INFO.

Parameters:
kind - The request kind.
Since:
4.2.427

addAnswer

RequestOperation.Answer addAnswer(String label)
Add an answer with the given label. Answers will be displayed in the order added.

Parameters:
label - The label.
Since:
4.2.427

addYes

RequestOperation.Answer addYes()
Adds an answer with a language dependent label for "yes".

Returns:
The yes-answer
Since:
4.2.427

addNo

RequestOperation.Answer addNo()
Adds an answer with a language dependent label for "no".

Returns:
The no-answer
Since:
4.2.427

addOk

RequestOperation.Answer addOk()
Adds an answer with a language dependent label for "ok".

Returns:
The ok-answer
Since:
4.2.427

addCancel

RequestOperation.Answer addCancel()
Adds an answer with a language dependent label for "cancel".

Returns:
The cancel-answer
Since:
4.2.427

setInitialAnswer

void setInitialAnswer(RequestOperation.Answer answer)
Defines the answer to be initially selected. Defaults to the last added answer.

Parameters:
answer - The initial answer.
Since:
4.2.427

perform

@Nullable
RequestOperation.Answer perform(@NotNull
                                         String question)
Asks the given question, returning the selected answer.

Parameters:
question - The question to be asked.
Returns:
The selected answer or null, if the request was closed with no answer.
Since:
4.2.427


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480