|
com.im.ijc.widgets/1 5.9.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.im.ijc.widgets.common.CommonWidgetsUtils
public final class CommonWidgetsUtils
Common Widgets utilities.
| Nested Class Summary | |
|---|---|
static class |
CommonWidgetsUtils.TreeCategory
|
| Method Summary | ||
|---|---|---|
static List<? extends DFItem> |
acceptItems(DFDataTree.Vertex vertex,
BindFieldAcceptor acceptor,
boolean recursive)
Recursively traverse subtree of the given vertex and returns all items accepted by the given acceptor. |
|
static void |
acceptItemsAsTree(List<CommonWidgetsUtils.TreeCategory> treeCollector,
DFDataTree.Vertex vertex,
BindFieldAcceptor acceptor)
|
|
static void |
acceptItemsAsTreeAndList(List<CommonWidgetsUtils.TreeCategory> treeCollector,
List<DFItem> listCollector,
DFDataTree.Vertex vertex,
BindFieldAcceptor acceptor)
|
|
static void |
addActionToMenu(JPopupMenu menu,
Action action)
|
|
static void |
addActionToMenu(JPopupMenu menu,
Action action,
Boolean checked)
|
|
static void |
addActionToMenu(JPopupMenu menu,
Class<? extends SystemAction> actionClass)
|
|
static void |
addLayerSubmenu(JPopupMenu menu,
DatasetType fgDatasetType,
Function<DatasetType,Void> callback)
|
|
static boolean |
canStartTableCellEditing(EventObject anEvent)
Performs a check if an event can initiate cell editing in a table. |
|
static String |
computeExpressionAsText(DFTermExpression expr)
|
|
static String |
computeExpressionAsText(DFTermExpression expr,
String originalText)
|
|
static JPopupMenu |
createOperatorPopupMenu(DFResultSet rs,
DFField field,
Runnable runInAWT)
Create popup menu for selection all available operators for the given field. |
|
static
|
createSettings()
|
|
static MouseListener |
createStartEditMouseListener(IJCWidget.Editable widget)
Simple factory to create a mouse listener that initiates editing on a mouse double click. |
|
static void |
executeQuery(DFView view)
|
|
static Object |
findFieldInQuery(DFField field,
DFTermExpression term)
Tries to find the bound field in given result set's working query. |
|
static MarvinStructure |
findStructureInQuery(DFField field,
DFTermExpression term)
|
|
static List<? extends DFField> |
getAllFields(DFDataTree dataTree)
|
|
static List<? extends DFField> |
getAllFields(DFView view)
|
|
static CommonWidgetSettings |
getCommonWidgetSettings(Object storedSettings)
|
|
static List<? extends DFField> |
getNumericFields(DFDataTree tree,
boolean recursive)
|
|
static SelectionDescription |
getRelativeSelection(SelectionDescription selection,
DatasetType datasetType)
|
|
static SelectionDescription |
getWidgetSelection(SelectionDescription selection,
DatasetType datasetType)
|
|
static
|
getWidgetSettingsWithRenderer(Class<T> rendererClass,
Object storedSettings,
Compatibility compatibility)
Returns an instance of widget settings
properly initialized with the old settings - a renderer; if the old
settings is being restored or just casted instance of the widget
settings. |
|
static boolean |
isRelationFields(DFField field)
Check if field is part of relation. |
|
static void |
notifyErrorWhenSettingValue(Exception exc)
|
|
static
|
openPropertySheetFor(Iterable<T> beans)
Open the dialog with property sheet. |
|
static boolean |
queryUpdateRSFromTextWidget(DFResultSet rs,
DFField field,
String newExpressionAsText,
Runnable beforeRSUpdate,
Runnable afterRSUpdate)
Helper utility method used by text widget and table widget. |
|
static boolean |
queryValidateFromTextWidget(DFResultSet rs,
DFField field,
String newExpressionAsText)
Helper utility method used by text widget and table widget. |
|
static void |
registerStandardKeys(JComponent comp,
IJCWidget.Editable widget)
Maps Edit (F2), Delete, Cut, Copy and Paste keys to standard actions. |
|
static void |
setCFFieldsValues(Object renderer,
DFResultSet.VertexState vs)
|
|
static void |
setDeleteAction(JComponent comp,
Action action)
Sets given action as a delete action of the given component. |
|
static void |
setToolTipError(TermErrors errors,
JComponent component)
|
|
static void |
setToolTipError(TermErrors errors,
String toolTipWhenNoErrors,
JComponent component)
Set tooltip hint for components in query mode. |
|
static void |
tryToCustomizeStructureRenderer(Object renderer)
|
|
static void |
tryToSetOperatorToStructureRenderer(Object renderer,
DFTermExpression expr)
|
|
static boolean |
updateMoleculeInQuery(DFResultSet rs,
DFField field,
MarvinStructure mol)
|
|
static boolean |
updateOperatorOrOptionsInQuery(DFResultSet rs,
DFField field,
DFOperator operator,
Map<String,Object> options,
Runnable runInAWT)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean canStartTableCellEditing(EventObject anEvent)
DefaultCellEditor.setClickCountToStart(int)public static <T> boolean openPropertySheetFor(Iterable<T> beans)
beans - The bean(s) to be customized
true means data were potentially changed, false means
beans wasn't changed.
public static Object findFieldInQuery(DFField field,
DFTermExpression term)
field - The field which you are looking for. Can be nullterm - The term where you are looking for the field occurrences. Can be null
public static MarvinStructure findStructureInQuery(DFField field,
DFTermExpression term)
public static String computeExpressionAsText(DFTermExpression expr,
String originalText)
expr - expressionoriginalText - user's original input
public static String computeExpressionAsText(DFTermExpression expr)
public static boolean queryValidateFromTextWidget(DFResultSet rs,
DFField field,
String newExpressionAsText)
rs - Result set for which the expression should be validatedfield - The field for this expressionnewExpressionAsText - The text version of the expression (without field name).
public static boolean queryUpdateRSFromTextWidget(DFResultSet rs,
DFField field,
String newExpressionAsText,
Runnable beforeRSUpdate,
Runnable afterRSUpdate)
rs - Result set where the expression should be updatedfield - The field for this expressionnewExpressionAsText - The text version of the expression (without field name).beforeRSUpdate - This Runnable is executed just before DFResultSet.setWorkingQuery method call. Can be null.afterRSUpdate - This Runnable is executed after DFResultSet.setWorkingQuery method call. Can be null.
public static void setToolTipError(TermErrors errors,
String toolTipWhenNoErrors,
JComponent component)
errors - Can be null - then it means there is no error and default tooltip will be used. If there are
errors, then the first error message is used as a tooltip.toolTipWhenNoErrors - In the case that there is no error this tooltip will be usedcomponent - The component where tooltip will be set
public static void setToolTipError(TermErrors errors,
JComponent component)
public static boolean updateMoleculeInQuery(DFResultSet rs,
DFField field,
MarvinStructure mol)
public static JPopupMenu createOperatorPopupMenu(DFResultSet rs,
DFField field,
Runnable runInAWT)
rs - The base resultset object - new working query will be set to this result setfield - The field bound to the widget which is invoking this popup menurunInAWT - The special runnable to be executed in AWT thread after operator is changed.
public static void addActionToMenu(JPopupMenu menu,
Action action,
Boolean checked)
public static void registerStandardKeys(JComponent comp,
IJCWidget.Editable widget)
public static MouseListener createStartEditMouseListener(IJCWidget.Editable widget)
public static boolean updateOperatorOrOptionsInQuery(DFResultSet rs,
DFField field,
DFOperator operator,
Map<String,Object> options,
Runnable runInAWT)
public static void tryToCustomizeStructureRenderer(Object renderer)
public static void tryToSetOperatorToStructureRenderer(Object renderer,
DFTermExpression expr)
public static boolean isRelationFields(DFField field)
public static void executeQuery(DFView view)
public static List<? extends DFItem> acceptItems(DFDataTree.Vertex vertex,
BindFieldAcceptor acceptor,
boolean recursive)
acceptor. Among fields, items includes also owning entities for
which the number of their accepted fields were more then zero or if
acceptor accepts empty entities.
vertex - root of a subtree to be traversedacceptor - field acceptorrecursive - if true traverse recursively
public static void acceptItemsAsTree(List<CommonWidgetsUtils.TreeCategory> treeCollector,
DFDataTree.Vertex vertex,
BindFieldAcceptor acceptor)
public static void acceptItemsAsTreeAndList(List<CommonWidgetsUtils.TreeCategory> treeCollector,
List<DFItem> listCollector,
DFDataTree.Vertex vertex,
BindFieldAcceptor acceptor)
public static List<? extends DFField> getNumericFields(DFDataTree tree,
boolean recursive)
public static List<? extends DFField> getAllFields(DFDataTree dataTree)
public static List<? extends DFField> getAllFields(DFView view)
public static void addActionToMenu(JPopupMenu menu,
Class<? extends SystemAction> actionClass)
public static void addActionToMenu(JPopupMenu menu,
Action action)
public static <T> WidgetSettingsWithRenderer<T> getWidgetSettingsWithRenderer(Class<T> rendererClass,
Object storedSettings,
Compatibility compatibility)
widget settings
properly initialized with the old settings - a renderer; if the old
settings is being restored or just casted instance of the widget
settings.
T - type of old settingsrendererClass - class of old rendererstoredSettings - currently stored settings. Might be WidgetSettingsWithRenderer instance or old renderer instancecompatibility - Compatibility object
public static <T> WidgetSettingsWithRenderer<T> createSettings()
public static CommonWidgetSettings getCommonWidgetSettings(Object storedSettings)
public static void setCFFieldsValues(Object renderer,
DFResultSet.VertexState vs)
public static void notifyErrorWhenSettingValue(Exception exc)
public static void addLayerSubmenu(JPopupMenu menu,
DatasetType fgDatasetType,
Function<DatasetType,Void> callback)
public static SelectionDescription getWidgetSelection(SelectionDescription selection,
DatasetType datasetType)
public static SelectionDescription getRelativeSelection(SelectionDescription selection,
DatasetType datasetType)
public static void setDeleteAction(JComponent comp,
Action action)
comp - target componentaction - action to be performed
|
com.im.ijc.widgets/1 5.9.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||