Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Path


                if(suffix.equals(_typeLable.getText())){
                    nameOfmodelToCreate = nameOfmodelToCreate.substring(0, nameOfmodelToCreate.lastIndexOf("."));
                }              
            }      
           
            IFolder targetContainer = _selectedContainer.getFolder(new Path(nameOfmodelToCreate));
            IFile targetFile = _selectedContainer.getFile(new Path(nameOfmodelToCreate + "." + _typeLable.getText()));

            if (targetContainer.exists()) {
                list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a folder named \"" + nameOfmodelToCreate + "\" below \"" + _selectedContainer.getName() + "\"."));

            } else if (targetFile.exists()) {
View Full Code Here


    } else {
      medium = mymedium;
    }

    // the path of the selected medium
    IPath mediumPath = designHelper.getTmlRoot().getFolder(new Path(medium)).getProjectRelativePath();

    // the path to the file which we are currently editing
    IPath pathOfEditedFile = activeFile.getParent().getProjectRelativePath();
    pathOfEditedFile = pathOfEditedFile.removeFirstSegments(mediumPath.segmentCount());

    ResourceIndexManager rsm = Plugin.getDefault().getResourceIndexManager();
    if (rsm != null) {
      nontmlspecificrefs = rsm.getTMLpaths(activeFile, medium);

      Iterator<String> it = nontmlspecificrefs.iterator();
      while (it.hasNext()) {

        // current file from the db
        IPath currentFile = new Path(it.next()).removeFileExtension();

        // path of the current file
        IPath currentFilePath = currentFile.removeLastSegments(1);

        // removing the path of the elected medium
View Full Code Here

        if (nameOfmodelToCreate.equals("")) {
            list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Please specify a name for the module."));
        } else if (!WGADesignStructureHelper.isValidModuleName(nameOfmodelToCreate)) {
            list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Invalid chars in module name."));
        } else {
            IFolder targetContainer = _selectedContainer.getFolder(new Path(nameOfmodelToCreate));
           
            if(nameOfmodelToCreate.contains(".")){
                String suffix = nameOfmodelToCreate.substring(nameOfmodelToCreate.lastIndexOf("."),nameOfmodelToCreate.length());
                if(suffix.equals(".tml")){
                    nameOfmodelToCreate = nameOfmodelToCreate.substring(0, nameOfmodelToCreate.lastIndexOf("."));
                }              
            }
           
            IFile targetFile = _selectedContainer.getFile(new Path(nameOfmodelToCreate + ".tml"));

            if (targetContainer.exists()) {
                list.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "There is already a folder named \"" + nameOfmodelToCreate + "\" below \"" + _selectedContainer.getName() + "\"."));

            } else if (targetFile.exists()) {
View Full Code Here

        }
       
        // retrieve J2EE libs
        Bundle bundle = Platform.getBundle("de.innovationgate.eclipse.plugins.Core");
        if (bundle != null && wgaVersion != null) {           
            IPath path = new Path("resources").append("librarySets");
            if (wgaVersion.isAtLeast(5, 0)) {
                path = path.append("j2ee14");
            } else {
                path = path.append("j2ee13");
            }
View Full Code Here

      messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "No design folder selected."));
    } else {
      WGADesignStructureHelper helper = new WGADesignStructureHelper(designRoot);
      IFolder html = helper.getTmlRoot().getFolder("html");
      if (html.exists()) {
        IFile outerLayoutFile = html.getFile(new Path(getOuterLayoutName() + ".tml"));
        if (outerLayoutFile.exists()) {
          messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "A module with name '" + outerLayoutName + "' already exists in '" + outerLayoutFile.getParent().getFullPath().toString() + "'."));   
        }
        IFile innerLayoutFile = html.getFile(new Path("inner").append(getInnerLayoutName() + ".tml"));
        if (innerLayoutFile.exists()) {
          messages.add(new Status(Status.ERROR, Plugin.PLUGIN_ID, "A module with name '" + innerLayoutName + "' already exists in '" + innerLayoutFile.getParent().getFullPath().toString() + "'."));   
        }
      }
    }
View Full Code Here

    if (_page != null) {
      try {         
          String header = Plugin.getDefault().getHeaderFileMap().get(Plugin.HEADER_TML_MODUL).getHeaderForProject(_page.getTargetContainer().getProject());     
        IFile portlet = WGADesignStructureHelper.createPortlet(_page.getModes(), _page.getPortletName(), (IFolder) _page.getTargetContainer(),header);
        WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), portlet.getParent().getFile(new Path("mode-view.tml")), ResourceIDs.EDITOR_TML);
        WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(portlet.getParent().getFile(new Path("mode-view.tml"))));
      } catch (CoreException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
View Full Code Here

      IFolder html = helper.getTmlRoot().getFolder("html");
      if (!html.exists()) {
        html.create(false, true, new NullProgressMonitor());
      }
     
      IFile outerLayoutFile = html.getFile(new Path(outerLayoutName + ".tml"));
      InputStream outerLayoutTemplate = null;
      try {
        outerLayoutTemplate = Plugin.getDefault().getResourceAsStream("resources/templates/defaultOuterLayout.template");
        outerLayoutFile.create(outerLayoutTemplate, true, new NullProgressMonitor());
      } finally {
View Full Code Here

    if (event.getType() != IResourceChangeEvent.POST_CHANGE)
      return;

    IResourceDelta rootDelta = event.getDelta();

    IResourceDelta docDelta = rootDelta.findMember(new Path(""));
    if (docDelta == null)
      return;

    final ArrayList<IResource> removed = new ArrayList<IResource>();
    IResourceDeltaVisitor rvisitor = new IResourceDeltaVisitor() {
View Full Code Here

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

      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];

        }
View Full Code Here

TOP

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

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.