com.jurismarches.vradi.ui.helpers
Class UIHelper

java.lang.Object
  extended by jaxx.runtime.JAXXUtil
      extended by jaxx.runtime.SwingUtil
          extended by com.jurismarches.vradi.ui.helpers.UIHelper

public class UIHelper
extends jaxx.runtime.SwingUtil

Classe de méthodes utiles pour les ui.

User: chemit Date: 23 nov. 2009 Time: 11:51:14


Nested Class Summary
static class UIHelper.NumberFormatterFactory
          NumberFormatterFactory creates a new NumberFormatter for Integer of variable length.
 
Nested classes/interfaces inherited from class jaxx.runtime.SwingUtil
jaxx.runtime.SwingUtil.TabbedPaneIterator<O>
 
Field Summary
static java.lang.String FORM_KEY_PREFIX
           
static java.lang.String INFOGENE_KEY_PREFIX
           
 
Fields inherited from class jaxx.runtime.SwingUtil
COLOR_PREFIX, DEFAULT_ICON_PATH, DEFAULT_ICON_PATH_PROPERTY, ICON_PREFIX
 
Fields inherited from class jaxx.runtime.JAXXUtil
PARENT
 
Method Summary
static void addThesaurusExpandOnClickListener(javax.swing.JTree tree)
          Add a listener of tree selection model to expand a new selected node when it is selected.
static void addThesaurusExpandOnClickListener(org.jdesktop.swingx.JXTreeTable treeTable)
          Add a listener of tree selection model to expand a new selected node when it is selected.
static void browseURI(java.lang.String uri)
           
static void browseURI(java.net.URI uri)
           
static void browseURI(java.net.URL url)
           
static void createEmail(java.lang.String emailAdress)
           
static java.awt.Component crossOf(java.awt.Component component)
          Used to cross of component
static java.lang.String crossOf(java.lang.String text)
          Used to cross of text
static void exportToCSV(java.io.File file, OfferListTableModel model)
          Export la table des résultats de recherche au format CSV.
static javax.swing.ListCellRenderer get2DigitsRenderer()
          Get time list renderer (hour or minutes).
static
<E extends java.awt.Component>
E
getContentIfExist(jaxx.runtime.swing.CardLayout2 contentLayout, javax.swing.JPanel content, java.lang.Class<E> uiClass)
          Get content if exist in content, else return null
static VradiDataService getDataService()
           
static java.lang.String getFormTraduction(java.lang.String key)
          Return traduction of form field pass in param
static javax.swing.ComboBoxModel getFormTypesModel()
           
static javax.swing.ComboBoxModel getFormTypesModel(boolean firstNull)
           
static EntityModel<Group> getGroupModel(boolean firstNull)
           
static
<T> T
getHandler(jaxx.runtime.JAXXContext context, java.lang.Class<T> handlerClass)
           
static javax.swing.ComboBoxModel getHourModel()
          Return an initialized ComboBoxModel with int from 0 to 24.
static java.lang.String getInfogeneTraduction(java.lang.String key)
          Return traduction of infogene field pass in param
static javax.swing.ComboBoxModel getMinuteModel()
          Return an initialized ComboBoxModel with int from 0 to 60.
static javax.swing.ComboBoxModel getNumberComboBoxModel(int nbData)
          Return an initialized ComboBoxModel with int from 0 to nbData.
static javax.swing.ComboBoxModel getNumberComboBoxModel(int startIndex, int nbData)
          Return an initialized ComboBoxModel with int from startIndex and filled with nbData.
static javax.swing.ListCellRenderer getStatusCellRenderer()
          Return status cell renderer (translate i18n status name key).
static javax.swing.ListModel getStatusesModel(boolean firstNull)
           
static javax.swing.ListCellRenderer getTranslationListCellRenderer()
           
static javax.swing.ListCellRenderer getTranslationRenderer()
          Return i18n translation for value.
static EntityModel<XmlStream> getXmlStreamsModel()
           
static void openAddressInBrowser(java.lang.String address)
          Ouvre un navigateur sur google maps.
static java.io.File openFileChooser(java.lang.String fileExtension, java.lang.String description, java.awt.Component component, java.lang.String validationLabel)
          Ouvre un file chooser configuré sur un certain type de fichier et retourne le fichier choisit par l'utilisateur.
static void setI18nTableHeaderRenderer(javax.swing.JTable table, java.lang.String... libelles)
           
static void updateListSelection(javax.swing.JList list, java.lang.Object value)
          Met à jour le modèle de sélection list donnée avec l'objet value entrant.
 
Methods inherited from class jaxx.runtime.SwingUtil
addExpandOnClickListener, addExpandOnClickListener, boxComponentWithJxLayer, center, computeTableColumnWidth, createActionIcon, createI18nIcon, createIcon, createImageIcon, expandTree, expandTreeTable, fillComboBox, fillComboBox, fillList, findComponentAt, fixTableColumnWidth, getDeepestObjectAt, getLayer, getLayeredComponents, getParentContainer, getUIManagerActionIcon, getUIManagerIcon, initNimbusLoookAndFeel, isLayered, loadUIConfig, loadUIConfig, lookingForEditor, newBooleanTableCellRenderer, newDeleteCellRenderer, newEmptyNumberTableCellRenderer, newEnumTableCellRenderer, newLabel, newMaxXDimension, newMaxXYDimension, newMaxYDimension, newMinDimension, newStringTableCellRenderer, newTabbedPaneIterator, openLink, openLink, setComponentHeight, setComponentWidth, setTableColumnEditor, setTableColumnRenderer, setText
 
Methods inherited from class jaxx.runtime.JAXXUtil
applyDataBinding, applyDataBinding, assignment, assignment, assignment, assignment, assignment, assignment, assignment, assignment, assignment, castList, castMap, checkJAXXContextEntries, checkJAXXContextEntry, decodeCompressedJAXXObjectDescriptor, decodeJAXXObjectDescriptor, destroy, destroy, findJaxxPropertyChangeListener, getDataBindingUpdateListener, getEventListener, getEventListener, getStringValue, initContext, invokeConstructor, newContextEntryDef, newContextEntryDef, newListContextEntryDef, newListContextEntryDef, newMapContextEntryDef, processDataBinding, removeDataBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFOGENE_KEY_PREFIX

public static final java.lang.String INFOGENE_KEY_PREFIX
See Also:
Constant Field Values

FORM_KEY_PREFIX

public static final java.lang.String FORM_KEY_PREFIX
See Also:
Constant Field Values
Method Detail

getInfogeneTraduction

public static java.lang.String getInfogeneTraduction(java.lang.String key)
Return traduction of infogene field pass in param

Parameters:
key - to traduct
Returns:
traducted

getFormTraduction

public static java.lang.String getFormTraduction(java.lang.String key)
Return traduction of form field pass in param

Parameters:
key - to traduct
Returns:
traducted

updateListSelection

public static void updateListSelection(javax.swing.JList list,
                                       java.lang.Object value)
Met à jour le modèle de sélection list donnée avec l'objet value entrant.

value represente normalement une collection de données.

Parameters:
list - la liste à updater
value - la liste des valeurs de la selection de la liste.

setI18nTableHeaderRenderer

public static void setI18nTableHeaderRenderer(javax.swing.JTable table,
                                              java.lang.String... libelles)

openAddressInBrowser

public static void openAddressInBrowser(java.lang.String address)
Ouvre un navigateur sur google maps. Utilisé dans les champs "address" des clients et des utilisateurs.

Parameters:
address - address to browse

browseURI

public static void browseURI(java.net.URI uri)
                      throws java.io.IOException
Throws:
java.io.IOException

browseURI

public static void browseURI(java.lang.String uri)
                      throws java.io.IOException
Throws:
java.io.IOException

browseURI

public static void browseURI(java.net.URL url)
                      throws java.io.IOException
Throws:
java.io.IOException

createEmail

public static void createEmail(java.lang.String emailAdress)
                        throws java.io.IOException,
                               java.net.URISyntaxException,
                               java.lang.UnsupportedOperationException
Throws:
java.io.IOException
java.net.URISyntaxException
java.lang.UnsupportedOperationException

