07.22.08

XML Hyperlink Project Update

Posted in DTD, NetBeans, Personal, XML, nb-61 at 5:10 pm by Varun

Recently,

I blogged about How to Hyperlink XML Layer, with the bit update on my project as well. So, DTD file, if exists, got opened when I click on ARGUMENT, opening TAG Token Id’s, like <filesystem><file name=”"></file></filesystem>

See the italics and bold faced text, they are hyperlinked. So, clicking them I am directed to the apt DTD file within the IDE. Earlier what happened, when I clicked the links again, file which is actually a TopComponent opened as Editor Window, was not requesting focus.

Navigation got smarter

However, now its working…If I click umpteen times, I will be directed to the doc same no. of times. You can get to see this feature in the Revamped Hyperlink Navigation Tutorial, based on a tutorial. I have developed a plugin for that for the time being, though expect the plugin to get updated soon.

NetBeans API’s (Lexer API) rocks!

Enjoy Technology…Enjoy NetBeans

07.17.08

taT | Reload Debugging (debug-fix-nb)

Posted in NetBeans, Tips|Tricks, nb-61 at 11:18 pm by Varun

Just few days back, I talked about that its rather a good practice to debug, not to run! While following that, I discovered another thing, which was there for quite some time, but I didn’t notice it, as I didn’t debug :P

    <target name="debug-fix-nb" if="netbeans.home"
depends="init,-pre-debug-fix,compile-single">
        <nbjpdareload>
            <fileset includes="${fix.class}*.class"
dir="${build.classes.dir}"/>
        </nbjpdareload>
    </target>

You must be thinking, what’s “debug-fix-nb”, its actually an Ant target, ran while we apply Code fixes during Debugging! Shocking, Indeed! I felt the same way, actually while building a module to run it in Target Platform, I realized I could reload it as well, without building whole module again.

Goto Installation Directory, and look for harness/common.xml
It contains many Ant targets, including the above…

Similar functionality exists, when you want to reload while debugging, HOW? Here lies the trick, while I was debugging a Module in Target Platform, I realized an error just after a break-point, so thought of fixing code, just before error could be detected.

Then, I came across an Icon in Toolbar, whose tool-tip suggested its used for applying code fixes. So, I made changes wherever needed, and clicked on that Icon, it reloaded that class and the debugging continued, from same point!

Now, that’s what I call a utility. Amazing, never thought debugging could be fun ;)

enJoy Technology…

07.10.08

How To Hyperlink XML Layer (Part 4)

Posted in DTD, NetBeans, Personal, XML, nb-61 at 12:41 pm by Varun

Hey,

As you know, I have been running a blog series on “Playing with XML Layer”. I have written 3 parts till now, that were tips and Tricks…

Its time for Part 4, though this isn’t any tips and Tricks, as its an abstract tutorial to hyperlink XML Layer, which conforms to any Document-Type-Definition.

Already there exists a tutorial to hyperlink the value contained within the HREF attribute (HTML files) in Platform Tutorials.

At the bottom of that Tutorial, they have mentioned what could be the Next Steps to follow, basically Work Ahead!

Working with JSP and XML documents. (Same principle as above.)

Implementation

As you can see they have mentioned in one of the points, that XML documents can follow the same principle. So, as part of my internship project, I worked to hyperlink the ELEMENT names and their ATTLIST attributes.

For instance;

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
<filesystem>
    <folder name="Actions">
        <folder name="Tools">
            <file name="org-nvarun-tat-SayCheez.instance"/>
        </folder>
    </folder>
    <!--Remember SayCheez in earlier parts,
        this is just a snippet of that XML Layer-->
</filesystem>

Now, I made use of XMLTokenId, as the reference tutorial made use of HTMLTokenId, and did the implementation based on XMLTokenId constants.

Note-
The required HyperlinkProvider instance will be registered under text/xml, so any XML file with that MIME Type will hyperlink as suggested.

Features

  • When you click on filesystem/folder/file, a Dialog Box prompts the user with a message that you have clicked right hyperlink, IDE opens the DTD file represented by PUBLIC_ID.
  • For that to happen, click on PUBLIC_ID first to let the IDE know which DTD, does the XML is specified by, then PUBLIC_ID -> URI mapping takes place (redesigning, refer to XML Code Completion support).
  • Also, it extracts the DTD file clicking the SYSTEM_ID (if present is hyperlinked) conforms to and hyperlinks it, clicking it will launch the Browser with the identified URL.

Work Ahead

When you click on filesystem/folder/file, locate the DTD file and open in NetBeans IDE, with specific caret position. As you know, Angad has already created a module for DTD-intra-hyperlinking! So, you would be able to enjoy both functionalities, similar to the one existing in IntelliJ IDEA!

Updated on July 14, 2008

sTay Tuned for More…

07.01.08

Article | NetBeans Reloaded

Posted in NetBeans, Platform, nb-60, nb-61 at 6:57 pm by Varun

Hi,

What happens when you developed a module, and test it by Install/Reload in Target Platform? New instance of NetBeans Target Platform starts running with your module installed in it.

Though, the statusbar in the IDE, shows a name to the left of the progress bar, which is something like org.netbeans.modules.something (reload)

Ever thought, why its reload, not install? Think after you read this blog.

Discovery

Why does every discovery occurs by accident? Yes, another accident lead to a discovery. When this instance is running, you could do changes in your code, and Run F6, this reloads the already running instance. So, no need to stop the build, and rebuild to run! Make changes, whether drastic OR not, it would reload, saving a lot of time.

Accident

I was testing one of my recently contributed tutorials at Community Docs, and while making some changes, I forgot there’s already an instance that’s running, and I accidentally Press F6, thinking that there would be 2 Target Platform’s running, apart from Development Platform, where I made changes. To my surprise, there was only single Target Platform running, which just got reloaded within few seconds. Isn’t it cool?

Your Thoughts

So, did you knew about it, you don’t? Do comment if you find it useful! If you have some tricks to share, do join Community Docs, right now and start contributing!

eNjoy Technology…

06.30.08

Article | Auto-Format in NetBeans

Posted in Java, NetBeans, Others, nb-61 at 11:50 pm by Varun

Hey,

Today, I started off working with JSF Framework, executed a series of well-described, neat tutorials which helped me go through the initial phase easily. Now, I am confident in doing what these tutorials explained.

Anyways, I came across a shortcut key, its Alt+Shift+F, used for Formatting the code present in the editor. Today, I used this key combo, in JSP using JSF Framework and Java Classes, as well.

Remember, how shortcut key’s are registered? This means this action is registered in the XML Layer of some module, as O-S-F.shadow! Anyways, that’s a different issue. Well, seriously I feel why the hell I came across this key, so late…It could have helped me save a lot of time, in many Java Projects I made using NetBeans!

eNjoy Technology…

« Older entries