Interface IBarcodescanner
-
- All Superinterfaces:
IAnyGroup<IBarcodescanner>,IComponent<IBarcodescanner>,IHtmlBasedComponent<IBarcodescanner>,IXulElement<IBarcodescanner>
public interface IBarcodescanner extends IXulElement<IBarcodescanner>, IAnyGroup<IBarcodescanner>
ImmutableBarcodescannercomponentOnly works for Chrome, Firefox and Edge. iOS Safari is supported since 11. (iOS WebView browsers like Chrome are not supported yet)
Support @Action
Name Action Type onDetect ActionData: DetectData
Notifies if the barcode scanner detect a barcode message.- Author:
- katherine
- See Also:
Barcodescanner
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIBarcodescanner.BuilderBuilds instances of typeIBarcodescanner.static classIBarcodescanner.UpdaterBuilds an updater of typeIBarcodescannerforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Field Summary
Fields Modifier and Type Field Description static IBarcodescannerDEFAULTConstant for default attributes of this immutable component.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetConsistencyBufferSize()Returns the consistency buffer size (used in 1D barcode).default intgetConsistencyThreshold()Returns the consistency threshold (used in 1D barcode).java.util.Map<java.lang.String,java.lang.Object>getConstraints()Returns the constraints.default doublegetErrorAcceptance()Returns the error acceptance (used in 1D barcode).default doublegetInterval()Returns the scan interval of the barcode scanner.default java.lang.StringgetType()Returns the types which the barcode scanner is dealing with.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisContinuous()Returns the continuous scan status of the barcode scanner.default booleanisEnable()Returns the enabled status of the barcode scanner.static IBarcodescannerofId(java.lang.String id)Returns the instance with the given id.static IBarcodescannerofInterval(int interval)Returns the instance with the given intervalstatic IBarcodescannerofType(java.lang.String type)Returns the instance with the given typeIBarcodescannerwithConsistencyBufferSize(int consistencyBufferSize)Returns a copy ofthisimmutable component with the specifiedconsistencyBufferSize.IBarcodescannerwithConsistencyThreshold(int consistencyThreshold)Returns a copy ofthisimmutable component with the specifiedconsistencyThreshold.IBarcodescannerwithConstraints(java.util.Map<java.lang.String,? extends java.lang.Object> constraints)Returns a copy ofthisimmutable component with the specifiedconstraints.IBarcodescannerwithContinuous(boolean continuous)Returns a copy ofthisimmutable component with the specifiedcontinuous.IBarcodescannerwithEnable(boolean enable)Returns a copy ofthisimmutable component with the specifiedenable.IBarcodescannerwithErrorAcceptance(double errorAcceptance)Returns a copy ofthisimmutable component with the specifiederrorAcceptance.IBarcodescannerwithInterval(double interval)Returns a copy ofthisimmutable component with the specifiedinterval.IBarcodescannerwithType(java.lang.String type)Returns a copy ofthisimmutable component with the specifiedtype.-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final IBarcodescanner DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zkmax.barscanner.Barcodescanner"- Specified by:
getWidgetClassin interfaceIComponent<IBarcodescanner>
-
getConstraints
@Nullable java.util.Map<java.lang.String,java.lang.Object> getConstraints()
Returns the constraints. About allowed constraints setting, see MediaStreamConstraintsDefault:
null.
-
withConstraints
IBarcodescanner withConstraints(@Nullable java.util.Map<java.lang.String,? extends java.lang.Object> constraints)
Returns a copy ofthisimmutable component with the specifiedconstraints.Sets the constraints. About allowed constraints setting, see MediaStreamConstraints
- Parameters:
constraints- The constraints setting.Default:
null.- Returns:
- A modified copy of the
thisobject
-
getType
default java.lang.String getType()
Returns the types which the barcode scanner is dealing with.Default:
"CODE128".
-
withType
IBarcodescanner withType(java.lang.String type)
Returns a copy ofthisimmutable component with the specifiedtype.Sets the encoded and decoded type of this component. The built-in types are
- CODE family: CODE39, CODE128, CODE128A, CODE128B, CODE128C
- EAN family: EAN13, EAN8, EAN5, EAN2
- ITF family: ITF14, ITF
- MSI family: MSI, MSI10, MSI11, MSI1010, MSI1110
- others: UPC, PHARMACODE , CODABAR, QR
- Parameters:
type- The encoded and decoded type of this component.Default:
"CODE128".- Returns:
- A modified copy of the
thisobject
-
getInterval
default double getInterval()
Returns the scan interval of the barcode scanner.Default:
1000. Unit: millisecond.
-
withInterval
IBarcodescanner withInterval(double interval)
Returns a copy ofthisimmutable component with the specifiedinterval.Sets the scan interval of the barcode scanner.
- Parameters:
interval- The scan interval of the barcode scanner.Default:
1000. Unit: millisecond.- Returns:
- A modified copy of the
thisobject
-
getConsistencyBufferSize
default int getConsistencyBufferSize()
Returns the consistency buffer size (used in 1D barcode).Default:
5.
-
withConsistencyBufferSize
IBarcodescanner withConsistencyBufferSize(int consistencyBufferSize)
Returns a copy ofthisimmutable component with the specifiedconsistencyBufferSize.Sets the consistency buffer size (used in 1D barcode).
- Parameters:
consistencyBufferSize- The consistency buffer size (used in 1D barcode).Default:
5.- Returns:
- A modified copy of the
thisobject
-
getConsistencyThreshold
default int getConsistencyThreshold()
Returns the consistency threshold (used in 1D barcode). In other way, the result is required to be scanned at least N times out of consistency buffer size.Default:
3.
-
withConsistencyThreshold
IBarcodescanner withConsistencyThreshold(int consistencyThreshold)
Returns a copy ofthisimmutable component with the specifiedconsistencyThreshold.Sets the consistency threshold (used in 1D barcode).
- Parameters:
consistencyThreshold- The consistency threshold (used in 1D barcode).Default:
3.- Returns:
- A modified copy of the
thisobject
-
getErrorAcceptance
default double getErrorAcceptance()
Returns the error acceptance (used in 1D barcode).Default:
0.1(means 10%)
-
withErrorAcceptance
IBarcodescanner withErrorAcceptance(double errorAcceptance)
Returns a copy ofthisimmutable component with the specifiederrorAcceptance.Sets the error acceptance (used in 1D barcode).
- Parameters:
errorAcceptance- The error acceptance (used in 1D barcode).Default:
0.1(means 10%).- Returns:
- A modified copy of the
thisobject
-
isContinuous
default boolean isContinuous()
Returns the continuous scan status of the barcode scanner.Default:
false.- Returns:
- boolean
-
withContinuous
IBarcodescanner withContinuous(boolean continuous)
Returns a copy ofthisimmutable component with the specifiedcontinuous.Sets the continuous scan status of the barcode scanner.
- Parameters:
continuous- The continuous scan status of the barcode scanner.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isEnable
default boolean isEnable()
Returns the enabled status of the barcode scanner.Default:
true.
-
withEnable
IBarcodescanner withEnable(boolean enable)
Returns a copy ofthisimmutable component with the specifiedenable.Sets the enabled status of the barcode scanner.
- Parameters:
enable- The enabled status of the barcode scanner.Default:
true.- Returns:
- A modified copy of the
thisobject
-
ofType
static IBarcodescanner ofType(java.lang.String type)
Returns the instance with the given type- Parameters:
type- The encoded or decoded type of the component.
-
ofInterval
static IBarcodescanner ofInterval(int interval)
Returns the instance with the given intervalBy calling this,
isContinuous()to be true.- Parameters:
interval- The scan interval of the barcode scanner.
-
ofId
static IBarcodescanner ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-