Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Status


        break;
    }
  }
 
    private void applyStatus(String message, int severity) {
      Status status = new Status(severity, WGADesignerPlugin.PLUGIN_ID, message);
      applyToStatusLine(status);
    }
View Full Code Here


    @Override
    public List<IStatus> validate() {
        List<IStatus> errors = new ArrayList<IStatus>();
       
        if (_tblDatabaseServers.getTable().getSelectionCount() <= 0) {
            errors.add(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a database server for the export."));
        }
       
        if (_txtDatabaseName.getText() == null || _txtDatabaseName.getText().trim().equals("")) {
            errors.add(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please define a name for the new database which will be created."));
        }
       
        return errors;
    }
View Full Code Here

    @Override
    public List<IStatus> validate() {
        List<IStatus> errors = new ArrayList<IStatus>();
       
        if (_tblRuntimes.getTable().getSelectionCount() <= 0) {
            errors.add(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a runtime."));
        } else {
            ISelection selection = _tblRuntimes.getSelection();
            if (selection instanceof IStructuredSelection) {
                WGARuntime runtime = (WGARuntime)((IStructuredSelection)selection).getFirstElement();
                validateWGARuntimeVersion(errors, runtime);
View Full Code Here

                                    DataSource content = new FileDataSource(((IFile) resource).getLocation().toFile());
                                    try {
                                        _remoteServer.getServices().updateFSDesignResource(_remoteServer.getSession(), remotePath, content, resource.getLocalTimeStamp());
                                    }
                                    catch (WGAServiceException e) {
                                        throw new CoreException(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Creating design file failed.", e));
                                    }
                                }
                                else if (resource.getType() == IResource.FOLDER) {
                                    try {
                                        _remoteServer.getServices().mkFSDesignDir(_remoteServer.getSession(), remotePath);
                                    }
                                    catch (WGAServiceException e) {
                                        throw new CoreException(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Creating design folder failed.", e));
                                    }
                                }
                                return true;
                            }
                        });
View Full Code Here

    try {
      writer = new XMLWriter(OutputFormat.createPrettyPrint());
      writer.setOutputStream(new FileOutputStream(new File(getWGABase().getLocation().toFile(), "auth.xml")));
      writer.write(auth);
    } catch (Exception e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default auth configuration.", e));
    } finally {
      try {
        if (writer != null) {
          writer.close();
        }
      } catch (IOException e) {
      }
    }
    FileOutputStream configFileStream = null;
    try {
      _config = WGARuntimeConfiguration.createDefaultConfig();
      synchronized (_wgaConfigLock) {
        configFileStream = new FileOutputStream(getConfigFile().getLocation().toFile());
        WGARuntimeConfiguration.write(_config, configFileStream);
      }
    } catch (Exception e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default runtime configuration.", e));
    } finally {
      if (configFileStream != null) {
        try {
          configFileStream.close();
        } catch (IOException e) {
        }
      }

    }

    // create wga.xml defaults
    try {
      retrieveWGAConfig(true);
    } catch (IncompatibleWGAConfigVersion e) {
      // should not happen bc. config file does not exist yet - but for
      // sure we generate a notice
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default wga configuration.", e));
    } catch (IOException e) {
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to generate default wga configuration.", e));
    }

    _project.refreshLocal(IResource.DEPTH_INFINITE, null);
  }
View Full Code Here

      WGADesign wgaDesign = (WGADesign) design;
      // create new folder and dirlink in design-root
      try {
        registerExternalDesign(wgaDesign);
      } catch (IOException e) {
        throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to register external design.", e));
      }
    }

    if (createdb) {
      IContainer container = null;
      if (design instanceof WGADesign) {
        container = ((WGADesign) design).getProject();
      } else {
        container = (IFolder) design;
      }
      WGAConfiguration wgaConfig = null;
      try {
        wgaConfig = retrieveWGAConfig(true);
      } catch (IncompatibleWGAConfigVersion e) {
        MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning",
            "Unable to register design in runtime. WGA Version seams to be incompatible. Please ensure you are using the latest version of WGADevelopmentStudio.");
        WGADesignerPlugin.getDefault().logError(e.getMessage(), e);
      } catch (IOException e) {
        throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to create default wga configuration.", e));
      }

      if (wgaConfig != null) {
        if (dbkey == null) {
          dbkey = container.getName();
        }
        dbkey = dbkey.toLowerCase();
        if (title == null) {
          title = container.getName();
        }
        if (domain == null) {
          domain = wgaConfig.getDefaultDomain();
        }
        // check if db already exists
        boolean csExists = wgaConfig.hasContentDatabase(dbkey);
        if (csExists) {
          throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "A database with key '" + dbkey + "' already exists."));
        } else {
          int existingDbs = wgaConfig.getContentDatabases().size();
          ContentStore cs = wgaConfig.createContentStoreOnEmbeddedServer(dbkey, container.getName());
          cs.setDomain(domain.getUid());
          cs.setTitle(title);

          if (properties != null) {
            cs.setDefaultLanguage(properties.getProperty(DesignTemplate.PROP_DEFAULT_LANGUAGE, Locale.getDefault().getLanguage()));
          } else {
            cs.setDefaultLanguage(Locale.getDefault().getLanguage());
          }

          // if this is the first autocreated db - make it the default
          // db
          if (wgaConfig.getDefaultDatabase() == null && existingDbs == 0) {
            wgaConfig.setDefaultDatabase(cs.getKey());
          }
        }

        try {
          saveWGAConfig(wgaConfig);
        } catch (Exception e) {
          throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to update wga configfile.", e));
        }
      }
    }
  }
View Full Code Here

      WGARuntimeConfiguration.write(_config, configFileStream);

      _project.refreshLocal(IResource.DEPTH_ONE, null);
    } catch (Exception e) {
      WGADesignerPlugin.getDefault().logError("Unable to save config of runtime '" + getName() + "'.", e);
      throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to save config of runtime '" + getName() + "'.", e));
    } finally {
      try {
        if (configFileStream != null) {
          configFileStream.close();
        }
View Full Code Here

    @Override
    public List<IStatus> validate() {
        List<IStatus> errors = new ArrayList<IStatus>();
       
        if (_tblWebApplications.getTable().getSelectionCount() <= 0) {
            errors.add(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Please select a web application for the export."));
        }
       
        return errors;
    }
View Full Code Here

          try {
            monitor.beginTask("Stopping WGA runtime '" + temp.getName() + "'.", 1);
            TomcatUtils.getInstance().stop(new SubProgressMonitor(monitor, 1));             
            return Status.OK_STATUS;
          } catch (Exception e) {
            return new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to stop WGA runtime '" + temp.getName() + "'.", e);
          } finally {
            monitor.done();
          }
        }
       
View Full Code Here

            monitor.beginTask("Restarting WGA runtime '" + temp.getName() + "'.", 2);
            TomcatUtils.getInstance().stop(new SubProgressMonitor(monitor, 1));   
            TomcatUtils.getInstance().start(temp, new SubProgressMonitor(monitor, 1));
            return Status.OK_STATUS;
          } catch (Exception e) {
            return new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to restart WGA runtime '" + temp.getName() + "'.", e);
          } finally {
            monitor.done();
          }
        }
       
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Status

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.