NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

TopComponent doesn't resize vertically automatically

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
ecerulm



Joined: 04 Mar 2009
Posts: 20

PostPosted: Thu Jul 01, 2010 6:51 am    Post subject: TopComponent doesn't resize vertically automatically Reply with quote

Hi,

I have two TopComponent arranged vertically using split mode as explained in this post. And when the main window opens the two TopComponent take all the space available 50%-50% as expected. When I reduce the vertical space in the main window the TopComponents resize properly mantaining the 50%-50% ratio.


But when I expand the window vertically none of the TopComponent grow. I can see only empty space (I believe is empty space, see ) between the bottom limit of the window and the bottom of the lower TC.

What's going on? What could be causing this resize behaviour? I'm sure it's something that I did wrong but I need some advice about what should I be looking for.

Thanks in advance

BTW, I "hide" all other modes in layer.xml (editor, output, explorer, etc...) both the folders, and the .wsmode files . It doesn't seem to have any effect.

For reference, I'm using this two wsmode files

Code:
<!DOCTYPE mode PUBLIC "-//NetBeans//DTD Mode Properties 2.3//EN" "http://www.netbeans.org/dtds/mode-properties2 3.dtd">
<mode version="2.3">
 <module name="com.rubenlaguna.en4j.mainmodule" spec="1.0"/>
 <name   unique="NoteListMode"/>
 <kind   type="view"/>
 <state type="joined"/>
 <constraints>
  <path orientation="vertical" number="0" weight="0.5"/>
  <!--<path orientation="horizontal" number="0" weight="1.0"/>-->
 </constraints>
 <empty-behavior permanent="true"/>
</mode>


Code:
<!DOCTYPE mode PUBLIC "-//NetBeans//DTD Mode Properties 2.3//EN" "http://www.netbeans.org/dtds/mode-properties2 3.dtd">
<mode version="2.3">
 <module name="com.rubenlaguna.en4j.NoteContentViewModule" spec="1.0"/>
 <name   unique="NoteContentViewMode"/>
 <kind   type="view"/>
 <state type="joined"/>
 <constraints>
  <path orientation="vertical" number="1" weight="0.5"/>
  <!--<path orientation="horizontal" number="0" weight="1.0"/>-->
 </constraints>
 <empty-behavior permanent="true"/>
</mode>
[url][/url]
Back to top
ecerulm



Joined: 04 Mar 2009
Posts: 20

PostPosted: Fri Jul 02, 2010 10:09 pm    Post subject: Reply with quote

I've trying different ways of solving this. No real solution yet.

But I realized that the empty space at the bottom is in reality the editor area.
If if change both TopComponents modes to be "editor" instead of "view" then the TopComponent are layout as expected and the resize works too. Unfortunately they get a special look and field when placed in the editor area (they show like tabs).

So I wonder if anybody knows either:

1) how to completely disable the editor area? (I've able to hide editor.wsmode et al, but there is still an editor area in WindowManager.wswmgr that can't be removed)

2) how to place TopComponents in the editor area mantaining the L&F of kind="view"?

EDIT: I tried hide the empty document area with

run.args.extra=-J-Dnetbeans.winsys.hideEmptyDocArea=true

and I get an NPE exception at startup


Code:
java.lang.NullPointerException
   at org.netbeans.core.windows.ModeStructureSnapshot$EditorSnapshot.isVisibleInSplit(ModeStructureSnapshot.java:443)
   at org.netbeans.core.windows.ModeStructureSnapshot$EditorSnapshot.hasVisibleDescendant(ModeStructureSnapshot.java:451)
   at org.netbeans.core.windows.ModeStructureSnapshot$SplitSnapshot.hasVisibleDescendant(ModeStructureSnapshot.java:264)
   at org.netbeans.core.windows.ModeStructureSnapshot$SplitSnapshot.hasVisibleDescendant(ModeStructureSnapshot.java:264)
   at org.netbeans.core.windows.ModeStructureSnapshot$SplitSnapshot.hasVisibleDescendant(ModeStructureSnapshot.java:264)
   at org.netbeans.core.windows.ModeStructureSnapshot$SplitSnapshot.getVisibleChildSnapshots(ModeStructureSnapshot.java:219)
   at org.netbeans.core.windows.view.ViewHelper.createSplitAccessor(ViewHelper.java:190)
...
...


I'm using NB 6.9 by the way


Last edited by ecerulm on Fri Jul 02, 2010 10:36 pm; edited 1 time in total
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Fri Jul 02, 2010 10:14 pm    Post subject: [platform-dev] Re: TopComponent doesn't resize vertically automatically Reply with quote

