Bug 159555 - Netbeans workspaces
Netbeans workspaces
Status: NEW
Product: platform
Classification: Unclassified
Component: -- Other --
6.x
All All
: P3 with 8 votes (vote)
: TBD
Assigned To: issues@platform
issues@platform
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-03 17:57 UTC by _ rsmogura
Modified: 2012-11-28 22:15 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
Full source code as NB project. (112.95 KB, application/octet-stream)
2009-03-03 17:58 UTC, _ rsmogura
Details
The source for Core Workspaces (extract inside NB src tree) (34.47 KB, text/plain)
2009-03-21 17:16 UTC, _ rsmogura
Details
The source for Core Workspaces (extract inside NB src tree) (34.47 KB, application/octet-stream)
2009-03-21 17:16 UTC, _ rsmogura
Details
Changed MainImp from NB 6.5 src (16.55 KB, text/plain)
2009-03-21 17:18 UTC, _ rsmogura
Details
The zipped diff. You need to put netbeans.png (icon) in proper place of sources. (19.01 KB, application/octet-stream)
2009-08-11 11:02 UTC, _ rsmogura
Details
hg diff -g (21.21 KB, application/octet-stream)
2009-08-27 09:46 UTC, _ rsmogura
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ rsmogura 2009-03-03 17:57:36 UTC
The following patch is my idea how to introduce workspaces in Netbeans (as to help introduce solution in 6.7 release I
little changed 

The short description how it works:
1. Instead of launching NB start patch with --nbexec param pointing to netbeans start script (if no specified
netbeans.exe ./netbeans will be used) (Good start script for workspace is needed!)
2. User choose or create workspace.
3. User clicks select.
4. Workspace start netbeans with --userdir pointing to workspace_dir/.workspace & saves selected workspace to recent
(config file: ~/.netbeans/workspace_config).

Everything was written in pure Java6 (with JAXB). Do you think is good idea?

If you think idea is good I can do more work to introduce workspaces but on behalf of 7.0 release.
Comment 1 _ rsmogura 2009-03-03 17:58:23 UTC
Created attachment 77658 [details]
Full source code as NB project.
Comment 2 Stanislav Aubrecht 2009-03-04 07:58:08 UTC
i think it would be better to integrate user dir selection directly into netbeans launcher - if no '--userdir' is given
on command line then the launcher would execute Main class attached to this issue instead of NetBeans main class.

cc'ing netbeans launcher owner
Comment 3 t_h 2009-03-04 09:47:26 UTC
Launcher needs to know user dir to perform operations like look for updates, check whether restart is required etc.
Running alternative main class specified as command line argument or in netbeans.conf is OK, but user dir needs to be
chosen quite early.
Comment 4 tusharvjoshi 2009-03-04 17:05:30 UTC
Hi Radek,

I downloaded and tested the attachment.

I created a JAR distribution and copied the lib folder and the JAR file in NetBeans 6.7M2 bin directory and started the 
JAR and created some workspaces.  I also tested the create new workspace feature with copying current one.  I found 
this utility very useful. 

Thanks for the creative piece of code.  I have voted for this issue.

with regards
Tushar
Comment 5 _ rsmogura 2009-03-04 18:40:57 UTC
Hi!

I'm working on integrating workspaces inside NB launcher. It's possible to do and can only be done in
org.netbeans.MainImpl (or Main, but I prefer MainImpl). It's last place where initial classpath is not set and it seen
that changing user's dir will not affect classes static init or any modules updates.

I have following question:

In MainImpl there is:
// only nbexec.exe puts userdir into netbeans.user
String user = System.getProperty ("netbeans.user");

I haven't seen that this property is setted in .exe. Do you know how this property works or can I ignore it?

Comment 6 _ rsmogura 2009-03-05 07:59:39 UTC
NB start scripts always sets --userdir and pass it to Launcher :(
Comment 7 t_h 2009-03-11 16:10:08 UTC
As I already wrote launcher also starts autoupdate so it needs to know userdir. It would be necessary to start your Main
class early to select userdir and then return control to launcher (so it can properly run autoupdate if necessary etc.)
Comment 8 _ rsmogura 2009-03-21 17:14:40 UTC
I extracted workspace code to separate module, and added support of workspaces to org.netbeans.MainImpl.

The workspaces works as follow:
1. On first start (no ~/.netbeans/workspcace_config.xml file) or starting NB with --workspace the Workspace window will
open.
2. User can choose workspace or select don't show dialog in future.

I hope extracted code can be enough useful to use it in different workspace related modules.

I include changed MainImpl & source code for basic workspace (core.workspaces). I successfully added this module to
nb6.5-src tree (need to add Workspace dependency to Bootstrap).
Comment 9 _ rsmogura 2009-03-21 17:16:39 UTC
Created attachment 78575 [details]
The source for Core Workspaces (extract inside NB src tree)
Comment 10 _ rsmogura 2009-03-21 17:16:58 UTC
Created attachment 78576 [details]
The source for Core Workspaces (extract inside NB src tree)
Comment 11 _ rsmogura 2009-03-21 17:18:07 UTC
Created attachment 78577 [details]
Changed MainImp from NB 6.5 src
Comment 12 tusharvjoshi 2009-08-05 03:39:29 UTC
Can this method be included in the main NetBeans distribution for version 6.8?  I can help by more testing of the
feature.  Last time I tested the files attached and they were working for me.
Comment 13 _ rsmogura 2009-08-05 13:47:58 UTC
It not only could but it should be included in 6.8. Today I will try to get Netbeans hg repository (bugged & long work)
and I will try to integrate it fast with new 6.8 sources. I found a simple bug, that makes Workspaces don't works as I
wanted to work. Tomorrow everything should be made & diff files committed.
Comment 14 _ rsmogura 2009-08-11 11:01:20 UTC
In the moment I'll post the ziped HG diff from Netbeans trunk. I would like to say sorry for a late in this, but I had
many problems with HG (transmission problems, compress problem...). It taken many days to download sources. 
Comment 15 _ rsmogura 2009-08-11 11:02:31 UTC
Created attachment 86086 [details]
The zipped diff. You need to put netbeans.png (icon) in proper place of sources.
Comment 16 Jiri Kovalsky 2009-08-21 14:37:41 UTC
Tomasi, what do you think about recent Radoslaw's contribution (module & updated org.netbeans.MainImpl)? Thanks for your
time!
Comment 17 _ rsmogura 2009-08-27 09:46:10 UTC
Created attachment 86722 [details]
hg diff -g
Comment 18 _ rsmogura 2009-08-27 09:48:34 UTC
Hi,

I've putted new diff, in old was a bug in source preventing running wokrspaces (how it gone there, I don't know).
Comment 19 Antonin Nebuzelsky 2009-09-08 13:24:44 UTC
I don't like the idea of introducing an extra UI which will be presented to all users at every start of NetBeans at all.

A feature like this may be useful to a certain amount of people. There is however an easy workaround already. Any user
can create a set of scripts or desktop icon shortcuts to run NetBeans with different values of "--userdir" parameter.
The user can also easily migrate settings from one userdir to another using the Export/Import functionality in Options
dialog.

Other users who don't want to start a different instance of the IDE for different sets of projects can use the Project
Groups available via File / Project Group submenu.

Also, because the userdir path is intensively used by the launcher, not only to pass it as a parameter to the Java code
but in more other ways, I don't recommend to do any hacky tricks changing it in the middle of the launcher execution.

Speaking about this particular approach, the cleanest solution in my opinion would be to create a separate program which
would be invoked by the user instead of invoking NetBeans launcher, the separate program would take care of the userdir
management and then it would start the right version of NetBeans launcher with the right userdir parameter. However, I
don't see a point in bundling this extra wrapper program with NetBeans.

I am open to a discussion.
Comment 20 _ rsmogura 2009-09-08 20:11:21 UTC
Hi.

I don't know for how many peoples this feature will be useful. Personally I worked in same time on 3 project sets, each
one differently configured. 

I want to emphasize, that workspaces concept goes much more far beyond project groups & import / export options (however
this functionality is similar). Currently we can only configure formatting options per project. You need sometimes to
configure, databases, libraries & modules just for specified solutions. You can't say user can create shortcrust and
scripts. I'm user too and I don't want to create shortcrust (maybe I don't know how to make it, I don't have access
privileges or I'm new user & I don't know --userdir), I don't want to start IDE just to import settings & restart. I
don't want each time remember to import / export configuration and when I forgot about exporting, I can loose some
config work. This what I want is... to do one click & make everything :). As real life isn't so much beautyfull we need
to simplicity this what we can.

