本文整理汇总了Java中javax.swing.undo.UndoManager.canRedo方法的典型用法代码示例。如果您正苦于以下问题:Java UndoManager.canRedo方法的具体用法?Java UndoManager.canRedo怎么用?Java UndoManager.canRedo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.undo.UndoManager
的用法示例。
在下文中一共展示了UndoManager.canRedo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRedo
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
public void onRedo() {
if(undoManager.canRedo())
undoManager.redo();
else {
// HACK need to call parent frames undo if we have no changes
CommonModuleFrame cmf = CommonModuleFrame.getCurrentFrame();
if(cmf == null) return;
final UndoManager cmfUndoManager = cmf.getExtension(UndoManager.class);
if(cmfUndoManager != null && cmfUndoManager.canRedo()) {
cmfUndoManager.redo();
// reset flag
hasChanges = false;
}
}
}
示例2: redo
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
public static void redo(Context context, final int count) throws Exception {
final UndoManager undoManager = getValidUndoManager(context);
logUndoRedoOp(context, "REDO", count);
int cnt = count;
while (undoManager.canRedo() && --cnt >= 0) {
undoManager.redo();
checkContent(context);
}
logPostUndoRedoOp(context, cnt);
}
示例3: run
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
@Override
protected void run(CsvGridSheetCellValuePanel valuePanel) {
UndoManager um = valuePanel.getUndoManager();
if (um.canRedo()) {
um.redo();
} else {
abort();
}
}
示例4: createRedoAction
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
@SuppressWarnings("serial")
public static Action createRedoAction(final UndoManager undoManager, String name) {
return new AbstractAction(name) {
public void actionPerformed(ActionEvent arg0) {
if (undoManager.canRedo()) {
undoManager.redo();
}
}
};
}
示例5: actionPerformed
import javax.swing.undo.UndoManager; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
try {
UndoManager currentManager = undoManageTeam.getCurrentManager();
if (currentManager.canRedo())
currentManager.redo();
} catch (CannotRedoException exceptionInfo) {
//Ignore the exception.
}
}