Monday Aug 31, 2015

Available: Official PDF of "Beginning NetBeans IDE for Java Developers"

Today I went to the Apress site for the new NetBeans book "Beginning NetBeans IDE for Java Developers". I used PayPal to pay for the PDF, since the hardcopy isn't available yet. I'm really looking forward to holding the hardcopy in my hands, the PDF is definitely secondary to me, though having it available is nice too! When I ordered it today, I assumed that I'd get sent some old version of the PDF of the book, together with the message: "Soon you will receive the final PDF of the book, for the moment here's a recent draft."

However, that was not the case at all! The final PDF of the book is available, right now. That's really great. Features that the final PDF of the book has, which early drafts did not have, and which the hardcopy book obviously will not have, either:

  • Bookmarks, as shown in the screenshot below.
  • Hyperlinks in the table of contents to the referenced pages.
  • Internal links, e.g., when the text says "as shown in Figure 3-2", there's a link on "3-2", which can be clicked, and then you're jumped to the related image.
  • Color in the screenshots, i.e., unlike the hardcopy book, the screenshots are not black/white, except for the awesome portraits of famous NetBeans users by Martien Bos

Here's an image of the book, showing Adam Bien's preface, as well as the bookmarks along the left side of the PDF reader:

And here's the start of the chapter on testing and code coverage, notice the hyperlinks mentioned above.

Get the book here: http://www.apress.com/9781484212585

Sunday Aug 30, 2015

NetBeans in Cancer Research in Pakistan

My background is not in IT, but in law—I grew up in South Africa and did my law degree there, focusing on subjects such as international law, labor law, and human rights law. I would certainly have become one of those typical human rights lawyers who inspired me to do a law degree in the first place—one of those lawyers from 90% of court room drama movies—pleading the innocence of an unjustly accused innocentshaking a self righteous finger at the heavens against the injustice of it allor standing on the ramparts of some eventually to be vindicated—after many years of hardship and struggle"lost cause".

It is with that kind of background that I am always so very pleased when the aspects of NetBeans that have always appealed to me most—free, open source, solid, stable, simple to get started, helpful community—are combined with the kind of vertical segment of software development that is closest to the kinds of concerns I had before being sidetracked into software—in this case, the software being developed at Shaukat Khanum Memorial Cancer Hospital in Pakistan:

The above is a laboratory automation integration solution being created at the aforementioned hospital in Pakistan on top of the NetBeans Platform and with NetBeans IDE. It integrates 63 pathology lab machines and analyzers into one coherent application, supporting a range of protocols. The system bi-directionally communicates with true random access analyzers, such as General Chemistry (e.g., Hitachi P-800, COBAS 6000) and Special Chemistry (e.g., Advia, Immulute), where analyzers read the tube barcodes and inquire the system for the test orders and receives them, analyzes samples, and reports back the results to the system. Other features include user/roles/rights management, integrated simulation for quick testing and debugging, and an easily accessible user interface for maintaining the analyzers and other machines, together with their support documents and manuals.

Many—even most—of my software colleagues will look at the above screenshot and say: "Oh my god! Why is that not a web app!" or "Wow—that needs to be converted to JavaFX, doesn't it?" And those software colleagues would be completely missing the point. Not going to explain this in detail again, have done that so many times already, but the web is simply not applicable to all imaginable business scenarios, while Java Swing is certainly a lot more stable with a lot more experienced developers available than JavaFX, and the usefulness that JavaFX would add to this particular application is so small that the significant investment that would be required would not be worth it.

When I read about the above software and write e-mails with the related software developers working in that hospital, to advise them on solutions they're working on for their software, yes, at that moment there's a very small and humble part of me that resonates with an earlier part of me, a younger part, sitting in a law lecture or, even, quite recently, listening to former head of the South African Constitutional Court, Albie Sachs, talk about his background and the motivations for the ways in which he has spent his life.

