Examples of IContainer


Examples of org.eclipse.core.resources.IContainer

  }

  public void init(IWorkbench workbench, IStructuredSelection selection) {
    _selection = selection;
    if (selection.getFirstElement() instanceof IContainer) {
      IContainer container = (IContainer) selection.getFirstElement();
      if (WGADesignStructureHelper.isValidScriptLocation(container)) {
        _scriptValidFolderSelected = true;
      }
    } else if (selection.getFirstElement() instanceof IFile) {
      IFile file = (IFile) selection.getFirstElement();
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    if (_txtPortletName.getText().equals("")) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please specify a name for the portlet"));
    } else if (!WGADesignStructureHelper.isValidModuleName(_txtPortletName.getText())) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Invalid chars in portlet name."));
    } else {
      IContainer targetContainer = _selectedContainer.getFolder(new Path(_txtPortletName.getText()));
      IFile targetFile = _selectedContainer.getFile(new Path(_txtPortletName.getText()));

      if (targetContainer == null || targetContainer.exists()) {

        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a folder named \"" + _txtPortletName.getText() + "\" below \"" + _selectedContainer.getName() + "\"."));
      } else if (targetFile == null || targetFile.exists()) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a file named \"" + _txtPortletName.getText() + "\" below \"" + _selectedContainer.getName() + "\"."));
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    // folder based design selected?
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IContainer) {
        IContainer container = (IContainer) selectedElement;

        IFile dirlink = container.getFile(new Path("dirlink.xml"));
        if (dirlink.exists()) {
          File linkedFile = WGUtils.resolveDirLink(container.getLocation().toFile());
          container = (IContainer) container.getWorkspace().getRoot().findContainersForLocationURI(linkedFile.toURI())[0];

        }

        if (WGADesignStructureHelper.isDesignFolder(container)) {
          _designContainer = container;
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    List<IStatus> list = new ArrayList<IStatus>();

    if (!(getTreeViewer().getTree().getSelectionCount() > 0)) {
      list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is no designfolder in workspace."));
    } else {
      IContainer treeSelection = (IContainer) getTreeViewer().getTree().getSelection()[0].getData();

      if (!WGADesignStructureHelper.isValidScriptLocation(treeSelection)) {
        list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "You cannot create a script module here. Please select a folder below the scripts folder."));
      }
    }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

  @Override
  protected IStructuredSelection getPreSelection(IResource workspaceSelection) {
    if (workspaceSelection == null) {
      return null;
    } else {
      IContainer bestContainer = null;
      if (workspaceSelection instanceof IContainer) {
        bestContainer = (IContainer) workspaceSelection;
      } else if (workspaceSelection instanceof IFile) {
        bestContainer = ((IFile) workspaceSelection).getParent();
      }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

                  } catch (Exception e) { 
                  }
                }
              }
              if (resource instanceof IContainer) {
                IContainer container = (IContainer) resource;
                if (WGADesignResourceValidator.shouldBeValidated(container)) {
                  try {
                    fMonitor.setTaskName("Validating '" + container.getLocation().toString() + "'.");
                    WGADesignResourceValidator.validate(container);
                    fMonitor.worked(1);                     
                  } catch (Exception e) { 
                  }
                }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

    }   
  }

  private void handleReOpenDesignResourceEditors() {
    // collect tml/ tmlscript editor which are editing a resource of the current design
    IContainer designRoot = ((IFileEditorInput)getEditorInput()).getFile().getParent();
    List<IEditorPart> editorsToReopen = WorkbenchUtils.findOpenEditors(Plugin.getDefault().getWorkbench(), ResourceIDs.EDITOR_TML, designRoot);
    editorsToReopen.addAll(WorkbenchUtils.findOpenEditors(Plugin.getDefault().getWorkbench(), ResourceIDs.EDITOR_TMLSCRIPT, designRoot));
    if (editorsToReopen.isEmpty()) {
      return;
    }
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

      String type = region.getAttributeValue("type");
      if (type != null && ( type.equals(WGADesignStructureHelper.SCRIPT_TYPE_CSS) || type.equals(WGADesignStructureHelper.SCRIPT_TYPE_JS)) ) {
        WGADesignStructureHelper designHelper = new WGADesignStructureHelper(activeFile);
            VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(activeFile);
           
        IContainer designRoot = designHelper.getDesignRoot();
        String medium = WGADesignStructureHelper.determineMediaKey(activeFile);
       
        ResourceIndexManager rsm = Plugin.getDefault().getResourceIndexManager();
        if (rsm != null) {
          // the path to the file which we are currently editing
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

  public void createMarkers(IResource resource) throws CoreException {
    resource.deleteMarkers(MARKER_ID, true, IResource.DEPTH_ZERO);

    if (_compliance.toWGAVersion().isAtLeast(5, 0)){
      IContainer container = (IContainer) resource;
      if(!container.getName().startsWith(".")){
        if (WGADesignStructureHelper.isMediaKeyContainer(container)) {
          IFile syncInfo = WGADesignStructureHelper.determineSyncInfo(container);       
          WGADesignConfigurationModelWrapper conf;
          try {
            conf = new WGADesignConfigurationModelWrapper(syncInfo);
            List<String> mediaKeyStrings = new ArrayList<String>();
            mediaKeyStrings.addAll(WGADesignStructureHelper.DEFAULT_MEDIA_KEYS);
            for (MediaKey current : conf.getMediaKeys()) {
              mediaKeyStrings.add(current.getKey());
            }
            if (!mediaKeyStrings.contains(container.getName())) {
              Map<String, Object> map = new HashMap<String, Object>();
              MarkerUtilities.setMessage(map, "Missing mediakey '" + container.getName() + "' in design configuration.");
              map.put(IMarker.LOCATION, resource.getFullPath().toString());
              map.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
              MarkerUtilities.createMarker(resource, map, MARKER_ID);
            }
          } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.core.resources.IContainer

  }

  private IContainer getDesignRoot() {
    IAdaptable element = getElement();
    if (element instanceof IContainer) {
      IContainer container = (IContainer) getElement();
      if (WGADesignStructureHelper.isDesignFolder(container)) {
        return container;
      }
    }
    return null;
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.