Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How can I get the IWorkbenchPage in the EditPart ?
How can I get the IWorkbenchPage in the EditPart ? [message #119173] Tue, 24 February 2004 02:19 Go to next message
Eclipse UserFriend
Originally posted by: sckimos.enet.co.kr

Hi.

I want to open the properties view, when user double-clicks the EditPart.
I've caught the REQ_OPEN request in the EditPart.performRequest(),
and I want to use IWorkbenchPage.showView() method.

But I don't know how can I get the IEditorPart (or IWorkbenchPart)
from the EditPart for getting active page (IWorkbenchPage).

Is there any way to get IWorkbenchPage in the EditPart ?

public void performRequest(Request req) {
if (req.getType() == REQ_OPEN) {
handleDoubleClick();
}
else
super.performRequest(req);
}

protected void handleDoubleClick() {
IWorkbenchPage page = getPage(); // how can i get the WorkbenchPage?
<====
if (page != null) {
try {
page.showView("org.eclipse.ui.views.PropertySheet");
} catch (PartInitException e) {
e.printStackTrace();
}
}

Thanks in advance.
Re: How can I get the IWorkbenchPage in the EditPart ? [message #119295 is a reply to message #119173] Tue, 24 February 2004 18:46 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

There are static helpers for accessing the current workbench window.
such as:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage()


"Kimos" <sckimos@enet.co.kr> wrote in message
news:c1ec4h$n8k$1@eclipse.org...
> Hi.
>
> I want to open the properties view, when user double-clicks the EditPart.
> I've caught the REQ_OPEN request in the EditPart.performRequest(),
> and I want to use IWorkbenchPage.showView() method.
>
> But I don't know how can I get the IEditorPart (or IWorkbenchPart)
> from the EditPart for getting active page (IWorkbenchPage).
>
> Is there any way to get IWorkbenchPage in the EditPart ?
>
> public void performRequest(Request req) {
> if (req.getType() == REQ_OPEN) {
> handleDoubleClick();
> }
> else
> super.performRequest(req);
> }
>
> protected void handleDoubleClick() {
> IWorkbenchPage page = getPage(); // how can i get the
WorkbenchPage?
> <====
> if (page != null) {
> try {
> page.showView("org.eclipse.ui.views.PropertySheet");
> } catch (PartInitException e) {
> e.printStackTrace();
> }
> }
>
> Thanks in advance.
>
>
Previous Topic:Different connections for same edit part
Next Topic:Calculate the best connection anchor
Goto Forum:
  


Current Time: Wed Jul 17 11:43:18 GMT 2024

Powered by FUDForum. Page generated in 0.04002 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top