/** * Fires a new <code>SelectionChangeEvent</code> built with * <code>source</code> as source and parameters as old and new values. */ public void fireSelectionChange() { SelectionChangeEvent evt = new SelectionChangeEvent(source, oldSelectedIndices, selectedIndices, leadingIndex); fireSelectionChange(evt); }
@Override public void selectedItemChange(ItemSelectionEvent event) { navigatorSelectionChanged(workspaceName, (ICompositeValueConnector) event.getSelectedItem()); } });
/** * Fires a value change, delegating to the value change support. * * @param changeEvent * the change event to propagate. */ protected void fireValueChange(ValueChangeEvent changeEvent) { if (valueChangeSupport != null) { valueChangeSupport.fireValueChange(changeEvent); } }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int... newSelectedIndices) { if(selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.setSelectedIndices(newSelectedIndices); }
/** * {@inheritDoc} */ @Override public void valueChange(ValueChangeEvent evt) { gate.setModel(evt.getNewValue()); }
/** * {@inheritDoc} */ @Override public void addSelectionChangeListener(ISelectionChangeListener listener) { if (selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.addSelectionChangeListener(listener); }
/** * {@inheritDoc} */ public void setSelectedIndices(int[] selectedIndices) { int leadingInd = -1; if (selectedIndices != null && selectedIndices.length > 0) { leadingInd = selectedIndices[selectedIndices.length - 1]; } setSelectedIndices(selectedIndices, leadingInd); }
/** * {@inheritDoc} */ @Override public void addValueChangeListener(IValueChangeListener listener) { if (listener != null) { if (valueChangeSupport == null) { valueChangeSupport = new ValueChangeSupport(this); } valueChangeSupport.addValueChangeListener(listener); } }
/** * Utility implementation to factorize method support. This should only be * used by subclasses which implement {@code IConnectorSelector}. * * @param listener * the listener to add. */ protected void implAddConnectorSelectionListener( IItemSelectionListener listener) { if (itemSelectionSupport == null) { itemSelectionSupport = new ItemSelectionSupport(); } itemSelectionSupport.addItemSelectionListener(listener); }
/** * {@inheritDoc} */ @Override public int[] getSelectedIndices() { if (selectionChangeSupport == null) { return new int[0]; } return selectionChangeSupport.getSelectedIndices(); }
/** * {@inheritDoc} */ @Override public void removeSelectionChangeListener(ISelectionChangeListener listener) { if (selectionChangeSupport != null) { selectionChangeSupport.removeSelectionChangeListener(listener); } }
/** * Gives a chance to the connector to create a specific subclass of connector * value change event. * * @param oldValue * the old connector value. * @param newValue * the new connector value. * @return the created change event. */ protected ValueChangeEvent createChangeEvent(Object oldValue, Object newValue) { return new ValueChangeEvent(this, oldValue, newValue); }
/** * Utility implementation to factorize method support. This should only be * used by subclasses which implement {@code IConnectorSelector}. * * @param listener * the listener to remove. */ protected void implRemoveConnectorSelectionListener( IItemSelectionListener listener) { if (itemSelectionSupport != null) { itemSelectionSupport.removeConnectorSelectionListener(listener); } }
/** * {@inheritDoc} */ @Override public void removeValueChangeListener(IValueChangeListener listener) { if (valueChangeSupport != null && listener != null) { valueChangeSupport.removeValueChangeListener(listener); } }
/** * {@inheritDoc} */ public void setSelectedIndices(int[] selectedInds, int leadingInd) { this.oldSelectedIndices = this.selectedIndices; this.selectedIndices = selectedInds; this.leadingIndex = leadingInd; fireSelectionChange(); } }
/** * {@inheritDoc} */ @Override public Set<IValueChangeListener> getValueChangeListeners() { if (valueChangeSupport == null) { return Collections.emptySet(); } return valueChangeSupport.getValueChangeListeners(); }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int[] newSelectedIndices, int leadingIndex) { if(selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.setSelectedIndices(newSelectedIndices, leadingIndex); }
/** * {@inheritDoc} */ @Override public void addSelectionChangeListener(ISelectionChangeListener listener) { if (selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.addSelectionChangeListener(listener); }
/** * {@inheritDoc} */ @Override public int[] getSelectedIndices() { if (selectionChangeSupport == null) { return new int[0]; } return selectionChangeSupport.getSelectedIndices(); }
/** * {@inheritDoc} */ @Override public void removeSelectionChangeListener(ISelectionChangeListener listener) { selectionChangeSupport.removeSelectionChangeListener(listener); }