workbenchwindowactiondelegate.java
来自「mywork是rcp开发的很好的例子」· Java 代码 · 共 54 行
JAVA
54 行
/************************************************************
*
* Copyright (c) 2003 Chemi. All rights reserved.
*
* This program and the accompanying materials
* are made available under the terms of the MIT License
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/mit-license.html
*
************************************************************/
package es.org.chemi.games.sokoban.actions;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PartInitException;
import es.org.chemi.games.sokoban.SokobanPlugin;
import es.org.chemi.games.sokoban.util.Constants;
public class WorkbenchWindowActionDelegate implements IWorkbenchWindowActionDelegate
{
private IWorkbenchPage page = null;
public void dispose()
{
}
public void init(IWorkbenchWindow workBenchWindow)
{
page = workBenchWindow.getActivePage();
}
public void run(IAction action)
{
try
{
SokobanPlugin.trace(this.getClass().getName(),"ActionSet es.org.chemi.games.minesweeper.actionSet executed."); //$NON-NLS-1$
page.showView(Constants.VIEW_ID);
}
catch(PartInitException ex)
{
SokobanPlugin.getDefault().getLog().log(new Status(IStatus.ERROR,SokobanPlugin.getDefault().getBundle().getSymbolicName(),IStatus.ERROR,ex.toString(),null));
}
}
public void selectionChanged(IAction arg0, ISelection arg1) {
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?