| View previous topic :: View next topic |
| Author |
Message |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Tue Jan 31, 2012 10:46 pm Post subject: "Output Window" location not working any longer |
|
|
Hello,
I have an application that runs fine and was started using NB 6.9, now I'm on 7.1
There is one problem though. I have two TopComponents that are registered to open in the "Output" Window location (i.e. below the editor).
But since I migrated to 7.1 these two windows no longer open below my TopComponents opened as mode Editor, but in the same place (so "hiding" the current editor).
The registration for the Window mode is done through the layer file.
How can I fix this, so that I the windows display below the current editor component when opened?
Could this be connected to the fact that apparently my project did was not "migrated" properly. See my question here: http://forums.netbeans.org/viewtopic.php?t=46275 |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Wed Feb 01, 2012 2:14 pm Post subject: |
|
|
I have another problem with the new Window API:
I have a TopComponent that opens (should open) in the explorer "part". When this is opened during startup (because I have "openAtStartup = true") this works correctly.
However if I close the window and re-open it, it opens in the editor position not as an explorer window.
The component is annotated with
@TopComponent.Registration(mode = "explorer", openAtStartup = true)
What am I missing here? |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Thu Feb 02, 2012 10:02 pm Post subject: Re: "Output Window" location not working any longer |
|
|
| tkellerer wrote: | But since I migrated to 7.1 these two windows no longer open below my TopComponents opened as mode Editor, but in the same place (so "hiding" the current editor).
The registration for the Window mode is done through the layer file.
How can I fix this, so that I the windows display below the current editor component when opened?
| I'm still struggling to get my component opened at the correct position.
What I have tried so far was switching from layer registrion to annotation based registration (hoping that the "position" attribute would give me some control over where the component opens)
Then I tried to create my own Mode (inspired by http://blogs.oracle.com/geertjan/entry/creating_a_new_mode_in)
So my mode definition looks like this:
| Code: |
<mode version="2.4">
<name unique="bottomeditor" />
<kind type="editor" />
<state type="joined" />
<constraints>
<path orientation="vertical" number="1" weight="0.2"/>
</constraints>
<bounds x="0" y="0" width="0" height="0" />
<frame state="0"/>
<empty-behavior permanent="false"/>
</mode> |
I played around with the value for the "number" attribute because according to this page: http://core.netbeans.org/windowsystem/changes.html the number should control where in the layout the component opens.
But all to no avail.
The best I could do is to open my new component above the existing editor component, but I need it below the current one (and I don't want it sliding, it needs to be anchored (or fixed whatever the word is).
So how do I get the old behaviour back?
It seems that 7.1 has lost a major flexibility in the Window system compared to 6.9  |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Thu Feb 02, 2012 10:17 pm Post subject: Re: "Output Window" location not working any longer |
|
|
| tkellerer wrote: | | The best I could do is to open my new component above the existing editor component, but I need it below the current one (and I don't want it sliding, it needs to be anchored (or fixed whatever the word is). | What I forgot to mention: even if I move the component to where it should be and the copy the contents of the generated .wsmode file into my own .wsmode file the component will still open above the existing one. |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Fri Feb 03, 2012 8:03 am Post subject: Re: "Output Window" location not working any longer |
|
|
| tkellerer wrote: | | The best I could do is to open my new component above the existing editor component, but I need it below the current one (and I don't want it sliding, it needs to be anchored (or fixed whatever the word is). | OK, I should have known that Geertjan would have something about this
This blog explained what I was missing:
http://blogs.oracle.com/geertjan/entry/creating_a_new_split_in
In a nutshell: I had to "enable" splitting for the "editor" mode.
Now the only thing that is strange, is the behaviour of the "Explorer" mode. |
|
| Back to top |
|
 |
SheriffDerek
Joined: 15 Nov 2011 Posts: 3
|
Posted: Fri Feb 03, 2012 3:36 pm Post subject: |
|
|
The platform generates background files from your code the first time you build it, and the window position type is actually stored there.
Try doing a "Clean and Build All", and they should assume the proper behavior for their type. |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Fri Feb 03, 2012 3:41 pm Post subject: |
|
|
| SheriffDerek wrote: | The platform generates background files from your code the first time you build it, and the window position type is actually stored there.
Try doing a "Clean and Build All", and they should assume the proper behavior for their type. | I do a Clean and build between those tests.
The problem with the explorer is not between two runs, but while the application is running. The following happens:
- Clean & Builde
- Start application
- TopComponent is annotated with "mode = "explorer", openAtStartup = true" and thus is shown in the Explorer position
- I close the TopComponent
- I re-open the TopComponent using "Window -> MyComponent" (no restart of the application)
- Component opens in the editor position |
|
| Back to top |
|
 |
ikvaso
Joined: 05 Nov 2011 Posts: 14
|
|
| Back to top |
|
 |
|