乐在其中

以JEE为主攻,以Flex为点缀,以Eclipse RCP为乐趣
请访问http://www.inframesh.org

首页 新随笔 联系 管理
  43 Posts :: 0 Stories :: 8 Comments :: 0 Trackbacks
Button btnBrowsePackage = new Button(container, SWT.NONE);
  btnBrowsePackage.setText("...");
  btnBrowsePackage.addSelectionListener(new SelectionListenerAdapter(){
   public void widgetSelected(SelectionEvent e)
   {
    super.widgetSelected(e);
    IJavaProject javaProject = JavaCore.create(getCurrentProject());
    SelectionDialog dialog = null;
    try
    {
     dialog = JavaUI.createPackageDialog(getSite().getShell(),
       javaProject,IJavaElementSearchConstants.CONSIDER_REQUIRED_PROJECTS);
    } catch (JavaModelException e1)
    {
     ExceptionHandler.handleExceptionAndAbort(e1);
    }
    if (dialog.open() != Window.OK)
    {
     return;
    }
    IPackageFragment pck = (IPackageFragment) dialog.getResult()[0];
    if (pck != null)
    {
     txtPackageName.setText(pck.getElementName());
    }
   }
   
  }); 
posted on 2009-02-04 23:04 suprasoft Inc,. 阅读(229) 评论(0)  编辑  收藏 所属分类: Eclipse

只有注册用户登录后才能发表评论。


网站导航:
 
©2005-2008 Suprasoft Inc., All right reserved.