com.levigo.jadice.swing.commands
Class AbstractDocumentCommand

java.lang.Object
  extended by com.levigo.util.swing.action.injection.InjectedCommand
      extended by com.levigo.util.swing.action.AbstractContextCommand
          extended by com.levigo.jadice.swing.commands.AbstractPageViewCommand
              extended by com.levigo.jadice.swing.commands.AbstractDocumentCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AbstractAnnotationCommand, AbstractToggleSearchCommand, AbstractToolActivationCommand, DirectPrintDocumentCommand, GradationCommand, RedoCommand, RemoveDocumentFromPageViewCommand, RotateCommand, ScrollCommand, SorterClearSelectionCommand, SorterSelectAllCommand, SpinCommand, ToggleCrosshairCommand, ToggleFontRenderModeCommand, ToggleInfoTreeCommand, ToggleLensCommand, ToggleNavigatorCommand, ToggleSorterCommand, ToggleUseImageUpscalingCommand, TurnPageCommand, UndoCommand, ZoomCommand

public abstract class AbstractDocumentCommand
extends AbstractPageViewCommand

Abstract superclass for all commands, which need a viewer and a document for functionality.


Nested Class Summary
static class AbstractDocumentCommand.Scope
           
 
Field Summary
protected  Document document
           
 
Constructor Summary
AbstractDocumentCommand()
           
 
Method Summary
protected  boolean canExecute()
          Subclasses may override this method to perform argument validation beyond the validation that happens automatically during the injection phase.
protected  RenderControls getRenderControls(boolean create)
          Return a RenderControls for the current scope.
 AbstractDocumentCommand.Scope getScope()
           
 void setScope(AbstractDocumentCommand.Scope scope)
           
 
Methods inherited from class com.levigo.jadice.swing.commands.AbstractPageViewCommand
getPageView, setPageView
 
Methods inherited from class com.levigo.util.swing.action.AbstractContextCommand
getContext, propagateContextChange, setContext
 
Methods inherited from class com.levigo.util.swing.action.injection.InjectedCommand
canExecute, execute, execute, getKey, isAvailable, isSelected, isSelected, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected Document document
Constructor Detail

AbstractDocumentCommand

public AbstractDocumentCommand()
Method Detail

canExecute

protected boolean canExecute()
Description copied from class: InjectedCommand
Subclasses may override this method to perform argument validation beyond the validation that happens automatically during the injection phase. This method is called after the context has been found to match the requirements specified via the Argument annotations and the arguments have been injected.

Overrides:
canExecute in class InjectedCommand
Returns:
true if the command can/may be executed in the current context, false otherwise.

setScope

public void setScope(AbstractDocumentCommand.Scope scope)

getScope

public AbstractDocumentCommand.Scope getScope()

getRenderControls

protected RenderControls getRenderControls(boolean create)
Return a RenderControls for the current scope.

Depending on the scope this method will either return the document controls of the current document or the page controls for the current page in the target PageView.

Parameters:
create - if the command should work in a per-page way ( getScope() == AbstractDocumentCommand.Scope.PAGE) and no page control is available, this parameter decides whether to create a new render controls for the page or to return the document render controls.
Returns:
RenderControls


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.