1 package cz
.cvut
.promod
.gui
.dialogs
.pluginsOverview
.extensions
;
3 import cz
.cvut
.promod
.services
.ModelerSession
;
4 import cz
.cvut
.promod
.plugin
.extension
.Extension
;
7 import javax
.swing
.event
.ListDataListener
;
9 import java
.util
.LinkedList
;
12 * ProMod, master thesis project
13 * User: Petr Zverina, petr.zverina@gmail.com
14 * Date: 17:20:11, 11.2.2010
16 * A Model component of ExtensionOverviewTab.
18 public class ExtensionOverviewTabModel
implements ListModel
{
20 private final List
<ExtensionLabelWrapper
> extensionsList
;
23 public ExtensionOverviewTabModel() {
24 extensionsList
= new LinkedList
<ExtensionLabelWrapper
>();
29 private void initList() {
30 for(final Extension extension
: ModelerSession
.getExtensionService().getExtensions()){
31 extensionsList
.add(new ExtensionLabelWrapper(extension
.getIdentifier(), extension
.getName()));
35 public int getSize() {
36 return extensionsList
.size();
39 public Object
getElementAt(int index
) {
40 return extensionsList
.get(index
);
43 public void addListDataListener(ListDataListener l
) {
47 public void removeListDataListener(ListDataListener l
) {
52 * Represents a list in list of extensions.
54 protected static class ExtensionLabelWrapper
{
56 private final String identifier
;
57 private final String displayName
;
59 private ExtensionLabelWrapper(final String identifier
, final String displayName
) {
60 this.identifier
= identifier
;
61 this.displayName
= displayName
;
64 public String
getIdentifier() {
69 public String
toString() {