this.controller.getDataStateDistributor().addChangeListener(new IChangeableObjectListener() { this.controller.getMessageDistributor().addChangeListener(new IChangeableObjectListener() {
public ConfigurableAction(final IActionConfiguration configuration) { super(configuration.getCustomization()); final IBooleanDistributor enabledDistributor = configuration.getEnabledDistributor().and(this.internalEnabledModel); enabledDistributor.addChangeListener(() -> ConfigurableAction.super.setEnabled(enabledDistributor.get())); super.setEnabled(enabledDistributor.get()); this.closure = configuration.getProcedure(); final IObjectDistributor<IGuiIcon> iconDistributor = configuration.getIconDistributor(); iconDistributor.addChangeListener( () -> GuiUtilities.invokeLater( () -> putValue( Action.SMALL_ICON, Optional.of(iconDistributor.get()).convert(i -> i.getSmallIcon()).get()))); final IObjectDistributor<String> toolTipTextDistributor = configuration.getToolTipTextDistributor(); toolTipTextDistributor.addChangeListener( () -> GuiUtilities.invokeLater(() -> putValue(Action.SHORT_DESCRIPTION, toolTipTextDistributor.get()))); }
public IObjectField<O> build() { final IObjectFieldConfiguration<O> configuration = this.builder.build(); final AbstractObjectTextField<O> field = create(configuration); final Color validColor = configuration.getBackgroundColor() == null ? this.VALID_COLOR : configuration.getBackgroundColor(); final IObjectDistributor<IValidationResult> validationResultDistributor = field.getValidationResultDistributor(); validationResultDistributor.addChangeListener(new IChangeableObjectListener() { @Override public void objectChanged() { GuiUtilities.invokeLater(new Runnable() { @Override public void run() { final IValidationResult validationResult = validationResultDistributor.get(); field.getColorReciever().setBackground( validationResult.isValid() ? validColor : AbstractObjectFieldBuilder.this.INVALID_COLOR); } }); } }); final IValidationResult validationResult = validationResultDistributor.get(); if (validationResult != null) { field.getColorReciever().setBackground(validationResult.isValid() ? this.VALID_COLOR : this.INVALID_COLOR); } return field; }
hourField.getValidationResultDistributor().addChangeListener(validatorsListener); minuteField.getValidationResultDistributor().addChangeListener(validatorsListener); dateModel.addChangeListener(validatorsListener);
this.validStateModel = this.chooserPanel.getValidStateModel(); this.valueModel.addChangeListener(this.valueChangeListener); this.validStateModel.addChangeListener(this.validateStateListener); contentComponent.removeAll(); contentComponent.add(this.chooserPanel.getComponent());
private void updateWizardState(final IWizardPage page) { synchronized (this.mutex) { if (this.currentPage != null) { this.currentPage.getNextEnabledModel().removeChangeListener(this.nextEnableListener); this.currentPage.getBackEnabledModel().removeChangeListener(this.backEnableListener); this.currentPage.getDataStateModel().removeChangeListener(this.dataStateListener); this.currentPage.getMessageDistributor().removeChangeListener(this.messageListener); } this.currentPage = page; this.nextEnabledModel.set(this.currentPage.getNextEnabledModel().get() && hasNext()); this.backEnabledModel.set(this.currentPage.getBackEnabledModel().get() && hasPrevious()); this.dataStateModel.set(this.currentPage.getDataStateModel().get()); this.currentPage.getNextEnabledModel().addChangeListener(this.nextEnableListener); this.currentPage.getBackEnabledModel().addChangeListener(this.backEnableListener); this.currentPage.getDataStateModel().addChangeListener(this.dataStateListener); this.currentPage.getMessageDistributor().addChangeListener(this.messageListener); } this.wizardStateModel.set(new WizardState()); }
this.validStateModel = this.chooserPanel.getValidStateModel(); this.valueModel.addChangeListener(this.valueChangeListener); this.validStateModel.addChangeListener(this.validateStateListener);