Examples of IModule


Examples of org.eclipse.wst.server.core.IModule

   * org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate#createModules
   * (org.eclipse.core.resources.IProject)
   */
  public IModule[] createModules(IProject project) {
    if (canCreateModule(project)) {
      IModule module = createModule(project.getName(), project.getName(),
          StandaloneFacetHandler.ID_MODULE_STANDALONE,
          StandaloneFacetHandler.ID_JAVA_STANDALONE_APP_VERSION,
          project);
      if (module != null) {
        return new IModule[] { module };
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

    CloudFoundryApplicationModule appModule = assertApplicationIsDeployed(prefix, IServer.STATE_STOPPED);
    assertNotNull("Expected non-null Cloud Foundry application module", appModule);

    // Now CHECK that the expected conditions in the helper method assert to
    // expected values
    IModule module = getModule(harness.getDefaultWebAppProjectName());

    appModule = assertCloudFoundryModuleExists(module, prefix);

    assertNotNull(
        "No Cloud Application mapping in Cloud module. Application mapping failed or application did not deploy",
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

    CloudFoundryApplicationModule appModule = null;
    if (modules == null || modules.length == 0) {
      throw CloudErrorUtil.toCoreException(INTERNAL_ERROR_NO_WST_MODULE);
    }
    else {
      IModule module = modules[0];

      CloudFoundryServer cloudServer = getCloudFoundryServer();

      appModule = cloudServer.getCloudModule(module);
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

  public List<String> getURLs() {
    return page.getURLs();
  }

  public boolean requiresURL() {
    IModule localModule = applicationModule.getLocalModule();

    if (localModule == null) {
      return true;
    }
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

      @Override
      public Image getImage(Object element) {
        Image image = super.getImage(element);

        if (element instanceof IModule) {
          IModule module = (IModule) element;
          CloudFoundryApplicationModule appModule = editorPage.getCloudServer()
              .getExistingCloudModule(module);
          if (appModule != null && appModule.getErrorMessage() != null) {
            return CloudFoundryImages.getImage(new DecorationOverlayIcon(image,
                CloudFoundryImages.OVERLAY_ERROR, IDecoration.BOTTOM_LEFT));
          }
        }

        return image;
      }

      @Override
      public String getText(Object element) {
        // This is the WTP module name (usually, it's the workspace
        // project name)
        String moduleName = super.getText(element);

        // However, the user has the option to specify a different name
        // when pushing an app, which is used as the cf app name. If
        // they are different, and the
        // corresponding workspace project is accessible, show both.
        // Otherwise, show the cf app name.

        if (element instanceof IModule) {

          IModule module = (IModule) element;

          // Find the corresponding Cloud Foundry-aware application
          // Module.
          CloudFoundryApplicationModule appModule = cloudServer.getExistingCloudModule((IModule) element);

          if (appModule != null) {
            String cfAppName = appModule.getDeployedApplicationName();

            if (cfAppName != null) {

              // Be sure not to show a null WTP module name,
              // although
              // that should not be encountered
              if (moduleName != null
                  && !cfAppName.equals(moduleName)
                  && CloudFoundryProperties.isModuleProjectAccessible.testProperty(
                      new IModule[] { module }, cloudServer)) {
                moduleName = cfAppName + " (" + moduleName + ")"; //$NON-NLS-1$ //$NON-NLS-2$
              }
              else {
                moduleName = cfAppName;
              }
            }
          }
        }

        return moduleName;
      }

    });
    applicationsViewer.setInput(new CloudApplication[0]);
    applicationsViewer.setSorter(new CloudFoundryViewerSorter());

    applicationsViewer.addSelectionChangedListener(new ISelectionChangedListener() {

      public void selectionChanged(SelectionChangedEvent event) {
        IStructuredSelection selection = (IStructuredSelection) event.getSelection();
        IModule module = (IModule) selection.getFirstElement();

        if (currentModule != module) {
          currentModule = module;
          getManagedForm().fireSelectionChanged(ApplicationMasterPart.this, selection);
        }
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

    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));
    }
  }
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

              StatusManager.getManager().handle(status, StatusManager.LOG);
              setErrorInPage(status);
            }
            else {
              IModule currentModule = editorPage.getMasterDetailsBlock().getCurrentModule();
              if (currentModule != null) {
                CloudFoundryApplicationModule appModule = editorPage.getCloudServer()
                    .getExistingCloudModule(currentModule);
                if (appModule != null && appModule.getErrorMessage() != null) {
                  setErrorInPage(appModule.getErrorMessage());
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

  static final String TUNNEL_SERVICE_COMMANDS_PROPERTY = "org.cloudfoundry.ide.eclipse.tunnel.service.commands"; //$NON-NLS-1$

  private static final String PROPERTY_DEPLOYMENT_NAME = "deployment_name"; //$NON-NLS-1$

  static void updateState(Server server, CloudFoundryApplicationModule appModule) throws CoreException {
    IModule localModule = appModule.getLocalModule();
    server.setModuleState(new IModule[] { localModule }, appModule.getState());
    if (server.getModulePublishState(new IModule[] { localModule }) == IServer.PUBLISH_STATE_UNKNOWN) {
      server.setModulePublishState(new IModule[] { localModule }, appModule.getPublishState());
    }
  }
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

  @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 = 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, CloudFoundryConstants.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;
          }
        }
      }
View Full Code Here

Examples of org.eclipse.wst.server.core.IModule

    return "Refresh application"; //$NON-NLS-1$
  }

  @Override
  protected void display404Error(IStatus status) {
    IModule currentModule = getEditorPage().getMasterDetailsBlock().getCurrentModule();
    if (currentModule != null) {
      getEditorPage().setMessage(Messages.RefreshApplicationEditorAction_WARNING_CANNOT_REFRESH,
          IMessageProvider.WARNING);
    }
    else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.