public abstract class AbstractPrintFeature extends AbstractFeature implements IPrintFeature
Constructor and Description |
---|
AbstractPrintFeature(IFeatureProvider fp)
Constructor that is to be called by any subclass.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute(IContext context)
Checks if this feature can be executed by delegating to the method
canPrint(IPrintContext) . |
boolean |
canPrint(IPrintContext context)
Checks if this feature can execute.
|
void |
execute(IContext context)
Executes this print feature by sequentially calling
prePrint(IPrintContext) , IPrintFeature.print(IPrintContext) and
postPrint(IPrintContext) . |
java.lang.String |
getName()
Returns the name of the print feature, by default "Print"
|
boolean |
hasDoneChanges()
Hook method that reports if changes have been done while executing this
feature.
|
void |
postPrint(IPrintContext context)
Hook method for executing stuff that needs to be done after actually
printing a diagram.
|
void |
prePrint(IPrintContext context)
Hook method for executing stuff that needs to be done before actually
printing a diagram.
|
canUndo, getDescription, getFeatureProvider, isAvailable, manageFont, manageFont, setProgressCallback, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
print
canUndo, isAvailable
getDescription
getFeatureProvider
public AbstractPrintFeature(IFeatureProvider fp)
fp
- The feature provider that created the featurepublic java.lang.String getName()
getName
in interface IName
getName
in class AbstractFeature
public final boolean canExecute(IContext context)
canPrint(IPrintContext)
.canExecute
in interface IFeature
context
- Context information for printing.true
in case this print feature can be executed,
false
otherwise.IContext
public boolean canPrint(IPrintContext context)
true
. Note that the Graphiti framework already
checks the availability of printer in the print action that triggers this
feature.canPrint
in interface IPrintFeature
context
- Context information for printing.true
in case this print feature can be executed,
false
otherwise.public void prePrint(IPrintContext context)
prePrint
in interface IPrintFeature
context
- Context information for printing.public final void execute(IContext context)
prePrint(IPrintContext)
, IPrintFeature.print(IPrintContext)
and
postPrint(IPrintContext)
. This method will fail in case the
passed context is no IPrintContext
.public void postPrint(IPrintContext context)
postPrint
in interface IPrintFeature
context
- Context information for printing.public boolean hasDoneChanges()
false
is returned the feature will not
appear in the undo stack. The default implementation simply returns
false
.hasDoneChanges
in interface IFeature
hasDoneChanges
in class AbstractFeature
true
in case changes have been made,
false
otherwise.