Friday Jan 09, 2009

and the Look&Feel of the NB IDE will be ...

As you probably noticed if you ever run the NetBeans IDE on different operating systems there is default look and feel for every OS. It is even more complicated... There is a look&feel assigned to every OS+JDK +WM combination. Does it look complicated? Or don't like the default?
You should read Look and Feels in NetBeans IDE where it's explained by Petr Chytil. Thanks to Adam Bien for screenshots.

Tuesday Nov 25, 2008

Project Groups screencast

Many NetBeans IDE users have different areas of work that they use the IDE for. For example, they might have some Java EE projects for a web application for their employer, but work on some personal Java SE projects in the evening. NetBeans lets you open and close projects at any time, but if there are a lot of projects in each group this may be cumbersome and error-prone. Switching user directories is an unreasonable workaround to this issue. Therefore, a number of users have requested that the IDE provide some facility for them to group projects together to make them easier to open and close as a unit.




Thursday Nov 13, 2008

Report exceptions in an easy way

Reporting bugs can be quite frustrating and boring process. The process works generally in following way. Go to a bug tracking system that usually has a web interface. Then you have to log in (isn't it painful already?). Then you report your problem/bug/issue. You can also attach a stack traces, thread dumps or screenshots to the bug report. And then somebody evaluates it and closes it as duplicate of another bug that somebody reported earlier. Isn't there an easier way how to report bugs?

Of course, there is a better and easier way. At least in NetBeans IDE(NB). The NB shows you Exception dialog whenever a exception appears in the software. If you will look carefully at the dialog you will notice Review and Report Problem button.



When you click the Review and Report Problem button then can report the exception into our database. You can provide additional comments that can help to reproduce or identify the problem. If you wanna be contacted later or if you are interested what will happen with the report then you can provide your user/password to netbeans.org.



If you are wondering what data are sent from your computer you can look at them. Just press View Data button. You'll see log of uigestures collector.

Your report will be uploaded to our server, entered into database(see the message). It will be evaluated if it is a duplicate of existing report or new report. New reports that fulfill the criteria will be then entered to Issuezilla as new bug reports.



More details about the exception reporter tool:

Wednesday Nov 05, 2008

Gimme test results in html

When you are developing a code in NetBeans repository then you should provide a tests that prove that your code works, of course. When you run your tests then it will generate the test result for you. But these test results are in XML which is not as readable as you'd expect.
There is a way how to convert the XML results to HTML. You can use junitreport task in your ant script. And to make it even more convenient for developers and testers we added new target test-generate-html to the common.xml that is used in all netbeans projects.
You should run this target after your tests. It will provide you more readable results. The html results are also generated after commit validation tests (commit-validation target) in NB build.

Friday Oct 03, 2008

Compile On Save - All you ever wanted to know about

My college Jirka Prox wrote a nice summarization of the new Compile on Save feature of NetBeans 6.5. It describes what is it, what it is not and also the most common examples when the CoS feature isn't for you.

If you are confused about the CoS or maybe not sure about the right behavior you should read it. This is wiki therefore it describes the most current behavior because the feature was/is evolving.

Tuesday Sep 30, 2008

Setting up small freeform project correctly - what are all these settings for?

What is freeform?

Freeform is a NetBeans project type that allows you to use Ant build script supplied with your sources. Typical usecase can be that you have already some sources, you are developing them "in you own way" (other IDE, or using VI, or...) and you want to work on them using NetBeans. Other common usecase for free-form can be that you check out some opensource project and you want to work on it in NetBeans IDE.
Let's take a look at some example. For a simple project, let's assume you have structure like this:
  • my_project
    • src
    • - contains Java sources
    • build
    • - this is where you build script puts \*.class files
    • lib
    • - some JAR libraries you depend on
    • javadoc
    • - here is generated output from javadoc target in build.xml
    • tests
    • - tests for your sources
    • other
    • - misc stuff
    • >build.xml
    • - you own build script
Of course this is just en example structure, and let's say ideal ;-). So if you want to set up this project as NetBeans project, you have to do something like this:
  1. Invoke New project wizard (File | New project | Java > Java Free-form project)
  2. Name and location panel
    • Location
    • - here you specify general location of your project. In this example you would browse for my_project folder
    • Build script
    • - if it's found under the project's folder, field gets populated automatically. Otherwise browse for your build.xml
    • Project name
    • - gets auto-populated from build.xml, feel free to change it if you wish
    • Project folder
    • - this is where your NetBeans project metadata will be stored. You will later open it in IDE using this project folder. It is possible to place it to other location than location of your project folder (my_project)
  3. Build and Run Actions panel
    • Here you just bind Ant targets to IDE actions. IDE tries to guess some of them. Modify as you wish.
  4. Source Packages Folders panel
    • Add here src folder as Source packages and tests as Test packages.
    • Hit Includes/Excludes button, it brings up dialog where you can setup what do you want to have in you source root visible. If you have e.g. HTML files mixed together with Java files in package folders, you may wish to exclude those HTML files, so that IDE's projects view won't display them.
  5. Java Sources panel
    • You need to set up project dependencies here. If you on know which JAR libraries your project depends, you can add them right now. Usually they are placed in lib folder, or similar, and are distributed together with project. Ideal case. If you have no idea, leave this empty, you can set up this later using Project properties dialog.
    • In the same way you set up dependencies for sources, set up also for tests.
  6. Project output panel
    • Here comes the tricky part. You need to bind here source folders you added on Source Packages Folders panel with binaries (JAR or folder with \*.class files), that are produced from those sources. However, currently you don't have probably any, because you have only sources and you did not build anything. So for now invoke Finish, you'll get back to this later.
  7. Busting error badges
    • If you haven't set up all dependencies correctly, you see probably a lot of error badges on your project file. The only way how to get rid of them is to add libraries on Java source classpath (this is acessible from project properies). The correct way how to do this is to take a look into build.xml file to examine classpath. Another approach is to look at import statements in \*.java files, and try to match them with content of lib folder (and add those matching JARs to Java source classpath). After a few iterations of adding library JAR files to Java source classpath should be red error badges gone.
  8. Binding project output
    • Invoke Build. If you set up target binding correctly, build action should be invoked on Ant script and should produce binaries. In our sample case are \*.class files compiled under build folder. Go to project properties, and set build folder as output for your sourceroot. This is an important thing, if you are going to use debugging or you want some other project depend on your project.
      Now your project should be set up correctly. Note that this is not any generic manual how to set up every existing project as NetBeans free-form project. But it should get some insight of possible workflow during setting thing up for newbies :)

