Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] Can u open a view on click of a button?

I should see the code for the Action then first (what does it
extend/implement), but in most Actions there is a way to get the
Workbench, the EditorPart, ViewPart or anything like that. From thos
classes you can always get the active Editor/View/...

Regards,
Leen

On 10/19/05, Ramakrishna RangaRao <rkrangar@xxxxxxx> wrote:
> Leen,
>     Thanks for the response . But that button is a toolbar button
> .Clicking on which I am calling EditorAction.java .. How do i get the
> Active page here ?
> can put that code , if u have , please!!
> -Ranga
>
> Leen Toelen wrote on 10/19/2005, 12:25 PM:
>
>  > Just put something like this in the selectionListener of a button.
>  >
>  > IViewPart tableView = null;
>  > try {
>  >             IWorkbenchPage page = getActivePage();
>  >             tableView = page.findView(view_id);
>  >             if (tableView == null) {
>  >                 // showView will give focus to the created view, we
>  > don't want
>  >                 // that so we save the active part
>  >                 IWorkbenchPart part = page.getActivePart();
>  >                 tableView = page.showView(view);
>  >                 // and return the focus to it
>  >                 page.activate(part);
>  >             }
>  > } catch (PartInitException e) {
>  >     e.printStackTrace();
>  > }
>  >
>  > Regards,
>  > Leen Toelen
>  >
>  >
>  > On 10/19/05, Ramakrishna RangaRao <rkrangar@xxxxxxx> wrote:
>  > >  Hi All,
>  > >
>  > >     Is it possible to open a view on click of a button in eclipse?
>  > >
>  > >  -Ranga
>  > > _______________________________________________
>  > > pde-dev mailing list
>  > > pde-dev@xxxxxxxxxxx
>  > > https://dev.eclipse.org/mailman/listinfo/pde-dev
>  > >
>  > >
>  > >
>  > _______________________________________________
>  > pde-dev mailing list
>  > pde-dev@xxxxxxxxxxx
>  > https://dev.eclipse.org/mailman/listinfo/pde-dev
>  >
>
>
> _______________________________________________
> pde-dev mailing list
> pde-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/pde-dev
>


Back to the top