RCP 学习 - 创建菜单

1. 创建handler

RCP 学习 - 创建菜单

package handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

import dialog.MantisDialog;

public class BreakfastrHandler extends AbstractHandler {

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

        MantisDialog dg = new MantisDialog(window.getShell(),"Breakfast-dew");
        dg.open();
        return null;
    }
        

}

 

 

2. 创建command

RCP 学习 - 创建菜单

 

RCP 学习 - 创建菜单

 

3. 配置handler关联command

RCP 学习 - 创建菜单

4. 创建菜单

RCP 学习 - 创建菜单

 

 

 

 

 

 

相关文章:

猜你喜欢
相关资源
相似解决方案