Friday Aug 28, 2015

YouTube: Overview of Newly Designed NetBeans Profiler

The redesign of the NetBeans Profiler is one of the big enhancements of the NetBeans IDE 8.1. In the release notes, you'll see a whole section dedicated to this:
  • Redesigned user interface
  • New features:
    • Live forward and reverse call trees in CPU results
    • Live allocation trees in Memory results
    • Monitoring CPU utilization
    • Thread dumps from profiled application
  • Engine improvements:
    • Faster connection to profiled application
    • Limited outgoing calls from profiled methods
    • Memory profiling for selected classes
  • Simplified profiler setup
  • Improved integration into the IDE

And, great newstoday, Josh Juneau, a NetBeans Dream Team member, has made available an excellent screencast on YouTube showing how friendly and usable the newly designed NetBeans Profiler is:

Thanks, Josh!

Thursday Aug 27, 2015

New: Complete Guide to Tuning the Appearance of NetBeans

The full article is here and will be added to and updated over time and should be considered the most complete and authoritative document on the topic of tuning the appearance of NetBeans:

https://jaxenter.com/netbeans/the-complete-guide-to-tuning-the-appearance-of-netbeans

Wednesday Aug 26, 2015

New from Apress: "Beginning NetBeans IDE for Java Developers"

Well, yesterday I heard the good news—the new Apress book "Beginning NetBeans IDE for Java Developers" has gone to the printer! This ends a cycle that started some months ago, with many in the NetBeans community being involved. Several people from the NetBeans Dream Team, as well as teachers using NetBeans around the world, and some of the subscribers on the NetBeans mailing list.

Here's where the book can be purchased: http://www.apress.com/9781484212585

Some sneak previews are in order! Here's what the cover looks like:

Here's the more readable version of the small squiggly text you see on the back of the book above:

Of course, the book is focused on NetBeans IDE 8.1, e.g., the newly designed NetBeans Profiler is used in the chapter on Profiling. What does the table of contents look like? Here it is:

It's a reasonably thorough introduction to NetBeans IDE, though there's certainly room for another book on NetBeans IDE to be entitled "The Definitive Guide to NetBeans IDE", as well as another book in the "Beginning" series, e.g., "Beginning NetBeans IDE for JavaScript Developers".

The foreword is by Jaroslav Tulach and the preface is by Adam Bien. Each chapter begins with a relevant quote from a famous NetBeans user, and a portrait of that user by the brilliant professional illustrator Martien Bos, e.g., the chapter on Profiling begins with a portrait of Kirk Pepperdine, with a quote from Kirk about how awesome the NetBeans Profiler is. Similarly, Arun Gupta is featured in the chapter where you develop a Java EE application, while others included include James Gosling, Toni Epple, Zoran Sevarac, Sean Phillips, Sven Reimers, and Ken Fogel.

The book is aimed at students at universities and technical colleges, etc, (in fact, it would be great if it would become something of a standard text at educational institutions) as well as developers in the enterprise. In the book, Maven and, to some extent as well, Java EE, are a bit dominant, though if you're using something different, you'll gain a lot from the book too. Initially an Ant-based "Hello World" application is created, later a more complex Java EE application with Maven, though each chapter stands on its own. By the end, you have a basic overview of the key features of NetBeans IDE.

More info about this book will be revealed over the coming weeks/months, including interviews with some of the many people involved in the book, and, of course, it will play a big role in a variety of activities around NetBeans as soon as it is released!

Tuesday Aug 25, 2015

Kendo UI Core in NetBeans IDE 8.1

Good news for users of Kendo UI Core, everywhere. Problems in the initial release of the Kendo UI Core plugin have been fixed and, if you're using NetBeans IDE 8.1 Beta (or later), you'll have code completion for Kendo UI Core components, together with documentation, once the plugin is installed:

But... there's more! In code completion, in the place where you'd expect it, you also get code completion for the attributes of the currently used Kendo UI Core component, together with related documentation:

