本文整理汇总了Java中org.eclipse.wst.server.core.IModule.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java IModule.getProject方法的具体用法?Java IModule.getProject怎么用?Java IModule.getProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.wst.server.core.IModule
的用法示例。
在下文中一共展示了IModule.getProject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkProjectFacets
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
/**
* Check that the associated projects support the App Engine runtime.
*/
@VisibleForTesting
IStatus checkProjectFacets(IModule[] toBeAdded) {
if (toBeAdded != null) {
for (IModule module : toBeAdded) {
if (!module.exists()) {
return StatusUtil.error(this, Messages.getString("deleted.project", module.getName())); //$NON-NLS-1$
}
if (module.getProject() != null) {
IStatus supportedFacets = FacetUtil.verifyFacets(module.getProject(), getServer());
if (supportedFacets != null && !supportedFacets.isOK()) {
return supportedFacets;
}
IStatus appEngineStandardFacetPresent = hasAppEngineStandardFacet(module);
if (appEngineStandardFacetPresent != null && !appEngineStandardFacetPresent.isOK()) {
return appEngineStandardFacetPresent;
}
}
}
}
return Status.OK_STATUS;
}
示例2: fillApplicationsContextMenu
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
private void fillApplicationsContextMenu(IMenuManager manager) {
IStructuredSelection selection = (IStructuredSelection) applicationsViewer.getSelection();
if (selection.isEmpty()) {
return;
}
IModule module = (IModule) selection.getFirstElement();
if (module != null) {
manager.add(new RemoveModuleAction(getSection().getShell(), editorPage.getServer().getOriginal(), module));
IProject project = module.getProject();
if (project != null && project.isAccessible()) {
manager.add(new UnmapProjectEditorAction(editorPage, module));
}
else if (project == null) {
manager.add(new RemapToProjectEditorAction(editorPage, module));
}
CloudFoundryApplicationModule appModule = getApplicationModule(module);
if (appModule != null) {
manager.add(new ShowConsoleEditorAction(cloudServer, appModule));
}
}
}
示例3: setupLaunchConfiguration
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy,
IProgressMonitor monitor) throws CoreException {
super.setupLaunchConfiguration(workingCopy, monitor);
// it seems surprising that the Server class doesn't already do this
Collection<IProject> projects = new ArrayList<>();
for (IModule module : getServer().getModules()) {
IProject project = module.getProject();
if (project != null) {
projects.add(project);
}
}
workingCopy.setMappedResources(projects.toArray(new IResource[projects.size()]));
}
示例4: getReferencedProjects
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
private static IProject[] getReferencedProjects(ILaunchConfiguration configuration)
throws CoreException {
IServer thisServer = ServerUtil.getServer(configuration);
IModule[] modules = ModuleUtils.getAllModules(thisServer);
Set<IProject> projects = new HashSet<>();
for (IModule module : modules) {
IProject project = module.getProject();
if (project != null) {
projects.add(project);
}
}
return projects.toArray(new IProject[projects.size()]);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:14,代码来源:LocalAppEngineServerLaunchConfigurationDelegate.java
示例5: handleRebelProject
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
protected void handleRebelProject(CloudServerEvent event, IModule module, String consoleMessage,
IProgressMonitor monitor) throws CoreException {
IProject project = module.getProject();
// Only replace rebel xml file if a manual Remoting
// update is performed on Spring boot applications
if (event.getType() == CloudServerEvent.EVENT_JREBEL_REMOTING_UPDATE
&& CloudFoundryProjectUtil.isSpringBootCloudFoundryConfigured(project)) {
updateRebelXML(project, monitor);
}
super.handleRebelProject(event, module, consoleMessage, monitor);
}
示例6: isJRebelEnabled
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
public static boolean isJRebelEnabled(IModule module, CloudFoundryServer cloudServer) {
IProject project = module != null ? module.getProject() : null;
return supportedServer(cloudServer) && project != null && project.isAccessible()
&& hasNature(project, "org.zeroturnaround.eclipse.remoting.remotingNature") //$NON-NLS-1$
&& hasNature(project, "org.zeroturnaround.eclipse.jrebelNature"); //$NON-NLS-1$
}
示例7: canModifyModules
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
public IStatus canModifyModules(IModule[] add, IModule[] remove) {
if (add != null) {
int size = add.length;
for (int i = 0; i < size; i++) {
IModule module = add[i];
if (!ApplicationRegistry.isSupportedModule(module)) {
return new Status(IStatus.ERROR, CloudFoundryPlugin.PLUGIN_ID, 0, NLS.bind(
Messages.CloudFoundryServer_ERROR_APPTYPE_NOT_SUPPORTED, module.getModuleType().getId()),
null);
}
IStatus status;
// If the module, in a non-faceted project, has been determined
// to be deployable to CF (ie. a single zip application
// archive), then this facet check is unnecessary.
boolean ignoreFacetCheck = isNonfacetedModule(module);
if (module.getProject() != null && !ignoreFacetCheck) {
status = FacetUtil.verifyFacets(module.getProject(), getServer());
if (status != null && !status.isOK()) {
return status;
}
}
}
}
// if (remove != null) {
// for (IModule element : remove) {
// if (element instanceof ApplicationModule) {
// return new Status(IStatus.ERROR, CloudfoundryPlugin.PLUGIN_ID, 0,
// "Some modules can not be removed.", null);
// }
// }
// }
return Status.OK_STATUS;
}
示例8: getModuleDelegate
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
public ModuleDelegate getModuleDelegate(IModule module) {
return new JavaLauncherModuleDelegate(module.getProject());
}
示例9: canModifyModules
import org.eclipse.wst.server.core.IModule; //导入方法依赖的package包/类
@Override
public IStatus canModifyModules(IModule[] add, IModule[] remove) {
if (add != null) {
int size = add.length;
for (int i = 0; i < size; i++) {
IModule module = add[i];
if (!ApplicationRegistry.isSupportedModule(module)) {
return new Status(IStatus.ERROR, DockerFoundryPlugin.PLUGIN_ID, 0, NLS.bind(
Messages.DockerFoundryServer_ERROR_APPTYPE_NOT_SUPPORTED, module.getModuleType().getId()),
null);
}
IStatus status;
// If the module, in a non-faceted project, has been determined
// to be deployable to CF (ie. a single zip application
// archive), then
// this facet check is unnecessary.
boolean ignoreFacetCheck = false;
// FIXNS: Enable with IModule2 workaround is in place, as its
// not available in Eclipse 4.3 and older.
// if (module instanceof IModule2) {
// String property =
// ((IModule2)module).getProperty(CloudFoundryConstants.PROPERTY_MODULE_NO_FACET);
// if (property != null && property.equals("true")) {
// ignoreFacetCheck = true;
// }
// }
// Workaround - Remove the following and use the above commented
// out code
ClassLoader classLoader = module.getClass().getClassLoader();
if (classLoader != null) {
try {
Class iModule2 = classLoader.loadClass("org.eclipse.wst.server.core.IModule2"); //$NON-NLS-1$
if (iModule2 != null) {
Method getProperty = iModule2.getMethod("getProperty", String.class); //$NON-NLS-1$
Object o = getProperty.invoke(module, DockerFoundryConstants.PROPERTY_MODULE_NO_FACET);
if (o instanceof String && ((String) o).equals("true")) { //$NON-NLS-1$
ignoreFacetCheck = true;
}
}
}
catch (Exception e) {
// If any issues, just go ahead and do the facet check
// below
}
}
// End of workaround
if (module.getProject() != null && !ignoreFacetCheck) {
status = FacetUtil.verifyFacets(module.getProject(), getServer());
if (status != null && !status.isOK()) {
return status;
}
}
}
}
// if (remove != null) {
// for (IModule element : remove) {
// if (element instanceof ApplicationModule) {
// return new Status(IStatus.ERROR, CloudfoundryPlugin.PLUGIN_ID, 0,
// "Some modules can not be removed.", null);
// }
// }
// }
return Status.OK_STATUS;
}