/** Called when explorer manager is about to change the current selection. * The view can forbid the change if it is not able to display such * selection. * * @param nodes the nodes to select * @return false if the view is not able to change the selection */ protected boolean selectionAccept (Node[] nodes) { // if the selection is just the root context, confirm the selection if (nodes.length == 1 && manager.getRootContext().equals(nodes[0])) { // XXX shouldn't this be exploredContext? return true; } // we do not allow selection in other than the exploredContext for (int i = 0; i < nodes.length; i++) { VisualizerNode v = VisualizerNode.getVisualizer (null, nodes[i]); if (model.getIndex (v) == -1) { return false; } } return true; }
/** Called when explorer manager is about to change the current selection. * The view can forbid the change if it is not able to display such * selection. * * @param nodes the nodes to select * @return false if the view is not able to change the selection */ protected boolean selectionAccept(Node[] nodes) { // if the selection is just the root context, confirm the selection if ((nodes.length == 1) && manager.getRootContext().equals(nodes[0])) { // XXX shouldn't this be exploredContext? return true; } // we do not allow selection in other than the exploredContext for (int i = 0; i < nodes.length; i++) { VisualizerNode v = VisualizerNode.getVisualizer(null, nodes[i]); if (model.getIndex(v) == -1) { return false; } } return true; }
/** Called when explorer manager is about to change the current selection. * The view can forbid the change if it is not able to display such * selection. * * @param nodes the nodes to select * @return false if the view is not able to change the selection */ protected boolean selectionAccept (Node[] nodes) { // if the selection is just the root context, confirm the selection if (nodes.length == 1 && manager.getRootContext().equals(nodes[0])) { // XXX shouldn't this be exploredContext? return true; } // we do not allow selection in other than the exploredContext for (int i = 0; i < nodes.length; i++) { VisualizerNode v = VisualizerNode.getVisualizer (null, nodes[i]); if (model.getIndex (v) == -1) { return false; } } return true; }
final void removed(VisualizerEvent.Removed ev) { VisualizerNode v = ev.getVisualizer(); int[] indices = ev.getArray(); //fire that model has been changed only when event source's (visualizer) //children are shown in the list if ((cachedDepth(v) <= 0) || (indices.length == 0)) { return; } clearChildrenCount(); int seg = (parent == v) ? 0 : getIndex(v); fireIntervalRemoved(this, indices[0] + seg, indices[indices.length - 1] + seg); }
final void removed (VisualizerEvent.Removed ev) { VisualizerNode v = ev.getVisualizer(); int[] indices = ev.getArray (); //fire that model has been changed only when event source's (visualizer) //children are shown in the list if (cachedDepth(v) <= 0 || indices.length == 0) return; clearChildrenCount(); int seg = (parent == v) ? 0 : getIndex(v); fireIntervalRemoved (this, indices[0] + seg, indices[indices.length - 1] + seg); }
final void removed (VisualizerEvent.Removed ev) { VisualizerNode v = ev.getVisualizer(); int[] indices = ev.getArray (); //fire that model has been changed only when event source's (visualizer) //children are shown in the list if (cachedDepth(v) <= 0 || indices.length == 0) return; clearChildrenCount(); int seg = (parent == v) ? 0 : getIndex(v); fireIntervalRemoved (this, indices[0] + seg, indices[indices.length - 1] + seg); }
final void added(VisualizerEvent.Added ev) { VisualizerNode v = ev.getVisualizer(); int[] indices = ev.getArray(); //fire that model has been changed only when event source's (visualizer) //children are shown in the list if ((cachedDepth(v) <= 0) || (indices.length == 0)) { return; } clearChildrenCount(); size = getSize(); int seg = (parent == v) ? 0 : getIndex(v); fireIntervalAdded(this, indices[0] + seg, indices[indices.length - 1] + seg); }
final void added (VisualizerEvent.Added ev) { VisualizerNode v = ev.getVisualizer(); int[] indices = ev.getArray (); //fire that model has been changed only when event source's (visualizer) //children are shown in the list if (cachedDepth(v) <= 0 || indices.length == 0) return; clearChildrenCount(); size = getSize (); int seg = (parent == v) ? 0 : getIndex(v); fireIntervalAdded (this, indices[0] + seg, indices[indices.length - 1] + seg); }
final void added (VisualizerEvent.Added ev) { VisualizerNode v = ev.getVisualizer(); int[] indices = ev.getArray (); //fire that model has been changed only when event source's (visualizer) //children are shown in the list if (cachedDepth(v) <= 0 || indices.length == 0) return; clearChildrenCount(); size = getSize (); int seg = (parent == v) ? 0 : getIndex(v); fireIntervalAdded (this, indices[0] + seg, indices[indices.length - 1] + seg); }
/** Called when selection has been changed. Make selection visible (at least partly). */ private void updateSelectionImpl() { Node[] sel = manager.getSelectedNodes(); int[] indices = new int[sel.length]; // bugfix #27094, make sure a selection is visible int firstVisible = list.getFirstVisibleIndex(); int lastVisible = list.getLastVisibleIndex(); boolean ensureVisible = indices.length > 0; for (int i = 0; i < sel.length; i++) { VisualizerNode v = VisualizerNode.getVisualizer(null, sel[i]); indices[i] = model.getIndex(v); ensureVisible = ensureVisible && ((indices[i] < firstVisible) || (indices[i] > lastVisible)); } // going to change list because of E.M.'s order -- temp disable the // listener if (listenerActive) { list.getSelectionModel().removeListSelectionListener(managerListener); } try { showSelection(indices); if (ensureVisible) { list.ensureIndexIsVisible(indices[0]); } } finally { if (listenerActive) { list.getSelectionModel().addListSelectionListener(managerListener); } } }
/** Called when selection has been changed. Make selection visible (at least partly). */ private void updateSelection() { Node[] sel = manager.getSelectedNodes (); int[] indices = new int[sel.length]; // bugfix #27094, make sure a selection is visible int firstVisible = list.getFirstVisibleIndex (); int lastVisible = list.getLastVisibleIndex (); boolean ensureVisible = indices.length > 0; for (int i = 0; i < sel.length; i++) { VisualizerNode v = VisualizerNode.getVisualizer (null, sel[i]); indices[i] = model.getIndex (v); ensureVisible = ensureVisible && (indices[i] < firstVisible || indices[i] > lastVisible); } // going to change list because of E.M.'s order -- temp disable the // listener if (listenerActive) list.getSelectionModel ().removeListSelectionListener(managerListener); try { showSelection (indices); if (ensureVisible) { list.ensureIndexIsVisible (indices[0]); } } finally { if (listenerActive) list.getSelectionModel ().addListSelectionListener(managerListener); } }
/** Called when selection has been changed. Make selection visible (at least partly). */ private void updateSelection() { Node[] sel = manager.getSelectedNodes (); int[] indices = new int[sel.length]; // bugfix #27094, make sure a selection is visible int firstVisible = list.getFirstVisibleIndex (); int lastVisible = list.getLastVisibleIndex (); boolean ensureVisible = indices.length > 0; for (int i = 0; i < sel.length; i++) { VisualizerNode v = VisualizerNode.getVisualizer (null, sel[i]); indices[i] = model.getIndex (v); ensureVisible = ensureVisible && (indices[i] < firstVisible || indices[i] > lastVisible); } // going to change list because of E.M.'s order -- temp disable the // listener if (listenerActive) list.getSelectionModel ().removeListSelectionListener(managerListener); try { showSelection (indices); if (ensureVisible) { list.ensureIndexIsVisible (indices[0]); } } finally { if (listenerActive) list.getSelectionModel ().addListSelectionListener(managerListener); } }