When you're using Visual Studio, you'll miss the above feature, i.e., context-sensitive code completion of attributes of Kendo UI Core components, since it's simply not supported fully or completely or correctly there:

Go here to get the plugin:

http://plugins.netbeans.org/plugin/60071/kendo-ui-core-editor

Many thanks to a variety of people involved in working on and supporting the Kendo UI Core Editor plugin for NetBeans IDE. In the first place, Johan Borchers for suggesting this feature for NetBeans IDE and also for trying it out multiple times, until we fixed the issues we initially had and now it works for him too in NetBeans IDE 8.1. Giorgio Del Cielo, thanks to you too, for trying out the plugin and reporting that it now works for you. Also, very many thanks to the Brazil team who worked on the documentation parsing of the Kendo UI Core Editor plugin during JavaOne Latin America, consisting of Mauricio Leal, Leonardo Zanivan, and All Pereira.

Many thanks to everyone. And there's still quite some work to be done, especially in the performance and caching of parsing results, i.e., these aspects are not optimal yet. Anyone wanting to get involved, there's a GitHub repo that contains all the code:

https://github.com/GeertjanWielenga/KendoNetBeans

Anyone using the plugin, please help by providing any kind of feedback, either here or on the plugin's page in the Plugin Portal.

Monday Aug 24, 2015

YouTube: Chrome Connector Plugin in NetBeans IDE 8.1

One of the best features for JavaScript development in NetBeans IDE is the Chrome Connector plugin, which connects the browser to NetBeans IDE and enables the Chrome browser—whether on the desktop or on a mobile deviceto integrate fully into the development cycle.

NetBeans IDE 8.1, which is currently in Beta, has some awesome enhancements for working with the Chrome browser via the Chrome Connector plugin. In particular, Polymer is supported for the first time via live Shadow DOM visualization and Knockout.js is even further integrated into the development cycle via a new window that shows live Knockout bindings of the currently selected item in the Chrome browser.

Find out all about the new features, plus a few additional handy tips and tricks, in a brand new YouTube screencast, here:

Watch more NetBeans videos here: https://www.youtube.com/user/NetBeansVideos

Friday Aug 21, 2015

Hello Perforce in NetBeans IDE

Figured out how to add the Perforce item below:

How to do it:

https://github.com/GeertjanWielenga/perforce

Below is the starting point, in the layer.xml, included in the Git repo above:

<folder name="VersioningOptionsDialog">
    <file name="Perforce.instance">
        <attr name="instanceClass" stringvalue="org.netbeans.perforce.PerforceAdvancedOption"/>
    </file>
</folder>

The rest follows from there, see the Git repo above that contains the entry point for configuring Perforce in NetBeans IDE.

Related info:

Thursday Aug 20, 2015

Overriding Default Context-Sensitive Action Enablement

By default, when you create an Action that is context sensitive, via the New Action wizard, the NetBeans Platform looks out for the types that are of interest to you and, when they're in the Lookup, enables your Action. In the case below, when multiple Parts are in the Lookup, i.e., typically, multiple PartNodes are selected and their underlying Part objects are published, the Action will automatically be enabled:

@ActionID(
        category = "Parts",
        id = "org.car.viewer.PartComparatorAction"
)
@ActionRegistration(
        displayName = "#CTL_PartComparatorAction"
)
@ActionReference(
        path = "Menu/File", 
        position = 1200)
@Messages("CTL_PartComparatorAction=Compare Parts")
public final class PartComparatorAction implements ActionListener {
    private final List<Part> context;
    public PartComparatorAction(List<Part> context) {
        this.context = context;
    }
    @Override
    public void actionPerformed(ActionEvent ev) {
        StringBuilder sb = new StringBuilder();
        for (Part part : context) {
            sb.append(part.getName()).append(" ");
        }
        StatusDisplayer.getDefault().setStatusText(sb.toString());
    }
}

