Package com.pnfsoftware.jeb.client.api
Interface IUnitFragment
- All Known Subinterfaces:
IUnitTextFragment
public interface IUnitFragment
A fragment representing parts of a
unit
. Fragments can be used to present documents
generated by the unit, or display regions or various representations of a unit.-
Method Summary
Modifier and TypeMethodDescriptionRetrieve the active address in the fragment, if any.getActiveAddress
(AddressConversionPrecision precision) Retrieve the active address in the fragment, with desired precision.Retrieve the currently active item in the fragment (eg, the caret is on an interactive text item), if any.Retrieve the text representing the currently active item.getUnit()
Get the unit visualized by this fragment.boolean
isActiveItem
(IItem item) Determine if the provided item is currently active in the fragment.boolean
setActiveAddress
(String address) Set the active address within this fragment to the provided address.
-
Method Details
-
getUnit
IUnit getUnit()Get the unit visualized by this fragment.- Returns:
- the unit, never null
-
isActiveItem
Determine if the provided item is currently active in the fragment.- Parameters:
item
-- Returns:
-
getActiveItem
IItem getActiveItem()Retrieve the currently active item in the fragment (eg, the caret is on an interactive text item), if any.- Returns:
- an item or null
-
getActiveItemAsText
String getActiveItemAsText()Retrieve the text representing the currently active item.- Returns:
- a string, or null if there is no active item or the item has no textual representation
-
getActiveAddress
String getActiveAddress()Retrieve the active address in the fragment, if any.- Returns:
-
getActiveAddress
Retrieve the active address in the fragment, with desired precision. Be careful that if precision is not managed, this method will return null. CallgetActiveAddress()
for safe result.- Parameters:
precision
- expected precision of the Active Address.- Returns:
-
setActiveAddress
Set the active address within this fragment to the provided address.- Parameters:
address
- the address- Returns:
- success indicator
-