zoukankan      html  css  js  c++  java
  • eclipse插件开发常用的选择器

    容器选择器(IFOlder,IPROJECT ,包等):


    ContainerSelectionDialog dialog = new ContainerSelectionDialog(
    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
    ResourcesPlugin.getWorkspace().getRoot(), false,
    "Select new file container");
    if (dialog.open() == ContainerSelectionDialog.OK) {
    Object[] result = dialog.getResult();
    if (result.length == 1) {
    org.eclipse.core.runtime.Path path = (org.eclipse.core.runtime.Path) result[0];
    srcPath = path.toString();
    System.out.println("=============" + srcPath);
    srcPath.endsWith("src");


    }
    }


    类选择器:

    SelectionDialog s = JavaUI.createTypeDialog(shell,
    null,
    project.getProject(),
    IJavaElementSearchConstants.CONSIDER_ALL_TYPES,
    true);
    if (s.open() == org.eclipse.jface.window.Window.OK) {
    SourceType type = (SourceType) s
    .getResult()[0];


    unit = (ICompilationUnit) type.getParent();
    LinkedList list = new LinkedList();
    getPackage(unit, list);
    pac = listToString(list);
    text1.setText(pac);
    }


    系统目录选择:

    DirectoryDialog dirDlg = new DirectoryDialog(shell);
    String dir = dirDlg.open();

    系统文件选择:

    FileDialog fd = new FileDialog(
    final String fileStr = fd.open();

  • 相关阅读:
    python字符串格式化
    MFC----任务管理器的制作
    高斯消元方程组
    linux qq下载
    python——tuple元组
    Codeforces 515C. Drazil and Factorial
    HDU 1102 Constructing Roads (最小生成树)
    hdu 01背包汇总(1171+2546+1864+2955。。。
    HDU 3392 Pie(DP)
    HDU 1024
  • 原文地址:https://www.cnblogs.com/liaomin416100569/p/9331424.html
Copyright © 2011-2022 走看看