Package org.eclipse.ui

Examples of org.eclipse.ui.IFileEditorInput


      if(!((HTMLEditorPart)editor).isFileEditorInput()){
        return;
      }
      // write to temporary file
      HTMLEditorPart editor = (HTMLEditorPart)this.editor;
      IFileEditorInput input = (IFileEditorInput)this.editor.getEditorInput();
      String charset = input.getFile().getCharset();
      String html    = editor.getSourceEditor().getDocumentProvider().getDocument(input).get();
      // replace JSP parts
      html = JSPPreviewConverter.convertJSP((IFileEditorInput)getEditorInput(),html);
     
      File tmpFile = editor.getSourceEditor().getTempFile();
View Full Code Here


 
  protected void doValidate() {
    try {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          IFileEditorInput input = (IFileEditorInput)getEditorInput();
          IFile file = input.getFile();
         
          file.deleteMarkers(IMarker.PROBLEM,false,0);
         
          try {
            HTMLProjectParams params = new HTMLProjectParams(file.getProject());
View Full Code Here

      }
     
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          try {
            IFileEditorInput input = (IFileEditorInput)getEditorInput();
            IFile file = input.getFile();
            file.deleteMarkers(IMarker.PROBLEM,false,0);
           
            HTMLProjectParams params = new HTMLProjectParams(file.getProject());
            if(params.getValidateJSP()){
              new JSPValidator(input.getFile()).doValidate();
            }
          } catch(Exception ex){
            //HTMLPlugin.logException(ex);
          }
        }
View Full Code Here

  protected IHTMLOutlinePage createOutlinePage(){
    return new XMLOutlinePage(this);
  }
 
    public void reloadXML() {
        IFileEditorInput input = (IFileEditorInput) getEditorInput();
        try {
            input.getFile().refreshLocal(2, null);
        } catch (CoreException e) {
        }
    }
View Full Code Here

  protected void doValidate(){
    try {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          try {
            IFileEditorInput input = (IFileEditorInput)getEditorInput();
            String xml = getDocumentProvider().getDocument(input).get();
            IFile resource = input.getFile();
            //String charset = resource.getCharset();
            //charset = "Shift_JIS";
            resource.deleteMarkers(IMarker.PROBLEM,false,0);
           
            HTMLProjectParams params = new HTMLProjectParams(resource.getProject());
            if(!params.getValidateXML()){
              return;
            }
           
            if(params.getUseDTD()==false){
              // remove DOCTYPE decl
              Matcher matcher = patternDoctypePublic.matcher(xml);
              if(matcher.find()){
                xml = removeMatched(xml,matcher.start(),matcher.end());
              }
              matcher = patternDoctypeSystem.matcher(xml);
              if(matcher.find()){
                xml = removeMatched(xml,matcher.start(),matcher.end());
              }
            }
           
            SAXParser parser = new SAXParser();
           
            String   dtd = getDTD(xml);
            String[] xsd = getXSD(xml);
           
            // Validation configuration
            if((dtd==null && xsd==null) || !params.getUseDTD()){
              parser.setFeature("http://xml.org/sax/features/validation", false);
            } else {
              parser.setFeature("http://xml.org/sax/features/validation", true);
              parser.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true);
            }
            if(xsd!=null && params.getUseDTD()){
//              parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
//              parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", xsd);
              parser.setFeature("http://apache.org/xml/features/validation/schema", true);
              parser.setFeature("http://xml.org/sax/features/namespaces", true);
            }
           
            parser.setFeature("http://xml.org/sax/features/use-entity-resolver2", true);
            parser.setEntityResolver(new DTDResolver(getDTDResolvers(),
                input.getFile().getLocation().makeAbsolute().toFile().getParentFile()));
            parser.setErrorHandler(new XMLValidationHandler(resource));
           
            parser.parse(new InputSource(new StringReader(xml))); //new ByteArrayInputStream(xml.getBytes(charset))));
           
          } catch(Exception ex){
View Full Code Here

      if(!isFileEditorInput()){
        return;
      }
      super.updateAssist();
     
      IFileEditorInput input = (IFileEditorInput)getEditorInput();
      HTMLProjectParams params = new HTMLProjectParams(input.getFile().getProject());
      if(params.getUseDTD()==false){
        return;
      }
     
      String xml = getDocumentProvider().getDocument(input).get();
     
      // Update DTD based completion information.
      String dtd = getDTD(xml);
      if(dtd!=null){
        DTDResolver resolver = new DTDResolver(getDTDResolvers(),
            input.getFile().getLocation().makeAbsolute().toFile().getParentFile());
        InputStream in = resolver.getInputStream(dtd);
        if(in!=null){
          Reader reader = new InputStreamReader(in);
          // update AssistProcessor
          XMLAssistProcessor assistProcessor =
            (XMLAssistProcessor)((HTMLConfiguration)getSourceViewerConfiguration()).getAssistProcessor();
          assistProcessor.updateDTDInfo(reader);
          reader.close();
        }
      }
     
      // Update XML Schema based completion information.
      String[] xsd = getXSD(xml);
      if(xsd!=null){
        DTDResolver resolver = new DTDResolver(getDTDResolvers(),
            input.getFile().getLocation().makeAbsolute().toFile().getParentFile());
        for(int i=0;i<xsd.length;i++){
          InputStream in = resolver.getInputStream(xsd[i]);
          if(in!=null){
            Reader reader = new InputStreamReader(in);
            // update AssistProcessor
View Full Code Here

        if (activeWindow == null) {
            return null;
        }
        for (IEditorReference editorRef : activeWindow.getActivePage().getEditorReferences()) {
            if (editorRef.getEditorInput() instanceof IFileEditorInput) {
                IFileEditorInput editorInput = (IFileEditorInput) editorRef.getEditorInput();
                if (definitionFile.equals(editorInput.getFile()))
                    return (DesignerEditor) editorRef.getEditor(true);
            }
        }
        return null;
    }
View Full Code Here

        return;
      }
     
      // write to temporary file
        HTMLEditorPart editor = (HTMLEditorPart)this.editor;
        IFileEditorInput input = (IFileEditorInput)this.editor.getEditorInput();
        String charset = input.getFile().getCharset();
      String html    = editor.getSourceEditor().getDocumentProvider().getDocument(input).get();
      // replace JSP part
      //html = HTMLUtil.convertJSP(html);
     
      File tmpFile = editor.getSourceEditor().getTempFile();
View Full Code Here

  protected Object openDialogBox(Object obj, Control cellEditorWindow) {
    try {
      // �v���W�F�N�g���擾���邽�߂ɃA�N�e�B�u�ȃG�f�B�^���擾
      IEditorPart editorPart = HTMLUtil.getActiveEditor();
     
      IFileEditorInput input = (IFileEditorInput)editorPart.getEditorInput();
      IJavaProject project = JavaCore.create(input.getFile().getProject());
     
      Shell shell = cellEditorWindow.getShell();
      SelectionDialog dialog = JavaUI.createTypeDialog(
          shell,new ProgressMonitorDialog(shell),
          SearchEngine.createJavaSearchScope(new IJavaElement[]{project}),
View Full Code Here

  protected void update(){
    outline.update();
    doValidate();
    updateFolding();
   
    IFileEditorInput input = (IFileEditorInput)getEditorInput();
    JavaScriptConfiguration config = (JavaScriptConfiguration)getSourceViewerConfiguration();
    config.getAssistProcessor().update(input.getFile());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IFileEditorInput

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.