当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationConfiguration.putUserData方法代码示例

本文整理汇总了Java中com.intellij.execution.application.ApplicationConfiguration.putUserData方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationConfiguration.putUserData方法的具体用法?Java ApplicationConfiguration.putUserData怎么用?Java ApplicationConfiguration.putUserData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.application.ApplicationConfiguration的用法示例。


在下文中一共展示了ApplicationConfiguration.putUserData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateJavaParameters

import com.intellij.execution.application.ApplicationConfiguration; //导入方法依赖的package包/类
@Override
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }
  ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
  SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings == null) {
    settings = new SnapShooterConfigurationSettings();
    appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
  }
  if (appConfiguration.ENABLE_SWING_INSPECTOR) {
    settings.setLastPort(NetUtils.tryToFindAvailableSocketPort());
  }

  if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
    params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
    params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
    // add +1 because idea_rt.jar will be added as the last entry to the classpath
    params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
    Set<String> paths = new TreeSet<String>();
    paths.add(PathUtil.getJarPathForClass(SnapShooter.class));         // ui-designer-impl
    paths.add(PathUtil.getJarPathForClass(BaseComponent.class));       // appcore-api
    paths.add(PathUtil.getJarPathForClass(ProjectComponent.class));    // openapi
    paths.add(PathUtil.getJarPathForClass(LwComponent.class));         // UIDesignerCore
    paths.add(PathUtil.getJarPathForClass(GridConstraints.class));     // forms_rt
    paths.add(PathUtil.getJarPathForClass(PaletteGroup.class));        // openapi
    paths.add(PathUtil.getJarPathForClass(LafManagerListener.class));  // ui-impl
    paths.add(PathUtil.getJarPathForClass(DataProvider.class));        // action-system-openapi
    paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class));       // idea
    paths.add(PathUtil.getJarPathForClass(Navigatable.class));         // pom
    paths.add(PathUtil.getJarPathForClass(AreaInstance.class));        // extensions
    paths.add(PathUtil.getJarPathForClass(FormLayout.class));          // jgoodies
    paths.addAll(PathManager.getUtilClassPath());
    for(String path: paths) {
      params.getClassPath().addFirst(path);
    }
    params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:SnapShooterConfigurationExtension.java

示例2: updateJavaParameters

import com.intellij.execution.application.ApplicationConfiguration; //导入方法依赖的package包/类
@Override
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }
  ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
  SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings == null) {
    settings = new SnapShooterConfigurationSettings();
    appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
  }
  if (appConfiguration.ENABLE_SWING_INSPECTOR) {
    try {
      settings.setLastPort(NetUtils.findAvailableSocketPort());
    }
    catch(IOException ex) {
      settings.setLastPort(-1);
    }
  }

  if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
    params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
    params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
    // add +1 because idea_rt.jar will be added as the last entry to the classpath
    params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
    Set<String> paths = new TreeSet<String>();
    paths.add(PathUtil.getJarPathForClass(SnapShooter.class));         // ui-designer-impl
    paths.add(PathUtil.getJarPathForClass(BaseComponent.class));       // appcore-api
    paths.add(PathUtil.getJarPathForClass(ProjectComponent.class));    // openapi
    paths.add(PathUtil.getJarPathForClass(LwComponent.class));         // UIDesignerCore
    paths.add(PathUtil.getJarPathForClass(GridConstraints.class));     // forms_rt
    paths.add(PathUtil.getJarPathForClass(LafManagerListener.class));  // ui-impl
    paths.add(PathUtil.getJarPathForClass(DataProvider.class));        // action-system-openapi
    paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class));       // idea
    paths.add(PathUtil.getJarPathForClass(Navigatable.class));         // pom
    paths.add(PathUtil.getJarPathForClass(AreaInstance.class));        // extensions
    paths.add(PathUtil.getJarPathForClass(FormLayout.class));          // jgoodies
    paths.addAll(PathManager.getUtilClassPath());
    for(String path: paths) {
      params.getClassPath().addFirst(path);
    }
    params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:45,代码来源:SnapShooterConfigurationExtension.java

示例3: updateJavaParameters

import com.intellij.execution.application.ApplicationConfiguration; //导入方法依赖的package包/类
@Override
public void updateJavaParameters(RunConfigurationBase configuration, OwnJavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }
  ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
  SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings == null) {
    settings = new SnapShooterConfigurationSettings();
    appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
  }
  if (appConfiguration.ENABLE_SWING_INSPECTOR) {
    try {
      settings.setLastPort(NetUtils.findAvailableSocketPort());
    }
    catch(IOException ex) {
      settings.setLastPort(-1);
    }
  }

  if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
    params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
    params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
    // add +1 because idea_rt.jar will be added as the last entry to the classpath
    params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
    Set<String> paths = new TreeSet<String>();
    paths.add(PathUtil.getJarPathForClass(SnapShooter.class));         // ui-designer-impl
    paths.add(PathUtil.getJarPathForClass(BaseComponent.class));       // appcore-api
    paths.add(PathUtil.getJarPathForClass(ProjectComponent.class));    // openapi
    paths.add(PathUtil.getJarPathForClass(LwComponent.class));         // UIDesignerCore
    paths.add(PathUtil.getJarPathForClass(GridConstraints.class));     // forms_rt
    paths.add(PathUtil.getJarPathForClass(LafManagerListener.class));  // ui-impl
    paths.add(PathUtil.getJarPathForClass(DataProvider.class));        // action-system-openapi
    paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class));       // idea
    paths.add(PathUtil.getJarPathForClass(Navigatable.class));         // pom
    paths.add(PathUtil.getJarPathForClass(AreaInstance.class));        // extensions
    paths.add(PathUtil.getJarPathForClass(FormLayout.class));          // jgoodies
    paths.addAll(PathManager.getUtilClassPath());
    for(String path: paths) {
      params.getClassPath().addFirst(path);
    }
    params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
  }
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:45,代码来源:SnapShooterConfigurationExtension.java


注:本文中的com.intellij.execution.application.ApplicationConfiguration.putUserData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。