Package jadex.base.gui.filetree
Class DefaultFileFilterMenuItemConstructor
- java.lang.Object
-
- jadex.base.gui.filetree.DefaultFileFilterMenuItemConstructor
-
- All Implemented Interfaces:
IMenuItemConstructor
,IPropertiesProvider
public class DefaultFileFilterMenuItemConstructor extends java.lang.Object implements IMenuItemConstructor, IPropertiesProvider
Dynamically create a new menu item structure for starting components.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map
filetypes
The supported file types to menu items.protected javax.swing.JMenu
menu
The menu.static java.lang.String
SELECT_ALL
Constant for select all menu item.static java.lang.String[]
STANDARD_TYPES
Constant for some standard file extensions.protected javax.swing.tree.TreeModel
treemodel
The root node.protected java.lang.String[]
types
The file types.
-
Constructor Summary
Constructors Constructor Description DefaultFileFilterMenuItemConstructor(AsyncSwingTreeModel treemodel)
Create a new filter menu item constructor.DefaultFileFilterMenuItemConstructor(AsyncSwingTreeModel treemodel, boolean selall)
Create a new filter menu item constructor.DefaultFileFilterMenuItemConstructor(java.lang.String[] types, AsyncSwingTreeModel treemodel)
Create a new filter menu item constructor.DefaultFileFilterMenuItemConstructor(java.lang.String[] types, AsyncSwingTreeModel treemodel, boolean selall)
Create a new filter menu item constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JMenuItem
getMenuItem()
Get or create a new menu item (struture).IFuture<Properties>
getProperties()
Write current state into properties.java.util.List<java.lang.String>
getSelectedComponentTypes()
Get all selected component types.boolean
isAll()
Test all flag.boolean
isEnabled()
Test if action is available in current context.void
setAll(boolean bool)
Set the all flag.IFuture<java.lang.Void>
setProperties(Properties props)
Update tool from given properties.void
setSelectedComponentTypes(java.util.Set selected)
Select a set of menu items.
-
-
-
Field Detail
-
STANDARD_TYPES
public static final java.lang.String[] STANDARD_TYPES
Constant for some standard file extensions.
-
SELECT_ALL
public static final java.lang.String SELECT_ALL
Constant for select all menu item.- See Also:
- Constant Field Values
-
types
protected java.lang.String[] types
The file types.
-
treemodel
protected javax.swing.tree.TreeModel treemodel
The root node.
-
menu
protected javax.swing.JMenu menu
The menu.
-
filetypes
protected java.util.Map filetypes
The supported file types to menu items.
-
-
Constructor Detail
-
DefaultFileFilterMenuItemConstructor
public DefaultFileFilterMenuItemConstructor(AsyncSwingTreeModel treemodel)
Create a new filter menu item constructor.
-
DefaultFileFilterMenuItemConstructor
public DefaultFileFilterMenuItemConstructor(AsyncSwingTreeModel treemodel, boolean selall)
Create a new filter menu item constructor.
-
DefaultFileFilterMenuItemConstructor
public DefaultFileFilterMenuItemConstructor(java.lang.String[] types, AsyncSwingTreeModel treemodel)
Create a new filter menu item constructor.
-
DefaultFileFilterMenuItemConstructor
public DefaultFileFilterMenuItemConstructor(java.lang.String[] types, AsyncSwingTreeModel treemodel, boolean selall)
Create a new filter menu item constructor.
-
-
Method Detail
-
isAll
public boolean isAll()
Test all flag.- Returns:
- True, if all is true.
-
setAll
public void setAll(boolean bool)
Set the all flag.- Parameters:
bool
- True for selecting all.
-
getSelectedComponentTypes
public java.util.List<java.lang.String> getSelectedComponentTypes()
Get all selected component types.- Returns:
- The selected component types.
-
setSelectedComponentTypes
public void setSelectedComponentTypes(java.util.Set selected)
Select a set of menu items.
-
getMenuItem
public javax.swing.JMenuItem getMenuItem()
Get or create a new menu item (struture).- Specified by:
getMenuItem
in interfaceIMenuItemConstructor
- Returns:
- The menu item (structure).
-
getProperties
public IFuture<Properties> getProperties()
Write current state into properties.- Specified by:
getProperties
in interfaceIPropertiesProvider
-
setProperties
public IFuture<java.lang.Void> setProperties(Properties props)
Update tool from given properties.- Specified by:
setProperties
in interfaceIPropertiesProvider
-
isEnabled
public boolean isEnabled()
Test if action is available in current context.- Returns:
- True, if available.
-
-