Examples of IContainer


Examples of org.eclipse.core.resources.IContainer

                    _multiTaskStatusControl.update(taskStatus);
                }
               
                taskStatus = _taskStatusMap.get(DESIGN_TASK);
                try {
                    IContainer designContainer = wizard.getRuntime().getConnectedDesignContainers().get(wizard.getWebApplication());
                    List<FSDesignResourceState> state = wizard.getRemoteServer().getServices().retrieveFSDesignResourceState(wizard.getRemoteServer().getSession(), designContainer.getName());
                    if (!state.isEmpty()) {
                        taskStatus.setSeverity(TaskStatus.WARNING);
                        taskStatus.setMessage("Design for web application already exist on remote server. The design will not be committed during this export. Please sync changes via design synchronization dialog after export.");
                        taskStatus.setSeverityLabel("already exists");
                    } else {
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

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

Examples of org.eclipse.core.resources.IContainer

                        _remoteServer.getServices().createDatabase(_remoteServer.getSession(), _remoteDatabaseServer, _remoteDatabaseServer.getCreateableContentStoreImplemenations().get(0),
                                pathOptions);
                        monitor.worked(1);

                        monitor.setTaskName("transfering design");
                        IContainer designContainer = _runtime.getConnectedDesignContainers().get(_webApplication);
                        designContainer.accept(new IResourceVisitor() {

                            public boolean visit(IResource resource) throws CoreException {
                                IPath remotePathObj = resource.getLocation();
                                int count = remotePathObj.matchingFirstSegments(_runtime.getDesignRoot().getLocation());
                                remotePathObj = remotePathObj.removeFirstSegments(count);
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

                }
            }          
        }
       
        if (_runtime != null && _webApplication == null) {
            IContainer designContainer = WGADesignStructureHelper.retrieveDesignContainerFromSelection(selection);
            if (designContainer != null) {
                try {
                    Map<String,IContainer> connectedDesigns = _runtime.getConnectedDesignContainers();
                    Iterator<String> dbkeys = connectedDesigns.keySet().iterator();
                    while (dbkeys.hasNext()) {
                        String dbkey = dbkeys.next();
                        IContainer container = connectedDesigns.get(dbkey);
                        if (container != null && container.equals(designContainer)) {
                            if (_webApplication == null) {
                                _webApplication = dbkey;
                            } else {
                                // more than one cs with this design - user must choose one
                                _webApplication = null;
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

  private Combo _combo;

  class NameSorter extends ViewerSorter {
    public int compare(Viewer viewer, Object e1, Object e2) {
      if (e1 instanceof IContainer && e2 instanceof IContainer) {
        IContainer ct1 = (IContainer) e1;
        IContainer ct2 = (IContainer) e2;
        return ct1.getName().toLowerCase().compareTo(ct2.getName().toLowerCase());
      }
      return 0;

    }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IFile) {
        _file = (IFile) selectedElement;
        if (_file.getFileExtension().equals("properties")) {
          IContainer container = _file.getParent();
          if (container.getName().startsWith("labels_")) {
            Properties props = WGADesignStructureHelper.loadLabel(_file);
            if (!props.isEmpty()) {
              _props = props;
              action.setEnabled(true);
            }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

               
                            
                Map<String, IContainer> contentDesign = currentRuntime.getConnectedDesignContainers();               
               
                for(String key : contentDesign.keySet()){
                    IContainer currentDesignFolder = contentDesign.get(key);
                    WGADesignStructureHelper helper = new WGADesignStructureHelper(currentDesignFolder);
                    if(helper.isWGADesignResourceOfCurrentDesign(tmlfile)){
                        return key;
                    }
                }  
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

      int matchingSegments = getRuntime().getDesignRoot().getFullPath().matchingFirstSegments(getLocal().getFullPath());     
      return getLocal().getFullPath().removeFirstSegments(matchingSegments).makeRelative().toString();
    } else {
      if (_localState != null && _localState.isDirLink()) {
        String linkName = _localState.getDirLinkName();
        IContainer linkTarget = _localState.getDirLinkTarget();
        int matchingSegments = linkTarget.getFullPath().matchingFirstSegments(getLocal().getFullPath());     
        return new Path(linkName).append(getLocal().getFullPath().removeFirstSegments(matchingSegments)).makeRelative().toString();       
      } else if (getRemote() != null) {
        FSDesignResourceState remoteState = ((WGAFSDesignResourceVariant)getRemote()).getState();
        if (remoteState != null) {
          return remoteState.getPath();
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();   
        if (selectedElement instanceof IProject || selectedElement instanceof IJavaProject) {
          _selectedProject = (IProject) selectedElement;         
        } else if (selectedElement instanceof IContainer) {
          IContainer container = (IContainer) selectedElement;
          if (container.getParent() instanceof IProject &&
              (container.getName().equalsIgnoreCase("designs") || container.getName().equalsIgnoreCase("plugins"))) {
            _selectedProject = container.getProject();           
        }
      }
    }
   
    try {
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

        IFolder tmlFolder = new WGADesignStructureHelper(referer).getTmlRoot();
        IFile fileToCreate = tmlFolder.getFile(new Path(_refPath));
        if (!fileToCreate.exists()) {
          try {
            // mkdir
            IContainer parent = fileToCreate.getParent();
            List<IFolder> foldersToCreate = new ArrayList<IFolder>();
            while (!parent.exists()) {
              if (parent instanceof IFolder) {
                foldersToCreate.add((IFolder)parent);
              }
              parent = parent.getParent();
            }
            for (int i=foldersToCreate.size() - 1; i >= 0; i--) {
              foldersToCreate.get(i).create(false, true, new NullProgressMonitor());
            }           
            // create tml file           
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.