Examples of IFile


Examples of org.eclipse.core.resources.IFile

    }

    public void apply(IDocument document) {
      IResource resource = _markerAnnotation.getMarker().getResource();
      if (resource instanceof IFile) {
        IFile referer = (IFile) resource;
        WGADesignStructureHelper helper = new WGADesignStructureHelper(referer);
       
        try {
          helper.createLabel(_labelFilename, _labelKey, "");                 
          // revalidate tmlfile and open editor
View Full Code Here

Examples of org.eclipse.core.resources.IFile

       
     
        if (!labelFilename.equalsIgnoreCase("general")) {
          // check if labelfile exists
          try {
            IFile labelFile = designHelper.getLabelFile(labelFilename);
            if (labelFile == null || !labelFile.exists()) {
              try {             
                IRegion attributeRegion = tmlInfo.getAttributeValueRegion("file");
                if (attributeRegion != null) {
                  charStart = attributeRegion.getOffset();
                  charEnd = charStart + attributeRegion.getLength();
View Full Code Here

Examples of org.eclipse.core.resources.IFile

  public String getTypeLabel() {
    return null;
  }

  public void open() {
    IFile file = Plugin.getDefault().getActiveFile();
    if (file != null) {
      IFile referenceFile = WGADesignStructureHelper.findReferencedTMLModule(file, _reference, _tmlRegion.getAttributeValue("medium"));
      if (referenceFile != null) {
        if (Plugin.getDefault().isDebugging()) {
          System.out.println(referenceFile.getProjectRelativePath());
        }
        try {
          WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), referenceFile, ResourceIDs.EDITOR_TML);
        } catch (PartInitException e) {
          Plugin.getDefault().logError("Unable to open editor for reference '" + _reference + "'.", e);
View Full Code Here

Examples of org.eclipse.core.resources.IFile

  private boolean hasMDHeader() {
    boolean hasMDHeader = false;
    try {
      IAdaptable element = getElement();
      if (element instanceof IFile) {
        IFile tmlFile = (IFile) getElement();
        TMLDocumentProvider provider = new TMLDocumentProvider();   
        IFileEditorInput input = new FileEditorInput(tmlFile);     
        provider.connect(input);
       
        if (provider.getDocument(input).getContentType(0).equals(TMLPartitionScanner.TML_METAHEADER)) {
View Full Code Here

Examples of org.eclipse.core.resources.IFile

  @Override
  public Model getModel() {
    if (_model == null) {
      IAdaptable element = getElement();
      if (element instanceof IFile) {
        IFile tmlFile = (IFile) getElement()
        _model = new TMLFileMetadataModel(tmlFile);
      }
    }
    return _model;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IFile

          charStart = partition.getOffset() + tmlInfo.getContent().indexOf("ref")+"ref='".length();
          charEnd = charStart + tmlInfo.getAttributeValue("ref").length();
        }           
        if (tmlInfo.hasAttribute("ref")) {
          String ref = tmlInfo.getAttributeValue("ref")
          IFile referencedFile = WGADesignStructureHelper.findReferencedTMLModule(file, ref, tmlInfo.getAttributeValue("medium"));
     
          if (referencedFile == null) {
             
             
            String referencePath = new WGADesignStructureHelper(file).computeTMLModuleReferencePath(file, ref, tmlInfo.getAttributeValue("medium"));
            Map<String, Object> attributes = new HashMap<String, Object>();
            if (ref != null && !ref.trim().equals("")) {
                if (wgaVersionIsAtLeast(5, 4) && ref.startsWith("::") && ref.toLowerCase().endsWith("@base")) {
                    MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Illegal reference '" + tmlInfo.getAttributeValue("ref") + "'.", attributes);
                    return;
                } else {
                  attributes.put(ATTRIBUTE_REFERENCE_TYPE, REFERENCE_TYPE_TML);
                  attributes.put(ATTRIBUTE_MISSING_REFERENCE_PATH, referencePath);
                  if (tmlInfo.getTagName().equals("portlet") || (tmlInfo.getTagName().equals("include") && tmlInfo.hasAttribute("type", "portlet"))) {
                    attributes.put(ATTRIBUTE_IS_PORTLET_REFERENCE, true);
                  } else {
                    attributes.put(ATTRIBUTE_IS_PORTLET_REFERENCE, false);
                  }
                }
            }
            if (wgaVersionIsAtLeast(5, 4)) {
                if (!referencePath.contains("@base")) {
                    MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Unsatisfied reference '" + tmlInfo.getAttributeValue("ref") + "'.", attributes);
                }
            } else {
                MarkerFactory.createErrorMarker(getMarkerID(), file, charStart, charEnd, "Unsatisfied reference '" + tmlInfo.getAttributeValue("ref") + "'.", attributes);
            }
          }
        }   
      }
    }
   
    // validate short tml module include syntax <tml:[modulename]>
    if (wgaVersionIsAtLeast(4, 1) && tmlInfo.getTagName().matches("\\[.*\\]") && !tmlInfo.getTagName().contains("/")) {
      if (!tmlInfo.hasAttribute("designdb") && !tmlInfo.isDynamicAttributeValue("medium")) {
       
        charStart = partition.getOffset() + tmlInfo.getContent().indexOf(tmlInfo.getTagName()) + 1;
        charEnd = charStart + tmlInfo.getTagName().length() - 2;
       
       
        String ref = tmlInfo.getTagName().replaceAll("\\[", "");
        ref = ref.replaceAll("\\]", "");
        IFile referencedFile = WGADesignStructureHelper.findReferencedTMLModule(file, ref, tmlInfo.getAttributeValue("medium"));   
        if (referencedFile == null) {
          String referencePath = new WGADesignStructureHelper(file).computeTMLModuleReferencePath(file, ref, tmlInfo.getAttributeValue("medium"));
          Map<String, Object> attributes = new HashMap<String, Object>();
          if (ref != null && !ref.trim().equals("")) {
              if (wgaVersionIsAtLeast(5, 4) && ref.startsWith("::") && ref.toLowerCase().endsWith("@base")) {
View Full Code Here

Examples of org.eclipse.core.resources.IFile

  private void handleActionReference(IFile file, ITypedRegion partition, TMLRegion tmlInfo, String attributeName) {
    int charStart = partition.getOffset();
    int charEnd = charStart + partition.getLength();
    String ref = tmlInfo.getAttributeValue(attributeName);
    if (ref != null && ref.contains(":")) {
      IFile referencedFile = null;
      String referenceType = null;
      String referencePath = null;
             
      referencedFile = WGADesignStructureHelper.findReferencedScript(file, ref, WGADesignStructureHelper.SCRIPT_TYPE_TMLSCRIPT);
      referenceType = REFERENCE_TYPE_SCRIPT;
View Full Code Here

Examples of org.eclipse.core.resources.IFile

  private void handleURLLayoutReference(IFile file, ITypedRegion partition, TMLRegion tmlInfo) {
    int charStart = partition.getOffset() + tmlInfo.getContent().indexOf("layout")+"layout='".length();
    int charEnd = charStart + tmlInfo.getAttributeValue("layout").length();
   
    String ref = tmlInfo.getAttributeValue("layout")
    IFile referencedFile = WGADesignStructureHelper.findReferencedTMLModule(file, ref, tmlInfo.getAttributeValue("medium"));

    if (referencedFile == null) {
      String referencePath = new WGADesignStructureHelper(file).computeTMLModuleReferencePath(file, ref, tmlInfo.getAttributeValue("medium"));
      Map<String, Object> attributes = new HashMap<String, Object>();
      if (ref != null && !ref.trim().equals("")) {
View Full Code Here

Examples of org.eclipse.core.resources.IFile

    int charEnd = charStart + partition.getLength();
   
    String type = tmlInfo.getAttributeValue("type");
    if ( type != null ) {
      String ref = tmlInfo.getAttributeValue("name");
      IFile referencedFile = null;
      String referenceType = null;
      String referencePath = null;
      if (type.equals(WGADesignStructureHelper.SCRIPT_TYPE_CSS) || type.equals(WGADesignStructureHelper.SCRIPT_TYPE_JS))  {           
        referencedFile = WGADesignStructureHelper.findReferencedScript(file, ref, type);
        referenceType = REFERENCE_TYPE_SCRIPT;
View Full Code Here

Examples of org.eclipse.core.resources.IFile

            TMLRegion tmlInfo = TMLRegion.parse(region, document, offset);
            if (tmlInfo.isCursorInTagName()) {
              return alphaNumericControlsNoEnter;
            } else if (tmlInfo.isCursorInAttributeValue()) {
               // check if attribute is tmlscript expression
                IFile activeFile = Plugin.getDefault().getActiveFile();
                String tagName = tmlInfo.getTagName();
                if (activeFile != null && tagName != null) {
                    VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(activeFile);
                    if (versionCompliance != null) {
                        TMLTag tag = TMLTagDefinitions.getInstance(versionCompliance).getTagByName(tagName);
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.