Formatting settings per project

There is new feature in NetBeans 6.5 that you can set up formatting settings per project. In previous releases there used to be only one formatting setting for whole IDE. Now you can work on several projects with different formatting. Or even better, you can share the settings with the whole team because it is saved in the nbproject/project.properties file of your project. This file is versioned by your version control system as it is part of the project.

If you want to set the "setting for specific project":
  • Open Project properties
  • Click Formating category
  • Select the "Use project specific options" radio button
  • Don't forget to click OK when closing the dialog to save the settings ;)
setting for specific project


Samle of properties that appears in your project.properties
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=4
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=80
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.classDeclBracePlacement=NEW_LINE
auxiliary.org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs=true
Note: this is available from NetBeans 6.5!

Wednesday Sep 24, 2008

Back to default layout of windows

It can happen that you changed the layout of windows in NetBeans IDE in a way that you are not able to use it anymore. Every change makes it even worse. Or maybe your layout just screw up for unknown reason (yes, bugs happen).
Then there is an action in Reset Windows in Window menu. It will set the layout of all windows to default positions. The IDE will look as you started it for the first time.

Thursday Aug 14, 2008

Don't you like Main Project? You Don't have to use it.

There was big conceptual change with the Main project approach in NetBeans IDE in recent builds. In short - when you haven't set up the main project then all the actions behaves as contextual.



There is nice document summarizing all the changes from user point view - ui spec. There are use cases when the main project concept has sense. For example you have some libraries and a project that uses them. In this case you always want to run the main project when you hit the Run(F6) button. But in other cases there is no need for a main project. Then Run(F6) runs the selected file or project. The main project is highlighted by bold name in the IDE.

