Package de.innovationgate.eclipse.wgadesigner.natures

Examples of de.innovationgate.eclipse.wgadesigner.natures.WGARuntime


    _doubleClickAction = new Action() {
        public void run() {
            ISelection selection = _table.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            if (obj instanceof WGARuntime) {
                WGARuntime runtime  = (WGARuntime)obj;
                try {
                    runtime.openEditor();
                }
                catch (PartInitException e) {
                    WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), getViewSite().getShell(), "Open runtime configuration failed", "Unable to open runtime configuration.", e);
                }
            }
View Full Code Here


    class RuntimeViewLabelProvider extends LabelProvider{

        @Override
        public Image getImage(Object element) {
            if (element instanceof WGARuntime) {               
                WGARuntime runtime = (WGARuntime)element;
                if (TomcatUtils.getInstance().isRunning(runtime)) {
                    return WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_START);
                }
                else {
                    return WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_RUNTIME);
View Full Code Here

        }

        @Override
        public String getText(Object element) {
            if(element instanceof WGARuntime){
                WGARuntime runtime = (WGARuntime)element;
               
                if (TomcatUtils.getInstance().isRunning(runtime)) {
                    String distri = TomcatUtils.getInstance().getCurrentRuntime().getConfiguration().getWgaDistribution();
                    return runtime.getName() + " " + distri + " (running) ";                 
                }
                return runtime.getName();
            }           
            return null;
        }
View Full Code Here

   
   
    class NameSorter extends ViewerSorter {
        public int compare(Viewer viewer, Object e1, Object e2) {
            if (e1 instanceof WGARuntime || e2 instanceof WGARuntime) {
                WGARuntime rt1 = (WGARuntime) e1;
                WGARuntime rt2 = (WGARuntime) e2;
                return rt1.getName().compareTo(rt2.getName());
            }

            return 0;

        }
View Full Code Here

        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

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        public String getColumnText(Object element, int columnIndex) { 
            WGARuntime runtime = (WGARuntime) element;
            return runtime.getName();
        }
View Full Code Here

      try {
        // create new project
        WGADesign designProject = WGADesignFactory.createDesign(project, getPluginTemplate());
       
        // register with runtime
        WGARuntime runtime = _page.getRuntime();
        if (runtime != null) {         
          WGADesignStructureHelper.createDirklink(runtime.getPluginRoot(), designProject.getDesignFolder(), _page.getPluginName());
         
         
          try {
            // elapse dirlink folder in navigation views
            WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(runtime.getPluginRoot().getFolder(_page.getPluginName())));
          } catch (Exception e) {           
          }
        }
                     
        // modify plugin config and open plugin design editor
View Full Code Here

    addPage(_page);
  }


  public boolean performFinish() {
    WGARuntime runtime = _page.getRuntime();   
    if(runtime != null){
      try {
        IFolder folder = runtime.getDesignRoot().getFolder(new Path(_page.getDesignName()));
        if (!folder.exists()) {
          folder.create(false, true, new NullProgressMonitor());
          DesignTemplate template = _page.getTemplate();
          WGADesignFactory.createDesign(folder, folder.getName(), template);
         
          if (!_page.isCreateContentStore()) {
            _page.getRuntime().register(folder, false, null, null, null, template.getProperties());
          } else {
            _page.getRuntime().register(folder, true, _page.getDatabaseKey(), _page.getDatabaseTitle(), _page.getDomain(), template.getProperties());
          }
         
          WGADesignStructureHelper helper = new WGADesignStructureHelper(folder);
            
          try {
            // select new created design in packages explorer, resource navigator & project explorer 
              if(template.getName().equals("empty")){
                  String wgaDistributionName = runtime.getConfiguration().getWgaDistribution();             
                            WGADeployment wgaDeployment = WGADesignerPlugin.getDefault().getWGADeploymentManager().getDeployment(wgaDistributionName);
                            WGADesignConfigurationModel configModel = helper.createModel();   
                            VersionCompliance vc = WGADesignStructureHelper.wgaVersionToVersionCompliance(wgaDeployment.getWGAVersion());
                            if(vc!=null){
                                configModel.setVersionCompliance(vc);
                                configModel.saveChanges();
                            }
             }
             
             
            WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(helper.getSyncInfo()));
            WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(folder));
          } catch (Exception e) {           
          }
         
          return true;
        } else {
          WorkbenchUtils.showErrorDialog(getShell(), "Design creation failed", "A design with name '" + _page.getDesignName() + "' already exists in the runtime '" + runtime.getName() + "'.");
          return false;
        }
      } catch (CoreException e) {
        WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), getShell(), "Design creation failed", "Unable to create new design in runtime '" + runtime.getName() + "'.", e);
        return false;
      }
    } else {
      WorkbenchUtils.showErrorDialog(getShell(), "Design creation failed", "No runtime selected for new design.");
      return false;
View Full Code Here

       
        return false;
    }

    public void init(IWorkbench workbench, IStructuredSelection selection) {
        WGARuntime runtime = null;
        if (selection.getFirstElement() instanceof WebApplication) {
            WebApplication app = (WebApplication) selection.getFirstElement();
            runtime = app.getRuntime();
            _webApplication = app.getContentStore().getKey();
        } else {               
            runtime = WGARuntime.fromSelection(selection);
        }
       
        if (runtime != null) {
            // validate runtime state           
            List<IStatus> errors = new ArrayList<IStatus>();
            ChooseRuntimePage.validateWGARuntimeVersion(errors, runtime);
            if (!errors.isEmpty()) {
                MessageDialog.openWarning(getShell(), "Invalid runtime", errors.get(0).getMessage());
            } else {
                if (!TomcatUtils.getInstance().isRunning(runtime)) {
                    boolean start = MessageDialog.openConfirm(getShell(), "Start WGA Runtime", "To export a web application the selected runtime '" + runtime.getName() + "' must be started. Start runtime now?");
                    if (start) {
                        StartWGARuntime.call(runtime, true);
                        _runtime = runtime;
                    }
                } else {
View Full Code Here

    return tableViewer;
  }

  protected void computeResult() {
    try {
      WGARuntime runtime = (WGARuntime) _selectedProject.getNature(ResourceIDs.NATURE_WGA_RUNTIME);

      String target = "designs";

      if (_combo.getText().equals("design")) {
        target = "designs";
      }

      if (_combo.getText().equals("plugin")) {
        target = "plugins";
      }
      IFolder targetFolder=runtime.getProject().getFolder(target);
      WGADesignStructureHelper.createDirklink(targetFolder, (IContainer) _treeViewer.getTree().getSelection()[0].getData(), _linkNameText.getText());
    } catch (CoreException e) {
      WGADesignerPlugin.getDefault().logWarning(e.getMessage(), e);
    } catch (IOException e) {
      WGADesignerPlugin.getDefault().logWarning(e.getMessage(), e);
View Full Code Here

TOP

Related Classes of de.innovationgate.eclipse.wgadesigner.natures.WGARuntime

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.