Package org.eclipse.wst.server.core

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


    @Override
    protected void performDeployment(CloudFoundryApplicationModule appModule, IProgressMonitor monitor)
        throws CoreException {
      final Server server = (Server) getServer();
      final CloudFoundryServer cloudServer = getCloudFoundryServer();
      final IModule module = modules[0];

      try {

        // Update the local cloud module representing the application
        // first.
View Full Code Here


      CloudService service1 = (CloudService) e1;
      CloudService service2 = (CloudService) e2;
      return service1.getName().compareTo(service2.getName());
    }
    if (e1 instanceof IModule && e2 instanceof IModule) {
      IModule m1 = (IModule) e1;
      IModule m2 = (IModule) e2;
      return m1.getName().compareTo(m2.getName());
    }
    return super.compare(viewer, e1, e2);
  }
View Full Code Here

   * 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

    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

    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

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

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

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

      @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

    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

              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

  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

TOP

Related Classes of org.eclipse.wst.server.core.IModule

Copyright © 2018 www.massapicom. 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.