[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: StickyView -how to initialize as visible from start up?

I am new to all this too! Try opening the view after the default perspective is opened

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(View.ID);

I think the error is caused because the stickyview extension is creating a placeholder and then your are doing the same within the default perspective which creates the "view already exists exception."

Stuff to fool around with while we all learn.
	

Nigel Pickard wrote:
OK, I'm definitely missing something here (I'm a relative newcomer to Eclipse, apologies). This is along the lines of my reply to James -you mention:

"and if not open it ... then tie it to your main perspective"

How do I open the view programatically? I was under the impression the way to do it was to use the default (as in default perspective that opens when I first start the app after installing) perspective and open the view there, e.g. if my default perspective is TestPerspective, under its createInitialLayout method:

public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.addView(TestStickyView.ID_VIEW, IPageLayout.RIGHT, 0.25f, editorArea);
.
.
}


Is there another way to open a specific view (e.g. my sticky view) for a perspective? And where should I call it from? I should add I've tried searching the documentation and newsgroups about this but with no success :(

Thanks