本文整理汇总了Java中javax.swing.event.ListDataEvent.CONTENTS_CHANGED属性的典型用法代码示例。如果您正苦于以下问题:Java ListDataEvent.CONTENTS_CHANGED属性的具体用法?Java ListDataEvent.CONTENTS_CHANGED怎么用?Java ListDataEvent.CONTENTS_CHANGED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.swing.event.ListDataEvent
的用法示例。
在下文中一共展示了ListDataEvent.CONTENTS_CHANGED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireContentsChanged
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);
}
}
示例2: setTab
@Override
public void setTab(int index, TabData data) {
if (!data.equals(getTab(index))) {
TabData olddata = getTab(index);
boolean txtChg = data.getText().equals(olddata.getText());
boolean compChg = data.getUserObject() != olddata.getUserObject();
list.set(index, data);
ComplexListDataEvent lde = new ComplexListDataEvent(this,
ListDataEvent.CONTENTS_CHANGED,
index, index,
txtChg,
compChg);
lde.setAffectedItems(new TabData[]{data});
fireContentsChanged(lde);
}
}
示例3: fireContentsChanged
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);
}
}
示例4: resultChanged
@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);
}
}
示例5: fireChange
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 ());
}
}
}
示例6: fireListDataEvent
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;
}
}
}
}
示例7: fireChange
private void fireChange() {
ListDataEvent ev = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, 0);
for (ListDataListener l : new ArrayList<ListDataListener>(listeners)) {
l.contentsChanged(ev);
}
}