NetBeans Forums

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

NetBeans 7.1 Swing Application Support discontinued
Goto page Previous  1, 2, 3, ... 14, 15, 16  Next
 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 9:05 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 12/01/2011 09:56 AM, Fabrizio Giudici wrote:
Quote:
On Thu, 01 Dec 2011 09:29:02 +0100, Ramon Casha <address-removed> wrote:

Quote:
Actually I think that project proves my point. That's a LOT of extra
baggage to support the NB Platform.

Again, I'd like to see an enumeration of this extra stuff.

Me too.

Quote:

Quote:
In any case, how easy or difficult
would it be to convert hundreds of existing forms to use this
infrastructure?

Of course it depends on the context. What did you use, specific of
SAF, for the forms?

You can simply copy and paste all your forms into a NetBeans Platform
application. Then create some new windows via a wizard in NetBeans IDE
and say "add(new myPanel())" inside any form in order to add it to your
window.

At the end of that, you have integrated your forms into a window system,
which is something that SAF doesn't have. For most serious applications
you need some kind of window system, so that the forms can be undocked
from the frame and moved around onto different monitors, so that they
can be resized and moved within the frame.

For no coding at all, you get that entire syste,.

Gj
Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 9:45 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot, not  to mention most of the XML files, the glue code to bind everything together, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.


Ramon Casha
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 10:03 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot


In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,


No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together


what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.




I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha



Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 10:43 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha





Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 10:49 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.

The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha







Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 10:58 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha











Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 11:01 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 12/01/2011 11:53 AM, Ramon Casha wrote:
Quote:
Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.

You'll have to convert manually. Find the places where you're using the resource references and rewrite them. Once you've done that, you should be able to open your forms again.

If your application is available in some open source repository, I'd be very happy to help you.

Gj

Quote:
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha













Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 11:13 am    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

Hmm that's 251 forms each with several resource references in this system alone. An automated tool shouldn't be too hard.

PS No it's not in an open source repository.

Ramon Casha


On 1 December 2011 11:56, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:53 AM, Ramon Casha wrote:
Quote:
Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.


You'll have to convert manually. Find the places where you're using the resource references and rewrite them. Once you've done that, you should be able to open your forms again.

If your application is available in some open source repository, I'd be very happy to help you.

Gj

Quote:
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha

















Back to top
Fabrizio Giudici
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 12:26 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On Thu, 01 Dec 2011 12:08:08 +0100, Ramon Casha <address-removed> wrote:

Quote:
Hmm that's 251 forms each with several resource references in this system
alone. An automated tool shouldn't be too hard.

Perhaps the new Inspect & Transform can help? For sure it helps for
replacing stuff in the code; I don't know about the .form stuff.


--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed
http://tidalwave.it - http://fabriziogiudici.it
Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 12:30 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 12/01/2011 12:08 PM, Ramon Casha wrote:
Quote:
Hmm that's 251 forms each with several resource references in this system alone. An automated tool shouldn't be too hard.

This should help:

http://wiki.netbeans.org/NewAndNoteworthyNB71#Inspect_And_Refactor

Gj

Quote:

PS No it's not in an open source repository.

Ramon Casha


On 1 December 2011 11:56, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:53 AM, Ramon Casha wrote:
Quote:
Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.


You'll have to convert manually. Find the places where you're using the resource references and rewrite them. Once you've done that, you should be able to open your forms again.

If your application is available in some open source repository, I'd be very happy to help you.

Gj

Quote:
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha



















Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 12:56 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

Looks like a good place for such a feature. Do you know if the custom hints include support for changing .form files as well as .java files, and if they can do things like read a string (eg, icon name) from a resource file and place it inside the source, or does it have to be a specially-made refactoring hint?

Ramon Casha


On 1 December 2011 13:25, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 12:08 PM, Ramon Casha wrote:
Quote:
Hmm that's 251 forms each with several resource references in this system alone. An automated tool shouldn't be too hard.


This should help:

http://wiki.netbeans.org/NewAndNoteworthyNB71#Inspect_And_Refactor

Gj

Quote:

PS No it's not in an open source repository.

Ramon Casha


On 1 December 2011 11:56, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:53 AM, Ramon Casha wrote:
Quote:
Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.


You'll have to convert manually. Find the places where you're using the resource references and rewrite them. Once you've done that, you should be able to open your forms again.

If your application is available in some open source repository, I'd be very happy to help you.

Gj

Quote:
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha























Back to top
Geertjan Wielenga
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 1:52 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On 12/01/2011 01:51 PM, Ramon Casha wrote:
Quote:
Looks like a good place for such a feature. Do you know if the custom hints include support for changing .form files as well as .java files, and if they can do things like read a string (eg, icon name) from a resource file and place it inside the source, or does it have to be a specially-made refactoring hint?


A problem is that the ResourceMap-related code is found in the read-only blue blocks in your forms and these cannot be refactored via the tool.

Gj
Quote:
Ramon Casha


On 1 December 2011 13:25, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 12:08 PM, Ramon Casha wrote:
Quote:
Hmm that's 251 forms each with several resource references in this system alone. An automated tool shouldn't be too hard.


This should help:

http://wiki.netbeans.org/NewAndNoteworthyNB71#Inspect_And_Refactor

Gj

Quote:

PS No it's not in an open source repository.

Ramon Casha


On 1 December 2011 11:56, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:53 AM, Ramon Casha wrote:
Quote:
Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.


