Defining Views [message #457394] |
Tue, 31 October 2006 07:12 |
Serge Messages: 76 Registered: July 2009 |
Member |
|
|
hi everyone
i got a question regarding the definition of views. you can define your
views either in the code (in the perspective where you want the views to
appear) or in the plugin.xml (as perspectiveextension). what's the
advantage of defining it in the code oder in the plugin.xml? what's like
the "right" way to do it? the only difference i noticed is that my folder
doesn't disappear when closing the last view when i define my views in the
xml-file. this is actually what i want. or is there any other way to make
my folder always visible? i guess it's not possible to open views in the
editor area, is it?! by the way i'm working with eclipse 3.1 at the
moment. is it also possible to mix the definitions? define some in the
code and some in the xml-file? i've tried the following so far, but my
case view always opens up in my console folder, why is that (and it's
still moveable and everything even though i've set it to false, but i
guess that's a whole other problem!)
here's my perspective:
public void createInitialLayout(IPageLayout layout)
{
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.setFixed(false);
IFolderLayout trayFolder = layout.createFolder("trayFolder",
IPageLayout.LEFT, 0.25f, editorArea);
trayFolder.addPlaceholder(TrayView.ID + ":*");
trayFolder.addView(TrayView.ID);
layout.createFolder("caseFolder", IPageLayout.TOP, 0.75f, editorArea );
IFolderLayout consoleFolder = layout.createFolder("consoleFolder",
IPageLayout.BOTTOM, 0.25f, editorArea);
consoleFolder.addPlaceholder(ConsoleView.ID + ":*");
consoleFolder.addView(ConsoleView.ID);
layout.getViewLayout(TrayView.ID).setCloseable(false);
layout.getViewLayout(TrayView.ID).setMoveable(false);
}
and here my xml-file:
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension targetID="CadastreClient.casePerspective">
<view
id="CadastreClient.caseView"
relative="caseFolder"
closeable="false"
moveable="false"
relationship="stack"
showTitle="false"
visible="false"/>
</perspectiveExtension>
</extension>
hope anyone has any advice.
kind regards
|
|
|
|
Re: Defining Views [message #457399 is a reply to message #457396] |
Tue, 31 October 2006 12:18 |
|
Serge wrote:
> hmm... just tested this with eclipse 3.2.1 and my folder disappears
> again when closing the last view. looks like as if this was a bug in 3.1
> but i actually liked this bug ;) i really need this for my application,
> i can't have this folder to disappear. is there any other way to do
> this, some kind of workaround? anything?
AFAIK, eclipse will always make empty view folders disappear. The only
folder that can be made to hang around is the main editor area folder.
As to your original question, a perspective is supposed to be a layout
that would help your user with his workflow (like java development).
If you are contributing a new workflow to eclipse, you would use
org.eclipse.ui.perspectives and write your IPerspectiveFactory.
If you have just written a couple of helper views (like an XML editor
and 2 model views that go with it) you would probably use
org.eclipse.ui.perspectiveExtensions to place them in an existing
perspective (like the java perspective)
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: Defining Views [message #457401 is a reply to message #457399] |
Tue, 31 October 2006 13:09 |
Serge Messages: 76 Registered: July 2009 |
Member |
|
|
hey paul
thanks for your answers. when i start my application and i don't add any
views to my folder it will be displayed empty. but after opening and
closing a view the folder disappears. it would be nice if you could set a
folder fixed. do you know if this is planned in any further version? as i
guessed before, i can't open views in the editor area, right? hmm.. i'll
have to find a way to do this.. i can't have my folder disappear.
ok, since i'm writing my own rcp application and not enhancing my eclipse
i would implement my perspective then.
thanks a lot for your reply
regards, Serge
Paul Webster wrote:
> Serge wrote:
>> hmm... just tested this with eclipse 3.2.1 and my folder disappears
>> again when closing the last view. looks like as if this was a bug in 3.1
>> but i actually liked this bug ;) i really need this for my application,
>> i can't have this folder to disappear. is there any other way to do
>> this, some kind of workaround? anything?
> AFAIK, eclipse will always make empty view folders disappear. The only
> folder that can be made to hang around is the main editor area folder.
> As to your original question, a perspective is supposed to be a layout
> that would help your user with his workflow (like java development).
> If you are contributing a new workflow to eclipse, you would use
> org.eclipse.ui.perspectives and write your IPerspectiveFactory.
> If you have just written a couple of helper views (like an XML editor
> and 2 model views that go with it) you would probably use
> org.eclipse.ui.perspectiveExtensions to place them in an existing
> perspective (like the java perspective)
> Later,
> PW
|
|
|
Powered by
FUDForum. Page generated in 0.05468 seconds