當前位置: 首頁>>代碼示例>>Java>>正文


Java ListDataListener類代碼示例

本文整理匯總了Java中javax.swing.event.ListDataListener的典型用法代碼示例。如果您正苦於以下問題:Java ListDataListener類的具體用法?Java ListDataListener怎麽用?Java ListDataListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ListDataListener類屬於javax.swing.event包,在下文中一共展示了ListDataListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: callListenersAdd

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
	}
}
 
開發者ID:mgropp,項目名稱:pdfjumbler,代碼行數:20,代碼來源:UndoableList.java

示例2: callListenersRemove

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
	}
}
 
開發者ID:mgropp,項目名稱:pdfjumbler,代碼行數:18,代碼來源:UndoableList.java

示例3: callListenersSet

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
	}
}
 
開發者ID:mgropp,項目名稱:pdfjumbler,代碼行數:20,代碼來源:UndoableList.java

示例4: fireListDataEvent

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
            }
        }

    }
}
 
開發者ID:NBANDROIDTEAM,項目名稱:NBANDROID-V2,代碼行數:24,代碼來源:LogDevicesComboBoxSupport.java

示例5: LocationsComboBoxModel

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:ApplicationLocationPanel.java

示例6: LicenseComboBoxModel

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:LicenseComboBoxModel.java

示例7: fireContentsChanged

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:LicenseComboBoxModel.java

示例8: resultChanged

import javax.swing.event.ListDataListener; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:ServerWizardVisual.java

示例9: fireChange

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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 ());
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:FilteredListModel.java

示例10: setDirty

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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);
    }
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:18,代碼來源:FormulaDialog.java

示例11: UndoableList

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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>();
}
 
開發者ID:mgropp,項目名稱:pdfjumbler,代碼行數:9,代碼來源:UndoableList.java

示例12: HistoryModel

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:HistorySupport.java

示例13: fire

import javax.swing.event.ListDataListener; //導入依賴的package包/類
private void fire() {
    final ListDataEvent event = new ListDataEvent(
            this,
            -1,
            -1,
            Integer.MAX_VALUE);
    for (ListDataListener l : listeners) {
        l.contentsChanged(event);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:HistorySupport.java

示例14: TaskModel

import javax.swing.event.ListDataListener; //導入依賴的package包/類
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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:TaskModel.java

示例15: intervalAdded

import javax.swing.event.ListDataListener; //導入依賴的package包/類
@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);
            }
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:TaskModel.java


注:本文中的javax.swing.event.ListDataListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。