[openide-dev] Tip Of The Day behaviour

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[openide-dev] Tip Of The Day behaviour

Gregor Kovač

Hi!

In my module I want to have a Tip Od The Day behaviour.
I'm using the latest dev build and I'm trying this with
OpenIDE-Module-Install specified in my manifest.mf file:
OpenIDE-Module-Install: org/netbeans/modules/fortune/FortuneInstall.class

In FortuneInstall I extend ModuleInstall class and override restored()
method where I show a simple JOptionPane dialog.
The problem is that this dialog appears twice, before NetBeans puts
Turning on modules in it's log file and after that.
Log file looks like:
-------------------------------------------------------------------------------
>Log Session: Monday, August 22, 2005 9:13:42 AM CEST
>System Info:
 Product Version       = NetBeans IDE Dev (Build 200508211800)
 Operating System      = Linux version 2.6.8.1-24mdksmp running on i386
 Java; VM; Vendor      = 1.5.0_04; Java HotSpot(TM) Client VM
1.5.0_04-b05; Sun Microsystems Inc.
 Java Home             = /usr/local/java/jdk150/jre
 System Locale; Encod. = sl_SI (nb); ISO-8859-2
 Home Dir; Current Dir = /home/gregor; /home/gregor/tmp/Projects/Fortune
 IDE Install; User Dir = /home/gregor/Apps/netbeans42/platform6;
/home/gregor/tmp/Projects/Fortune/build/testuserdir
 CLASSPATH             =
/home/gregor/Apps/netbeans42/platform6/lib/boot.jar:/home/gregor/Apps/netbeans42/platform6/lib/org-openide-modules.jar:/home/gregor/Apps/netbeans42/platform6/lib/org-openide-util.jar:/usr/local/java/jdk150/lib/dt.jar:/usr/local/java/jdk150/lib/tools.jar
 Boot & ext classpath  =
/usr/local/java/jdk150/jre/lib/rt.jar:/usr/local/java/jdk150/jre/lib/i18n.jar:/usr/local/java/jdk150/jre/lib/sunrsasign.jar:/usr/local/java/jdk150/jre/lib/jsse.jar:/usr/local/java/jdk150/jre/lib/jce.jar:/usr/local/java/jdk150/jre/lib/charsets.jar:/usr/local/java/jdk150/jre/classes:/usr/local/java/jdk150/jre/lib/ext/sunjce_provider.jar:/usr/local/java/jdk150/jre/lib/ext/sunpkcs11.jar:/usr/local/java/jdk150/jre/lib/ext/dnsns.jar:/usr/local/java/jdk150/jre/lib/ext/looks-1.3.1.jar:/usr/local/java/jdk150/jre/lib/ext/localedata.jar
 Dynamic classpath     =