Other users don't need to start different instances, and can use project groups still. If they want they can check
"Don't show this dialogue again" & will not see workspaces any more.

In first approach I done it as external program. My reasons to put it in build was:
1) The comment for this bug,
2) Start scripts do realy much more & are more complicated then MainImpl.java
3) Start scripts is splitted in exe & sh script, witch have some special tratment for other systems
4) Few other, but I don't remember...

I think the one thing to discuss is how to implement it. I wanted workspaces in Netbeans long long long time. I realized
this year how to make it. In simple way. This solution is relay, --userdir solutions is persistent for module developers
& Netbeans developers too.

Thanks for all opinions & sugestions
P.S.

In personal opinion I can't predict for how many user workspaces will be useful (I don't know how many users uses PHP,
C++ in Netbeans too :) ). This what I know, if I do something it's not enough too do it, but I need to present it.
Please bear in mind that Users of Netbeans are form skilled from new to Java up to developers that can write in Notepad.
Comment 21 _ rsmogura 2009-09-08 20:20:57 UTC
P.P.S

The concept of "workspacing" Netbeans isn't new. It's many solutions, like shared libraries (useful in CVS sharing too),
formation per projects, import/export of configuration, project groups & relative project references, so "workspacing"
is needed.

We don't need afraid about changing userdir on the fly & treat Launcher as something mystic never-to-change black box :)

Once again thanks for discussion & interesting in this not-new idea.
Comment 22 Jesse Glick 2010-05-06 22:02:52 UTC
(In reply to comment #20)
> Currently we can only configure formatting
> options per project. You need sometimes to
> configure, databases, libraries & modules just for specified solutions.

In general we do not encourage switching the user directory (except for specialized purposes such as demos). Would rather work on particular things you think _currently_ need to be switched at the global level to work effectively with particular projects:

1. Databases I don't know much about, but I would presume it would be straightforward for the NB DB support to associate some database definitions with projects rather than global settings. Or you can just ignore definitions you are not actively using.

2. Libraries can already be associated with projects or sets of projects. (And this is reflected in the Ant build.)

3. You should not need to disable a set of modules just to work with projects which do not happen to make use of them.


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