Friday Jan 08, 2010

Netbeans and Git

I've heard some Netbeans users say that it does not work with the Git version control system. They're right that it doesn't come built-in but you can download a separate plugin called nbgit that does support it.

I'm using the nbgit plugin with Netbeans 6.8 and it highlights diffs for me in the UI. However, I am still using the command line for actual git operations and I use GitX to visualize my revisions.

Tuesday Dec 11, 2007

Add Custom Rake Tasks to NetBeans 6 Ruby IDE

As part of a demo, I wanted to deploy a Ruby on Rails application into a Rails Virtual Appliance using Capistrano. A Rails Virtual Appliance is a Virtual Machine that contains a complete stack of software from the Operating System up to Ruby on Rails itself. If you are using NetBeans 6 as your IDE, you can create a file such as $PROJECT/lib/tasks/demo.rake containing something like the following:

# Rake task to deploy to a production server for virtual appliance demo
# 2007-12-10eeg

# File that contains IP address of virtual appliance. If this file cannot
# be read, then the user will be prompted for the information.
TARGET_IP_FILE = '/ApplianceShare/ipfile.txt'

namespace :demo do
  desc 'Print the target IP address'
  task :print_target_ip do
    puts "Target host IP: #{get_target_host}"
  end

  desc 'Show the coolstack page'
  task :show_coolstack do
    sh "open http://#{get_target_host}/"
  end

  desc 'Show the main depot web application page'
  task :show_app do
    sh "open http://#{get_target_host}:8000/store/"
  end

  desc 'Deploy to production'
  task :deploy do
    target_host = get_target_host
    sh "cap -S target=#{target_host} deploy:setup"
    sh "cap -S target=#{target_host} deploy:cold"
  end

  desc 'Deploy and run the application'
  task :run => [:deploy, :show_app]
end

def get_target_host
  if File.readable?(TARGET_IP_FILE)
    f = File.new(TARGET_IP_FILE)
    line = f.readline
    host_ip = line.chomp
  else
    print "Target host: "
    line = $stdin.gets
    host_ip = line.chomp
  end
  host_ip
end

### Local Variables:
### mode: ruby
### End:

Note that the rake task uses sh to call Capistrano via the cap command to deploy the app into the production machine which in this case is a Virtual Appliance. Then, within NetBeans, you can invoke the context menu on the project node in the Projects Window and select "Run Rake Task" and navigate to the task you want to invoke. See this blog entry or wiki page for more information on NetBeans and Rake.

Friday May 04, 2007

JMaki Support for NetBeans Visual Web Pages

A project I've been spending much of my time on recently is support for NetBeans Visual Web development on the jMaki project. This means creating components, or rather wrapper components, for the jMaki components. The jMaki project is a JavaScript framework that itself wraps other JavaScript components (i.e. widgets) and it also provides some of its own native components. Craig McClanahan started this sub-project of JMaki by creating JSF wrappers for widgets for the Yahoo yui TreeView and Tabbed View components. I added three others: Menu, AutoComplete, and Slider. You can download a prototype complib file.

Why would you want to wrap existing JavaScript components? Creating good JavaScript and Ajax components is hard, so why not leverage the work of others? I mostly worked on Yahoo yui widgets and many of them are well-designed and tested in the real world. After all, they're deployed on yahoo pages and other sites as well. Plus, there is an active user community and the code is open-sourced.

So why use an additional jMaki JavaScript wrapper instead of just creating JSF wrappers for the yui components? Yahoo yui is just one example of a nice JavaScript widget library. The same argument applies to other widget libraries too like Dojo and Scriptaculous. By using jMaki, it is possible to mix widgets from different underlying widget libraries and get them to work together.

Here are some screenshots of an older prototype which I haven't had time to update, but it still gives a good idea of how the widgets look in the IDE.

The next screenshot shows the same (older) prototype web application but deployed on a server and viewed in a browser. In this image, I hovered the mouse over "Goto" which caused a sub-menu of two web sites to slide out. Then, I moved the mouse over the "java.sun.com" sub-menu item, but the mouse does not show in the screenshot. Activating the item will go to that URL. This behavior was specified at design-time in the IDE.

So what did I learn from this work? Visual web component development is possible but it isn't the simplest task. Re-using an existing JavaScript widget does save a significant chunk of work, but there is still additional work with wrapping the widget with JSF and possibly jMaki, along with the accompanying debugging work. Making the components product quality would require a commitment of engineering resources -- though, less than if you were to also have to create the JavaScript widgets themselves from scratch.

If you're interested in learning more about the jMaki project and tools support and you will be in the neighborhood of San Francisco around the week of Monday, May 7, 2007 (ISO 2007-05-07), some of the key players will be speaking at JavaOne and CommunityOne. Even if you can't make it to JavaOne because of the cost, this year there is a free CommunityOne event that you can register for. For example, I did a search for Craig McClanahan and came up with this list of talks. You can also search for Greg Murray for jMaki talks and Ludo Champenois for other tools related talks.

Tuesday Dec 05, 2006

Webinar of Upcoming Release of Netbeans Visual Web Pack

I just saw a good webinar on NetBeans Visual Web Pack. You may need to look at the main news page for a link. Currently, there is a Technology Preview (TP) version that you can download, but a product quality version -- we call it FCS for First Customer Ship -- with some improvements will be out soon. In particular, there are significant improvements in the user interface (UI) for third-party component libraries that should make them easier to use. Craig demoed some of it in the webinar. There has been a change from TP and previous versions of Creator in the UI for component libraries. First, you must import a "complib" file to make a component library known to the IDE. Then, you must separately add them to a project to make it available to a project and appear on the palette. Feel free to let me know what you think.

About

edwingo

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