However, the default behavior is such that even when only one Part object is exposed to the Lookup, the Action is enabled, as shown below:

The above doesn't really make sense because you need more than one of something to make it worthwhile to compare. To override this default behavior, you can abandon the default underlying class and implement your own enablement strategy.

Begin by including "lazy = false", shown in bold below, which will generate layer.xml entries that, instead of delegating to the internal NetBeans Platform code for handling enablement, lets you provide that enablement yourself, as shown here:

@ActionID(
        category = "Parts",
        id = "org.car.viewer.PartComparatorAction"
)
@ActionRegistration(
        lazy = false,
        displayName = "NOTUSED"
)
@ActionReference(
        path = "Menu/File",
        position = 1200)
@Messages("CTL_PartComparatorAction=Compare Parts")
public final class PartComparatorAction extends AbstractAction {
    Lookup context;
    public PartComparatorAction() {
        context = Utilities.actionsGlobalContext();
        putValue(NAME, Bundle.CTL_PartComparatorAction());
    }
    @Override
    public boolean isEnabled() {
        return context.lookupAll(Part.class).size() > 1;
    }
    @Override
    public void actionPerformed(ActionEvent ev) {
        StringBuilder sb = new StringBuilder();
        for (Part part : context.lookupAll(Part.class)) {
            sb.append(part.getName()).append(" ");
        }
        StatusDisplayer.getDefault().setStatusText(sb.toString());
    }
}

Now, as is implied by the isEnabled method above, only when more than one object of interest is in the Lookup, will the Action be enabled. Below you can see that, in contrast to the earlier screenshot, the Action is disabled here because of the code above, which overrides the default behavior:

Note that in the second code scenario, you get hold of the Lookup yourself, you check whether the correct objects are available in the Lookup and then enable/disable as appropriate, and you also iterate through the objects in the Lookup to process them when the Action is invoked. In the default scenario, all this is done for you automatically, with the downside that even when only one object is available the Action will be enabled.

Also see:

Tuesday Aug 18, 2015

Complex Properties Windows on the NetBeans Platform (Part 2)

In part 1, you ended up removing the UI components from the custom Properties window whenever the Lookup changes. That's kind of messy and here's an alternative approach, where you repopulate the custom Properties window instead of recreating its UI components.