/home/gregor/Apps/netbeans42/platform6/core/core.jar:/home/gregor/Apps/netbeans42/platform6/core/org-openide-filesystems.jar:/home/gregor/Apps/netbeans42/platform6/core/updater.jar:/home/gregor/Apps/netbeans42/nb4.2/core/org-netbeans-upgrader.jar:/home/gregor/Apps/netbeans42/nb4.2/core/locale/core_nb.jar:/home/gregor/Apps/netbeans42/nb4.2/core/locale/updater_nb.jar:/home/gregor/Apps/netbeans42/ide6/core/org-netbeans-modules-utilities-cli.jar
-------------------------------------------------------------------------------
[WARNING] Warning: the extension
/home/gregor/Apps/netbeans42/enterprise2/modules/ext/jmxri.jar may be
multiply loaded by modules:
[/home/gregor/Apps/netbeans42/enterprise2/modules/org-netbeans-modules-j2ee-sun-appsrv.jar,
/home/gregor/Apps/netbeans42/enterprise2/modules/org-netbeans-modules-j2ee-weblogic9.jar];
see:
http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/classpath.html#class-path
[org.netbeans.core.modules #2] Warning: the module org.netbeans.core uses
org.openide.compat which is deprecated: The classes in this API are all
deprecated and can be replaced by more modern APIs.
[org.netbeans.core.modules #2] Warning: the module
org.netbeans.core.execution uses org.openide.compat which is deprecated:
The classes in this API are all deprecated and can be replaced by more
modern APIs.
[org.netbeans.core.modules #2] Warning: the module
org.netbeans.modules.java uses org.openide.compat which is deprecated: The
classes in this API are all deprecated and can be replaced by more modern
APIs.
[org.netbeans.core.modules #2] Warning: the module
org.netbeans.libs.j2eeeditor uses org.openide.compat which is deprecated:
The classes in this API are all deprecated and can be replaced by more
modern APIs.
[org.netbeans.core.modules #2] Warning: the module
org.netbeans.modules.j2eeserver uses org.openide.compat which is
deprecated: The classes in this API are all deprecated and can be replaced
by more modern APIs.
[org.netbeans.core.modules #2] Warning: the module
org.netbeans.core.windows uses org.openide.compat which is deprecated: The
classes in this API are all deprecated and can be replaced by more modern
APIs.
Module Fortune was restored !!!
Showing as tip of The day = true
Reading fortune from /home/gregor/.fortune
Turning on modules:
       org.openide.util [6.4 200508211800]
       org.openide.modules [6.3 200508211800]
       org.openide.awt [6.5 200508211800]
       org.netbeans.modules.fortune [ 050822]
       .......................
Deploying test module
/home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
Disabling
/home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
Turning off modules:
       org.netbeans.modules.fortune [ 050822]
Enabling
/home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
Installing new module: Fortune
Module Fortune was restored !!!
Showing as tip of The day = true
Reading fortune from /home/gregor/.fortune
Turning on modules:
       org.netbeans.modules.fortune [ 050822]
Done.
BUILD SUCCESSFUL (total time: 49 seconds)


What am I doing wrong ? Maybe the approach is all wrong ? Please help me.

Best regards,
       Kovi

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Reply | Threaded
Open this post in threaded view
|

[openide-dev] Re: Tip Of The Day behaviour

Jesse Glick
[hidden email] wrote:

> In FortuneInstall I extend ModuleInstall class and override restored()
> method where I show a simple JOptionPane dialog.
> The problem is that this dialog appears twice, before NetBeans puts
> Turning on modules in it's log file and after that.
>
> Module Fortune was restored !!!
> Turning on modules:
>        org.netbeans.modules.fortune [ 050822]
>        .......................
> Deploying test module
> /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
> Disabling
> /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
> Turning off modules:
>        org.netbeans.modules.fortune [ 050822]
> Enabling
> /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
> Installing new module: Fortune
> Module Fortune was restored !!!
> Turning on modules:
>        org.netbeans.modules.fortune [ 050822]

Because you're using Reload in Target Platform rather than Run, so it
(1) starts the IDE with your module enabled, (2) reloads your module.
Subsequent Reload actions with the IDE running will just do (2).

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org

Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Tip Of The Day behaviour

Gregor Kovač

Yes, you were right. Using only Run did the job, but .. :)

How do I make my JOptionPane appear after the NetBeans' splashscreen is done, so after the modules have been loaded and the IDE has opened?

Best regards,
        Kovi

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~



Jesse Glick <[hidden email]>
Pošiljatelj: news <[hidden email]>

23.08.2005 12:50
Prosim, odgovorite za dev

       
        Za:        [hidden email]
        kp:        
        Zadeva:        [openide-dev]  Re: Tip Of The Day behaviour



[hidden email] wrote:
> In FortuneInstall I extend ModuleInstall class and override restored()
> method where I show a simple JOptionPane dialog.
> The problem is that this dialog appears twice, before NetBeans puts
> Turning on modules in it's log file and after that.
>
> Module Fortune was restored !!!
> Turning on modules:
>        org.netbeans.modules.fortune [ 050822]
>        .......................
> Deploying test module
> /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
> Disabling
> /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
> Turning off modules:
>        org.netbeans.modules.fortune [ 050822]
> Enabling
> /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar...
> Installing new module: Fortune
> Module Fortune was restored !!!
> Turning on modules:
>        org.netbeans.modules.fortune [ 050822]

Because you're using Reload in Target Platform rather than Run, so it
(1) starts the IDE with your module enabled, (2) reloads your module.
Subsequent Reload actions with the IDE running will just do (2).

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org


Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Tip Of The Day behaviour

Santhosh-8
In reply to this post by Gregor Kovač
This is what i do, and it works perfectly:

public class MyModule extends ModuleInstall{
    public void restored() {
        SwingUtilities.invokeLater(showTips);
    }

    Runnable showTips = new Runnable(){
        public void run(){
            WindowManager.getDefault().getMainWindow().addWindowListener(new WindowAdapter() {
                public void windowOpened(WindowEvent e) {
                    // show tips dialog
                }
            });
        }
    };
}

- santhosh

Aaron Pestel <[hidden email]> wrote ..

> [hidden email] wrote:
>
> > How do I make my JOptionPane appear after the NetBeans' splashscreen
> > is done, so after the modules have been loaded and the IDE has opened?
>
> We start a thread in the restored method that waits until the main
> window is visible and then displays a dialog.  It's probably not the
> best way, but it's worked.
>
> -Aaron
Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Tip Of The Day behaviour

Aaron Pestel
In reply to this post by Gregor Kovač
[hidden email] wrote:

> How do I make my JOptionPane appear after the NetBeans' splashscreen
> is done, so after the modules have been loaded and the IDE has opened?

We start a thread in the restored method that waits until the main
window is visible and then displays a dialog.  It's probably not the
best way, but it's worked.

-Aaron
Reply | Threaded
Open this post in threaded view
|

[openide-dev] Create NBM

Gregor Kovač
In reply to this post by Santhosh-8

Hi!

When I right click my module project and select Create NBM I get following error:

/home/gregor/Apps/netbeans42/harness/common.xml:261: Tracking file /home/gregor/tmp/Projects/Fortune/build/cluster/update_tracking/org-netbeans-modules-fortune.xml cannot be found for module codenamebase org.netbeans.modules.fortune
BUILD FAILED (total time: 0 seconds)

What am I missing ?

Thanks and best regards,
        Kovi

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Reply | Threaded
Open this post in threaded view
|

[openide-dev] Re: Create NBM

Jesse Glick
[hidden email] wrote:
> When I right click my module project and select Create NBM I get
> following error:
>
> /home/gregor/Apps/netbeans42/harness/common.xml:261: Tracking file
> /home/gregor/tmp/Projects/Fortune/build/cluster/update_tracking/org-netbeans-modules-fortune.xml
> cannot be found for module codenamebase org.netbeans.modules.fortune
>
> What am I missing ?

Clearly you're missing the file it is referring to, though I cannot
guess why you would not have that file, unless you overrode the
'netbeans' target and failed to call the normal impl.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org

Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Create NBM

Gregor Kovač

Nope, I didn't write anything in properties, xml, .. files. only manifest.mf, changes Project properties with a help of the dialog, layer.xml and I wrote my java code.

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~



Jesse Glick <[hidden email]>
Pošiljatelj: news <[hidden email]>

24.08.2005 19:22
Prosim, odgovorite za dev

       
        Za:        [hidden email]
        kp:        
        Zadeva:        [openide-dev]  Re: Create NBM



[hidden email] wrote:
> When I right click my module project and select Create NBM I get
> following error:
>
> /home/gregor/Apps/netbeans42/harness/common.xml:261: Tracking file
> /home/gregor/tmp/Projects/Fortune/build/cluster/update_tracking/org-netbeans-modules-fortune.xml
> cannot be found for module codenamebase org.netbeans.modules.fortune
>
> What am I missing ?

Clearly you're missing the file it is referring to, though I cannot
guess why you would not have that file, unless you overrode the
'netbeans' target and failed to call the normal impl.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org


Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Create NBM

Gregor Kovač

I manually added the missing file (PROJECT/build/cluster/update_tracking/org-netbeans-modules-fortune.xml) and the NBM was created.
Then I right clicked module's project and chose Clean. Then the whole PROJECT/Build directory was deleted and NBM could not be created anymore.

Best regards,
        Kovi

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~



[hidden email]

24.08.2005 20:12
Prosim, odgovorite za dev

       
        Za:        [hidden email]
        kp:        
        Zadeva:        Re: [openide-dev]  Re: Create NBM




Nope, I didn't write anything in properties, xml, .. files. only manifest.mf, changes Project properties with a help of the dialog, layer.xml and I wrote my java code.


-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~



Jesse Glick <[hidden email]>
Pošiljatelj: news <[hidden email]>

24.08.2005 19:22
Prosim, odgovorite za dev

       
       Za:        [hidden email]

       kp:        

       Zadeva:        [openide-dev]  Re: Create NBM




[hidden email] wrote:
> When I right click my module project and select Create NBM I get
> following error:
>
> /home/gregor/Apps/netbeans42/harness/common.xml:261: Tracking file
> /home/gregor/tmp/Projects/Fortune/build/cluster/update_tracking/org-netbeans-modules-fortune.xml
> cannot be found for module codenamebase org.netbeans.modules.fortune
>
> What am I missing ?

Clearly you're missing the file it is referring to, though I cannot
guess why you would not have that file, unless you overrode the
'netbeans' target and failed to call the normal impl.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org


Reply | Threaded
Open this post in threaded view
|

[openide-dev] Re: Create NBM

Jesse Glick
[hidden email] wrote:
> I manually added the missing file
> (PROJECT/build/cluster/update_tracking/org-netbeans-modules-fortune.xml)
>  and the NBM was created. Then I right clicked module's project and
> chose Clean. Then the whole PROJECT/Build directory was deleted and
> NBM could not be created anymore.

Don't know what to tell you - works fine for me and everyone else I
know, using <genlist> in the standard 'netbeans' target.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org

Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Create NBM

Gregor Kovač
In reply to this post by Gregor Kovač

Hi!

Now I figured out what was the problem. Not reading the whole output was the issue :)
The output clearly states:
Generating information for Auto Update...
Manifest in jar file /home/gregor/tmp/Projects/Fortune/build/cluster/modules/org-netbeans-modules-fortune.jar does not contain tag OpenIDE-Module-Specification-Version
nbm:
/home/gregor/Apps/netbeans42/harness/common.xml:261: Tracking file /home/gregor/tmp/Projects/Fortune/build/cluster/update_tracking/org-netbeans-modules-fortune.xml cannot be found for module codenamebase org.netbeans.modules.fortune
BUILD FAILED (total time: 0 seconds)

So adding OpenIDE-Module-Specification-Version to my manifest.mf solved the issue.

Best regards,
        Kovi

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~




[hidden email]

24.08.2005 20:12
Prosim, odgovorite za dev

       
        Za:        [hidden email]
        kp:        
        Zadeva:        Re: [openide-dev]  Re: Create NBM




Nope, I didn't write anything in properties, xml, .. files. only manifest.mf, changes Project properties with a help of the dialog, layer.xml and I wrote my java code.


-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
| Gregor Kovac |    [hidden email]   |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  In A World Without Fences Who Needs Gates?  |
|              Experience Linux.               |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~



Jesse Glick <[hidden email]>
Pošiljatelj: news <[hidden email]>

24.08.2005 19:22
Prosim, odgovorite za dev

       
       Za:        [hidden email]

       kp:        

       Zadeva:        [openide-dev]  Re: Create NBM




[hidden email] wrote:
> When I right click my module project and select Create NBM I get
> following error:
>
> /home/gregor/Apps/netbeans42/harness/common.xml:261: Tracking file
> /home/gregor/tmp/Projects/Fortune/build/cluster/update_tracking/org-netbeans-modules-fortune.xml
> cannot be found for module codenamebase org.netbeans.modules.fortune
>
> What am I missing ?

Clearly you're missing the file it is referring to, though I cannot
guess why you would not have that file, unless you overrode the
'netbeans' target and failed to call the normal impl.

-J.

--
[hidden email]  x22801  netbeans.org  ant.apache.org