本文整理汇总了Java中org.jdesktop.swingx.action.AbstractActionExt类的典型用法代码示例。如果您正苦于以下问题:Java AbstractActionExt类的具体用法?Java AbstractActionExt怎么用?Java AbstractActionExt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractActionExt类属于org.jdesktop.swingx.action包,在下文中一共展示了AbstractActionExt类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCancelAction
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Creates and returns an Action which cancels an ongoing edit correctly.
* Note: the correct thing to do is to call the editor's cancelEditing, the
* wrong thing to do is to call table removeEditor (as core JTable does...).
* So this is a quick hack around a core bug, reported against SwingX in
* #610-swingx.
*
* @return an Action which cancels an edit.
*/
private Action createCancelAction() {
Action action = new AbstractActionExt() {
@Override
public void actionPerformed(ActionEvent e) {
if (!isEditing())
return;
getCellEditor().cancelCellEditing();
}
@Override
public boolean isEnabled() {
return isEditing();
}
};
return action;
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:JXTable.java
示例2: installWrapper
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Creates an life action wrapper around the action registered with
* actionKey, sets its SMALL_ICON property to the given icon and installs
* itself with the newActionKey.
*
* @param actionKey the key of the action to wrap around
* @param newActionKey the key of the wrapper action
* @param icon the icon to use in the wrapper action
*/
private void installWrapper(final String actionKey, String newActionKey,
Icon icon) {
AbstractActionExt wrapper = new AbstractActionExt(null, icon) {
@Override
public void actionPerformed(ActionEvent e) {
Action action = monthView.getActionMap().get(actionKey);
if (action != null) {
action.actionPerformed(e);
}
}
};
monthView.getActionMap().put(newActionKey, wrapper);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:25,代码来源:CalendarHeaderHandler.java
示例3: interactiveUpdateUIPickerMonthView
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #706-swingx: picker doesn't update monthView.
*
*/
public void interactiveUpdateUIPickerMonthView() {
final JXDatePicker picker = new JXDatePicker();
JXFrame frame = showInFrame(picker, "picker update ui");
Action action = new AbstractActionExt("toggleUI") {
@Override
public void actionPerformed(ActionEvent e) {
String uiClass = (String) UIManager.get(JXMonthView.uiClassID);
boolean custom = uiClass.indexOf("Custom") > 0;
if (!custom) {
UIManager.put(JXMonthView.uiClassID, "org.jdesktop.swingx.test.CustomMonthViewUI");
} else {
UIManager.put(JXMonthView.uiClassID, null);
}
picker.updateUI();
custom = !custom;
}
};
addAction(frame, action);
frame.pack();
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:JXDatePickerVisualCheck.java
示例4: interactiveTreeTableClipIssueDefaultRenderer
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Experiments to try and understand clipping issues: occasionally, the text
* in the tree column is clipped even if there is enough space available.
*
* Here we don't change any renderers.
*/
public void interactiveTreeTableClipIssueDefaultRenderer() {
final JXTreeTable treeTable = new JXTreeTable(createActionTreeModel());
treeTable.setHorizontalScrollEnabled(true);
treeTable.setRootVisible(true);
treeTable.collapseAll();
treeTable.packColumn(0, -1);
final JTree tree = new JTree(treeTable.getTreeTableModel());
tree.collapseRow(0);
JXFrame frame = wrapWithScrollingInFrame(treeTable,
tree, "JXTreeTable vs. core JTree: default renderer");
Action revalidate = new AbstractActionExt("revalidate") {
@Override
public void actionPerformed(ActionEvent e) {
treeTable.revalidate();
tree.revalidate();
} };
addAction(frame, revalidate);
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:JXTreeTableIssues.java
示例5: interactiveFindDialogSelectionTree
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #720, 692-swingx: findDialog on tree selection as match-marker lost
*
* Scenario (#692): open find via button
* - press button to open find
* - run a search with match, selects a node
* - close findDialog, clears selection
*
* Scenario (#702): open find via ctrl-f
* - focus tree
* - ctrl-f to open findDialog
* - run a search with match, selects a node
* - close findDialog
* - tab to button, clears selection
*/
public void interactiveFindDialogSelectionTree() {
final JXTree table = new JXTree();
JComponent comp = Box.createVerticalBox();
comp.add(new JScrollPane(table));
Action action = new AbstractActionExt("open find dialog") {
public void actionPerformed(ActionEvent e) {
SearchFactory.getInstance().showFindDialog(table, table.getSearchable());
}
};
comp.add(new JButton(action));
JXFrame frame = wrapInFrame(comp, "Tree FindDialog: selection lost");
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:32,代码来源:FindVisualCheck.java
示例6: interactiveScrollRectToVisible
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #1181-swingx: scrollRectToVisible not effective if component in JXTaskPane.
* Yet another one for the same issue - moved from TaskPaneIssues.
*
* example adapted from tjwolf,
* http://forums.java.net/jive/thread.jspa?threadID=66759&tstart=0
*/
public void interactiveScrollRectToVisible() {
final JXTree tree = new JXTree();
tree.expandAll();
JXTaskPane pane = new JXTaskPane();
pane.add(tree);
JComponent component = new JPanel(new BorderLayout());
component.add(pane);
JXFrame frame = wrapWithScrollingInFrame(component, "scroll to last row must work");
Action action = new AbstractActionExt("scrollToLastRow") {
@Override
public void actionPerformed(ActionEvent e) {
tree.scrollRowToVisible(tree.getRowCount()- 1);
}
};
addAction(frame, action);
// small dimension, make sure there is something to scroll
show(frame, 300, 200);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:JXCollapsiblePaneVisualCheck.java
示例7: interactiveLocaleColumnControl
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #459-swingx: columnControl properties not updated on locale setting.
*
*/
public void interactiveLocaleColumnControl() {
final JXTable table = new JXTable(10, 4);
table.setColumnControlVisible(true);
table.getColumnExt(0).setTitle(table.getLocale().getLanguage());
Action toggleLocale = new AbstractActionExt("toggleLocale") {
@Override
public void actionPerformed(ActionEvent e) {
Locale old = table.getLocale();
table.setLocale(old == A_LOCALE ? OTHER_LOCALE : A_LOCALE);
table.getColumnExt(0).setTitle(table.getLocale().getLanguage());
}
};
JXFrame frame = wrapWithScrollingInFrame(table, "toggle locale on table - column control not updated");
addAction(frame, toggleLocale);
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:24,代码来源:XLocalizeTest.java
示例8: interactiveTestColumnControlInvisibleColumns
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #192: initially invisibility columns are hidden but marked as
* visible in control.
*
* Issue #38 (swingx): initially invisble columns don't show up in the
* column control list.
*
* Visual check: first enable column control then set column invisible.
*
*/
public void interactiveTestColumnControlInvisibleColumns() {
final JXTable table = new JXTable(new AncientSwingTeam());
table.setColumnControlVisible(true);
final TableColumnExt firstNameColumn = table.getColumnExt("First Name");
firstNameColumn.setVisible(false);
JXFrame frame = wrapWithScrollingInFrame(
table,
"ColumnControl (#192, #38-swingx) first enable ColumnControl then column invisible");
Action toggleHideable = new AbstractActionExt(
"toggle hideable first Name") {
@Override
public void actionPerformed(ActionEvent e) {
firstNameColumn.setHideable(!firstNameColumn.isHideable());
}
};
addAction(frame, toggleHideable);
show(frame);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:31,代码来源:ColumnControlButtonVisualCheck.java
示例9: testAdditonalActionGrouping
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue: add support for custom grouping of additional actions
* http://java.net/jira/browse/SWINGX-968
*/
@Test
public void testAdditonalActionGrouping() {
JXTable table = new JXTable(10, 4);
AbstractActionExt custom = new AbstractActionExt("Custom") {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
}
};
custom.putValue(GroupKeyActionGrouper.GROUP_KEY, 0);
table.getActionMap().put(ColumnControlButton.COLUMN_CONTROL_MARKER + "myCommand", custom);
ColumnControlButton button = new ColumnControlButton(table);
button.setActionGrouper(new GroupKeyActionGrouper());
DefaultColumnControlPopup popup = (DefaultColumnControlPopup) button.getColumnControlPopup();
assertEquals("additional actions visible, component count expected ",
table.getColumnCount()
+ 1 /* separator */ + 3 /*default actions with column. prefix*/
+ 1 /* separator custom group */ + 1 /* custom action */,
popup.getPopupMenu().getComponentCount());
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:ColumnControlButtonTest.java
示例10: interactiveMinimalDaysInFirstWeekPicker
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #736-swingx: monthView cannot cope with minimalDaysInFirstWeek.
*
* Here: look at impact of forcing the minimalDays to a value different
* from the calendar. Days must be displayed in starting from the
* first row under the days-of-week. Selection must be reflected in the
* datepicker.
*/
public void interactiveMinimalDaysInFirstWeekPicker() {
JXDatePicker picker = new JXDatePicker();
final JXMonthView monthView = picker.getMonthView();
monthView.setShowingWeekNumber(true);
monthView.setShowingLeadingDays(true);
monthView.setShowingTrailingDays(true);
Action action = new AbstractActionExt("toggle minimal") {
@Override
public void actionPerformed(ActionEvent e) {
int minimal = monthView.getSelectionModel().getMinimalDaysInFirstWeek();
monthView.getSelectionModel().setMinimalDaysInFirstWeek(minimal > 1 ? 1 : 4);
}
};
final JXFrame frame = wrapInFrame(picker, "click unselectable fires ActionEvent");
addAction(frame, action);
frame.pack();
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:JXMonthViewVisualCheck.java
示例11: interactiveUpdateUIMonthView
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #706-swingx: picker doesn't update monthView.
*
* Here: visualize weird side-effects of monthView.updateUI - year
* incremented.
*/
public void interactiveUpdateUIMonthView() {
// calendar.set(1955, 10, 9);
final JXMonthView monthView = new JXMonthView();
monthView.setTraversable(true);
final JXFrame frame = showInFrame(monthView, "MonthView update ui - visible month kept");
Action action = new AbstractActionExt("toggleUI") {
@Override
public void actionPerformed(ActionEvent e) {
monthView.updateUI();
}
};
addAction(frame, action);
frame.pack();
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:JXMonthViewVisualCheck.java
示例12: interactiveUpdateUIMonthViewCustomUI
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #706-swingx: picker doesn't update monthView.
*
* Show toggle of UI (selectin color)
*/
public void interactiveUpdateUIMonthViewCustomUI() {
final JXMonthView monthView = new JXMonthView();
monthView.setSelectionDate(new Date());
final JXFrame frame = showInFrame(monthView, "MonthView custom ui (selection color)");
Action action = new AbstractActionExt("toggleUI") {
@Override
public void actionPerformed(ActionEvent e) {
String uiClass = (String) UIManager.get(JXMonthView.uiClassID);
boolean custom = uiClass.indexOf("Custom") > 0;
if (!custom) {
UIManager.put(JXMonthView.uiClassID, "org.jdesktop.swingx.test.CustomMonthViewUI");
} else {
UIManager.put(JXMonthView.uiClassID, null);
}
monthView.updateUI();
custom = !custom;
}
};
addAction(frame, action);
frame.pack();
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:28,代码来源:JXMonthViewVisualCheck.java
示例13: interactiveAutoScrollOnResize
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* #705-swingx: JXMonthview must not scroll on revalidate.
*
* Misbehaviour here : multi-month spanning selection, travers two month into the future and
* resize the frame - jumps back to first. Auto-scroll in the delegates
* selection listener would have a similar effect.
*
*/
public void interactiveAutoScrollOnResize() {
final JXMonthView us = new JXMonthView();
us.setTraversable(true);
us.setSelectionMode(SelectionMode.SINGLE_INTERVAL_SELECTION);
final Calendar today = Calendar.getInstance();
CalendarUtils.endOfMonth(today);
Date start = today.getTime();
today.add(Calendar.DAY_OF_MONTH, 60);
us.setSelectionInterval(start, today.getTime());
JXFrame frame = wrapInFrame(us, "resize");
// quick check if lastDisplayed is updated on resize
Action printLast = new AbstractActionExt("log last") {
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("last updated?" + us.getLastDisplayedDay());
}
};
addAction(frame, printLast);
frame.pack();
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:33,代码来源:JXMonthViewVisualCheck.java
示例14: interactiveLastDisplayed
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #659-swingx: lastDisplayedDate must be synched.
*
*/
public void interactiveLastDisplayed() {
final JXMonthView month = new JXMonthView();
month.setSelectionMode(SelectionMode.SINGLE_INTERVAL_SELECTION);
month.setTraversable(true);
Action action = new AbstractActionExt("check lastDisplayed") {
@Override
public void actionPerformed(ActionEvent e) {
Calendar cal = Calendar.getInstance();
cal.setTime(month.getLastDisplayedDay());
Date viewLast = cal.getTime();
cal.setTime(month.getUI().getLastDisplayedDay());
Date uiLast = cal.getTime();
LOG.info("last(view/ui): " + viewLast + "/" + uiLast);
}
};
JXFrame frame = wrapInFrame(month, "default - for debugging only");
addAction(frame, action);
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:27,代码来源:JXMonthViewVisualCheck.java
示例15: interactiveColumnSelection
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #875-swingx: cell selection incorrect in hierarchical column.
*
*/
public void interactiveColumnSelection() {
final JXTreeTable treeTable = new JXTreeTable(new FileSystemModel());
treeTable.setColumnSelectionAllowed(true);
final JTable table = new JTable(new AncientSwingTeam());
table.setColumnSelectionAllowed(true);
JXFrame frame = wrapWithScrollingInFrame(treeTable, table, "columnSelection in treetable");
Action action = new AbstractActionExt("Toggle dnd: false") {
@Override
public void actionPerformed(ActionEvent e) {
boolean dragEnabled = !treeTable.getDragEnabled();
treeTable.setDragEnabled(dragEnabled);
table.setDragEnabled(dragEnabled);
setName("Toggle dnd: " + dragEnabled);
}
};
addAction(frame, action);
show(frame);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:JXTreeTableVisualCheck.java
示例16: interactiveDisabledTreeColumn
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #853-swingx: tree is not disabled.
*
*/
public void interactiveDisabledTreeColumn() {
final JXTreeTable treeTable = new JXTreeTable(new FileSystemModel());
JXFrame frame = showWithScrollingInFrame(treeTable, "disabled - tree follows table");
Action action = new AbstractActionExt("toggle enabled") {
@Override
public void actionPerformed(ActionEvent e) {
treeTable.setEnabled(!treeTable.isEnabled());
}
};
addAction(frame, action);
show(frame);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:JXTreeTableVisualCheck.java
示例17: interactiveToggleDnDEnabled
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #168-jdnc: dnd enabled breaks node collapse/expand.
* Regression? Dnd doesn't work at all?
*
*/
public void interactiveToggleDnDEnabled() {
final JXTreeTable treeTable = new JXTreeTable(treeTableModel);
treeTable.setColumnControlVisible(true);
final JXTree tree = new JXTree(treeTableModel);
JXTree renderer = (JXTree) treeTable.getCellRenderer(0, 0);
tree.setRowHeight(renderer.getRowHeight());
JXFrame frame = wrapWithScrollingInFrame(treeTable, tree, "toggle dragEnabled (starting with false)");
Action action = new AbstractActionExt("Toggle dnd: false") {
@Override
public void actionPerformed(ActionEvent e) {
boolean dragEnabled = !treeTable.getDragEnabled();
treeTable.setDragEnabled(dragEnabled);
tree.setDragEnabled(dragEnabled);
setName("Toggle dnd: " + dragEnabled);
}
};
addAction(frame, action);
addComponentOrientationToggle(frame);
show(frame);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:29,代码来源:JXTreeTableVisualCheck.java
示例18: interactiveAutoScrollOnSelectionList
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* #703-swingx: select date doesn't ensure visibility of selected.
* #712-swingx: support optional auto-scroll on selection.
*
* compare with core list: doesn't scroll as well.
*
*/
public void interactiveAutoScrollOnSelectionList() {
// add hoc model
SortedSet<Date> dates = getDates();
final JXList us = new JXList(new ListComboBoxModel<Date>(new ArrayList<Date>(dates)));
us.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
JXFrame frame = wrapWithScrollingInFrame(us, "list - autoscroll on selection");
Action next = new AbstractActionExt("select last + 1") {
public void actionPerformed(ActionEvent e) {
int last = us.getLastVisibleIndex();
us.setSelectedIndex(last + 1);
// shouldn't effect scrolling state
us.revalidate();
// client code must trigger
// us.ensureIndexIsVisible(last+1);
}
};
addAction(frame, next);
frame.pack();
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:31,代码来源:SelectionIssues.java
示例19: interactiveDialogCancelOnEscape
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #675-swingx: esc doesn't reach rootpane.
*
* Verify that the escape is intercepted only if editing.
* BUT: (core behaviour) starts editing in table processKeyBinding. So every
* second is not passed on.
*/
public void interactiveDialogCancelOnEscape() {
Action cancel = new AbstractActionExt("cancel") {
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("performed: cancel action");
}
};
final JButton field = new JButton(cancel);
JXTable xTable = new JXTable(10, 3);
JTable table = new JTable(xTable.getModel());
JXFrame frame = wrapWithScrollingInFrame(xTable, table, "escape passed to rootpane (if editing)");
frame.setCancelButton(field);
frame.add(field, BorderLayout.SOUTH);
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:JXTableVisualCheck.java
示例20: interactivePrefScrollable
import org.jdesktop.swingx.action.AbstractActionExt; //导入依赖的package包/类
/**
* Issue #508/547-swingx: clean up of pref scrollable.
* Visual check: column init on model change.
*
*/
public void interactivePrefScrollable() {
final DefaultTableModel tableModel = new DefaultTableModel(30, 7);
final AncientSwingTeam ancientSwingTeam = new AncientSwingTeam();
final JXTable table = new JXTable(tableModel);
table.setColumnControlVisible(true);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
final JXFrame frame = showWithScrollingInFrame(table, "initial sizing");
addMessage(frame, "initial size: " + table.getPreferredScrollableViewportSize());
Action action = new AbstractActionExt("toggle model") {
@Override
public void actionPerformed(ActionEvent e) {
table.setModel(table.getModel() == tableModel ? ancientSwingTeam : tableModel);
frame.pack();
}
};
addAction(frame, action);
frame.pack();
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:JXTableVisualCheck.java
注:本文中的org.jdesktop.swingx.action.AbstractActionExt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论