public class PlanetPropertiesTopComponent extends TopComponent
        implements LookupListener {

    private Lookup.Result<PlanetNode> planetNodeResult;
    private final JPanel mainPanel;
    private boolean isInitialized = false;

    public PlanetPropertiesTopComponent() {
        setName(Bundle.CTL_PlanetPropertiesTopComponent());
        setLayout(new BorderLayout());
        mainPanel = new JPanel(new MigLayout());
        JLabel title = new JLabel();
        add(title, BorderLayout.NORTH);
        add(mainPanel, BorderLayout.CENTER);
    }

    @Override
    public void resultChanged(LookupEvent le) {
        if (!planetNodeResult.allInstances().isEmpty()) {
            PlanetNode planetNode
                    = planetNodeResult.allInstances().iterator().next();
            if (!isInitialized) {
                initializeContent(planetNode);
            } else {
                repopulateContent(planetNode);
            }
        }
    }

    private void initializeContent(PlanetNode planetNode) {
        writeTabDisplayName(planetNode);
        List<Property> booleanProperties = new ArrayList<Property>();
        PropertySet ps = planetNode.getPropertySets()[0];
        Property<?>[] props = ps.getProperties();
        for (Node.Property property : props) {
            SinglePropertyJPanel ppJPanel
                    = new SinglePropertyJPanel(property);
            if (property.getValueType().equals(boolean.class)) {
                booleanProperties.add(property);
            } else {
                mainPanel.add(
                        ppJPanel,
                        "dock north, wrap, growx, pushx");
            }
        }
        mainPanel.add(
                new MultiPropertyJPanel(booleanProperties),
                "wrap, growx, pushx");
        revalidate();
        isInitialized = true;
    }

    private void repopulateContent(PlanetNode planetNode) {
        writeTabDisplayName(planetNode);
        PropertySet ps = planetNode.getPropertySets()[0];
        Property<?>[] props = ps.getProperties();
        for (Node.Property property : props) {
            Component[] components = mainPanel.getComponents();
            for (Component component : components) {
                if (component instanceof SinglePropertyJPanel) {
                    SinglePropertyJPanel spjp = (SinglePropertyJPanel) component;
                    PropertyPanel pp = spjp.getPropertyPanel().get(0);
                    String ppDisplayName = pp.getProperty().getDisplayName();
                    if (ppDisplayName.equals(property.getDisplayName())) {
                        pp.setProperty(property);
                    }
                } else
                if (component instanceof MultiPropertyJPanel) {
                    MultiPropertyJPanel mpjp = (MultiPropertyJPanel) component;
                    List<PropertyPanel> ppList = mpjp.getPropertyPanel();
                    for (PropertyPanel pp : ppList) {
                        String ppDisplayName = pp.getProperty().getDisplayName();
                        if (ppDisplayName.equals(property.getDisplayName())) {
                            pp.setProperty(property);
                        }
                    }
                }
            }
        }
    }

    private void writeTabDisplayName(PlanetNode planetNode) {
        String displayName = planetNode.getDisplayName();
        setDisplayName(displayName + " - Properties");
    }

    @Override
    public void componentOpened() {
        planetNodeResult
                = Utilities.actionsGlobalContext().lookupResult(PlanetNode.class);
        planetNodeResult.addLookupListener(
                this);
    }

    @Override
    public void componentClosed() {
        planetNodeResult.removeLookupListener(this);
    }

}

Monday Aug 17, 2015

Java Everywhere: Write Once Run Anywhere with DukeScript

For quite some time already, Java has been failing on its “write once, run anywhere” promise. DukeScript (DukeScript.com) would like to change that by enabling a clean separation of view and logic in cross-platform applications. In this article, a simple scenario is used to introduce the basics of DukeScript.

For many years, Java Swing enabled developers to write applications that could run on any operating system. That all came to an end with the arrival of smart phones, tablets, and embedded computers. In the enterprise, the desktop dominated for many years. In the meantime, however, every IT project includes plans for a future where the application will need to be ported to mobile platforms. Building native applications for all platforms requires special skills and is expensive in terms of both maintenance and development. What is to be done?

DukeScript gives you a Java-based solution again that enables cross-platform applications to be developed. DukeScript provides a clean separation of view and logic enabling UI designers to focus on UI design and coders to focus on writing well-tested application code. 

Read all about it here, which is where the paragraphs above come from: http://www.javacodegeeks.com/2015/08/java-everywhere-write-once-run-anywhere-with-dukescript.html and learn how to create a cross-platform To Do List application:

Sunday Aug 16, 2015

Simplified Reflection for AbstractNode

When using BeanNode, you don't need to create a PropertySheet because the NetBeans Platform uses reflection to build that for you. However, when using AbstractNode, you don't have that built-in reflection support. Instead, you need to override createSheet() in your AbsrtractNode and then, in the simplest cases, you can populate your PropertySheet by creating Properties that extend PropertySupport.Reflection.

I've come up with a simplified way of doing that:

