mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-07 04:28:13 +00:00
Initial version based on previous work. (Version alpha 7)
This commit is contained in:
47
trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java
Normal file
47
trunk/src/com/jpexs/asdec/abc/gui/ABCComboBoxModel.java
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2010. JPEXS
|
||||
*/
|
||||
|
||||
package com.jpexs.asdec.abc.gui;
|
||||
|
||||
import com.jpexs.asdec.tags.DoABCTag;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListDataListener;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ABCComboBoxModel implements ComboBoxModel {
|
||||
public List<DoABCTag> list;
|
||||
public int itemIndex = 0;
|
||||
|
||||
public ABCComboBoxModel(List<DoABCTag> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
public int getSize() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public Object getElementAt(int index) {
|
||||
return list.get(index);
|
||||
}
|
||||
|
||||
public void addListDataListener(ListDataListener l) {
|
||||
|
||||
}
|
||||
|
||||
public void removeListDataListener(ListDataListener l) {
|
||||
|
||||
}
|
||||
|
||||
public void setSelectedItem(Object anItem) {
|
||||
itemIndex = list.indexOf(anItem);
|
||||
}
|
||||
|
||||
public Object getSelectedItem() {
|
||||
return getElementAt(itemIndex);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user