One of the top 10 features of Egypt is, of course, the shisha (more specifically, the contents thereof). Here is me last night outside a cafe in Cairo with Hamada, Amr, and Khaled, applying the default shisha usecase:
The discussion obviously turned to the need for tight integration between shisha and NetBeans IDE. Initial brainstorms around powering NetBeans IDE via a shisha were briefly assessed and then rejected as brilliant but impractical. Then, as if out of thin air, the concept of a NetBeans plugin for shishas was born. Here is a first implementation—shisha cursor:
package org.netbeans.shisha;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import org.openide.modules.ModuleInstall;
import org.openide.windows.WindowManager;
public class Installer extends ModuleInstall {
@Override
public void restored() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
//Create the cursor:
Toolkit tk = Toolkit.getDefaultToolkit();
ImageIcon shishaImageIcon = new javax.swing.ImageIcon(getClass().getResource("/org/netbeans/shisha/shisha.png"));
Image shishaImage = shishaImageIcon.getImage();
Cursor shishaCursor= tk.createCustomCursor(shishaImage, new Point(10,10), "Shisha");
//Use the cursor in the main window:
JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();
frame.setCursor(shishaCursor);
}
});
}
}
And this is how the source structure looks, together with the shisha cursor installed into the IDE:
Even tighter integration can be achieved by setting the shisha cursor in the editor too, by changing the caret to use the same icon. Further steps could involve extending the Options window with a selection of different shishas from which the user can select their preferred model. In this case, unfortunately, the content thereof is irrelevant.























