install4j API

com.install4j.api.context
Class DefaultUnattendedProgressInterface

java.lang.Object
  extended by com.install4j.api.context.DefaultUnattendedProgressInterface
All Implemented Interfaces:
ProgressInterface, UnattendedProgressInterface

public class DefaultUnattendedProgressInterface
extends java.lang.Object
implements UnattendedProgressInterface

Default implementation of UnattendedProgressInterface. You can override its methods to customize the default behavior.

Author:
ej-technologies GmbH

Field Summary
 
Fields inherited from interface com.install4j.api.context.ProgressInterface
OVERWRITE_ALL, OVERWRITE_NEVER, OVERWRITE_NO, OVERWRITE_YES, RETRY_CANCEL, RETRY_NO, RETRY_YES
 
Constructor Summary
DefaultUnattendedProgressInterface()
           
 
Method Summary
 boolean askContinue(java.io.File file)
          Default implementation for unattended mode.
 int askOverwrite(java.io.File file)
          Default implementation for unattended mode.
 int askRetry(java.io.File file)
          Default implementation for unattended mode.
 int getPercentCompleted()
          Returns the last value set by setPercentCompleted.
 boolean isAskForProxy()
          Default implementation for unattended mode.
 void setCancelButtonEnabled(boolean enabled)
          Default implementation for unattended mode that does nothing.
 void setCancelButtonVisible(boolean visible)
          Default implementation for unattended mode that does nothing.
 void setDetailMessage(java.lang.String message)
          Default implementation for unattended mode that does nothing.
 void setIndeterminateProgress(boolean indeterminateProgress)
          Default implementation for unattended mode that does nothing.
 void setPercentCompleted(int value)
          Sets the percentage of completion of the current action and saves it to a local variable.
 void setSecondaryPercentCompleted(int value)
          Sets the percentage of completion of a secondary task, like the unpacking of a JAR file that was packed with Pack200.
 void setStatusMessage(java.lang.String message)
          Default implementation for unattended mode that does nothing.
 void setVisible(boolean visible)
          Default implementation for unattended mode that does nothing.
 void showFailure(java.lang.String message)
          Default implementation for unattended mode that does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUnattendedProgressInterface

public DefaultUnattendedProgressInterface()
Method Detail

setVisible

public void setVisible(boolean visible)
Default implementation for unattended mode that does nothing.

Specified by:
setVisible in interface UnattendedProgressInterface
Parameters:
visible - true at startup and false at exit
See Also:
UnattendedProgressInterface.setVisible(boolean)

setCancelButtonEnabled

public void setCancelButtonEnabled(boolean enabled)
Default implementation for unattended mode that does nothing.

Specified by:
setCancelButtonEnabled in interface UnattendedProgressInterface
Parameters:
enabled - true or false
See Also:
UnattendedProgressInterface.setCancelButtonEnabled(boolean)

setCancelButtonVisible

public void setCancelButtonVisible(boolean visible)
Default implementation for unattended mode that does nothing.

Specified by:
setCancelButtonVisible in interface UnattendedProgressInterface
Parameters:
visible - true or false
See Also:
UnattendedProgressInterface.setCancelButtonVisible(boolean)

isAskForProxy

public boolean isAskForProxy()
Default implementation for unattended mode.

Specified by:
isAskForProxy in interface UnattendedProgressInterface
Returns:
always returns false
See Also:
UnattendedProgressInterface.isAskForProxy()

setStatusMessage

public void setStatusMessage(java.lang.String message)
Default implementation for unattended mode that does nothing.

Specified by:
setStatusMessage in interface ProgressInterface
Parameters:
message - the new message.
See Also:
ProgressInterface.setStatusMessage(String)

setDetailMessage

public void setDetailMessage(java.lang.String message)
Default implementation for unattended mode that does nothing.

Specified by:
setDetailMessage in interface ProgressInterface
Parameters:
message - the new message.
See Also:
ProgressInterface.setDetailMessage(String)

setPercentCompleted

public void setPercentCompleted(int value)
Sets the percentage of completion of the current action and saves it to a local variable.

Specified by:
setPercentCompleted in interface ProgressInterface
Parameters:
value - a value between 0 and 100.
See Also:
ProgressInterface.setPercentCompleted(int)

getPercentCompleted

public int getPercentCompleted()
Returns the last value set by setPercentCompleted.

Specified by:
getPercentCompleted in interface ProgressInterface
Returns:
the percentage of completion
See Also:
ProgressInterface.getPercentCompleted()

setSecondaryPercentCompleted

public void setSecondaryPercentCompleted(int value)
Description copied from interface: ProgressInterface
Sets the percentage of completion of a secondary task, like the unpacking of a JAR file that was packed with Pack200.

Note: Has no effect if not called from an action or if the containing screen doesn't display progress.

Specified by:
setSecondaryPercentCompleted in interface ProgressInterface
Parameters:
value - a value between 0 and 100.

setIndeterminateProgress

public void setIndeterminateProgress(boolean indeterminateProgress)
Default implementation for unattended mode that does nothing.

Specified by:
setIndeterminateProgress in interface ProgressInterface
Parameters:
indeterminateProgress - true or false
See Also:
ProgressInterface.setIndeterminateProgress(boolean)

showFailure

public void showFailure(java.lang.String message)
Default implementation for unattended mode that does nothing.

Specified by:
showFailure in interface ProgressInterface
Parameters:
message - the error message
See Also:
ProgressInterface.showFailure(String)

askOverwrite

public int askOverwrite(java.io.File file)
                 throws UserCanceledException
Default implementation for unattended mode.

Specified by:
askOverwrite in interface ProgressInterface
Parameters:
file - the file in question.
Returns:
always returns OVERWRITE_NO
Throws:
UserCanceledException
See Also:
ProgressInterface.askOverwrite(File)

askRetry

public int askRetry(java.io.File file)
             throws UserCanceledException
Default implementation for unattended mode.

Specified by:
askRetry in interface ProgressInterface
Parameters:
file - the file in question.
Returns:
always returns RETRY_NO
Throws:
UserCanceledException
See Also:
ProgressInterface.askRetry(File)

askContinue

public boolean askContinue(java.io.File file)
                    throws UserCanceledException
Default implementation for unattended mode.

Specified by:
askContinue in interface ProgressInterface
Parameters:
file - the file in question.
Returns:
always returns true
Throws:
UserCanceledException
See Also:
ProgressInterface.askContinue(File)

install4j API