Rio Project 4.2 API Documentation



org.rioproject.resources.ui
Class Util

java.lang.Object
  extended by org.rioproject.resources.ui.Util

public class Util
extends Object

General utilities for use with a UI component in Rio

Author:
Dennis Reedy

Nested Class Summary
static class Util.DisposeActionListener
           
static class Util.MultiLineToolTip
           
static class Util.MultiLineToolTipUI
           
 
Constructor Summary
Util()
           
 
Method Summary
static void dispose(Container comp)
          If the Container has a dispose method, call it
static ApplianceInfo getApplianceInfo(Entry[] attrs)
          Helper to get the ApplianceInfo Entry
static ImageIcon getImageIcon(String location)
          Get an image as a resource and create an ImageIcon
static OperationalStringManager getOperationalStringManager(ProvisionMonitor monitor, String opStringName)
           
static Color getRowColor(DefaultMutableTreeNode root, DefaultMutableTreeNode node, JTree tree, Color defaultColor, Color altRowColor)
          Get the color for row in the tree table
static ImageIcon getScaledImageIcon(String location, int width, int height)
          Get an image as a resource and create an ImageIcon
static Properties loadProperties(String filename)
          Load properties from ${user.home}/.rio
static void saveProperties(Properties props, String filename)
          Save properties to a file stored in ${user.home}/.rio
static void showError(String text, Component comp, String title)
          Show an error in a Dialog
static void showError(Throwable e, Component comp, String title)
          Show an exception in a Dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getOperationalStringManager

public static OperationalStringManager getOperationalStringManager(ProvisionMonitor monitor,
                                                                   String opStringName)
                                                            throws RemoteException,
                                                                   OperationalStringException
Throws:
RemoteException
OperationalStringException

getRowColor

public static Color getRowColor(DefaultMutableTreeNode root,
                                DefaultMutableTreeNode node,
                                JTree tree,
                                Color defaultColor,
                                Color altRowColor)
Get the color for row in the tree table

Parameters:
root - The tree root
node - The tre node
tree - The tree
defaultColor - The default background color
altRowColor - The background color for alternate rows
Returns:
The row color

dispose

public static void dispose(Container comp)
If the Container has a dispose method, call it

Parameters:
comp - The Container

saveProperties

public static void saveProperties(Properties props,
                                  String filename)
                           throws IOException
Save properties to a file stored in ${user.home}/.rio

Parameters:
props - The Properties object to save, must not be null
filename - The file name to save the Proeprties to
Throws:
IOException - If there are exceptions accessing the file system

loadProperties

public static Properties loadProperties(String filename)
                                 throws IOException
Load properties from ${user.home}/.rio

Parameters:
filename - The name of the properties file to load
Returns:
A Properties object loaed from the system
Throws:
IOException - If there are exceptions accessing the file system

getImageIcon

public static ImageIcon getImageIcon(String location)
Get an image as a resource and create an ImageIcon

Parameters:
location - The image icon location
Returns:
The corresponding ImageIcon loaded from the location

getScaledImageIcon

public static ImageIcon getScaledImageIcon(String location,
                                           int width,
                                           int height)
Get an image as a resource and create an ImageIcon

Parameters:
location - The image icon location
width - The scaled width
height - The scaled height
Returns:
The corresponding ImageIcon loaded from the location and scaled

getApplianceInfo

public static ApplianceInfo getApplianceInfo(Entry[] attrs)
Helper to get the ApplianceInfo Entry

Parameters:
attrs - - Array of Entry objects
Returns:
ApplianceInfo

showError

public static void showError(Throwable e,
                             Component comp,
                             String title)
Show an exception in a Dialog

Parameters:
e - The exception
comp - The parent component
title - The title to use

showError

public static void showError(String text,
                             Component comp,
                             String title)
Show an error in a Dialog

Parameters:
text - The text to show
comp - The parent component
title - The title to use

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.