You'll have to convert manually. Find the places where you're using the resource references and rewrite them. Once you've done that, you should be able to open your forms again.

If your application is available in some open source repository, I'd be very happy to help you.

Gj

Quote:
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha

























Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 2:19 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

Which brings us back to square one. Damn.
Ramon Casha


On 1 December 2011 14:47, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 01:51 PM, Ramon Casha wrote:
Quote:
Looks like a good place for such a feature. Do you know if the custom hints include support for changing .form files as well as .java files, and if they can do things like read a string (eg, icon name) from a resource file and place it inside the source, or does it have to be a specially-made refactoring hint?



A problem is that the ResourceMap-related code is found in the read-only blue blocks in your forms and these cannot be refactored via the tool.

Gj
Quote:
Ramon Casha


On 1 December 2011 13:25, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 12:08 PM, Ramon Casha wrote:
Quote:
Hmm that's 251 forms each with several resource references in this system alone. An automated tool shouldn't be too hard.


This should help:

http://wiki.netbeans.org/NewAndNoteworthyNB71#Inspect_And_Refactor

Gj

Quote:

PS No it's not in an open source repository.

Ramon Casha


On 1 December 2011 11:56, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:53 AM, Ramon Casha wrote:
Quote:
Yes precisely. That's why I'm trying to find out if there's a way to either (a) keep SAF support in the NB7.1 editor, or (b) convert existing forms to use "standard Swing" instead of SAF.


You'll have to convert manually. Find the places where you're using the resource references and rewrite them. Once you've done that, you should be able to open your forms again.

If your application is available in some open source repository, I'd be very happy to help you.

Gj

Quote:
Ramon Casha


On 1 December 2011 11:44, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 11:38 AM, Ramon Casha wrote:
Quote:
I'm only concerned with the GUI editor. At present it won't even open the forms any more. I just need some backward compatibility, or a way to migrate my forms away from the SAF without losing the resources or actions.


The resources and actions are an inherent part of SAF. Without SAF, you don't have these features anymore.

Gj

Quote:

Anything else, like the application class, persisting positions etc. I can handle myself.
Ramon Casha


On 1 December 2011 10:58, Geertjan Wielenga <address-removed ([email]address-removed[/email])> wrote:
Quote:
On 12/01/2011 10:39 AM, Ramon Casha wrote:
Quote:
On 1 December 2011 09:56, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
Again, I'd like to see an enumeration of this extra stuff.

Well for a "simple" application to consist of 4 projects is already quite a lot



In a NetBeans Platform application, you could have one single module, if that's what you wanted. You can have as many or as few modules as you like.


Quote:
, not  to mention most of the XML files,



No XML files are needed in NetBeans Platform applications.


Quote:
the glue code to bind everything together



what glue code do you mean exactly?

Quote:
, etc - when all I want is the resource strings and actions in my forms.

Isn't there a simple way to tell NB to "remove" the SAF bits from a form and convert it to "regular" Swing (but not NB platform)? From the .form file there doesn't seem to be a huge difference between them anyway.





I think you'd need to remove the Application class that SAF provides and then write your own main method for starting the application and for persisting the main window's position and size and for cleaning up the application. After that, you'd need to find the Tasks that SAF supports and rewrite them, using SwingWorker directly. Also, you'd need to do a search and replace for all the Action annotations -- not sure though what they should be replaced with.

For the resource strings, you could use the NbBundle class from the NetBeans Platform, just include the Utilities JAR (nothing else) from the NetBeans Platform and then you have the same functionality as SAF provides.

Of course, the simpler route to doing all the rewriting described above is to use the NetBeans Platform, where you get everything described above for free, i.e., for no work at all.

Gj

Quote:


Ramon Casha





























Back to top
Fabrizio Giudici
Posted via mailing list.





PostPosted: Thu Dec 01, 2011 2:42 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

On Thu, 01 Dec 2011 15:13:59 +0100, Ramon Casha <address-removed> wrote:

Quote:
Which brings us back to square one. Damn.

I'm wondering whether by means of the editor APIs is it possible to
temporary remove the markers that demarcate "immutable" text segments,
perform the refactoring, and then put the markers back.


--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed
http://tidalwave.it - http://fabriziogiudici.it
Back to top
rcasha



Joined: 30 Nov 2011
Posts: 35

PostPosted: Thu Dec 01, 2011 3:11 pm    Post subject: NetBeans 7.1 Swing Application Support discontinued Reply with quote

I think it would be easier to provide a one-time "migration wizard" for forms. I don't think it should be too difficult - process the .form file, find all the resources for all items from the resource file (including icon, shortcut, tooltip etc) and convert them to ResourceBundle.getXXX code, keeping the same properties file. However it would need to change the .form file and then invoke whatever code generates the "initComponents" method from the form file.

Ramon Casha


On 1 December 2011 15:37, Fabrizio Giudici <address-removed ([email]address-removed[/email])> wrote:
Quote:
On Thu, 01 Dec 2011 15:13:59 +0100, Ramon Casha <address-removed ([email]address-removed[/email])> wrote:

Quote:
Which brings us back to square one. Damn.


I'm wondering whether by means of the editor APIs is it possible to temporary remove the markers that demarcate "immutable" text segments, perform the refactoring, and then put the markers back.


--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
address-removed ([email]address-removed[/email])
http://tidalwave.it - http://fabriziogiudici.it


Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Goto page Previous  1, 2, 3, ... 14, 15, 16  Next
Page 2 of 16

 
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