@Override
protected Sheet createSheet() {
    Sheet sheet = Sheet.createDefault();
    Sheet.Set basicSet = Sheet.createPropertiesSet();
    Planet planet = getLookup().lookup(Planet.class);
    try {
        basicSet.put(new PropSupport.StringProp(planet, "name", "Name"));
        basicSet.put(new PropSupport.IntegerProp(planet, "size", "Size"));
        basicSet.put(new PropSupport.ColorProp(planet, "color", "Color"));
        basicSet.put(new PropSupport.BooleanProp(planet, "hasWater", "Has Water"));
        basicSet.put(new PropSupport.BooleanProp(planet, "hasLife", "Has Life"));
        basicSet.put(new PropSupport.PlanetTypeProp(planet, "type", "Type"));
    } catch (NoSuchMethodException ex) {
        Exceptions.printStackTrace(ex);
    }
    sheet.put(basicSet);
    return sheet;
}

And here's PropSupport, i.e., my own class, essentially an API, that hides the below via the method calls above:

public class PropSupport {

    public static class StringProp 
        extends PropertySupport.Reflection<String> {
        public StringProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, String.class, propName);
            setDisplayName(displayName);
        }
    }
    public static class ColorProp 
        extends PropertySupport.Reflection<Color> {
        public ColorProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, Color.class, propName);
            setDisplayName(displayName);
        }
    }
    public static class IntegerProp 
        extends PropertySupport.Reflection<Integer> {
        public IntegerProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, int.class, propName);
            setDisplayName(displayName);
        }
    }
    public static class BooleanProp 
        extends PropertySupport.Reflection<Boolean> {
        public BooleanProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, boolean.class, propName);
            setDisplayName(displayName);
        }
    }
    public static class PlanetTypeProp 
        extends PropertySupport.Reflection<PlanetType> {
        public PlanetTypeProp(
                Planet bean, 
                String propName, 
                String displayName) throws NoSuchMethodException {
            super(bean, PlanetType.class, propName);
            setDisplayName(displayName);
        }
    }

}

Now I can pass in a few arguments and get back via reflection my underlying properties very easily.

Saturday Aug 15, 2015

Complex Properties Windows on the NetBeans Platform (Part 1)

When you have complex requirements for your Properties windows, I'd recommend that you stop forcing your requirements into the default Properties window and create your own instead.

Below, you see a node hierarchy and you also see a Properties window. The screenshot on the left shows the default Properties window provided by the NetBeans Platform, while the one on the right shows a Properties window I made myself.

There's quite a few differences. Notice how neat the second one is, just as professional as the first. Especially notice that I have two properties ("Has Water" and "Has Life") next to each other in my own Properties window, which is something that the default Properties window is unable to do. The Properties window I created also looks a bit different and could be customized a lot further, i.e., right now every property is displayed in its own panel, except for boolean properties. Since each row is a JPanel and not a row in a JTable or something in the default Properties window, I have much more control over the rendering of my custom Properties window than I have over the default Properties window provided by the NetBeans Platform.

And, the cool, thing is, I didn't create any of the widgets you see above, i.e., the drop-down list, the checkboxes, and the color picker, myself—the most important component here is org.openide.explorer.propertysheet.PropertyPanel.

The structure of this solution is as follows:


The most interesting part is the 'PlanetPropertiesTopComponent', which looks like this:

public class PlanetPropertiesTopComponent extends TopComponent
        implements LookupListener {

    private Lookup.Result<Node> nodeResult;

    public PlanetPropertiesTopComponent() {
        setName(Bundle.CTL_PlanetPropertiesTopComponent());
    }

    @Override
    public void resultChanged(LookupEvent le) {
        if (!nodeResult.allInstances().isEmpty()) {
            rewritePanel();
        }
    }

    private void rewritePanel() {
        removeAll();
        setLayout(new BorderLayout());
        JPanel mainPanel = new JPanel(new MigLayout());
        add(mainPanel, BorderLayout.CENTER);
        Node node
                = nodeResult.allInstances().iterator().next();
        String displayName = node.getDisplayName();
        setDisplayName(displayName + " - Properties");
        List<Property> booleanProperties = new ArrayList<Property>();
        Property<?>[] props = node.getPropertySets()[0].getProperties();
        for (Node.Property property : props) {
            JPanel ppJPanel = new SinglePropertyJPanel(property);
            if (property.getValueType().equals(boolean.class)) {
                booleanProperties.add(property);
            } else {
                mainPanel.add(
                        ppJPanel, 
                        "dock north, wrap, growx, pushx");
            }
        }
        mainPanel.add(
                new MultiPropertyJPanel(booleanProperties), 
                "wrap, growx, pushx");
        repaint();
        validate();
    }

    @Override
    public void componentOpened() {
        nodeResult
                = Utilities.actionsGlobalContext().lookupResult(Node.class);
        nodeResult.addLookupListener(this);
    }

    @Override
    public void componentClosed() {
        nodeResult.removeLookupListener(this);
    }

}

