Create the following model class.
package de.vogella.dnd.jface.model;
public class Todo {
private String shortDescription;
private String longDescription;
public String getShortDescription() {
return shortDescription;
}
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
public String getLongDescription() {
return longDescription;
}
public void setLongDescription(String longDescription) {
this.longDescription = longDescription;
}
}
Create the following content providers (Singletons).
package de.vogella.dnd.jface.model;
import java.util.ArrayList;
import java.util.List;
public enum ContentProvider {
INSTANCE;
public ListgetModel(){
Listlist = new ArrayList ();
Todo todo = new Todo("Java", "Learn the Closure proposal");
list.add(todo);
todo = new Todo("Eclipse", "Learn more about the RCP platform");
list.add(todo);
return list;
}
}
package de.vogella.dnd.jface.model;
import java.util.ArrayList;
import java.util.List;
public enum ContentProviderTree {
INSTANCE;
Listlist = new ArrayList ();
private ContentProviderTree() {
list.add("Branch1");
list.add("Branch1");
}
public ListgetModel(){
return list;
}
}
0 comments:
Post a Comment