Java 类javax.swing.event.ListDataListener 实例源码

项目:pdfjumbler    文件:UndoableList.java   
private void callListenersAdd(ListEdit<T> edit, ListDataEvent dataEvent) {
    assert (!editProtection[0]);

    editProtection[0] = true;
    try {
        if (edit != null) {
            addEdit(edit);
        }

        if (dataEvent != null) {
            for (ListDataListener l : listDataListeners) {
                l.intervalAdded(dataEvent);
            }
        }
    }
    finally {
        editProtection[0] = false;
    }
}
项目:pdfjumbler    文件:UndoableList.java   
private void callListenersRemove(ListEdit<T> edit, ListDataEvent dataEvent) {
    assert (!editProtection[0]);

    editProtection[0] = true;
    try {
        if (edit != null) {
            addEdit(edit);
        }

        for (ListDataListener l : listDataListeners) {
            l.intervalRemoved(dataEvent);
        }
    }
    finally {
        editProtection[0] = false;
    }
}
项目:pdfjumbler    文件:UndoableList.java   
private void callListenersSet(ListEdit<T> edit, ListDataEvent dataEvent) {
    assert (!editProtection[0]);

    editProtection[0] = true;
    try {
        if (edit != null) {
            addEdit(edit);
        }

        if (dataEvent != null) {
            for (ListDataListener l : listDataListeners) {
                l.contentsChanged(dataEvent);
            }
        }
    }
    finally {
        editProtection[0] = false;
    }
}
项目:NBANDROID-V2    文件:LogDevicesComboBoxSupport.java   
private void fireListDataEvent(int type, int index1, int index2) {
    ListDataEvent event = new ListDataEvent(this, type, index1, index2);

    for (ListDataListener listener : dataListeners) {
        switch (type) {
            case ListDataEvent.CONTENTS_CHANGED: {
                listener.contentsChanged(event);
                break;
            }

            case ListDataEvent.INTERVAL_ADDED: {
                listener.intervalAdded(event);
                break;
            }

            case ListDataEvent.INTERVAL_REMOVED: {
                listener.intervalRemoved(event);
                break;
            }
        }

    }
}
项目:incubator-netbeans    文件:ApplicationLocationPanel.java   
public LocationsComboBoxModel(List<File> locations, List<String> labels) {
    this.locations = new LinkedList<String>();
    for (File file: locations) {
        this.locations.add(file.toString());
    }

    this.labels = new LinkedList<String>();
    this.labels.addAll(labels);

    this.listeners = new LinkedList<ListDataListener>();

    if (labels.size() > 0) {
        this.selectedItem = labels.get(0);
        this.selectedItemFromList = true;
    } else {
        this.selectedItem = StringUtils.EMPTY_STRING;
        this.selectedItemFromList = false;
    }
}
项目:incubator-netbeans    文件:LicenseComboBoxModel.java   
public LicenseComboBoxModel(Project suiteProject, List<String> names, List<String> types) {
    this.suiteProject = suiteProject;
    this.names = new LinkedList<String>();
    this.names.addAll(names);

    this.types = new LinkedList<String>();
    this.types.addAll(types);

    this.listeners = new LinkedList<ListDataListener>();

    if (names.size() > 0) {
        this.selectedItem = names.get(0);
        this.selectedItemFromList = true;
    } else {
        this.selectedItem = "";
        this.selectedItemFromList = false;
    }
}
项目:incubator-netbeans    文件:LicenseComboBoxModel.java   
private void fireContentsChanged(int index) {
    final ListDataListener[] clone;
    synchronized (listeners) {
        clone = listeners.toArray(new ListDataListener[listeners.size()]);
    }

    final ListDataEvent event = new ListDataEvent(
            this,
            ListDataEvent.CONTENTS_CHANGED,
            index,
            index);

    for (ListDataListener listener : clone) {
        listener.contentsChanged(event);
    }
}
项目:incubator-netbeans    文件:ServerWizardVisual.java   
@Override
public final void resultChanged(LookupEvent ev) {
    List<WizardAdapter> fresh = new ArrayList<WizardAdapter>();
    for (ServerWizardProvider wizard : result.allInstances()) {

        // safety precaution shouldn't ever happen - used because of bridging
        if (wizard.getInstantiatingIterator() != null) {
            fresh.add(new WizardAdapter(wizard));
        }
    }
    Collections.sort(fresh);

    synchronized (serverWizards) {
        serverWizards.clear();
        serverWizards.addAll(fresh);
    }

    ListDataEvent event = new ListDataEvent(this,
                ListDataEvent.CONTENTS_CHANGED, 0, fresh.size() - 1);
    for (ListDataListener l : listeners) {
        l.contentsChanged(event);
    }
}
项目:incubator-netbeans    文件:FilteredListModel.java   
private void fireChange (ListDataEvent ev) {
    if (list.getListenerCount () == 0) {
        return ;
    }
    Object[] arr = list.getListenerList ();
    for (int i = arr.length - 1; i >= 0; i -= 2) {
        ListDataListener l = (ListDataListener)arr[i];
        switch (ev.getType ()) {
            case ListDataEvent.CONTENTS_CHANGED: l.contentsChanged (ev); break;
            case ListDataEvent.INTERVAL_ADDED: l.intervalAdded (ev); break;
            case ListDataEvent.INTERVAL_REMOVED: l.intervalRemoved (ev); break;
            default:
                throw new IllegalArgumentException  ("Unknown type: " + ev.getType ());
        }
    }
}
项目:JavaGraph    文件:FormulaDialog.java   
public void setDirty(String filterText) {
    if (!this.ignoreChange) {
        getChoiceBox().doConfigure(false);
        this.dirty = true;
        this.filterText = filterText;
        this.selectedItem = null;
        for (ListDataListener l : this.listeners) {
            l.contentsChanged(
                new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, getSize()));
        }
        getChoiceBox().hidePopup();
        if (getSize() > 0 && filterText.length() > 0) {
            getChoiceBox().showPopup();
        }
        getChoiceBox().doConfigure(true);
    }
}
项目:pdfjumbler    文件:UndoableList.java   
public UndoableList(List<T> list) {
    this.list = list;
    this.parent = null;
    this.offset = 0;
    this.editProtection = new boolean[]{ false };
    this.editListeners = new ArrayList<UndoableEditListener>();
    this.listDataListeners = new ArrayList<ListDataListener>();
}
项目:incubator-netbeans    文件:HistorySupport.java   
HistoryModel(
        @NonNull final HistorySupport history,
        @NonNull final String emptyMessage) {
    Parameters.notNull("history", history); //NOI18N
    listeners = new CopyOnWriteArrayList<ListDataListener>();
    this.history = history;
    this.emptyMessage = emptyMessage;
    this.history.addPropertyChangeListener(WeakListeners.propertyChange(this, history));
}
项目:incubator-netbeans    文件:HistorySupport.java   
private void fire() {
    final ListDataEvent event = new ListDataEvent(
            this,
            -1,
            -1,
            Integer.MAX_VALUE);
    for (ListDataListener l : listeners) {
        l.contentsChanged(event);
    }
}
项目:incubator-netbeans    文件:TaskModel.java   
TaskModel(Executor eventExecutor) {
    selectionModel = new DefaultListSelectionModel();
    model = new DefaultListModel();
    dataListeners = new LinkedHashSet<ListDataListener>();
    selectionListeners = new LinkedHashSet<ListSelectionListener>();
    TaskListener list = new TaskListener();
    model.addListDataListener(list);
    selectionModel.addListSelectionListener(list);
    this.eventExecutor = eventExecutor;
}
项目:incubator-netbeans    文件:TaskModel.java   
@Override
public void intervalAdded(final ListDataEvent e) {
    final ListDataListener[] lists = getDataListeners();
    eventExecutor.execute(new Runnable() {
        @Override
        public void run() {
            for (ListDataListener list : lists) {
                list.intervalAdded(e);
            }
        }
    });
}
项目:incubator-netbeans    文件:TaskModel.java   
@Override
public void contentsChanged(final ListDataEvent e) {
    final ListDataListener[] lists = getDataListeners();
    eventExecutor.execute(new Runnable() {
        @Override
        public void run() {
            for (ListDataListener list : lists) {
                list.contentsChanged(e);
            }
        }
    });
}
项目:KernelHive    文件:InputDataPanel.java   
public URLComboBoxModel(List<String> urls) {
    listeners = new ArrayList<ListDataListener>();
    items = new ArrayList<Object>();
    for (String s : urls) {
        items.add(s);
    }
    if (items.size() > 0) {
        selectedItem = items.get(0);
    }
}
项目:WordnetLoom    文件:GenericListModel.java   
/**
 * powiadomienie wszystkich słuchaczy o zmianie
 */
