How can I get the IWorkbenchPage in the EditPart ? [message #119173] |
Tue, 24 February 2004 02:19 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03308 seconds