With Main project No Main Project set up
Build Main Project Build Project
Clean and Build Main Project Clean and Build Project
Batch Build Main Project Batch Build Project
Run Main Project Run Project
Debug Main Project Debug Project


Another interesting improvement is that the Set As Main Project option will be disable (even not present for some projects in New Project wizard). By default it will be off for PHP Project, Ruby Project, Rails Project, Java Library (no checkbox at all), EJB project (typically exists in the context of an EAR application), UML Project (no checkbox at all). On for all other projects where it is present.

Thursday Aug 07, 2008

Short Look&Feel Switches for NetBeans

NetBeans as any other java application can be run in various look and feels. Generally you can switch the look&feel by adding the jar with look&feel classes to classpath of your application and specifying the required look and feel with --laf command line switch.
  • netbeans --cp:p C:\\looks-1.2.2.jar --laf com.jgoodies.plaf.plastic.PlasticXPLookAndFeel
For you convenience there are new "shortcuts" for switching the well known look and feels.
  • Metal
  • Nimbus
  • GTK
  • Windows
  • Aqua
How it works? Use "netbeans --laf Metal" and you are 10 years back ;)
Please, be aware that not all the switches works on all platforms. The Metal and Nimbus will work on all operating systems however Nimbus is part of jdk 6. Aqua works only on Macs. GTK on unixes. And Windows is obvious, isn't it?.

Wanna know more?

Tuesday Jul 29, 2008

NetBeans' Mercurial Repositories

The list of all NetBeans repositories can be found at http://hg.netbeans.org/. There is lot of repositories (clones) that are used for different purposes by different teams.
The most important repositories are
  • main-golden - a copy of main synchronized only after a successful continuous build. Thus it is always "safe" to pull from. If a build is broken, it will contain only older changes.
  • main - modules in the standard distribution and stable AU, build infrastructure, tests and test infrastructure, installer


There are also team repositories used by netbeans teams (e.g. core-main) and also main/contrib. The common developer work flow looks like
  1. clone the main (or main-golden) [of course, you have to do it just first time, then you are using just pull - http://wiki.netbeans.org/HgHowTos]
  2. fix bug / add new feature
  3. commit it - don't forget about the right commit message
  4. push to main
  5. when the main build pass all the change sets are pushed into the main-golden
  6. production build from main is created and published
Interested in more details?

Friday Jul 11, 2008

Automatic linking between Hg and Issuezilla

There always has been effort to link the commits of the bug fixes with the bug reports. There are an automated systems out there that do the work for you. For example JIRA can synchronize with Mercurial. Unfortunately, it wasn't such easy in the environment where the NetBeans developers had to work.
Before we moved to Mercurial VCS we had a rule that developer closing issue as FIXED had to provide also the cvs commit log to bug that he had closed. After the move to the Mercurial recently, developer are asked to provide changeset number when they are closing a bug report.

Time has changed. There has been developed new hudson plugin that adds new comment to the bug report when you commit your commit log with a message following simple pattern.
The pattern is #ISSUE_NUMBER("#[0-9]{4,7}+") wherever in the commit message. The best practice is to add the "#ISSUE_NUMBER - issue summary" to the first line of your commit. Example of commit log message: #139566 - [permui] Mercurial menu item in Tools menu doesn't follow permanent ui spec.

If you will commit the changeset with such message the you can expect the following message will appear in the issue (example)when your changes are correctly propagated into the main-golden repository :
------- Additional comments from qa@netbeans.org Tue Jul 29 14:43:08 +0000 2008 -------
Integrated into 'main-golden', available in build \*200807291401\* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/bda38e44840f
User: Lukas Hasik 
Log: #139566 - [permui] Mercurial menu item in Tools menu doesn't follow permanent ui spec

IMPORTANT: the message is added to the issue only when the changeset is integrated into main-golden repository AND new build of main-golden passed. < href="http://blogs.sun.com/coreqa/entry/netbeans_mercurial_repositories">Main-golden is synchronized with main repository when all the tests pass. In some cases it can take a while therefore if you hurry with your bug fix verification provide us the changeset immediately when you are closing the issue as FIXED.
About

Team blog of NetBeans Core and Platform Quality Assurance team

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today