Posts tagged with ‘java’
Java: static declaration of collection
December 17th, 2008
I don’t know if this is a new feature in Java 5 that I did not know before or I just did not know this is possible in Java. But I learned today that you can do static declaration of collection types as below:
public static List<String> supportedCopyPropertyTypes = new ArrayList<String>() {
private static final long serialVersionUID = 660145948432567403L;
{
add("String");
add("BigDecimal");
add("int");
}
};
Eclipse run java code easily
December 11th, 2008
Eclipse has a scrapbook function that allows you to run Java code on the fly. Sometimes you just want to test out a simple piece of code without having to create another Java class, execute it in the main method or create a junit to test it out.
For example, today I wanted to make sure I remember integer division in Java correctly. So I simply just want to execute the following piece of code.
int a = 10;
int b = 8;
int c = 17;
System.out.println(a / b);
System.out.println(c / b);
In order to do that, create a new Scrapbook page in your project. I just called mine blah.jpage. Then paste the code in there. Highlight the code, right click and select execute or ctrl+U. The results of your execution will then show up in the console. That comes in pretty handy sometimes.
How to STYLE a table using CSS (JSF examples)
October 18th, 2007
Tables are very important parts of the web interface. They are (hopefully) used for tabular data. It is one of the oldest and most basic HTML presentation tag but in order for it to smoothly fit into the new CSS age, we need to look at the most practical way in correctly setting up the markup and the CSS.
Nowadays, we no longer wish to make separate instances of a similar application for different clients. We want to thrive on making a single application that will fit the needs of as many clients as possible. This task is very challenging. In my opinion the ideal situation is to have the clients and developers both understand the benefits of the end goal and compromise to reach it. As developers we can always dream to have a single application reach the level of customization we can accomplish with many separate applications and yet don’t confuse the heck out of the end users. While I am unsure if that’s ever a possibility, I know ways that might help get us closer.
One of the biggest challenges is to give each client who uses the same application their own unique UI presentation. This is no small task and I only plan to address a small issue you might encounter in accomplishing this task. That’s how to mark up a table with the most amount of UI flexibility.
(more…)


