FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

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

Developing SDI applications in Netbeans

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



Joined: 30 Oct 2009
Posts: 2

PostPosted: Fri Oct 30, 2009 4:04 pm    Post subject: Developing SDI applications in Netbeans Reply with quote

Hello. I'm starting work on a new project, and would like to use Netbeans as the RCP framework. The problem is, our customer prefers a single document interface for our application, which Netbeans no longer officially supports. My question is, has anyone out there recently developed an SDI application using the Netbeans RCP framework, and if so, how did you re-enable or replace the now-missing SDI functionality?
Thanks,
Ed
Back to top
View user's profile Send private message
Quintin Beukes
Posted via mailing list.





PostPosted: Fri Oct 30, 2009 6:09 pm    Post subject: Developing SDI applications in Netbeans Reply with quote

I don't think it supports it specifically. Though have a look at these. Might help:

http://blogs.sun.com/geertjan/entry/limiting_the_netbeans_window_system
http://wiki.netbeans.org/DevFaqReplaceWindowSystem
http://wiki.netbeans.org/NetBeansDeveloperFAQ#section-NetBeansDeveloperFAQ-WindowSystem
Quintin Beukes


On Fri, Oct 30, 2009 at 6:05 PM, edbeaty <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hello.  I'm starting work on a new project, and would like to use Netbeans as the RCP framework. The problem is, our customer prefers a single document interface for our application, which Netbeans no longer officially supports.  My question is, has anyone out there recently developed an SDI application using the Netbeans RCP framework, and if so, how did you re-enable or replace the now-missing SDI functionality?

Thanks,

Ed




Back to top
tomwheeler



Joined: 03 Sep 2008
Posts: 564

PostPosted: Fri Oct 30, 2009 6:18 pm    Post subject: Developing SDI applications in Netbeans Reply with quote

Support for it was removed a few releases ago, so it's not built in.
That said, it's possible to replace NetBeans' own Window System with
your own implementation that has the behavior you want. I wrote an
FAQ entry about it:

http://wiki.netbeans.org/DevFaqReplaceWindowSystem

The part about DummyWindowManager will probably be of special interest
to you since it opens each TopComponent in its own window.

Feel free to update the FAQ based on what you learn.

On Fri, Oct 30, 2009 at 11:05 AM, edbeaty <address-removed> wrote:
Quote:
Hello.
Back to top
View user's profile Send private message
Gregg Wonderly
Posted via mailing list.





PostPosted: Fri Oct 30, 2009 6:31 pm    Post subject: Developing SDI applications in Netbeans Reply with quote

Tom Wheeler wrote:
Quote:
Support for it was removed a few releases ago, so it's not built in.
That said, it's possible to replace NetBeans' own Window System with
your own implementation that has the behavior you want. I wrote an
FAQ entry about it:

http://wiki.netbeans.org/DevFaqReplaceWindowSystem

The part about DummyWindowManager will probably be of special interest
to you since it opens each TopComponent in its own window.

Feel free to update the FAQ based on what you learn.

Tom, is there an @ServiceProvider annotation use that will do the same thing as
the #- prefix to remove the old one? Does the position value take care of this
if you know the other position value, or is there a way to make sure yours is
the one used if you use the annotation?

Gregg Wonderly
Back to top
tomwheeler



Joined: 03 Sep 2008
Posts: 564

PostPosted: Fri Oct 30, 2009 6:53 pm    Post subject: Developing SDI applications in Netbeans Reply with quote

I'm just now switching to the 6.7.1 platform and so I haven't yet used
the annotations much. That said, the @ServiceProvider annotation's
javadoc:

http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/lookup/ServiceProvider.html

indicates that you could set the position and/or specify a list of
implementations which your own implementation supersedes. If you
manage to get it working, it would be great if you could put a quick
example in this FAQ entry:

http://wiki.netbeans.org/DevFaqLookupHowToOverride

On Fri, Oct 30, 2009 at 1:30 PM, Gregg Wonderly <address-removed> wrote:
Quote:
Tom, is there an @ServiceProvider annotation use that will do the same thing
as the #- prefix to remove the old one?
Back to top
View user's profile Send private message
Jesse Glick
Posted via mailing list.





PostPosted: Fri Oct 30, 2009 11:14 pm    Post subject: Re: Developing SDI applications in Netbeans Reply with quote

Gregg Wonderly wrote:
Quote:
is there an @ServiceProvider annotation use that will do the same
thing as the #- prefix to remove the old one? Does the position value
take care of this if you know the other position value, or is there a
way to make sure yours is the one used if you use the annotation?

You can do either. Since the standard decl is (*)

package org.netbeans.core.windows;
@ServiceProvider(service=WindowManager.class)
public class WindowManagerImpl extends WindowManager {...}

and any declared position trumps no declared position, you could write

@ServiceProvider(service=WindowManager.class, position=/*RIPJSB*/1750)
public class MyWindowManager extends WindowManager {...}

to make yours be loaded preferentially (WM.getDefault just uses the first instance it finds); or

@ServiceProvider(service=WindowManager.class, supersedes="org.netbeans.core.windows.WindowManagerImpl")
public class MyWindowManager extends WindowManager {...}

to hide the original and thus have the same effect.

(*) You don't need source code or even binaries to find this out; just peek at the summary produced by dev builds:

http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/build/generated/services.txt
Back to top
edbeaty



Joined: 30 Oct 2009
Posts: 2

PostPosted: Mon Nov 02, 2009 5:58 pm    Post subject: Reply with quote

Thanks for the quick help. I tried the annotation method, but I get a ClassCastException. I added the DummyWindowManager mentioned in the Wiki to the NetBeans Paint demo using the annotation:

Code:
@ServiceProvider(service=WindowManager.class, supersedes="org.netbeans.core.windows.WindowManagerImpl")
public final class DummyWindowManager extends WindowManager {
...
}


but when I run it, I get:

Code:

java.lang.ClassCastException: org.netbeans.paint.DummyWindowManager cannot be cast to org.netbeans.core.windows.WindowManagerImpl
   at org.netbeans.core.windows.WindowManagerImpl.getInstance(WindowManagerImpl.java:131)
   at org.netbeans.core.windows.PersistenceHandler.load(PersistenceHandler.java:141)
   at org.netbeans.core.windows.WindowSystemImpl.load(WindowSystemImpl.java:77)
[catch] at org.netbeans.core.NonGui$2.run(NonGui.java:184)


Since WindowManagerImpl is final, I don't see a way around this. Any ideas?
Thanks,
Ed
Back to top
View user's profile Send private message
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