source: java/FramclipsePlugin/src/main/java/com/framsticks/framclipse/internal/parser/ASTProperty.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/plain
File size: 1.4 KB
Line 
1/* Generated By:JJTree: Do not edit this line. ASTProperty.java */
2
3package com.framsticks.framclipse.internal.parser;
4
5import org.eclipse.jface.text.IDocument;
6
7
8public class ASTProperty extends ElementWithOffset {
9       
10  private String name = "[noname]";
11
12        protected String value = "[undefined]";
13
14        public String getValue() {
15                return value;
16        }
17
18        public void setValue(String value) {
19                this.value = value;
20        }
21 
22 
23  public ASTProperty(int id) {
24    super(id);
25  }
26
27  public ASTProperty(FramclipseNonScriptParser p, int id) {
28    super(p, id);
29  }
30
31        public String getName() {
32                return name;
33        }
34       
35        public void setName(String name) {
36                this.name = name;
37        }
38       
39        @Override
40        public String toString() {
41                return name + ": "+value;
42        }
43
44        @Override
45        public boolean isEquivalent(ElementWithOffset element, IDocument document) {
46                if(!(element instanceof ASTProperty))
47                        return false;
48                if(!(this.name.equals(((ASTProperty)element).name)))
49                        return false;
50               
51                return super.isEquivalent(element, document);
52        }
53
54        @Override
55        public void jjtClose() {
56               
57                if (children != null && children.length == 1){
58                        if (children[0] instanceof ASTSingleLinePropertyValue) {
59                                ASTSingleLinePropertyValue v = (ASTSingleLinePropertyValue) children[0];
60                                value = v.getValue();
61                                children = null;
62                        } else
63                                if (children[0] instanceof ASTMultiLinePropertyValue) {                                 
64                                        value = "...";
65                                        children = null;
66                                }
67                }
68                       
69                super.jjtClose();
70        }
71       
72       
73
74
75
76}
Note: See TracBrowser for help on using the repository browser.