public class FormTableUtilityPopup extends Object implements MouseListener, KeyListener
| Modifier and Type | Field and Description |
|---|---|
static String |
POPUP_AUTOWIDTH
autowidth
|
static String |
POPUP_COLUMN
component name in popup for the column item
|
static String |
POPUP_COLUMN_DESELECTALL
component name in popup for
|
static String |
POPUP_COLUMN_MENU
component name in popup for the column submenu
|
static String |
POPUP_COLUMN_SELECTALL
component name in popup for select all columns item
|
static String |
POPUP_EXPORT_EXCEL
component name in popup for
|
static String |
POPUP_EXPORT_EXCEL_SELECTED
component name in popup for
|
static String |
POPUP_EXPORT_XML
component name in popup for
|
static String |
POPUP_EXPORT_XML_SELECTED
component name in popup for
|
static String |
POPUP_LOAD_DEFAULTS
component name in popup for
|
static String |
POPUP_LOAD_SYSTEM_PREFS
component name in popup for
|
static String |
POPUP_LOAD_USER_PREFS
component name in popup for
|
static String |
POPUP_MENU
component name in popup for the menu
|
static String |
POPUP_PRINT
component name in popup for
|
static String |
POPUP_SAVE_SYSTEM_PREFS
component name in popup for
|
static String |
POPUP_SAVE_USER_PREFS
component name in popup for
|
static String |
POPUP_SEARCH
component name in popup for
|
| Constructor and Description |
|---|
FormTableUtilityPopup() |
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyListener()
Adds the default key listener for
KeyEvent.VK_F3. |
void |
addKeyListenerForKey(int keyCode)
Adds a key listener for a given keycode.
|
JPopupMenu |
createPopupMenu()
Creates the popup-menu.
|
String |
getIntro()
Gets the intro text.
|
FormTable<?> |
getTable()
Gets the table.
|
String |
getTitle()
Gets the title.
|
boolean |
isColumnMenuEnabled()
Returns whether the column menu is enabled.
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
void |
mouseClicked(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
removeKeyListener()
Removes the key listener.
|
void |
restoreSettings(boolean system)
Restores the tables default settings from the Preferences.
|
void |
saveSettings(boolean system)
Saves the table settings to the Preferences.
|
boolean |
search(String searchText,
boolean caseSensitive)
Searches for a text starting at the current cell.
|
void |
setColumnMenuEnabled(boolean columnMenuEnabled)
Enables or disables the column menu.
The column menu allows to set the visibility of columns. |
void |
setIntro(String intro)
Sets the intro-text.
The intro will be printed on the first page and shown in toExcel sheets. |
void |
setTable(FormTable<?> table)
Sets the table.
|
void |
setTitle(String title)
Sets the title.
The title will be printed pn each page and shown in toExcel sheets. |
void |
showExcelDialog(boolean onlySelected)
Opens a dialog to export a table to an Excel sheet.
|
void |
showPrintDialog()
Prints the table.
|
void |
showSearchDialog()
Opens a dialog to search in a table
starting at the current cell.
|
void |
showXmlDialog(boolean onlySelected)
Opens a dialog to export a table to an XML file.
|
void |
toExcel(File file,
boolean onlySelected)
Converts the table to an Excel spreadsheet.
|
void |
toXml(File file,
boolean onlySelected)
Exports a table to an XML file.
|
public static final String POPUP_MENU
public static final String POPUP_COLUMN_MENU
public static final String POPUP_COLUMN
public static final String POPUP_COLUMN_SELECTALL
public static final String POPUP_COLUMN_DESELECTALL
public static final String POPUP_SEARCH
public static final String POPUP_PRINT
public static final String POPUP_EXPORT_EXCEL
public static final String POPUP_EXPORT_EXCEL_SELECTED
public static final String POPUP_EXPORT_XML
public static final String POPUP_EXPORT_XML_SELECTED
public static final String POPUP_SAVE_SYSTEM_PREFS
public static final String POPUP_LOAD_SYSTEM_PREFS
public static final String POPUP_SAVE_USER_PREFS
public static final String POPUP_LOAD_USER_PREFS
public static final String POPUP_LOAD_DEFAULTS
public static final String POPUP_AUTOWIDTH
public void setTable(FormTable<?> table)
table - the table, null to clearpublic FormTable<?> getTable()
public void setTitle(String title)
title - the title, null if default from windowpublic String getTitle()
public void setIntro(String intro)
intro - the intro, null = nonepublic String getIntro()
public JPopupMenu createPopupMenu()
public boolean isColumnMenuEnabled()
public void setColumnMenuEnabled(boolean columnMenuEnabled)
columnMenuEnabled - true to enable column menu (default)public void saveSettings(boolean system)
system - is true if save to systemRoot, else userRootpublic void restoreSettings(boolean system)
system - is true if load ONLY from systemRoot, else try userRoot first (should be default)public boolean search(String searchText, boolean caseSensitive)
searchText - the search textcaseSensitive - true if case sensitivepublic void showSearchDialog()
public void showPrintDialog()
public void toExcel(File file, boolean onlySelected) throws IOException
file - the output fileonlySelected - true if export only selected rowsIOException - if export failedpublic void showExcelDialog(boolean onlySelected)
onlySelected - true if export only selected rowspublic void toXml(File file, boolean onlySelected) throws IOException, TransformerConfigurationException, SAXException
file - the output fileonlySelected - true if export only selected rowsIOException - if file could not be openedTransformerConfigurationException - if no transformer could be createdSAXException - if xml document creation failedpublic void showXmlDialog(boolean onlySelected)
onlySelected - true if export only selected rowspublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void addKeyListenerForKey(int keyCode)
keyCode - the keycodepublic void addKeyListener()
KeyEvent.VK_F3.
Pressing this key will start the search dialog or continue the search.public void removeKeyListener()
public void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void keyTyped(KeyEvent e)
keyTyped in interface KeyListenerTentackle - a domain driven enterprise framework