EH_Aurrera
EH_Aurrera

Reputation: 33

Open hidden view

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

Answers (1)

Luiz E.
Luiz E.

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

Related Questions