ecerulm wrote:
Quote:
I've trying different ways of solving this. No real solution yet.

But I realized that the empty space at the bottom is in reality the editor area.
If if change both TopComponents modes to be "editor" instead of "view" then the TopComponent are layout as expected and the resize works too. Unfortunately they get a special look and field when placed in the editor area (they show like tabs).

So I wonder if anybody knows either:

1) how to completely disable the editor area? (I've able to hide editor.wsmode et al, but there is still an editor area in WindowManager.wswmgr that can't be removed)


Maybe override the WindowManager.wsmgr, with your own.

Quote:
2) how to place TopComponents in the editor area mantaining the L&F of kind="view"?




Create your own view mode in that area.

Gj
Quote:

Back to top
ecerulm



Joined: 04 Mar 2009
Posts: 20

PostPosted: Fri Jul 02, 2010 10:57 pm    Post subject: Reply with quote

Hi Geertjan, thanks for looking into this

1) I tried that, even if override WindowManager.wswmgr in layer.xml and remove <editor-area> I still get the editor/document area. As soon as I close the app I can see that build/testuserdir/config/Windows2Local/WindowManager.wswmgr
has a editor-area element. Netbeans adds it automatically

2) I didn't understand you. If I set the mode to kind="view" I cannot place in the document area because the only way to put it the document area is to set kind="editor" instead (and the component looks "ugly"). How can I create a mode kind="view" inside the document area?


I found netbeans.winsys.hideEmptyDocArea property that is suppose to do want I want (hide the document are if it's empty) but I get an exception when I try to set it up (either in run.extra.args or via System.setProperty). I think I will file a bug report on that one EDIT bug report created http://netbeans.org/bugzilla/show_bug.cgi?id=188336. (using NB 6.9)


Last edited by ecerulm on Fri Jul 02, 2010 11:10 pm; edited 1 time in total
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Fri Jul 02, 2010 11:01 pm    Post subject: [platform-dev] Re: TopComponent doesn't resize vertically automatically Reply with quote

ecerulm wrote:
Quote:
Hi Geertjan, thanks for looking into this

1) I tried that, even if override WindowManager.wswmgr in layer.xml and remove <editor-area> I still get the editor/document area. As soon as I close the app I can see that build/testuserdir/config/Windows2Local/WindowManager.wswmgr
has a editor-area element. Netbeans adds it automatically

2) I didn't understand you. If I set the mode to kind="view" I cannot place in the document area because the only way to put it the document area is to set kind="editor" instead (and the component looks "ugly"). How can I create a mode kind="view" inside the document area?



First of all, why do you need to do this?

Gj

Quote:
I found netbeans.winsys.hideEmptyDocArea property that is suppose to do want I want (hide the document are if it's empty) but I get an exception when I try to set it up (either in run.extra.args or via System.setProperty). I think I will file a bug report on that one. (using NB 6.9)




Back to top
ecerulm



Joined: 04 Mar 2009
Posts: 20

PostPosted: Fri Jul 02, 2010 11:24 pm    Post subject: Reply with quote

It's at the top of the thread !

I have two modes splitted vertically (as shown in the screenshot in the thread http://forums.netbeans.org/viewtopic.php?p=78825#78825) and resize doesn't work properly because of this empty editor area at the bottom. When I make the window bigger the empty editor area gets bigger (the two modes remain same size).


Anyway I found why netbeans.winsys.hideEmptyDocArea=true was giving me an NPE. During my numerous tests I removed set editor.wsmode as hidden in my layer.xml and that together with hideEmptyDocArea produces the NPE. I reverted the change to layer.xml and know it WORKS!. I have two views in my app splitted vertically and resize works.
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Sat Jul 03, 2010 6:59 am    Post subject: [platform-dev] Re: TopComponent doesn't resize vertically automatically Reply with quote

ecerulm wrote:
Quote:
It's at the top of the thread !

I have two modes splitted vertically (as shown in the screenshot in the thread http://forums.netbeans.org/viewtopic.php?p=78825#78825) and resize doesn't work properly because of this empty editor area at the bottom. When I make the window bigger the empty editor area gets bigger (the two modes remain same size).


Anyway I found why netbeans.winsys.hideEmptyDocArea=true was giving me an NPE. During my numerous tests I removed set editor.wsmode as hidden in my layer.xml and that together with hideEmptyDocArea produces the NPE. I reverted the change to layer.xml and know it WORKS!. I have two views in my app splitted vertically and resize works.





Tried your instructions -- they work for me too!

Great, thanks a lot.

Gj
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo