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 String FORM_KEY_PREFIX
           
static 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(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(String uri)
           
static void browseURI(URI uri)
           
static void browseURI(URL url)
           
static void createEmail(String emailAdress)
           
static Component crossOf(Component component)
          Used to cross of component
static String crossOf(String text)
          Used to cross of text
static void exportToCSV(File file, OfferListTableModel model)
          Export la table des résultats de recherche au format CSV.
static ListCellRenderer get2DigitsRenderer()
          Get time list renderer (hour or minutes).
static
<E extends Component>
E
getContentIfExist(jaxx.runtime.swing.CardLayout2 contentLayout, JPanel content, Class<E> uiClass)
          Get content if exist in content, else return null
static com.jurismarches.vradi.services.VradiDataService getDataService()
           
static String getFormTraduction(String key)
          Return traduction of form field pass in param
static ComboBoxModel getFormTypesModel()
           
static ComboBoxModel getFormTypesModel(boolean firstNull)
           
static EntityModel<com.jurismarches.vradi.entities.Group> getGroupModel(boolean firstNull)
           
static
<T> T
getHandler(jaxx.runtime.JAXXContext context, Class<T> handlerClass)
           
static ComboBoxModel getHourModel()
          Return an initialized ComboBoxModel with int from 0 to 24.
static String getInfogeneTraduction(String key)
          Return traduction of infogene field pass in param
static ComboBoxModel getMinuteModel()
          Return an initialized ComboBoxModel with int from 0 to 60.
static ComboBoxModel getNumberComboBoxModel(int nbData)
          Return an initialized ComboBoxModel with int from 0 to nbData.
static ComboBoxModel getNumberComboBoxModel(int startIndex, int nbData)
          Return an initialized ComboBoxModel with int from startIndex and filled with nbData.
static ListCellRenderer getStatusCellRenderer()
          Return status cell renderer (translate i18n status name key).
static ListModel getStatusesModel(boolean firstNull)
           
static ListCellRenderer getTranslationListCellRenderer()
           
static ListCellRenderer getTranslationRenderer()
          Return i18n translation for value.
static EntityModel<com.jurismarches.vradi.entities.XmlStream> getXmlStreamsModel()
           
static void openAddressInBrowser(String address)
          Ouvre un navigateur sur google maps.
static File openFileChooser(String fileExtension, String description, Component component, String validationLabel)
          Ouvre un file chooser configuré sur un certain type de fichier et retourne le fichier choisit par l'utilisateur.
static void setI18nTableHeaderRenderer(JTable table, String... libelles)
           
static void updateListSelection(JList list, 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 String INFOGENE_KEY_PREFIX
See Also:
Constant Field Values

FORM_KEY_PREFIX

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

getInfogeneTraduction

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

Parameters:
key - to traduct
Returns:
traducted

getFormTraduction

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

Parameters:
key - to traduct
Returns:
traducted

updateListSelection

public static void updateListSelection(JList list,
                                       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(JTable table,
                                              String... libelles)

openAddressInBrowser

public static void openAddressInBrowser(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(URI uri)
                      throws IOException
Throws:
IOException

browseURI

public static void browseURI(String uri)
                      throws IOException
Throws:
IOException

browseURI

public static void browseURI(URL url)
                      throws IOException
Throws:
IOException

createEmail

public static void createEmail(String emailAdress)
                        throws IOException,
                               URISyntaxException,
                               UnsupportedOperationException
Throws:
IOException
URISyntaxException
UnsupportedOperationException

exportToCSV

public static void exportToCSV(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 File openFileChooser(String fileExtension,
                                   String description,
                                   Component component,
                                   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 ListCellRenderer getTranslationListCellRenderer()

getHandler

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

getNumberComboBoxModel

public static 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 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 ComboBoxModel getHourModel()
Return an initialized ComboBoxModel with int from 0 to 24. (used in xmlstream import time config)

Returns:
ComboBoxModel

getMinuteModel

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

Returns:
ComboBoxModel

get2DigitsRenderer

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

Returns:
ListCellRenderer

getTranslationRenderer

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

Returns:
i18n transaltion

getDataService

public static com.jurismarches.vradi.services.VradiDataService getDataService()

getGroupModel

public static EntityModel<com.jurismarches.vradi.entities.Group> getGroupModel(boolean firstNull)

getXmlStreamsModel

public static EntityModel<com.jurismarches.vradi.entities.XmlStream> getXmlStreamsModel()

getStatusesModel

public static ListModel getStatusesModel(boolean firstNull)

getStatusCellRenderer

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

Returns:
ListCellRenderer

getFormTypesModel

public static ComboBoxModel getFormTypesModel()

getFormTypesModel

public static ComboBoxModel getFormTypesModel(boolean firstNull)

getContentIfExist

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


crossOf

public static String crossOf(String text)
Used to cross of text

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

crossOf

public static Component crossOf(Component component)
Used to cross of component

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

addThesaurusExpandOnClickListener

public static void addThesaurusExpandOnClickListener(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.