protected void notifyAllListeners() {
    for (ListDataListener dataListener : listeners
            .getListeners(ListDataListener.class)) {
        dataListener.contentsChanged(new ListDataEvent(this,
                ListDataEvent.CONTENTS_CHANGED, 0, 0));
    }
}
项目:pdfjumbler    文件:UndoableList.java   
public void addListDataListener(ListDataListener l) {
    listDataListeners.add(l);
}
项目:pdfjumbler    文件:UndoableList.java   
public void removeListDataListener(ListDataListener l) {
    listDataListeners.remove(l);
}
项目:NBANDROID-V2    文件:AndroidPlatformCustomizer.java   
private void fireJavadocRemoved() {
    for (ListDataListener listener : javadocListeners) {
        listener.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, aPackage.getJavadocPaths().size() - 1, aPackage.getJavadocPaths().size() - 1));
    }
}
项目:school-game    文件:StatementEditorPanel.java   
@Override
public void removeListDataListener(ListDataListener l)
{
}
项目:incubator-netbeans    文件:RuntimeComboBox.java   
@Override
public void addListDataListener(ListDataListener l) {
    listeners.add(l);
}
项目:incubator-netbeans    文件:RuntimeComboBox.java   
@Override
public void removeListDataListener(ListDataListener l) {
    listeners.remove(l);
}
项目:incubator-netbeans    文件:RuntimeComboBox.java   
private void fireDataAdded(int start, int stop) {
    if (stop <= start) return;
    for(ListDataListener l : listeners) {
        l.intervalAdded(new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, start, stop));
    }
}
项目:incubator-netbeans    文件:RuntimeComboBox.java   
private void fireDataRemoved(int start, int stop) {
    for(ListDataListener l : listeners) {
        l.intervalRemoved(new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, start, stop));
    }
}
项目:incubator-netbeans    文件:RuntimeComboBox.java   
private void fireDataChanged() {
    int stop = getSize() - 1;
    for(ListDataListener l : listeners) {
        l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, stop));
    }
}
项目:incubator-netbeans    文件:PlatformsComboBoxModel.java   
@Override
public void addListDataListener(ListDataListener l) {
    delegate.addListDataListener(l);
}
项目:incubator-netbeans    文件:PlatformsComboBoxModel.java   
@Override
public void removeListDataListener(ListDataListener l) {
    delegate.removeListDataListener(l);
}
项目:incubator-netbeans    文件:JavaPlatformComponentFactory.java   
public void addListDataListener(ListDataListener l) {
    listeners.add(l);
}
项目:NBANDROID-V2    文件:AndroidPlatformCustomizer.java   
private void fireJavadocAdded() {
    for (ListDataListener listener : javadocListeners) {
        listener.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, aPackage.getJavadocPaths().size() - 2, aPackage.getJavadocPaths().size() - 1));
    }
}
项目:incubator-netbeans    文件:JavaPlatformComponentFactory.java   
private void fireChange() {
    ListDataEvent ev = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, 0);
    for (ListDataListener l : new ArrayList<ListDataListener>(listeners)) {
        l.contentsChanged(ev);
    }
}
项目:school-game    文件:StatementEditorPanel.java   
@Override
public void addListDataListener(ListDataListener l)
{
}
项目:incubator-netbeans    文件:ApplicationLocationPanel.java   
public void addListDataListener(ListDataListener listener) {
    synchronized (listeners) {
        listeners.add(listener);
    }
}
项目:incubator-netbeans    文件:ApplicationLocationPanel.java   
public void removeListDataListener(ListDataListener listener) {
    synchronized (listeners) {
        listeners.remove(listener);
    }
}
项目:incubator-netbeans    文件:ConfigFilesUIs.java   
public void addListDataListener(ListDataListener l) {
}
项目:incubator-netbeans    文件:ConfigFilesUIs.java   
public void removeListDataListener(ListDataListener l) {
}
项目:incubator-netbeans    文件:ConfigFilesUIs.java   
public void addListDataListener(ListDataListener l) {
}
项目:incubator-netbeans    文件:ConfigFilesUIs.java   
public void removeListDataListener(ListDataListener l) {
}
项目:incubator-netbeans    文件:CreateDatabasePanel.java   
@Override
public void addListDataListener(ListDataListener listener) {
}