exportToCSV

public static void exportToCSV(java.io.File file,
                               OfferListTableModel model)
Export la table des résultats de recherche au format CSV.

Parameters:
file - file to export to
model - model to export

openFileChooser

public static java.io.File openFileChooser(java.lang.String fileExtension,
                                           java.lang.String description,
                                           java.awt.Component component,
                                           java.lang.String validationLabel)
Ouvre un file chooser configuré sur un certain type de fichier et retourne le fichier choisit par l'utilisateur.

Parameters:
fileExtension - extension with begin "."
description - filter description
component - parent component
validationLabel - ok button label
Returns:
selected file or null

getTranslationListCellRenderer

public static javax.swing.ListCellRenderer getTranslationListCellRenderer()

getHandler

public static <T> T getHandler(jaxx.runtime.JAXXContext context,
                               java.lang.Class<T> handlerClass)

getNumberComboBoxModel

public static javax.swing.ComboBoxModel getNumberComboBoxModel(int startIndex,
                                                               int nbData)
Return an initialized ComboBoxModel with int from startIndex and filled with nbData. (used in xmlstream import time config)

Parameters:
startIndex - start index
nbData - nb data
Returns:
ComboBoxModel

getNumberComboBoxModel

public static javax.swing.ComboBoxModel getNumberComboBoxModel(int nbData)
Return an initialized ComboBoxModel with int from 0 to nbData. (used in xmlstream import time config)

Parameters:
nbData - nb data
Returns:
ComboBoxModel

getHourModel

public static javax.swing.ComboBoxModel getHourModel()
Return an initialized ComboBoxModel with int from 0 to 24. (used in xmlstream import time config)

Returns:
ComboBoxModel

getMinuteModel

public static javax.swing.ComboBoxModel getMinuteModel()
Return an initialized ComboBoxModel with int from 0 to 60. (used in xmlstream import time config)

Returns:
ComboBoxModel

get2DigitsRenderer

public static javax.swing.ListCellRenderer get2DigitsRenderer()
Get time list renderer (hour or minutes).

Returns:
ListCellRenderer

getTranslationRenderer

public static javax.swing.ListCellRenderer getTranslationRenderer()
Return i18n translation for value.

Returns:
i18n transaltion

getDataService

public static VradiDataService getDataService()

getGroupModel

public static EntityModel<Group> getGroupModel(boolean firstNull)

getXmlStreamsModel

public static EntityModel<XmlStream> getXmlStreamsModel()

getStatusesModel

public static javax.swing.ListModel getStatusesModel(boolean firstNull)

getStatusCellRenderer

public static javax.swing.ListCellRenderer getStatusCellRenderer()
Return status cell renderer (translate i18n status name key).

Returns:
ListCellRenderer

getFormTypesModel

public static javax.swing.ComboBoxModel getFormTypesModel()

getFormTypesModel

public static javax.swing.ComboBoxModel getFormTypesModel(boolean firstNull)

getContentIfExist

public static <E extends java.awt.Component> E getContentIfExist(jaxx.runtime.swing.CardLayout2 contentLayout,
                                                                 javax.swing.JPanel content,
                                                                 java.lang.Class<E> uiClass)
Get content if exist in content, else return null


crossOf

public static java.lang.String crossOf(java.lang.String text)
Used to cross of text

Parameters:
text - to cross of
Returns:
text crossed of

crossOf

public static java.awt.Component crossOf(java.awt.Component component)
Used to cross of component

Parameters:
component - to cross of
Returns:
component crossed of

addThesaurusExpandOnClickListener

public static void addThesaurusExpandOnClickListener(javax.swing.JTree tree)
Add a listener of tree selection model to expand a new selected node when it is selected.

Parameters:
tree - the tree to treate

addThesaurusExpandOnClickListener

public static void addThesaurusExpandOnClickListener(org.jdesktop.swingx.JXTreeTable treeTable)
Add a listener of tree selection model to expand a new selected node when it is selected.

Parameters:
treeTable - the treeTable to treate


Copyright © 2009-2010 JurisMarches. All Rights Reserved.