This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 30195 - NPE at ExplorerOperator.selectPageFilesystems()
Summary: NPE at ExplorerOperator.selectPageFilesystems()
Status: CLOSED FIXED
Alias: None
Product: qa
Classification: Unclassified
Component: Jellytools (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P1 blocker (vote)
Assignee: issues@qa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-17 09:45 UTC by Jan Becicka
Modified: 2003-02-10 14:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE (3.29 KB, text/plain)
2003-01-17 09:48 UTC, Jan Becicka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2003-01-17 09:45:26 UTC
today's build, today's jemmy, test4u

ExplorerOperator explorerOperator = new 
ExplorerOperator();
explorerOperator.selectPageFilesystems();

throws NPE.
Comment 1 Jan Becicka 2003-01-17 09:48:36 UTC
Created attachment 8604 [details]
NPE
Comment 2 Jiri Skrivanek 2003-01-17 10:04:49 UTC
It is cause by UI change in IDE. Docked internal frames don't have
drag texture on title bar #27033. I will investigate it later but
probably it will has to be fixed in jemmy.
Comment 3 Jiri Skrivanek 2003-01-17 13:28:19 UTC
Fixed in jellytools version 2.0.42.
Added class NbInternalFrameDriver which extends
DefaultInternalFrameDriver because NetBeans IDE defines its own title
pane for JInternalFrames
(org.netbeans.core.windows.frames.NbInternalFrameUI.NbTitlePane).
It is not descendant of BasicInternalFrameTitlePane that's why jemmy's
JInternalFrameOperator doesn't find it. We have to find that component
ourselves and override method activate.
This driver has to be registered as the one of first things in a test.
Registration was added to JellyTestCase, NbFrameOperator and
TopComponentOperator.
Comment 4 Alexandre Iline 2003-01-17 23:09:36 UTC
I think the fix is acceptable.

Let's think, though.

JInternalFrame does not have a functionality to get a title pane, 
so,
from Jemmy point of view, this is, obviously, related to 
"custom components" area.

Having that in mind we need to create an inheritor of
JInternalFrameOperator and override findTitlePane() method - 
that's would be the most appropriate fix.

If we use your approach, it is necessary to do next thing:
create a DefaultInternalFrameDriver.getTitleOperator() method
which would return an instance of BasicInternalFrameTitlePane.
NbInternalFrameDriver.getTitleOperator() would just return 
NbTitlePane.

But still, JInternalFrameOperator.findTitlePane() does not work, 
and thus, JInternalFrameOperator.getTitleOperator() does not work
either.

So, I think, first approach (inheriting of JInternaFrameOperator) 
is better.

Do you agree?

Comment 5 Jiri Skrivanek 2003-01-20 09:22:33 UTC
I don't want to make users to change their tests. That would be true
if we create org.netbeans.jellytools.JInternalFrameOperator extends
org.netbeans.jemmy.operators.JInternalFrameOperator. Only chance is to
copy class JInternalFrameOperator to jellytools repository under jemmy
package.
I asked integrator of IDE change, if it is possible to extend
BasicInternalFrameTitlePane instead of JComponent. I that case we have
to do nothing.
I also thought about change in Jemmy. Instead of line 

   return(comp instanceof BasicInternalFrameTitlePane);

there would be

   return  comp.getClass().getName().
                  endsWith("TitlePane"));
Comment 6 Jan Becicka 2003-01-21 09:32:15 UTC
Verified
Comment 7 Alexandre Iline 2003-01-21 23:04:48 UTC
All right, I now the solution.

There is the whole set of classes which hide
real implementation of user action reprodusing:
drivers. Why don't we extend them to hide
the discussed kind of logic?

Speeking technically, here we might use one more driver type:
public interface InternalFrameDriver {
        public Component getTitlePane(Operator 
internalFrameOperator);
}

Having that, we can simply register new operator: 
NbInternalFrameDriver 
with one method.

This driver type will, of course, be used by JInternalFrameOperator
to get a title pane.

Please, let me know if you do not see anything wrong with this.

Comment 8 Jiri Skrivanek 2003-02-10 14:05:49 UTC
Closing this issue. In jemmy was added InternalFrameDriver to be able
to override getTitlePane() method. In IDE title pane was extended from
BasicInternalFrameTitle, so we don't need any workaround in jellytools
no more.