Reputation: 33
I have a perspective with two views, at the beginning of the application shows a viewA and hides the viewB. It´s possible the user select an item from the table in viewA and that selection open viewB which at the beginning is hidden, while hiding viewA?
Upvotes: 0
Views: 234
Reputation: 7229
supouse you have a TableViewer, on your View, you do this:
this.yourTableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (selection .isEmpty()) {
MessageHelper.openWarning("Select something");
return;
}
try {
//opens a Editor instead a view
getSite().getPage().openEditor(new UsuarioEditorInput((Usuario) selecao.getFirstElement()), "br.com.germantech.ecf.usuarioEditor");
}
catch (PartInitException e) {
e.printStackTrace();
}
}
});
Upvotes: 1