- java.lang.Object
-
- io.github.interacto.command.CommandImpl
-
- io.github.interacto.command.library.OpenWebPage
-
- All Implemented Interfaces:
Command
public class OpenWebPage extends CommandImpl
This command opens an URI in the default browser.- Author:
- Arnaud BLOUIN
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.github.interacto.command.Command
Command.CmdStatus, Command.RegistrationPolicy
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbrowsedprotected URIuriThe URI to open.-
Fields inherited from class io.github.interacto.command.CommandImpl
status
-
-
Constructor Summary
Constructors Constructor Description OpenWebPage()Creates the command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDo()Checks whether the command can be executed.protected voiddoCmdBody()This method contains the statements to execute the command.voidflush()Flushes the command.booleanhadEffect()State whether the execution of this command has effects on the system.voidsetUri(URI newURI)-
Methods inherited from class io.github.interacto.command.CommandImpl
cancel, createMemento, doIt, done, getRegistrationPolicy, getStatus, isDone, toString, unregisteredBy
-
-
-
-
Field Detail
-
uri
protected URI uri
The URI to open.
-
browsed
protected boolean browsed
-
-
Method Detail
-
flush
public void flush()
Description copied from interface:CommandFlushes the command. Can be useful to close streams, free objects, etc. A command should flushed manually only when it is not managed by the cmd registry of the application. When a command is gathered and managed by a command registry, it is automatically flushed when the command registry removes the cmd.- Specified by:
flushin interfaceCommand- Overrides:
flushin classCommandImpl
-
doCmdBody
protected void doCmdBody()
Description copied from class:CommandImplThis method contains the statements to execute the command. This method is automatically called by DoIt and must not be called explicitly.- Specified by:
doCmdBodyin classCommandImpl
-
canDo
public boolean canDo()
Description copied from interface:CommandChecks whether the command can be executed.- Specified by:
canDoin interfaceCommand- Overrides:
canDoin classCommandImpl- Returns:
- True if the command can be executed.
-
hadEffect
public boolean hadEffect()
Description copied from interface:CommandState whether the execution of this command has effects on the system.- Specified by:
hadEffectin interfaceCommand- Overrides:
hadEffectin classCommandImpl- Returns:
- True: the command has effects on the system.
-
setUri
public void setUri(URI newURI)
- Parameters:
newURI- The URI to open.
-
-