Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Non-Closeable Views are closeable via Menu(suspected bug)
Non-Closeable Views are closeable via Menu [message #1711463] Fri, 16 October 2015 10:14 Go to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
This is kind of tricky to find (but hey, some users did!)

First a summary of what i try to do.
I created several Views in my Application which shall NOT be closeable.
therefore i add them to a IViewLayout and disable closeable:

public void preventClose(IPageLayout layout, String... viewIds) {
		if (debug)
			System.out.println("disable close for " + viewIds.length + " views");
		for (int i = 0; i < viewIds.length; i++) {
			if (debug)
			System.out.println("\tdisable close for: " + viewIds[i]);
			try {
				IViewLayout vLayout = layout.getViewLayout(viewIds[i]);
				vLayout.setCloseable(false);
			} catch (Exception e) {
				System.err.println("the id you passed for preventClose is not a View (Folder?): " + viewIds[i]);
			}
		}
	}


this is nice and works!
i noticed that you can still close the Views if you drag em outside of the Application, as they gain normal Shell-Controls then (already discussed this with Tom Schindl, and we noticed this to be a non trivial case)

but now i noticed a trivial case where an Menu-Point keeps visible which should not show up with closeable=false

you can 'Minimize' a view in a folderLayout, then you get a quick-toolbar, with an restore button/Icon, and an icon/button for each View.
index.php/fa/23563/0/

rightclick on an icon/button. a context menue pops up giving you the following options:


    Orientation > (with submenu)
    Restore
    Close <- this is just wrong, if closeable is false!


index.php/fa/23564/0/

is there a way i can influence this menu?

[Updated on: Fri, 16 October 2015 10:19]

Report message to a moderator

Re: Non-Closeable Views are closeable via Menu [message #1711465 is a reply to message #1711463] Fri, 16 October 2015 10:19 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
No you need to file a bug report so that it can be fixed - to only other
chance I see is to roll your own renderer.

Tom

On 16.10.15 12:14, Ludwig Moser wrote:
> This is kind of tricky to find (but hey, some users did!)
>
> First a summary of what i try to do.
> I created several Views in my Application which shall NOT be closeable.
> therefore i add them to a IViewLayout and disable closeable:
>
>
> public void preventClose(IPageLayout layout, String... viewIds) {
> if (debug)
> System.out.println("disable close for " + viewIds.length + " views");
> for (int i = 0; i < viewIds.length; i++) {
> if (debug)
> System.out.println("\tdisable close for: " + viewIds[i]);
> try {
> IViewLayout vLayout = layout.getViewLayout(viewIds[i]);
> vLayout.setCloseable(false);
> } catch (Exception e) {
> System.err
> .println("the id you passed for preventClose is not a View (Folder?): "
> + viewIds[i]);
> }
> }
> }
>
>
> this is nice and works!
> i noticed that you can still close the Views if you drag em outside of the Application, as they gain normal Shell-Controls then (already discussed this with Tom Schindl, and we noticed this to be a non trivial case)
>
> but now i noticed a trivial case where an Menu-Point keeps visible which should not show up with closeable=false
>
> you can 'Minimize' a view in a folderLayout, then you get a quick-toolbar, with an restore button/Icon, and an icon/button for each view.
>
>
> rightclick on an icon/button. a context menue pops up giving you the following options:
>
>
> Orientation > (with submenu)
> Restore
> Close <- this is just wrong, if closeable is false!
>
>
>
>
> is there a way i can influence this menu?
>
Re: Non-Closeable Views are closeable via Menu [message #1711474 is a reply to message #1711465] Fri, 16 October 2015 11:12 Go to previous message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
submitted
https://bugs.eclipse.org/bugs/show_bug.cgi?id=479952
Previous Topic:Enable and disable Command Menu item programmatically
Next Topic:child windows in rcp application
Goto Forum:
  


Current Time: Thu Apr 25 07:56:56 GMT 2024

Powered by FUDForum. Page generated in 0.02800 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top