|
|
Re: IPartListener2 [message #84987 is a reply to message #84929] |
Fri, 25 April 2008 16:59 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
did you try to override DemoWorkbenchWindowAdvisor#postWindowCreate()?
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Michal NkD Nikodím [mailto:michal.nikodim@asei.cz]
Bereitgestellt: Freitag, 25. April 2008 15:28
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: IPartListener2
Betreff: Re: IPartListener2
I found one place where i have complete instance Window with page and
there are'nt created any view yet.
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
...
protected void makeActions(final IWorkbenchWindow window) {
window.getPartService().addPartListener(new MyPartListener());
....
}
..
}
Probably, i do many mistakes in english language when i tryied describe
my problem. I make apology.
NkD
Michal NkD Nikodím napsal(a):
> I need add part listener to window.getPartService() or activePage, but
i
> need add this listener before all view (workbenchpart) created.
>
> I have one perspective which opening on start two view.
>
> code:
>
> public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor{
> .....
>
> public void preStartup() {
> Sysout("PRE STARTUP");
> PlatformUI.getWorkbench().addWindowListener(new
WindowListener(){
> ...
> public void windowOpened(IWorkbenchWindow window) {
> Sysout("WINDOW OPENED");
> window.getPartService().addPartListener(new
> MyPartListener());
> }
> });
> }
> }
>
> and in View in method :
>
> public void createPartControl(Composite parent) {
> sysout("VIEW CREATED");
> }
>
> and in MyPartListener:
>
> .....
> public void partOpened(IWorkbenchPartReference partRef) {
> Sysout("PART OPENED");
> }
> ....
>
>
> Result is:
>
> PRE STARTUP
> VIEW CREATED
> WINDOW OPENED
>
> and i need:
>
> PRE STARTUP
> WINDOW OPENED
> PART OPENED
> VIEW CREATED
>
> or
>
> PRE STARTUP
> WINDOW OPENED
> VIEW CREATED
> PART OPENED
>
>
> When i register IPartListener ??
>
>
>
> P.S. sry for my English
>
>
>
>
>
>
|
|
|
|
Re: IPartListener2 [message #85120 is a reply to message #85107] |
Mon, 28 April 2008 06:50 |
NkD Missing name Messages: 61 Registered: July 2009 |
Member |
|
|
if i use:
DemoWorkbenchWindowAdvisor#postWindowCreate(){
getWindowConfigurer().getWindow().getPartService().addPartLi stener(new
MyPartListener());
}
log:
1. View - Part CREATED view.listofpersons
2. View - Part CREATED view.persondashboard
3. View - Part CREATED view.relationdashboard
4. PartListener - partOpened view.relationdashboard
5. View - Part CREATED view.address
6. PartListener - partOpened view.address
.....
missed two view (1,2)
if i use:
ApplicationActionBarAdvisor#akeActions(final IWorkbenchWindow window){
window.getPartService().addPartListener(new MyPartListener());
}
log:
1. View - Part CREATED view.listofpersons
2. PartListener - partOpened view.listofpersons
3. View - Part CREATED view.persondashboard
4. PartListener - partOpened view.persondashboard
5. View - Part CREATED view.relationdashboard
6. PartListener - partOpened view.relationdashboard
7. View - Part CREATED view.address
8. PartListener - partOpened view.address
.....
it's right
About other important thing:
public class Perspective implements IPerspectiveFactory {
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
IFolderLayout left = layout.createFolder("folder.left",
IPageLayout.LEFT, 0.25f, editorArea);
left.addView(ViewId.LIST_OF_PERSONS.ID);
left.addPlaceholder(ViewId.LIST_OF_VIEWS.ID);
IPlaceholderFolderLayout right =
layout.createPlaceholderFolder("folder.right", IPageLayout.RIGHT, 0.80f,
editorArea);
right.addPlaceholder(ViewId.LOG.ID);
IFolderLayout top = layout.createFolder("folder.top",
IPageLayout.TOP, 0.37f, editorArea);
top.addView(ViewId.PERSON_DASHBOARD.ID);
top.addView(ViewId.RELATION_DASHBOARD.ID);
IPlaceholderFolderLayout bottom =
layout.createPlaceholderFolder("folder.bottom", IPageLayout.BOTTOM,
0.63f, editorArea);
bottom.addPlaceholder(ViewId.ADDRESS.ID);
bottom.addPlaceholder(ViewId.BIRT.ID);
bottom.addPlaceholder(ViewId.REMUN_VIEW.ID);
}
}
and view.address is open from (only for developing):
WorkbenchWindowAdvisor#postWindowOpen() {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().showView( "view.address");
} catch (PartInitException e) {
throw new RuntimeException(e);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.04153 seconds