protected void onElementInitialized() { hookEvents(); if (owner != null) { InitializeEvent.fire(owner); } } }
@Override public void update() { // Trigger InitializeEvent to update corresponding button widget InitializeEvent.fire(this); }
protected void onElementInitialized() { hookEvents(); if (owner != null) { InitializeEvent.fire(owner); } } }
protected void onElementInitialized() { hookEvents(); if (owner != null) { InitializeEvent.fire(owner); } } }
protected void attachActivationListenersForModel() { getDetailModel().getPropertyChangedEvent().addListener((ev, sender, args) -> { if ("IsDiskHotPlugAvailable".equals(args.propertyName)) { //$NON-NLS-1$ InitializeEvent.fire(plugButtonDefinition); InitializeEvent.fire(unPlugButtonDefinition); } }); getDetailModel().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { InitializeEvent.fire(plugButtonDefinition); InitializeEvent.fire(unPlugButtonDefinition); }); } }
void addPropertyChangeEventHandler() { propertyChangeListener = (ev, sender, args) -> InitializeEvent.fire(UiCommandButtonDefinition.this); command.getPropertyChangedEvent().addListener(propertyChangeListener); }
/** * Assigns the given command to this button definition. * <p> * Triggers {@link InitializeEvent} when the provided command or its property changes. * <p> * If the given {@code command} is {@code null}, an empty command will be used. */ protected void setCommand(UICommand command) { UICommand newCommand = command != null ? command : EMPTY_COMMAND; if (this.command != newCommand) { // Remove property change handler from current command removePropertyChangeEventHandler(); // Update current command this.command = newCommand; InitializeEvent.fire(UiCommandButtonDefinition.this); // Add property change handler to new command if (newCommand != EMPTY_COMMAND) { addPropertyChangeEventHandler(); } } }