Home » Eclipse Projects » Rich Client Platform (RCP) » how to prevent a view from being disposed/closed?
how to prevent a view from being disposed/closed? [message #459361] |
Thu, 30 November 2006 23:29  |
Eclipse User |
|
|
|
Originally posted by: fermi.inetmon.com
I have several question regarding viewpart.
1. Is there anyway I can prevent a view to be closed? (i.e. disabling the
close button on a view).
2. I want my rcp application to have several viewpart that has a fix
position on the rcp application (openable by button, but NOT resizeable nor
moveable.)
I read an idea to implement ISaveablePart2 on our viewpart to have a
listener on the 'x' close button on a view, but how to make the view dirty
so that it will catch the close event. furthermore, I really not clear on
how to implement this ISaveablePart2. can anyone show some chunk of code?
Thanks in advance.
Regards,
--
Fermi
|
|
| |
Re: how to prevent a view from being disposed/closed? [message #459423 is a reply to message #459363] |
Fri, 01 December 2006 16:24   |
Eclipse User |
|
|
|
Originally posted by: fermi.inetmon.com
This is a multi-part message in MIME format.
------=_NextPart_000_00AF_01C7154C.12450740
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Michael,
Thanks, but I did try that already, but it doesn work before. Now I =
realize that I previously call the =
IWorkbenchConfigurer.setSaveAndRestore(true) so whenever I call =
pageLayout.getViewLayout("your.view.id").setCloseable(false) in my =
perspective factory, it doesnt take effect at all.. ;)
so, ok its my bad.. :) but to call =
pageLayout.getViewLayout("your.view.id").setCloseable(false), I need to =
add the view to the pageLayout first by calling =
pageLayout.addView("view.id") right..? the thing is I dont really =
understand how to control the layout (using IPageLayout). can you show =
me how to create a layout (inside perspective factory) with 4 view that =
will look like this:
------------------------------
| | 2 |
| |---------------------|
| 1 | 3 |
| |--------------------|
| | 4 |
-----------------------------
oh, another thing, please dont tell me that I can not control the =
resizeable option of a viewpart..?? :(
Thanks in advance.
Best Regards,
--
Fermi
"Michael Spector" <michael@zend.com> wrote in message =
news:ekmjpq$qu6$1@utils.eclipse.org...
> Muhammad Fermi Pasha wrote:
>=20
>> I have several question regarding viewpart.
>> 1. Is there anyway I can prevent a view to be closed? (i.e. disabling =
the
>> close button on a view).
>> 2. I want my rcp application to have several viewpart that has a fix
>> position on the rcp application (openable by button, but NOT =
resizeable
>> nor moveable.)
>>=20
>=20
> In your perspective factory:
>=20
> pageLayout.getViewLayout("your.view.id").setCloseable(false);
>=20
> See IViewLayout for more information.
>=20
> --=20
> With best regards, Michael Spector
------=_NextPart_000_00AF_01C7154C.12450740
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi Michael,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks, but I did try that already, but =
it doesn=20
work before. Now I realize that I previously call the=20
IWorkbenchConfigurer.setSaveAndRestore(true) so whenever I call=20
pageLayout.getViewLayout("your.view.id").setCloseable(false) in my =
perspective=20
factory, it doesnt take effect at all.. ;)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>so, ok its my bad.. :) but to call=20
pageLayout.getViewLayout("your.view.id").setCloseable(false), I need to =
add the=20
view to the pageLayout first by calling pageLayout.addView("view.id") =
right..?=20
the thing is I dont really understand how to control the layout (using=20
IPageLayout). can you show me how to create a layout (inside=20
perspective factory) with 4 view that will look like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2>------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| =20
|   ; 2 &nbs p=
;   ;=20
|</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| =20
|---------------------|</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| 1 =20
|   ; 3 &nbs p=
;   ;=20
|</DIV>
<DIV>| |--------------------|</DIV>
<DIV>| =20
|   ; =20
4   ; |</DIV>
<DIV>-----------------------------<BR></DIV>
<DIV></FONT><FONT face=3DArial size=3D2>oh, another thing, please dont =
tell me that=20
I can not control the resizeable option of a =
viewpart..??</FONT> <FONT=20
face=3DArial size=3D2>:(</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>--</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Fermi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Michael Spector" <</FONT><A=20
href=3D"mailto:michael@zend.com"><FONT face=3DArial=20
size=3D2>michael@zend.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in message=20
</FONT><A href=3D"news:ekmjpq$qu6$1@utils.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:ekmjpq$qu6$1@utils.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> Muhammad Fermi =
Pasha=20
wrote:<BR>> <BR>>> I have several question regarding=20
viewpart.<BR>>> 1. Is there anyway I can prevent a view to be =
closed?=20
(i.e. disabling the<BR>>> close button on a view).<BR>>> 2. =
I want=20
my rcp application to have several viewpart that has a fix<BR>>> =
position=20
on the rcp application (openable by button, but NOT =
resizeable<BR>>> nor=20
moveable.)<BR>>> <BR>> <BR>> In your perspective =
factory:<BR>>=20
<BR>> =
pageLayout.getViewLayout("your.view.id").setCloseable(false); <BR>>=20
<BR>> See IViewLayout for more information.<BR>> <BR>> -- =
<BR>> With=20
best regards, Michael Spector</FONT></BODY></HTML>
------=_NextPart_000_00AF_01C7154C.12450740--
|
|
|
Re: how to prevent a view from being disposed/closed? [message #459427 is a reply to message #459423] |
Fri, 01 December 2006 19:32   |
Eclipse User |
|
|
|
Originally posted by: fermi.inetmon.com
This is a multi-part message in MIME format.
------=_NextPart_000_010A_01C71566.56ADD9B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Nevermind, its ok now. I'm just too lazy to try..
Thanks for the feedbacks!!
"Muhammad Fermi Pasha" <fermi@inetmon.com> wrote in message =
news:ekoec7$ujn$1@utils.eclipse.org...
Hi Michael,
Thanks, but I did try that already, but it doesn work before. Now I =
realize that I previously call the =
IWorkbenchConfigurer.setSaveAndRestore(true) so whenever I call =
pageLayout.getViewLayout("your.view.id").setCloseable(false) in my =
perspective factory, it doesnt take effect at all.. ;)
so, ok its my bad.. :) but to call =
pageLayout.getViewLayout("your.view.id").setCloseable(false), I need to =
add the view to the pageLayout first by calling =
pageLayout.addView("view.id") right..? the thing is I dont really =
understand how to control the layout (using IPageLayout). can you show =
me how to create a layout (inside perspective factory) with 4 view that =
will look like this:
------------------------------
| | 2 |
| |---------------------|
| 1 | 3 |
| |--------------------|
| | 4 |
-----------------------------
oh, another thing, please dont tell me that I can not control the =
resizeable option of a viewpart..?? :(
Thanks in advance.
Best Regards,
--
Fermi
"Michael Spector" <michael@zend.com> wrote in message =
news:ekmjpq$qu6$1@utils.eclipse.org...
> Muhammad Fermi Pasha wrote:
>=20
>> I have several question regarding viewpart.
>> 1. Is there anyway I can prevent a view to be closed? (i.e. =
disabling the
>> close button on a view).
>> 2. I want my rcp application to have several viewpart that has a =
fix
>> position on the rcp application (openable by button, but NOT =
resizeable
>> nor moveable.)
>>=20
>=20
> In your perspective factory:
>=20
> pageLayout.getViewLayout("your.view.id").setCloseable(false);
>=20
> See IViewLayout for more information.
>=20
> --=20
> With best regards, Michael Spector
------=_NextPart_000_010A_01C71566.56ADD9B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Nevermind, its ok now. I'm just too =
lazy to=20
try..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for the feedbacks!!</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Muhammad Fermi Pasha" <<A=20
href=3D"mailto:fermi@inetmon.com">fermi@inetmon.com</A>> wrote in =
message <A=20
=
href=3D"news:ekoec7$ujn$1@utils.eclipse.org">news:ekoec7$ujn$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Hi Michael,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks, but I did try that already, =
but it doesn=20
work before. Now I realize that I previously call the=20
IWorkbenchConfigurer.setSaveAndRestore(true) so whenever I call=20
pageLayout.getViewLayout("your.view.id").setCloseable(false) in my =
perspective=20
factory, it doesnt take effect at all.. ;)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>so, ok its my bad.. :) but to call=20
pageLayout.getViewLayout("your.view.id").setCloseable(false), I need =
to add=20
the view to the pageLayout first by calling =
pageLayout.addView("view.id")=20
right..? the thing is I dont really understand how to control the =
layout=20
(using IPageLayout). can you show me how to create =
a layout (inside=20
perspective factory) with 4 view that will look like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2>------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| =20
=
|   ; 2 &nbs p=
;   ;=20
|</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| =20
|---------------------|</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>| 1 =20
=
|   ; 3 &nbs p=
;   ;=20
|</DIV>
<DIV>| |--------------------|</DIV>
<DIV>| =20
|   ; =20
4   ; |</DIV>
<DIV>-----------------------------<BR></DIV>
<DIV></FONT><FONT face=3DArial size=3D2>oh, another thing, please dont =
tell me=20
that I can not control the resizeable option of a=20
viewpart..??</FONT> <FONT face=3DArial size=3D2>:(</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>--</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Fermi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Michael Spector" <</FONT><A=20
href=3D"mailto:michael@zend.com"><FONT face=3DArial=20
size=3D2>michael@zend.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in=20
message </FONT><A href=3D"news:ekmjpq$qu6$1@utils.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:ekmjpq$qu6$1@utils.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> Muhammad =
Fermi Pasha=20
wrote:<BR>> <BR>>> I have several question regarding=20
viewpart.<BR>>> 1. Is there anyway I can prevent a view to be =
closed?=20
(i.e. disabling the<BR>>> close button on a view).<BR>>> =
2. I want=20
my rcp application to have several viewpart that has a fix<BR>>> =
position on the rcp application (openable by button, but NOT=20
resizeable<BR>>> nor moveable.)<BR>>> <BR>> <BR>> In =
your=20
perspective factory:<BR>> <BR>>=20
pageLayout.getViewLayout("your.view.id").setCloseable(false); <BR>> =
<BR>>=20
See IViewLayout for more information.<BR>> <BR>> -- <BR>> =
With best=20
regards, Michael Spector</FONT> </BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_010A_01C71566.56ADD9B0--
|
|
| |
Re: how to prevent a view from being disposed/closed? [message #459444 is a reply to message #459439] |
Sat, 02 December 2006 00:04  |
Eclipse User |
|
|
|
Originally posted by: fermi.inetmon.com
Hi Paul,
> Also, you can fix the layout of the entire perspective. That'll prevent
> dragging resizing that's not directly related to resizing the entire
> window.
can we actually fix the layout of the entire perspective? fix here means
user wont be able to drag, move, resize or close the view on that
perspective? I've done the following (plus set the perspective's 'fixed' tag
to true in the xml file), the result user cannot drag, move nor close but
user still able to resize the view layout (even can resize until the view is
invisible only left the tab name).
view resize as the result of resizing the entire window is ok, but can we
prevent user from resizing the view? or am I missing something in my code..?
Thanks for your help.
Regards,
--
Fermi
IFolderLayout folder = layout.createFolder("foldID", IPageLayout.LEFT,
0.25f, IPageLayout.ID_EDITOR_AREA);
folder.addPlaceholder("com.inetmon.jn.nwd.views.NWDMainView " + ":*");
folder.addView("com.inetmon.jn.nwd.views.NWDMainView");
IFolderLayout folder2 = layout.createFolder("foldID2", IPageLayout.RIGHT,
0.75f, IPageLayout.ID_EDITOR_AREA);
IFolderLayout folder3 = layout.createFolder("foldID3", IPageLayout.TOP,
0.31f, "foldID2");
IFolderLayout folder4 = layout.createFolder("foldID4", IPageLayout.BOTTOM,
0.37f, "foldID2");
folder3.addView("WormView");
folder2.addPlaceholder("MoreInfoView"+ ":*");
folder2.addView("DailyView");
folder4.addView("AdView");
|
|
|
Goto Forum:
Current Time: Mon Apr 14 17:24:40 EDT 2025
Powered by FUDForum. Page generated in 0.03021 seconds
|