Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Closeable parts
Closeable parts [message #659698] Tue, 15 March 2011 09:52 Go to next message
AppleJus Mising name is currently offline AppleJus Mising nameFriend
Messages: 46
Registered: July 2010
Member
Hello ,

I am trying to make a part (in a partstack) be uncloseable.
I added the tag closeable="false" in the .e4xmi at the corresponding part definition but to no avail.

Thanks for any help!
Re: Closeable parts [message #659981 is a reply to message #659698] Wed, 16 March 2011 13:42 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/15/2011 05:53 AM, AppleJus wrote:
> Hello ,
>
> I am trying to make a part (in a partstack) be uncloseable.
> I added the tag closeable="false" in the .e4xmi at the corresponding

Are you using the correct tag? "NoClose"

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Closeable parts [message #662643 is a reply to message #659981] Thu, 31 March 2011 11:49 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
I am also experimenting with this. Setting the checkbox "Closable" in the Workbenchmodel Editor does not have any effect on the file.

Manually setting the attribute closeable="false" has no effect.
Manually setting the attribute closeable="NoClose" leads to an Error: "Value 'NoClose' is not legal."

I also tried to modify the model of the Part:

	@Inject private MPart part;
	
	@PostConstruct
	public void postConstruct() {
		part.setCloseable(false);
		...


This does not have any effect.

Christoph

[Updated on: Thu, 31 March 2011 11:50]

Report message to a moderator

Re: Closeable parts [message #662886 is a reply to message #662643] Fri, 01 April 2011 11:33 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/31/2011 07:49 AM, Christoph Keimel wrote:
> I am also experimenting with this. Setting the checkbox "Closable" in
> the Workbenchmodel Editor does not have any effect on the file.
>
> Manually setting the attribute closeable="false" has no effect.
> Manually setting the attribute closable="NoClose" leads to an Error:
> "Value 'NoClose' is not legal."
>
> I also tried to modify the model:
>
> @Inject private MPart part;
>
> @PostConstruct
> public void postConstruct() {
> part.setCloseable(false);

Also try part.getTags().add("NoClose");

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Closeable parts [message #663002 is a reply to message #662886] Fri, 01 April 2011 22:04 Go to previous messageGo to next message
AppleJus Mising name is currently offline AppleJus Mising nameFriend
Messages: 46
Registered: July 2010
Member
getTags().add("NoClose");

works! Thank you
Re: Closeable parts [message #664291 is a reply to message #663002] Fri, 08 April 2011 09:54 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Guys,

I can't get it to work even in a very simple sample. I think I am missing some very basic point.

This is my Part-Class:

public class TestPart {
	@Inject private Composite parent;
	@Inject private MPart part;
	
	@PostConstruct
	public void postConstruct() {
		part.getTags().add("NoClose");
		
		Text text = new Text(parent, SWT.MULTI);
		text.setText("Hello World");
	}
}


The Part is Child of a Part Stack. The Label will still show the "X" for closing and closing is performed, when the "X" is clicked.

Maybe I have the wrong Version of Plugins? I am using the Plugins from eclipse-e4-repo-incubation-I20110329-2200.

Any help is greatly appreciated.

Regards,
Christoph
Re: Closeable parts [message #664300 is a reply to message #664291] Fri, 08 April 2011 10:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Why don't you set the tag in the .e4xmi? My current guess is that you
can't change this at runtime because the CTabItem has been constructed
already before and IIRC SWT.Close is passed to the constructor.

Tom

Am 08.04.11 11:54, schrieb Christoph Keimel:
> Hi Guys,
>
> I can't get it to work even in a very simple sample. I think I am
> missing some very basic point.
>
> This is my Part-Class:
>
> public class TestPart {
> @Inject private Composite parent;
> @Inject private MPart part;
>
> @PostConstruct
> public void postConstruct() {
> part.getTags().add("NoClose");
>
> Text text = new Text(parent, SWT.MULTI);
> text.setText("Hello World");
> }
> }
>
> The Part is Child of a Part Stack. The Label will still show the "X" for
> closing and closing is performed, when the "X" is clicked.
>
> Maybe I have the wrong Version of Plugins? I am using the Plugins from
> eclipse-e4-repo-incubation-I20110329-2200.
>
> Any help is greatly appreciated.
>
> Regards,
> Christoph
>
Re: Closeable parts [message #664302 is a reply to message #664300] Fri, 08 April 2011 10:27 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi Tom,

I knew I was missing something basic. Sometimes you can't see the trees in the forest Smile

Thanks for your help. Issue is solved.

Smile,
Christoph
Re: Closeable parts [message #664491 is a reply to message #659981] Sat, 09 April 2011 18:06 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

MPart#setClosable(false) should now work as well in the latest nightly
builds [1]! The reason for the flag is that when we talk about
perspectives the view can be closeable in perspective A but not in B.

The only missing part is that it is not dynamic after the CTabItem has
been created [2].

Tom

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=342291
[2]https://bugs.eclipse.org/bugs/show_bug.cgi?id=342299

Am 16.03.11 14:42, schrieb Paul Webster:
> On 03/15/2011 05:53 AM, AppleJus wrote:
>> Hello ,
>>
>> I am trying to make a part (in a partstack) be uncloseable.
>> I added the tag closeable="false" in the .e4xmi at the corresponding
>
> Are you using the correct tag? "NoClose"
>
> PW
>
>
Re: Closeable parts [message #734151 is a reply to message #664491] Thu, 06 October 2011 21:35 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 18
Registered: September 2011
Junior Member
This works fine for me to make a part not closeable, but how can I make the stack itself not closeable? MPartStack doesn't have setCloseable() and doesn't seem to heed the "NoClose" tag. Surely there's some simple way to do this?
Re: Closeable parts [message #734163 is a reply to message #734151] Thu, 06 October 2011 21:44 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
What do you mean by not closeable? That it doesn't vanish when the last
entry in the stack is gone?

Then this is not yet supported because the behavior in 3.x is also like
it is today in e4. We already discussed this and it is far more easy to
implement in e4 than it is in 3.x where we still face issues to
correctly implement this really easy feature.

So please file a bug report this by setting a tag and respecting this
tag in the CleanupAddon.

Tom

Am 06.10.11 23:35, schrieb grillo321:
> This works fine for me to make a part not closeable, but how can I make
> the stack itself not closeable? MPartStack doesn't have setCloseable()
> and doesn't seem to heed the "NoClose" tag. Surely there's some simple
> way to do this?
Re: Closeable parts [message #734173 is a reply to message #734163] Thu, 06 October 2011 23:23 Go to previous message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 18
Registered: September 2011
Junior Member
There are two problems, 1) closing last part in stack closes stack and 2) minimizing initially empty stack closes it rather than minimizing it.

Added bug report:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=360173
Previous Topic:XWT: difference between static and dynamic resource
Next Topic:how to set minimum size for windows or parts
Goto Forum:
  


Current Time: Tue Apr 23 12:51:18 GMT 2024

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

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

Back to the top