createEditor(editor, (TreeItem) e.item);
}
}
}
});
TreeColumn c1 = new TreeColumn(_tree, SWT.DEFAULT);
new TreeViewerColumn(_viewer, c1).setLabelProvider(new ColumnLabelProvider() {
/**
* @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
*/
@Override
public String getText(Object element) {
if (element instanceof PropertyBinding)
return ((PropertyBinding) element).getDescriptor().getName();
return super.getText(element);
}
});
c1.setText("Name");
c1.setWidth(200);
TreeColumn c2 = new TreeColumn(_tree, SWT.DEFAULT);
new TreeViewerColumn(_viewer, c2).setLabelProvider(new ColumnLabelProvider() {
/**
* @see org.eclipse.jface.viewers.ColumnLabelProvider#getText(java.lang.Object)
*/
@Override
public String getText(Object element) {
if (element instanceof PropertyBinding) {
PropertyBinding prop = (PropertyBinding) element;
Object val = prop.getValue();
if (val == null)
return null;
if (val instanceof Calendar)
return new SimpleDateFormat("dd.MM.yyyy HH:mm:ss").format(((Calendar) val).getTime());
return val.toString();
}
return super.getText(element);
}
});
c2.setText("Value");
c2.setWidth(250);
Object o = UIActivator.getDefault().getCurrentObject();
_content.setObject(o);
}