Notice that we listen for "Node", which is org.openide.nodes.Node. When a new Node is selected, the content of the Properties window is recreated, using the properties that are found in the Node, hence the related PropertyPanels are used automatically.

To get the "SinglePropertyJPanel" and "MultiPropertyJPanel" exactly right, I used the Matisse GUI Builder. Here's the "SinglePropertyJPanel":

And here's the "MultiPropertyJPanel":


In each case, there's a JLabel and a PropertyPanel in the GUI Builder for a JPanel. The PropertyPanel can be added to the Component Palette, by right-clicking inside of it, choosing Palette Manager, and then clicking "Add from JAR". Then browse to your installation of NetBeans IDE (or the NetBeans Platform) and browse to 'platform/modules/org-openide-explorer.jar', at which point you can choose 'PropertyPanel', which will then be added to the Component Palette. From there, drag it onto your JPanel in the GUI Builder.

The constructor of "SinglePropertyJPanel" is as follows:

public class SinglePropertyJPanel extends JPanel {

    public SinglePropertyJPanel(Property property) {
        initComponents();
        propertyName.setText(property.getDisplayName());
        propertyPanel.setProperty(property);
        setBackground(Color.WHITE);
        setBorder(new LineBorder(Color.GRAY));
    }

And here is the constructor of the "MultiPropertyPanel", which currently handles two properties:

public class MultiPropertyJPanel extends JPanel {

