Changeset 56


Ignore:
Timestamp:
01/25/10 12:55:18 (14 years ago)
Author:
tmaciejewski
Message:

Framclipse updates:

  • added information where parsing errors occured
  • removed deprecated API from hover support
Location:
java/FramclipsePlugin
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • java/FramclipsePlugin/META-INF/MANIFEST.MF

    r13 r56  
    1313 org.eclipse.ui.workbench.texteditor,
    1414 org.eclipse.ui.views,
    15  org.eclipse.ui.ide
     15 org.eclipse.ui.ide,
     16 org.eclipse.core.resources
    1617Eclipse-LazyStart: true
    1718Export-Package:
  • java/FramclipsePlugin/src/main/java/com/framsticks/framclipse/editors/configuration/FramclipseReconcilingStrategy.java

    r13 r56  
    77import java.util.List;
    88
     9import org.eclipse.core.resources.IMarker;
     10import org.eclipse.core.resources.IResource;
     11import org.eclipse.core.runtime.CoreException;
    912import org.eclipse.core.runtime.IPath;
    1013import org.eclipse.core.runtime.IProgressMonitor;
     
    2225import org.eclipse.ui.IPathEditorInput;
    2326import org.eclipse.ui.IURIEditorInput;
     27import org.eclipse.ui.ide.ResourceUtil;
    2428
    2529import com.framsticks.framclipse.editors.FramclipseEditor;
     
    3337import com.framsticks.framclipse.internal.parser.FramclipseParser;
    3438import com.framsticks.framclipse.internal.parser.Node;
     39import com.framsticks.framclipse.internal.parser.ParseException;
     40import com.framsticks.framclipse.internal.parser.TokenMgrError;
    3541
    3642
     
    8995                                                viewer.setRedraw(false);
    9096                                               
    91                                                 parseDocument();
     97                                                IResource resource = ResourceUtil.getResource(fEditor.getEditorInput());
     98                                                resource.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ZERO);
     99
     100                                                try {
     101                                                        parseDocument();
     102                                                } catch (ParseException e) {
     103                                                        ErrorHandler<ParseException> handler = new ErrorHandler.ParseErrorHandler();
     104                                                        handler.createMarker(resource, e);
     105                                                } catch (TokenMgrError e) {
     106                                                        ErrorHandler<TokenMgrError> handler = new ErrorHandler.TokenErrorHandler();
     107                                                        handler.createMarker(resource, e);
     108                                                }
    92109                                                fEditor.updateOutlinePage();
    93110                                               
    94111                                                collectAndUpdateAnnotations();
     112                                        } catch (CoreException e) {
     113                                                e.printStackTrace();
    95114                                        }
    96115                                        finally
     
    105124        }
    106125       
    107         void parseDocument()
     126        void parseDocument() throws ParseException
    108127        {
    109128               
  • java/FramclipsePlugin/src/main/java/com/framsticks/framclipse/editors/hover/FramscriptTextHover.java

    r13 r56  
    55import org.eclipse.jface.internal.text.html.BrowserInformationControl;
    66import org.eclipse.jface.internal.text.html.HTMLTextPresenter;
     7import org.eclipse.jface.resource.JFaceResources;
    78import org.eclipse.jface.text.AbstractReusableInformationControlCreator;
    89import org.eclipse.jface.text.BadLocationException;
     
    3536
    3637                public IInformationControl doCreateInformationControl(Shell parent) {
    37                         int shellStyle= SWT.RESIZE | SWT.TOOL;
    38                         int style= SWT.V_SCROLL | SWT.H_SCROLL;
    39                         if (BrowserInformationControl.isAvailable(parent))
    40                                 return new BrowserInformationControl(parent, shellStyle, style);
    41                         else
    42                                 return new DefaultInformationControl(parent, shellStyle, style, new HTMLTextPresenter(false));
     38//                      int shellStyle= SWT.RESIZE | SWT.TOOL;
     39//                      int style= SWT.V_SCROLL | SWT.H_SCROLL;
     40//                      if (BrowserInformationControl.isAvailable(parent)) {
     41//                              return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, true);
     42//                              return new BrowserInformationControl(parent, shellStyle, style);
     43//                      } else
     44//                              return new DefaultInformationControl(parent, shellStyle, style, new HTMLTextPresenter(false));
     45                                return new DefaultInformationControl(parent, true);
    4346                }
    4447        }
     
    4750               
    4851                public IInformationControl doCreateInformationControl(Shell parent) {
    49                         if (BrowserInformationControl.isAvailable(parent))
    50                                 return new BrowserInformationControl(parent, SWT.TOOL | SWT.NO_TRIM, SWT.NONE, EditorsUI.getTooltipAffordanceString());
    51                         else
    52                                 return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true), EditorsUI.getTooltipAffordanceString());
     52//                      if (BrowserInformationControl.isAvailable(parent)) {
     53//                              return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, true);
     54//                              return new BrowserInformationControl(parent, SWT.TOOL | SWT.NO_TRIM, SWT.NONE, EditorsUI.getTooltipAffordanceString());
     55//                      } else {
     56//                              return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true), EditorsUI.getTooltipAffordanceString());
     57                                return new DefaultInformationControl(parent, true);
     58//                      }
    5359                }
    5460
  • java/FramclipsePlugin/src/main/java/com/framsticks/framclipse/internal/parser/FramclipseParser.java

    r13 r56  
    2626        }
    2727       
    28         public Node parse(String content, EditorType editorType, URL url) {
     28        public Node parse(String content, EditorType editorType, URL url) throws ParseException {
    2929                if (editorType.equals(EditorType.FRAMSCRIPT)) {
    3030
     
    6666                                                                }
    6767                                                                recursiveSetOffset(inc, inc.getBeginOffset(), inc.getEndOffset());
    68                                                         } catch (Throwable e) {
     68                                                        } catch (ParseException e) {
    6969                                                                inc.setValid(false);
    7070                                                                System.err.println("In "+path+fname);
     
    7575                                }
    7676                                return model;
     77                        } catch (ParseException e) {
     78                                e.printStackTrace();
     79                                throw e;
     80                        } catch (TokenMgrError e) {
     81                                e.printStackTrace();
     82                                throw e;
    7783                        } catch (Exception e) {
    7884                                e.printStackTrace();
    79                         } catch (TokenMgrError err) {
    80                                 err.printStackTrace();
    8185                        }
    8286                }
Note: See TracChangeset for help on using the changeset viewer.