コード例 #1
0
  private ILaunchConfiguration getConfigurationNamed(String name) {
    try {
      for (ILaunchConfiguration config :
          DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations()) {
        if (name.equals(config.getName())) {
          return config;
        }
      }
    } catch (CoreException exception) {
      DartUtil.logError(exception);
    }

    return null;
  }
コード例 #2
0
ファイル: RunServerAction.java プロジェクト: krestenkrab/dart
  private IFile findFile(IStructuredSelection selection) {
    Object sel = selection.getFirstElement();

    if (sel instanceof IFile) {
      return (IFile) sel;
    } else if (sel instanceof DartElement) {
      try {
        IResource resource = ((DartElement) sel).getCorrespondingResource();

        if (resource instanceof IFile) {
          return (IFile) resource;
        }
      } catch (DartModelException exception) {
        DartUtil.logError(exception);
      }
    }

    return null;
  }