if (sel instanceof IStructuredSelection) {
IStructuredSelection iss = (IStructuredSelection)sel;
Object elem = iss.getFirstElement();
if (elem instanceof IPropertyDescriptor) {
IPropertyDescriptor pd = (IPropertyDescriptor)elem;
JcrNode jcrnode = (JcrNode)viewer.getInput();
jcrnode.deleteProperty(pd.getDisplayName());
refreshContent();
}
}
}
};
deleteAction.setText("Delete");
deleteAction.setToolTipText("Delete a proeprty");
deleteAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
doubleClickAction = new Action() {
public void run() {
//TODO doesn't do anything currently..
ISelection selection = viewer.getSelection();
// Object obj = ((IStructuredSelection)selection).getFirstElement();
// showMessage("Double-click detected on "+obj.toString());
}
};
showInEditorAction = new Action() {
public void run() {
JcrNode node = (JcrNode)viewer.getInput();
final IFile file = node.getFileForEditor();
if (file!=null) {
try {
IDE.openEditor(getPage(), file, true);
} catch (PartInitException e) {
e.printStackTrace(System.out);