    public MultiPropertyJPanel(List<Property> properties) {
        initComponents();
        for (int i = 0; i < properties.size(); i++) {
            Property property = properties.get(i);
            if (i == 1) {
                jLabel1.setText(property.getDisplayName());
                propertyPanel1.setProperty(property);
            } else {
                jLabel2.setText(property.getDisplayName());
                propertyPanel2.setProperty(property);
            }
        }
        setBackground(Color.WHITE);
        setBorder(new LineBorder(Color.BLACK, 1));
    }

Also, here's a neat trick in the PlanetNode, or any other Node, for removing all the elipsis buttons next to string properties:

@Override
public PropertySet[] getPropertySets() {
    PropertySet[] original = super.getPropertySets();
    for (PropertySet ps : original) {
        Property<?>[] properties = ps.getProperties();
        for (Property<?> property : properties) {
            if (property.getValueType().equals(String.class)) {
                property.setValue("suppressCustomEditor", true);
            }
        }
    }
    return original;
}

Now see part 2!

Friday Aug 14, 2015

European Space Agency on Java and NetBeans

SNAP (SeNtinel Application Platform) is an open source common architecture for European Space Agency (ESA) Toolboxes focused on the exploitation of Earth Observation data. Its latest release, based on the NetBeans Platform, has been developed over the past year.

The source code is on GitHub:

https://github.com/senbox-org/snap-desktop

It can be extended and here's examples for doing that:

https://github.com/senbox-org/snap-examples

It is currently in Beta and here's what it looks like. Click to enlarge the image:

The reasons for choosing the selected architecture: "The SNAP architecture is ideal for Earth Observation processing and analysis due to the following technological innovations: Extensibility, Portability, Modular Rich Client Platform, Generic EO Data Abstraction, Tiled Memory Management, and a Graph Processing Framework." (More on that here.)

More info:

Developers working for ESA on SNAP have contributed significantly to NetBeans, as described in an earlier blog entry here.

You too can create applications just like the above. Or you can base your own applications on SNAP. All the principles for doing so can be learned since the NetBeans Platform underlying SNAP is well documented:

Thursday Aug 13, 2015

YouTube: Create a Node.js Express App in NetBeans IDE

Here's a quick screencast showing the basic features for Node.js frontend development with Express.js, in which you use the Express application generator to set up your application, all from within the IDE, within about 3 minutes:

Wednesday Aug 12, 2015

End-to-End Sample for Node.js, Express.js, Jade, and Knockout.js

In NetBeans IDE 8.1, you'll find a handy sample for learning about Node.js and friends (Express.js and Jade, with Knockout for bidirectional data binding):

Here's how the source code looks that you get at the end of the wizard above:

From the IDE, you can run npm and Bower to install all the modules and packages defined in 'package.json' and 'bower.json'.

And here's the running application, with the NetBeans Chrome Connector plugin installed into Chrome so that the Knockout window in the IDE shows the Knockout bindings live in the browser:

Tuesday Aug 11, 2015

Node.js: Free & Open Source Smart Tools

NetBeans IDE 8.1 Beta, released end of last week, has a heap of tools for Node.js application development. In fact, Node.js application development is the key feature of NetBeans IDE 8.1. In fact, if "awesome integrated Node.js application development" is your answer to the question "what's the key feature of NetBeans IDE 8.1", then you've really got the message!

The big features for Node.js application development in NetBeans IDE 8.1 are focused on (1) creating Node.js backend applications, (2) creating Node.js front-end applications with the Express framework, (3) editing Node.js code in a fast and smart JavaScript editor, (4) running Node.js applications, and (5) debugging Node.js applications.

Here's a quick screencast showing the basic features for Node.js backend application development, in which you create, run, and debug a Node.js web server in 3 minutes:

Or go here to see it: https://www.youtube.com/watch?v=hx6vXCdOYlA

More screencasts coming soon, including usage of the Express.js integration, i.e., web frontend development on top of Node.js backend applications.

But I like the smaller features especially, such as the code completion (with documentation included!) for Node.js modules in the JavaScript editor:

Join us, Node.js developers everywhere, NetBeans is a lightweight and free tool with a special new focus on Node.js application development! Lightweight? Yes, there's a special download, which includes the JRE (i.e., no need to install that separately anymore), focused on HTML5/JavaScript developers, which has tools only for those developers, i.e., no Java tools at all, only those tools you need as Node.js developers. Startup time of NetBeans IDE for HTML5/JavaScript, for me, is about 8 seconds, which surely is pretty fast. Get it here, for free: http://download.netbeans.org/netbeans/8.1/beta/

Monday Aug 10, 2015

Announcement: NetBeans IDE 8.1 Beta

Friday Aug 07, 2015

Customizable Code Fold Borders in NetBeans IDE 8.1

Those collapsed code folds can be pretty glary:

So, for the first time in NetBeans IDE 8.1, you can configure that white color:

Much quieter code fold borders now, set to Gray:

See:

If you're curious what "Code Folding" and "Code Folding Bar" are for (though note neither of these two are new in 8.1), i.e., right above "Code Folding Border" in the second screenshot above, I have set "Code Folding" to Green below and "Code Folding Bar" to Blue, so that you can see the effect:

Finally, right below "Code Folding Border", in the second screenshot above, is "Editor sidebars background", which is also new in NetBeans IDE 8.1. I have set it to Red below, so you can see it:

See: https://netbeans.org/bugzilla/show_bug.cgi?id=243229

Thursday Aug 06, 2015

Released: NetBeans IDE 8.1 Beta

All the information is here: https://netbeans.org/community/releases/81

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« September 2015
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