Package com.pnfsoftware.jeb.core.units
Class AbstractInteractiveUnit
java.lang.Object
com.pnfsoftware.jeb.core.events.JebEventSource
com.pnfsoftware.jeb.core.units.AbstractUnit
com.pnfsoftware.jeb.core.units.AbstractInteractiveUnit
- All Implemented Interfaces:
IUnitCreator,IUserDataSupport,IAddressableUnit,IInteractiveUnit,IUnit,IEventSource
Skeleton of an interactive unit. Usage of this abstract class is encouraged. This unit provides a
default metadata manager.
Implementors must implement their own constructor; the default constructor is used for deserialization only. Example of a typical interactive unit constructor:
public DerivedClass(String name, IUnitProcessor unitProcessor, IUnitCreator parent,
IPropertyDefinitionManager pdm) {
super(..., name, unitProcessor, parent, pdm);
...
}
-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.core.events.JebEventSource
onEventCallCount -
Constructor Summary
ConstructorsConstructorDescriptionAbstractInteractiveUnit(String formatType, String name, IUnit parent) AbstractInteractiveUnit(String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanExecuteAction(ActionContext actionContext) The skeleton implementation returns false.booleanexecuteAction(ActionContext actionContext, IActionData actionData) The skeleton implementation returnsexecuteAction(actionContext, actionData, true).booleanexecuteAction(ActionContext actionContext, IActionData actionData, boolean notify) The skeleton implementation returns false.getAddressActions(String address) The skeleton implementation returns an empty list.getAddressOfItem(long id) The skeleton implementation returns null.The skeleton implementation returns an empty list.getItemActions(long id) The skeleton implementation returns an empty list.longgetItemAtAddress(String address) The skeleton implementation returns 0.getItemObject(long id) The skeleton implementation returns null.The skeleton implementation returns an empty metadata manager.getRelatedItems(long id) The skeleton implementation returns an empty list.booleanisValidAddress(String address) The default implementation returns true IFF the address can be converted to a valid (non-zero) item id.booleanprepareExecution(ActionContext actionContext, IActionData actionData) The skeleton implementation returns false.Methods inherited from class com.pnfsoftware.jeb.core.units.AbstractUnit
addChild, addChild, addChild, addNotification, canBePersisted, clearAllData, dispose, finalize, generateQuickState, getAllData, getChildren, getContributions, getCreationTimestamp, getData, getDescription, getFormatter, getFormatType, getIconData, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, hasChildren, initializePropertyObjects, internalSwapChildren, isDeserialized, isDisposed, isProcessed, isStale, isTransientChild, logError, logException, logInfo, logTrace, logWarn, onPropertyChange, postDeserialization, process, processInternal, removeChild, removeChild, setChild, setChild, setData, setName, setNotes, setParent, setProcessed, setProcessed, setRealName, setStatus, setStatus, setUnitProcessor, toStringMethods inherited from class com.pnfsoftware.jeb.core.events.JebEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, removeListener, setParentSourceMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.core.units.IAddressableUnit
getAddressLabel, getAddressLabels, getCanonicalAddress, getWellKnownAddressesMethods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSourceMethods inherited from interface com.pnfsoftware.jeb.core.units.IInteractiveUnit
addressToLocation, getCommentManager, getFullComment, getFullComments, getInlineComment, getInlineComments, locationToAddress, setInlineCommentMethods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, execprvfunc, generateQuickState, getChildren, getContributions, getCreationTimestamp, getDescription, getExtraInputs, getFormatter, getFormatType, getIconData, getInput, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getParentArtifact, getParentProject, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, initializePropertyObjects, isDisposed, isProcessed, isStale, isTransientChild, notifyGenericChange, postDeserialization, process, removeChild, setName, setNotes, setParent, setRealName, setUnitProcessorMethods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Constructor Details
-
AbstractInteractiveUnit
-
AbstractInteractiveUnit
public AbstractInteractiveUnit(String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
-
-
Method Details
-
getItemObject
The skeleton implementation returns null.- Specified by:
getItemObjectin interfaceIAddressableUnit- Parameters:
id- the item id- Returns:
- an object, whose type is defined by contract, potentially null
-
getGlobalActions
The skeleton implementation returns an empty list.- Specified by:
getGlobalActionsin interfaceIInteractiveUnit- Returns:
- the list of actions
-
getItemActions
The skeleton implementation returns an empty list.- Specified by:
getItemActionsin interfaceIInteractiveUnit- Parameters:
id- the target item identifier- Returns:
- the list of actions
-
isValidAddress
The default implementation returns true IFF the address can be converted to a valid (non-zero) item id.- Specified by:
isValidAddressin interfaceIAddressableUnit- Returns:
-
getAddressActions
The skeleton implementation returns an empty list.- Specified by:
getAddressActionsin interfaceIInteractiveUnit- Parameters:
address- the target address- Returns:
- the list of actions
- See Also:
-
getAddressOfItem
The skeleton implementation returns null.- Specified by:
getAddressOfItemin interfaceIAddressableUnit- Parameters:
id- the item id- Returns:
- an address best representing or matching the provided item, null otherwise
-
getRelatedItems
The skeleton implementation returns an empty list.- Specified by:
getRelatedItemsin interfaceIAddressableUnit- Parameters:
id- an item id- Returns:
- a list of related items (not containing the provided id), may be empty - never null
-
getItemAtAddress
The skeleton implementation returns 0.- Specified by:
getItemAtAddressin interfaceIAddressableUnit- Parameters:
address- the address- Returns:
- an item best representing or matching the provided address, 0 otherwise
-
canExecuteAction
The skeleton implementation returns false.- Specified by:
canExecuteActionin interfaceIInteractiveUnit- Parameters:
actionContext- location context for the action- Returns:
- true
-
prepareExecution
The skeleton implementation returns false.- Specified by:
prepareExecutionin interfaceIInteractiveUnit- Parameters:
actionContext- location context for the actionactionData- data for the action- Returns:
- true if the preparation was successful, and the action may be executed. Upon successful preparation, actionData will contain plugin-set pre-execution data
-
executeAction
The skeleton implementation returnsexecuteAction(actionContext, actionData, true).- Specified by:
executeActionin interfaceIInteractiveUnit- Parameters:
actionContext- location context for the actionactionData- data for the action- Returns:
- true if the execution was successful. Upon successful execution, actionData will contain plugin-set post-execution data
-
executeAction
The skeleton implementation returns false.- Specified by:
executeActionin interfaceIInteractiveUnit- Parameters:
actionContext- context for the actionactionData- data for the actionnotify- true to notify clients if the action was successfully executed and the unit contents has changed- Returns:
- action success indicator
-
getMetadataManager
The skeleton implementation returns an empty metadata manager.- Specified by:
getMetadataManagerin interfaceIInteractiveUnit- Returns:
- the manager, null if none
-