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 36517 - "runide.sh -open foo.xml" displays foo.xml in a web browser
Summary: "runide.sh -open foo.xml" displays foo.xml in a web browser
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Open File (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-09 18:48 UTC by Jesse Glick
Modified: 2003-12-11 14:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-10-09 18:48:31 UTC
Whereas you would reasonably expect it to open
foo.xml in the NetBeans text editor.

The reason is that XMLDataObject (from xml/core)
has EditCookie, EditorCookie, and ViewCookie, but
no OpenCookie. (Assuming no xml/tree-edit module.)
DefaultOpenFileImpl.openDataObjectByCookie has
this check:

if ((line != -1 && (cookie =
dataObject.getCookie(cookieClass =
EditorCookie.class)) != null)
        || (cookie =
dataObject.getCookie(cookieClass =
OpenCookie.class)) != null
        || (cookie =
dataObject.getCookie(cookieClass =
ViewCookie.class)) != null) {
    return openByCookie(cookie, cookieClass, line);
}

If you do not specify a line number, the only
matching clause is thus for ViewCookie.

It should add a check for EditCookie, probably
after OpenCookie.

(There is no perfect way to find out which cookie
should be preferred, esp. among OpenCookie and
EditCookie; one trick would be to get the node
delegate, and if the default action of the node is
one of OpenAction or EditAction or ViewAction, use
that cookie in preference to the others. Do this
in the event queue.)
Comment 1 Marian Petras 2003-10-10 09:51:55 UTC
Accepted.

Jesse, thank you for the investigation and suggestion how to fix it.
Comment 2 _ pkuzel 2003-10-13 10:07:04 UTC
There is an issue #24429 that calls for explaining effect of Open vs.
Edit actions. Probably text representation vs. visual representation
(XML tree, form, ...).
Comment 3 Marian Petras 2003-10-21 10:27:35 UTC
I will add the check for EditCookie. I won't implement the described
check for the default action of the node delegate until issue #24429
is resolved.
Comment 4 Marian Petras 2003-10-21 13:11:08 UTC
Fixed in the trunk.