/** * {@inheritDoc} */ @Override public void addSelectionChangeListener(ISelectionChangeListener listener) { if (selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.addSelectionChangeListener(listener); }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int... newSelectedIndices) { if(selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.setSelectedIndices(newSelectedIndices); }
/** * {@inheritDoc} */ @Override public void addSelectionChangeListener(ISelectionChangeListener listener) { if (selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.addSelectionChangeListener(listener); }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int[] newSelectedIndices, int leadingIndex) { if(selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.setSelectedIndices(newSelectedIndices, leadingIndex); }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int[] selectedIndices, int leadingIndex) { int[] newSelectedIndices = selectedIndices; if (newSelectedIndices != null && newSelectedIndices.length == 0) { newSelectedIndices = null; } int[] oldSelectedIndices = getSelectedIndices(); if (oldSelectedIndices != null && oldSelectedIndices.length == 0) { oldSelectedIndices = null; } if (selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } selectionChangeSupport.setSelectedIndices(newSelectedIndices, leadingIndex); if ((oldSelectedIndices == null && newSelectedIndices != null) || (oldSelectedIndices != null && newSelectedIndices == null) || (oldSelectedIndices != null && !Arrays.equals(oldSelectedIndices, newSelectedIndices))) { if (newSelectedIndices == null) { implFireSelectedConnectorChange(null); } else { implFireSelectedConnectorChange(getChildConnector(leadingIndex)); } } }
/** * {@inheritDoc} */ @Override public void selectionChange(SelectionChangeEvent evt) { boolean sourceIsScl = evt.getSource() instanceof ISelectionChangeListener; if (sourceIsScl && selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } if (sourceIsScl) { selectionChangeSupport.addInhibitedListener((ISelectionChangeListener) evt.getSource()); } try { setSelectedIndices(evt.getNewSelection(), evt.getLeadingIndex()); } finally { if (sourceIsScl) { selectionChangeSupport.removeInhibitedListener((ISelectionChangeListener) evt.getSource()); } } }
/** * {@inheritDoc} */ @Override public void selectionChange(SelectionChangeEvent evt) { boolean isSourceScl = evt.getSource() instanceof ISelectionChangeListener; if (isSourceScl && selectionChangeSupport == null) { selectionChangeSupport = new SelectionChangeSupport(this); } if (isSourceScl) { selectionChangeSupport .addInhibitedListener((ISelectionChangeListener) evt.getSource()); } try { setSelectedIndices(evt.getNewSelection(), evt.getLeadingIndex()); } finally { if (isSourceScl) { selectionChangeSupport .removeInhibitedListener((ISelectionChangeListener) evt.getSource()); } } }