本文整理匯總了Java中javax.swing.plaf.ActionMapUIResource類的典型用法代碼示例。如果您正苦於以下問題:Java ActionMapUIResource類的具體用法?Java ActionMapUIResource怎麽用?Java ActionMapUIResource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ActionMapUIResource類屬於javax.swing.plaf包,在下文中一共展示了ActionMapUIResource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
protected ActionMap createActionMap() {
AbstractAction escAction = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
getFileChooser().cancelSelection();
}
@Override
public boolean isEnabled(){
return getFileChooser().isEnabled();
}
};
ActionMap map = new ActionMapUIResource();
map.put("approveSelection", getApproveSelectionAction());
map.put("cancelSelection", escAction);
map.put("Go Up", getChangeToParentDirectoryAction());
return map;
}
示例2: createActions
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
protected ActionMap createActions() {
final AbstractAction escAction = new AbstractAction() {
private static final long serialVersionUID = -3976059968191425942L;
@Override
public void actionPerformed(ActionEvent e) {
FileChooserUI.this.fileList.stopThumbnailGeneration();
getFileChooser().cancelSelection();
}
@Override
public boolean isEnabled() {
return getFileChooser().isEnabled();
}
};
final ActionMap map = new ActionMapUIResource();
map.put("approveSelection", getApproveSelectionAction());
map.put("cancelSelection", escAction);
return map;
}
示例3: createMyActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
static ActionMap createMyActionMap() {
ActionMap map = new ActionMapUIResource();
map.put("navigateNext", new NextAction());
map.put("navigatePrevious", new PreviousAction());
map.put("navigateRight", new RightAction());
map.put("navigateLeft", new LeftAction());
map.put("navigateUp", new UpAction());
map.put("navigateDown", new DownAction());
map.put("navigatePageUp", new PageUpAction());
map.put("navigatePageDown", new PageDownAction());
map.put("requestFocus", new RequestFocusAction());
map.put("requestFocusForVisibleComponent", new RequestFocusForVisibleAction());
map.put("setSelectedIndex", new SetSelectedIndexAction());
map.put("scrollTabsForwardAction", new ScrollTabsForwardAction());
map.put("scrollTabsBackwardAction", new ScrollTabsBackwardAction());
return map;
}
示例4: getActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
/**
* Creates an ActionMap to be installed on the text component.
*
* @return an ActionMap to be installed on the text component
*/
private ActionMap getActionMap()
{
// Note: There are no .actionMap entries in the standard L&Fs. However,
// with the RI it is possible to install action maps via such keys, so
// we must load them too. It can be observed that when there is no
// .actionMap entry in the UIManager, one gets installed after a text
// component of that type has been loaded.
String prefix = getPropertyPrefix();
String amName = prefix + ".actionMap";
ActionMap am = (ActionMap) UIManager.get(amName);
if (am == null)
{
am = createActionMap();
UIManager.put(amName, am);
}
ActionMap map = new ActionMapUIResource();
map.setParent(am);
return map;
}
示例5: createActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
/**
* Creates a default ActionMap for text components that have no UI default
* for this (the standard for the built-in L&Fs). The ActionMap is copied
* from the text component's getActions() method.
*
* @returna default ActionMap
*/
private ActionMap createActionMap()
{
ActionMap am = new ActionMapUIResource();
Action[] actions = textComponent.getActions();
for (int i = actions.length - 1; i >= 0; i--)
{
Action action = actions[i];
am.put(action.getValue(Action.NAME), action);
}
// Add TransferHandler's actions here. They don't seem to be in the
// JTextComponent's default actions, and I can't make up a better place
// to add them.
Action copyAction = TransferHandler.getCopyAction();
am.put(copyAction.getValue(Action.NAME), copyAction);
Action cutAction = TransferHandler.getCutAction();
am.put(cutAction.getValue(Action.NAME), cutAction);
Action pasteAction = TransferHandler.getPasteAction();
am.put(pasteAction.getValue(Action.NAME), pasteAction);
return am;
}
示例6: installKeyboardActions
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
/**
* Installs look and feel keyboard actions on the root pane.
*
* @param rp the root pane to install the keyboard actions to
*/
protected void installKeyboardActions(JRootPane rp)
{
// Install the keyboard actions.
ActionMapUIResource am = new ActionMapUIResource();
am.put("press", new DefaultPressAction(rp));
am.put("release", new DefaultReleaseAction(rp));
SwingUtilities.replaceUIActionMap(rp, am);
// Install the input map from the UIManager. It seems like the actual
// bindings are installed in the JRootPane only when the defaultButton
// property receives a value. So we also only install an empty
// input map here, and fill it in propertyChange.
ComponentInputMapUIResource im = new ComponentInputMapUIResource(rp);
SwingUtilities.replaceUIInputMap(rp, JComponent.WHEN_IN_FOCUSED_WINDOW,
im);
}
示例7: createDefaultActions
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
/**
* Creates the default actions when there are none specified by the L&F.
*
* @return the default actions
*/
private ActionMap createDefaultActions()
{
ActionMapUIResource am = new ActionMapUIResource();
Action action = new NavigateAction("selectNext");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("selectPrevious");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("selectParent");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("selectChild");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("return");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("cancel");
am.put(action.getValue(Action.NAME), action);
return am;
}
示例8: createActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
ActionMap createActionMap()
{
ActionMap map = new ActionMapUIResource();
map.put("navigatePageDown", new NavigatePageDownAction());
map.put("navigatePageUp", new NavigatePageUpAction());
map.put("navigateDown",
new NavigateAction("navigateDown", SwingConstants.SOUTH));
map.put("navigateUp",
new NavigateAction("navigateUp", SwingConstants.NORTH));
map.put("navigateLeft",
new NavigateAction("navigateLeft", SwingConstants.WEST));
map.put("navigateRight",
new NavigateAction("navigateRight", SwingConstants.EAST));
map.put("requestFocusForVisibleComponent",
new RequestFocusForVisibleComponentAction());
map.put("requestFocus", new RequestFocusAction());
return map;
}
示例9: createActions
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
protected ActionMap createActions() {
final Action escAction = new AbstractAction() {
private static final long serialVersionUID = -3976059968191425942L;
@Override
public void actionPerformed(ActionEvent e) {
FileChooserUI.this.fileList.stopThumbnailGeneration();
getFileChooser().cancelSelection();
}
@Override
public boolean isEnabled() {
return getFileChooser().isEnabled();
}
};
final ActionMap map = new ActionMapUIResource();
map.put("approveSelection", getApproveSelectionAction());
map.put("cancelSelection", escAction);
return map;
}
示例10: getActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
/**
* Creates an ActionMap to be installed on the text component.
*
* @return an ActionMap to be installed on the text component
*/
private ActionMap getActionMap()
{
// Note: There are no .actionMap entries in the standard L&Fs. However,
// with the RI it is possible to install action maps via such keys, so
// we must load them too. It can be observed that when there is no
// .actionMap entry in the UIManager, one gets installed after a text
// component of that type has been loaded.
String prefix = getPropertyPrefix();
String amName = prefix + ".actionMap";
ActionMap am = (ActionMap) UIManager.get(amName);
if (am == null)
{
am = createActionMap();
UIManager.put(amName, am);
}
ActionMap map = new ActionMapUIResource();
map.setParent(am);
return map;
}
示例11: createDefaultActions
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
/**
* Creates the default actions when there are none specified by the L&F.
*
* @return the default actions
*/
private ActionMap createDefaultActions()
{
ActionMapUIResource am = new ActionMapUIResource();
Action action = new NavigateAction("selectNext");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("selectPrevious");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("selectParent");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("selectChild");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("return");
am.put(action.getValue(Action.NAME), action);
action = new NavigateAction("cancel");
am.put(action.getValue(Action.NAME), action);
return am;
}
示例12: createActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
ActionMap createActionMap()
{
ActionMap map = new ActionMapUIResource();
map.put("navigatePageDown", new NavigatePageDownAction());
map.put("navigatePageUp", new NavigatePageUpAction());
map.put("navigateDown",
new NavigateAction("navigateDown", SwingConstants.SOUTH));
map.put("navigateUp",
new NavigateAction("navigateUp", SwingConstants.NORTH));
map.put("navigateLeft",
new NavigateAction("navigateLeft", SwingConstants.WEST));
map.put("navigateRight",
new NavigateAction("navigateRight", SwingConstants.EAST));
map.put("requestFocusForVisibleComponent",
new RequestFocusForVisibleComponentAction());
map.put("requestFocus", new RequestFocusAction());
return map;
}
示例13: loadActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
ActionMap loadActionMap() {
ActionMap map = new ActionMapUIResource();
put(map, new Actions(Actions.NEXT));
put(map, new Actions(Actions.PREVIOUS));
put(map, new Actions(Actions.RIGHT));
put(map, new Actions(Actions.LEFT));
put(map, new Actions(Actions.UP));
put(map, new Actions(Actions.DOWN));
put(map, new Actions(Actions.PAGE_UP));
put(map, new Actions(Actions.PAGE_DOWN));
put(map, new Actions(Actions.REQUEST_FOCUS));
put(map, new Actions(Actions.REQUEST_FOCUS_FOR_VISIBLE));
put(map, new Actions(Actions.SET_SELECTED));
put(map, new Actions(Actions.SELECT_FOCUSED));
put(map, new Actions(Actions.SCROLL_FORWARD));
put(map, new Actions(Actions.SCROLL_BACKWARD));
return map;
}
示例14: createActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
protected ActionMap createActionMap()
{
ActionMap map = new ActionMapUIResource();
Action refreshAction = new AbstractVFSUIAction(VFSFilePane.ACTION_REFRESH)
{
public void actionPerformed(ActionEvent evt)
{
getFileChooser().rescanCurrentDirectory();
}
};
map.put(VFSFilePane.ACTION_APPROVE_SELECTION,
getApproveSelectionAction());
map.put(VFSFilePane.ACTION_CANCEL, getCancelSelectionAction());
map.put(VFSFilePane.ACTION_REFRESH, refreshAction);
map.put(VFSFilePane.ACTION_CHANGE_TO_PARENT_DIRECTORY,
getChangeToParentDirectoryAction());
return map;
}
示例15: installUIActionMap
import javax.swing.plaf.ActionMapUIResource; //導入依賴的package包/類
final void installUIActionMap() {
UIDefaults uiDefaults = UIManager.getLookAndFeelDefaults();
String propertyName = getPropertyPrefix() + ".actionMap";
ActionMap actionMap1 = new ActionMapUIResource();
putActionToActionMap(focusAction, actionMap1);
Object actionMap2 = uiDefaults.get(propertyName);
if (actionMap2 == null) {
ActionMapUIResource map = new ActionMapUIResource();
Action[] actions = component.getActions();
for (int i = 0; i < actions.length; i++) {
putActionToActionMap(actions[i], map);
}
putActionToActionMap(TransferHandler.getPasteAction(), map);
putActionToActionMap(TransferHandler.getCutAction(), map);
putActionToActionMap(TransferHandler.getCopyAction(), map);
actionMap2 = map;
if (!(component instanceof JEditorPane)) {
uiDefaults.put(propertyName, map);
}
}
actionMap1.setParent((ActionMap)actionMap2);
SwingUtilities.replaceUIActionMap(component, actionMap1);
}