|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjaxx.runtime.Util
jaxx.runtime.SwingUtil
public class SwingUtil
The runtime swing util class with some nice stuff. Note : Replace previous class jaxx.runtime.swing.Utils in previous versions.
| Nested Class Summary | |
|---|---|
static class |
SwingUtil.TabbedPaneIterator<O>
A simple iterator on a JTabbedPane. |
| Field Summary | |
|---|---|
static java.lang.String |
COLOR_PREFIX
|
static java.lang.String |
ICON_PREFIX
|
| Fields inherited from class jaxx.runtime.Util |
|---|
DEFAULT_ICON_PATH, DEFAULT_ICON_PATH_PROPERTY |
| Constructor Summary | |
|---|---|
SwingUtil()
|
|
| Method Summary | ||
|---|---|---|
static org.jdesktop.jxlayer.JXLayer<?> |
boxComponentWithJxLayer(javax.swing.JComponent component)
Box a component in a JXLayer. |
|
static void |
center(java.awt.Component parent,
java.awt.Component component)
Centrer un component graphique au center d'un autre component. |
|
static void |
fillComboBox(JAXXComboBox combo,
java.util.Collection<?> data,
java.lang.Object select,
boolean firstNull)
Fill a combo box model with some datas, and select after all the given object |
|
static void |
fillComboBox(javax.swing.JComboBox combo,
java.util.Collection<?> data,
java.lang.Object select)
Fill a combo box model with some datas, and select after all the given object |
|
static java.awt.Component |
findComponentAt(java.awt.Container cont,
int width,
int height,
int x,
int y)
|
|
static void |
fixTableColumnWidth(javax.swing.JTable table,
int columnIndex,
int width)
|
|
static java.awt.Component |
getDeepestObjectAt(java.awt.Component parent,
int x,
int y)
Gets the higest visible component in a ancestor hierarchy at specific x,y coordinates |
|
static org.jdesktop.jxlayer.JXLayer<javax.swing.JComponent> |
getLayer(javax.swing.JComponent comp)
|
|
static java.util.List<javax.swing.JComponent> |
getLayeredComponents(JAXXObject object)
|
|
static void |
initNimbusLoookAndFeel()
Try to load the Nimbus look and feel. |
|
static boolean |
isLayered(javax.swing.JComponent comp)
|
|
static void |
loadUIConfig(java.lang.String defaultUIConfig,
java.lang.String extraUIConfig)
Load the ui.properties file and set in UIManager colors and icons found. |
|
static java.util.Map<java.lang.String,javax.swing.JComponent> |
lookingForEditor(java.lang.Class<?> clazz,
java.awt.Container container)
recherche les composants portant le meme nom que les champs de la classe clazz. |
|
static javax.swing.table.TableCellRenderer |
newBooleanTableCellRenderer(javax.swing.table.DefaultTableCellRenderer renderer)
|
|
static
|
newDecoratedListCellRenderer(Decorator<O> decorator)
Génère un renderer de liste graphique basée sur un décorateur donné. |
|
static DecoratorTableCellRenderer |
newDecorateTableCellRenderer(javax.swing.table.TableCellRenderer renderer,
Decorator<?> decorator)
|
|
static javax.swing.table.TableCellRenderer |
newDeleteCellRenderer(javax.swing.table.DefaultTableCellRenderer renderer)
|
|
static EmptyNumberTableCellRenderer |
newEmptyNumberTableCellRenderer(javax.swing.table.TableCellRenderer renderer)
|
|
static
|
newEnumTableCellRenderer(javax.swing.table.TableCellRenderer renderer,
java.lang.Class<E> enumClass)
|
|
static javax.swing.JLabel |
newLabel(java.lang.String text,
java.lang.Object iconKey,
int aligment)
|
|
static java.awt.Dimension |
newMaxXDimension()
|
|
static java.awt.Dimension |
newMaxXYDimension()
|
|
static java.awt.Dimension |
newMaxYDimension()
|
|
static java.awt.Dimension |
newMinDimension()
|
|
static javax.swing.table.TableCellRenderer |
newStringTableCellRenderer(javax.swing.table.DefaultTableCellRenderer renderer,
int length,
boolean tooltip)
|
|
static SwingUtil.TabbedPaneIterator<java.awt.Component> |
newTabbedPaneIterator(javax.swing.JTabbedPane tabs)
Iterate the components of a JTabbedPane in natural order. |
|
static void |
openLink(javax.swing.event.HyperlinkEvent he)
Open a link coming from a HyperlinkEvent. |
|
static void |
setI18nTableHeaderRenderer(javax.swing.JTable table,
java.lang.String... libelles)
|
|
static void |
setTableColumnEditor(javax.swing.JTable table,
int columnIndex,
javax.swing.table.TableCellEditor editor)
|
|
static void |
setTableColumnRenderer(javax.swing.JTable table,
int columnIndex,
javax.swing.table.TableCellRenderer editor)
|
|
static void |
setText(javax.swing.text.JTextComponent c,
java.lang.String text)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ICON_PREFIX
public static final java.lang.String COLOR_PREFIX
| Constructor Detail |
|---|
public SwingUtil()
| Method Detail |
|---|
public static java.awt.Dimension newMinDimension()
public static java.awt.Dimension newMaxXDimension()
public static java.awt.Dimension newMaxYDimension()
public static java.awt.Dimension newMaxXYDimension()
public static void setText(javax.swing.text.JTextComponent c,
java.lang.String text)
public static void fillComboBox(javax.swing.JComboBox combo,
java.util.Collection<?> data,
java.lang.Object select)
combo - the combo to filldata - data ot inject in comboselect - the object to select in combo after reflling his model
public static void fillComboBox(JAXXComboBox combo,
java.util.Collection<?> data,
java.lang.Object select,
boolean firstNull)
combo - the combo to filldata - data ot inject in comboselect - the object to select in combo after reflling his modelfirstNull - add a first null element
public static void fixTableColumnWidth(javax.swing.JTable table,
int columnIndex,
int width)
public static void setTableColumnEditor(javax.swing.JTable table,
int columnIndex,
javax.swing.table.TableCellEditor editor)
public static void setTableColumnRenderer(javax.swing.JTable table,
int columnIndex,
javax.swing.table.TableCellRenderer editor)
public static void setI18nTableHeaderRenderer(javax.swing.JTable table,
java.lang.String... libelles)
public static javax.swing.table.TableCellRenderer newStringTableCellRenderer(javax.swing.table.DefaultTableCellRenderer renderer,
int length,
boolean tooltip)
public static org.jdesktop.jxlayer.JXLayer<?> boxComponentWithJxLayer(javax.swing.JComponent component)
JXLayer.
component - the component to box
JXLayer boxing the componentpublic static java.util.List<javax.swing.JComponent> getLayeredComponents(JAXXObject object)
public static org.jdesktop.jxlayer.JXLayer<javax.swing.JComponent> getLayer(javax.swing.JComponent comp)
public static boolean isLayered(javax.swing.JComponent comp)
public static java.util.Map<java.lang.String,javax.swing.JComponent> lookingForEditor(java.lang.Class<?> clazz,
java.awt.Container container)
clazz - la classe ou recherche les champscontainer - le container ou rechercher les composants d'edition
public static void center(java.awt.Component parent,
java.awt.Component component)
parent - le component parentcomponent - le component à centrer
public static void initNimbusLoookAndFeel()
throws javax.swing.UnsupportedLookAndFeelException,
java.lang.ClassNotFoundException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
javax.swing.UnsupportedLookAndFeelException - if nimbus is not applicable
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static void loadUIConfig(java.lang.String defaultUIConfig,
java.lang.String extraUIConfig)
throws java.io.IOException
UIManager colors and icons found.
defaultUIConfig - le path vers le fichier de la config d'ui par défaut (doit etre dansle class-path)extraUIConfig - le path vers une surcharge de la config d'ui (doit etre dans le class-path)
java.io.IOException - if could not load the ui.properties filepublic static SwingUtil.TabbedPaneIterator<java.awt.Component> newTabbedPaneIterator(javax.swing.JTabbedPane tabs)
JTabbedPane in natural order.
Says using method Container.getComponent(int)
tabs - the
public static javax.swing.JLabel newLabel(java.lang.String text,
java.lang.Object iconKey,
int aligment)
public static java.awt.Component getDeepestObjectAt(java.awt.Component parent,
int x,
int y)
parent - x - y -
public static java.awt.Component findComponentAt(java.awt.Container cont,
int width,
int height,
int x,
int y)
public static <O> javax.swing.DefaultListCellRenderer newDecoratedListCellRenderer(Decorator<O> decorator)
O - le type des données gérées par le décorateurdecorator - le décorateur à encapsuler
Decoratorpublic static javax.swing.table.TableCellRenderer newDeleteCellRenderer(javax.swing.table.DefaultTableCellRenderer renderer)
public static javax.swing.table.TableCellRenderer newBooleanTableCellRenderer(javax.swing.table.DefaultTableCellRenderer renderer)
public static DecoratorTableCellRenderer newDecorateTableCellRenderer(javax.swing.table.TableCellRenderer renderer,
Decorator<?> decorator)
public static EmptyNumberTableCellRenderer newEmptyNumberTableCellRenderer(javax.swing.table.TableCellRenderer renderer)
public static <E extends java.lang.Enum<E>> EnumTableCellRenderer<E> newEnumTableCellRenderer(javax.swing.table.TableCellRenderer renderer,
java.lang.Class<E> enumClass)
public static void openLink(javax.swing.event.HyperlinkEvent he)
HyperlinkEvent.
And try to open the link if an url in a browser.
he - the event to treate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||