Class AbstractSingleLanguageComponent<SingleLanguageModel extends ISingleLanguageModel>
- java.lang.Object
-
- com._1c.g5.aef2.components.Component<M,P>
-
- com._1c.g5.aef2.standard.components.StandardComponent<M,P>
-
- com._1c.g5.aef2.standard.components.AbstractControlComponent<M,P,VM>
-
- com._1c.g5.v8.dt.ui.aef.component.AbstractDtSelectComponent<M,P,ActionBarViewModel>
-
- com._1c.g5.v8.dt.ui.aef.component.AbstractDtActionBarComponent<SingleLanguageModel,IDtActionBarParameterization>
-
- com._1c.g5.v8.dt.md.ui.aef.components.AbstractSingleLanguageComponent<SingleLanguageModel>
-
- All Implemented Interfaces:
IComponent<SingleLanguageModel>
,IEventChannel
- Direct Known Subclasses:
SingleLanguageFormattedTextComponent
public class AbstractSingleLanguageComponent<SingleLanguageModel extends ISingleLanguageModel> extends AbstractDtActionBarComponent<SingleLanguageModel,IDtActionBarParameterization>
The component that processes the given value which is a text field.
So the input model is a value associated with language code.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com._1c.g5.aef2.standard.components.StandardComponent
StandardComponent.BindingDirection
-
-
Field Summary
-
Fields inherited from class com._1c.g5.v8.dt.ui.aef.component.AbstractDtSelectComponent
CLEAR_BUTTON_COMMAND_ID, DEFAULT_CONTEXT, OPEN_BUTTON_COMMAND_ID, SELECT_BUTTON_COMMAND_ID
-
-
Constructor Summary
Constructors Constructor Description AbstractSingleLanguageComponent(IDtActionBarParameterization parameterization)
Creates a new instance of the component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attachToModel()
Attaches this component to the model.protected Collection<ButtonItemViewModel>
createButtons()
Creates a collection of theButtonItemViewModel
that will be added to the component view model.protected ActionBarViewModel
createControlViewModel()
Creates control view model instance.protected LocalStringDialog
createMultiLanguageDialog(org.eclipse.swt.widgets.Shell shell, boolean isMultiLine, IValue<String> inputData)
Creates dialog for editing strings on multiple languages.protected void
detachFromModel()
Detaches this component from the model.protected void
disposeViewModels()
Disposes the view models of this component.protected String
getCurrentCode()
Gets current language code.protected ScriptVariant
getScriptVariant()
Gets current script variant.protected String
getValueForView(String value)
Gets value for view based on given value.protected Version
getVersion()
Gets current version.protected void
handleButtonClicked(IViewModel viewModel)
Handles the button clicked event.boolean
isEnabled()
returntrue
if the component is in enabled state andfalse
otherwise.protected boolean
isOpenButtonShouldBeVisible()
Returns whether Open button should be visible.protected void
onDialogClosedByOK(LocalStringDialog dialog, IValue<String> workingCopy)
Called when dialog is closed by pressing OK button.-
Methods inherited from class com._1c.g5.v8.dt.ui.aef.component.AbstractDtSelectComponent
createButtonItem, createClearButtonItem, createOpenButtonItem, createSelectButtonItem, createViewModels, dispose
-
Methods inherited from class com._1c.g5.aef2.standard.components.AbstractControlComponent
getControlViewModel, handleExternalValidationEvent, isEditable, refresh, setLayoutData, updateViewModels
-
Methods inherited from class com._1c.g5.aef2.standard.components.StandardComponent
bindList, bindModel, bindValue, bindValue, createDefaultViewModelList, createDefaultViewModelValue, getLayoutData, isPassive, setEnabled, setFocus, updateViewModelStatus
-
Methods inherited from class com._1c.g5.aef2.components.Component
addComponent, addListener, addViewModel, areChildCommitsEnabled, areChildRefreshEnabled, areComponentsCreated, beginExternalUpdate, checkComponents, checkViewModels, commit, createComponents, disposeComponents, endExternalUpdate, getComponents, getModel, getParameterization, getParent, getRunnableQueue, getScene, getServiceEventQualifiers, getViewModels, isDisposed, isInExternalUpdate, queueAndWaitEvent, queueEvent, removeComponent, removeListener, removeViewModel, setChildCommitsEnabled, setChildRefreshEnable, setModel, setParent, setScene, subscribeOnEvents, subscribeOnEvents, unsubscribeOnEvents
-
-
-
-
Constructor Detail
-
AbstractSingleLanguageComponent
public AbstractSingleLanguageComponent(IDtActionBarParameterization parameterization)
Creates a new instance of the component.- Parameters:
parametrization
- options of the component, cannot benull
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Description copied from class:StandardComponent
returntrue
if the component is in enabled state andfalse
otherwise. Children of disabled standard components are considered disabled unconditionally, regardless of theenabled
flag.- Overrides:
isEnabled
in classStandardComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization>
-
handleButtonClicked
protected void handleButtonClicked(IViewModel viewModel)
Description copied from class:AbstractDtSelectComponent
Handles the button clicked event.- Overrides:
handleButtonClicked
in classAbstractDtSelectComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization,ActionBarViewModel>
- Parameters:
viewModel
- the view model of the event sender.
-
attachToModel
protected void attachToModel()
Description copied from class:Component
Attaches this component to the model. Override it to add some listeners to the model.- Overrides:
attachToModel
in classComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization>
-
detachFromModel
protected void detachFromModel()
Description copied from class:Component
Detaches this component from the model. Override it to remove listeners from the model.- Overrides:
detachFromModel
in classComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization>
-
createControlViewModel
protected ActionBarViewModel createControlViewModel()
Description copied from class:AbstractControlComponent
Creates control view model instance.- Overrides:
createControlViewModel
in classAbstractDtActionBarComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization>
- Returns:
- a newly created control view model.
-
disposeViewModels
protected void disposeViewModels()
Description copied from class:Component
Disposes the view models of this component. Override it to do some additional disposal operations specific to a component.- Overrides:
disposeViewModels
in classAbstractControlComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization,ActionBarViewModel>
-
createButtons
protected Collection<ButtonItemViewModel> createButtons()
Description copied from class:AbstractDtSelectComponent
Creates a collection of theButtonItemViewModel
that will be added to the component view model.- Overrides:
createButtons
in classAbstractDtSelectComponent<SingleLanguageModel extends ISingleLanguageModel,IDtActionBarParameterization,ActionBarViewModel>
- Returns:
- the collection of the
ButtonItemViewModel
.
-
getCurrentCode
protected String getCurrentCode()
Gets current language code.- Returns:
- the current language code, never
null
-
getScriptVariant
protected ScriptVariant getScriptVariant()
Gets current script variant.- Returns:
- the current script variant, never
null
-
getVersion
protected Version getVersion()
Gets current version.- Returns:
- the current version, can be
null
-
createMultiLanguageDialog
protected LocalStringDialog createMultiLanguageDialog(org.eclipse.swt.widgets.Shell shell, boolean isMultiLine, IValue<String> inputData)
Creates dialog for editing strings on multiple languages.- Parameters:
shell
- the shellisMultiLine
- are strings multilineinputData
- dialog input data, cannot benull
- Returns:
- the created dialog, never
null
-
onDialogClosedByOK
protected void onDialogClosedByOK(LocalStringDialog dialog, IValue<String> workingCopy)
Called when dialog is closed by pressing OK button.- Parameters:
dialog
- the dialog closed.workingCopy
- the working copy model.
-
isOpenButtonShouldBeVisible
protected boolean isOpenButtonShouldBeVisible()
Returns whether Open button should be visible.- Returns:
- true if Open button should be visible, false otherwise
-
-