Eclipse plugin 笔记

 

  1. 取得当前plugin的状态保存地AutoDAOUIPlugin.getDefault().getStateLocation().toFile().getAbsolutePath()
      
  2.  打开一个对话框MessageDialog.openError(getShell(), "错误信息", "数据库连接设置错误!"),同样也可以使用静态类MessageDialog打开一个普通的消息对话框
  3. 在当前上下文中打开一个对话框NewDriverWizard wizard = new NewDriverWizard();
    		wizard.setNeedsProgressMonitor(true);
    		WizardDialog wizardDialog = new WizardDialogAutoDAOLocation(shell, wizard, 600, 650); //$NON-NLS-1$
    		wizardDialog.setMinimumPageSize(500, 550);
    		wizardDialog.open();
      构造函数WizardDialogAutoDAOLocation的第二个参数类型是org.eclipse.jface.wizard.IWizard
  4. 打开一个SWT Composit框,放置几个按钮 
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.layout.RowLayout;
    import org.eclipse.swt.widgets.Button;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Shell;
    
    public class LayoutExample {
        public static void main(String[] args) {
            Display display = new Display();
            Shell shell = new Shell(display);
            // Create the layout.
            RowLayout layout = new RowLayout();
            // Optionally set layout fields.
            layout.wrap = true;
            // Set the layout into the composite.
            shell.setLayout(layout);
            // Create the children of the composite.
            new Button(shell, SWT.PUSH).setText("B1");
            new Button(shell, SWT.PUSH).setText("Wide Button 2");
            new Button(shell, SWT.PUSH).setText("Button 3");
            shell.pack();
            shell.open();
            
            while (!shell.isDisposed()) {
                if (!display.readAndDispatch()) display.sleep();
            }
        }
    }
     
  5. 代码里面是怎么实现F5的效果?
    当生成了代码,之后必须手动去目录结构上按一下F5才能将最新生成的代码显示出来。这个如何通过JDT的代码实现?
    		org.eclipse.core.resources.IResource resource = javaProject
    				.getProject().getFolder(srcFolder);
    
    		resource.refreshLocal(IResource.DEPTH_INFINITE,
    				new NullProgressMonitor());
     
  6. d

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值