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


Java IModulePublishHelper类代码示例

本文整理汇总了Java中org.eclipse.wst.server.core.internal.IModulePublishHelper的典型用法代码示例。如果您正苦于以下问题:Java IModulePublishHelper类的具体用法?Java IModulePublishHelper怎么用?Java IModulePublishHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IModulePublishHelper类属于org.eclipse.wst.server.core.internal包,在下文中一共展示了IModulePublishHelper类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLauncherDirectory

import org.eclipse.wst.server.core.internal.IModulePublishHelper; //导入依赖的package包/类
/**
 * Return the launcher directory path.
 * 
 * The -launcherDir war/output/path is the war deployment directory
 * 
 * @param server
 * @param launchConfig
 * @param gwtFacetedProject
 * @return the launcher directory or war output path
 */
private String getLauncherDirectory(IServer server, ILaunchConfiguration launchConfig,
    IFacetedProject gwtFacetedProject) {
  String launcherDir = null;

  // The root module will be the server module
  // The root module may have children such as, client, shared
  // The root module may not have any children
  for (IModule[] module : getAllModules(server)) {
    if (module[module.length - 1].getProject() == gwtFacetedProject.getProject()) {
      // Child modules are overlaid or included in the root module
      IPath path = null;
      if (server instanceof IModulePublishHelper) {
        path = ((IModulePublishHelper) server).getPublishDirectory(new IModule[] { module[0] });
      } else {
        IModulePublishHelper helper = server.getAdapter(IModulePublishHelper.class);
        if (helper != null) {
          path = helper.getPublishDirectory(new IModule[] { module[0] });
        }
      }
      // example:
      // /Users/branflake2267/Documents/runtime-EclipseApplication/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/broyer-sandbox-server
      launcherDir = path == null ? null : path.toOSString();
      if (launcherDir != null) {
        return launcherDir;
      }
    }
  }

  // Get the the war output path from classic launch configuration working directory
  // Also used GaeServerBehaviour.setupLaunchConfig(...)
  try {
    launcherDir = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
  } catch (CoreException e) {
    logMessage(
        "posiblyLaunchGwtSuperDevModeCodeServer: Couldn't get working directory from launchConfig IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY.");
  }

  return launcherDir;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:50,代码来源:GwtWtpPlugin.java


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