Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » About PropertyTabbed
About PropertyTabbed [message #467501] Fri, 04 May 2007 13:45
Eclipse UserFriend
Originally posted by: moutaz.ahmed.gmail.com

hii

i used to develope "The Eclipse Tabbed Properties View" article, he used a listViewer to list his controls,

but in my application, i want to use a treeViewer.

is there any Error in my "ViewContentProvider" and "ViewLabelProvider" ?


where the nodes i created for the tree is an object for the ButtonElement.

class ViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {

public void inputChanged(Viewer v, Object oldInput, Object newInput) {
}

public void dispose() {
}

public Object[] getElements(Object parent) {
return getChildren(parent);
}

public Object getParent(Object child) {
if (child instanceof TreeObject) {
return ((TreeObject)child).getParent();
}
return null;
}

public Object[] getChildren(Object parent) {
if (parent instanceof TreeParent) {
return ((TreeParent)parent).getChildren();
}
return new Object[0];
}

public boolean hasChildren(Object parent) {
if (parent instanceof TreeParent)
return ((TreeParent)parent).hasChildren();
return false;
}
}

class ViewLabelProvider extends LabelProvider {

public String getText(Object obj) {
return obj.toString();
}
public Image getImage(Object obj) {
String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
if (obj instanceof TreeParent)
imageKey = ISharedImages.IMG_OBJ_FOLDER;
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKe y);
}
}
Previous Topic:Data Model
Next Topic:set color for property entry in properties view
Goto Forum:
  


Current Time: Thu May 22 06:56:45 EDT 2025

Powered by FUDForum. Page generated in 0.06987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top