changelevelaction.java

来自「mywork是rcp开发的很好的例子」· Java 代码 · 共 38 行

JAVA
38
字号
/************************************************************
 *
 * 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.jface.action.Action;

import es.org.chemi.games.sokoban.SokobanPlugin;
import es.org.chemi.games.sokoban.ui.ChangeLevelDialog;
import es.org.chemi.games.sokoban.ui.MainView;

public class ChangeLevelAction extends Action 
{
	private MainView view = null;
	
	public ChangeLevelAction(String label, MainView view) 
	{
		super(label);
		this.view = view;
	}

	public void run() 
	{
		SokobanPlugin.trace(this.getClass().getName(),"Change level solicited."); //$NON-NLS-1$
		
		ChangeLevelDialog dialog = new ChangeLevelDialog(view.getViewSite().getShell(), view.getMap());
		dialog.open();		
		view.setFocus(); // Workaround to Bugzilla Bug 42670
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?