|
From: <ce...@us...> - 2004-01-13 13:54:09
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model
In directory sc8-pr-cvs1:/tmp/cvs-serv11308/src/net/sourceforge/csseditor/internal/model
Modified Files:
SourceReference.java StyleSheet.java StyleRule.java
AtRule.java PropertyInfo.java Declaration.java
AbstractRule.java
Log Message:
REmove unnecessary 'this' qualifiers
Index: SourceReference.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/SourceReference.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SourceReference.java 27 Dec 2003 18:46:55 -0000 1.2
--- SourceReference.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 56,61 ****
public String getSource() {
try {
! return this.document.get(this.sourceRegion.getOffset(),
! this.sourceRegion.getLength());
} catch (BadLocationException e) {
throw new IllegalStateException(
--- 56,61 ----
public String getSource() {
try {
! return document.get(sourceRegion.getOffset(),
! sourceRegion.getLength());
} catch (BadLocationException e) {
throw new IllegalStateException(
***************
*** 68,72 ****
*/
public IRegion getSourceRegion() {
! return this.sourceRegion;
}
--- 68,72 ----
*/
public IRegion getSourceRegion() {
! return sourceRegion;
}
***************
*** 74,78 ****
public final void setSourceRegion(IRegion region) {
! this.sourceRegion = new Region(region.getOffset(), region.getLength());
}
--- 74,78 ----
public final void setSourceRegion(IRegion region) {
! sourceRegion = new Region(region.getOffset(), region.getLength());
}
***************
*** 80,84 ****
protected final IDocument getDocument() {
! return this.document;
}
--- 80,84 ----
protected final IDocument getDocument() {
! return document;
}
Index: StyleSheet.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/StyleSheet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StyleSheet.java 27 Dec 2003 18:46:55 -0000 1.2
--- StyleSheet.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 53,57 ****
private Object dirtyLock = new Object();
-
private boolean dirty = true;
--- 53,56 ----
***************
*** 80,84 ****
*/
public IRule[] getRules() {
! return (IRule[]) this.rules.toArray(new IRule[this.rules.size()]);
}
--- 79,83 ----
*/
public IRule[] getRules() {
! return (IRule[]) rules.toArray(new IRule[rules.size()]);
}
***************
*** 89,106 ****
throws LexicalErrorException, SyntaxErrorException {
! synchronized (this.dirtyLock) {
! if (!this.dirty) {
return;
}
! this.dirty = false;
}
synchronized (this) {
! this.rules.clear();
ICssParser parser = new DefaultCssParser();
parser.setProblemCollector(problemCollector);
parser.setSource(getDocument());
! IRule[] rules = parser.parseRules(this);
! this.rules.addAll(Arrays.asList(rules));
fireChangeEvent();
}
--- 88,104 ----
throws LexicalErrorException, SyntaxErrorException {
! synchronized (dirtyLock) {
! if (!dirty) {
return;
}
! dirty = false;
}
synchronized (this) {
! rules.clear();
ICssParser parser = new DefaultCssParser();
parser.setProblemCollector(problemCollector);
parser.setSource(getDocument());
! rules.addAll(Arrays.asList(parser.parseRules(this)));
fireChangeEvent();
}
***************
*** 111,115 ****
*/
public void addListener(IStyleSheetListener listener) {
! this.listeners.add(listener);
}
--- 109,113 ----
*/
public void addListener(IStyleSheetListener listener) {
! listeners.add(listener);
}
***************
*** 118,122 ****
*/
public void removeListener(IStyleSheetListener listener) {
! this.listeners.remove(listener);
}
--- 116,120 ----
*/
public void removeListener(IStyleSheetListener listener) {
! listeners.remove(listener);
}
***************
*** 134,139 ****
*/
public void documentChanged(DocumentEvent event) {
! synchronized (this.dirtyLock) {
! this.dirty = true;
}
}
--- 132,137 ----
*/
public void documentChanged(DocumentEvent event) {
! synchronized (dirtyLock) {
! dirty = true;
}
}
***************
*** 147,151 ****
*/
public void addRule(IRule rule) {
! this.rules.add(rule);
}
--- 145,149 ----
*/
public void addRule(IRule rule) {
! rules.add(rule);
}
***************
*** 154,158 ****
private void fireChangeEvent() {
StyleSheetChangeEvent event = new StyleSheetChangeEvent(this);
! for (Iterator i = this.listeners.iterator(); i.hasNext(); ) {
IStyleSheetListener listener = (IStyleSheetListener) i.next();
listener.styleSheetChanged(event);
--- 152,156 ----
private void fireChangeEvent() {
StyleSheetChangeEvent event = new StyleSheetChangeEvent(this);
! for (Iterator i = listeners.iterator(); i.hasNext(); ) {
IStyleSheetListener listener = (IStyleSheetListener) i.next();
listener.styleSheetChanged(event);
Index: StyleRule.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/StyleRule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StyleRule.java 27 Dec 2003 18:46:55 -0000 1.2
--- StyleRule.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 63,67 ****
*/
public final ISourceReference getSelector() {
! return this.selector;
}
--- 63,67 ----
*/
public final ISourceReference getSelector() {
! return selector;
}
Index: AtRule.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/AtRule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AtRule.java 27 Dec 2003 18:46:55 -0000 1.2
--- AtRule.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 61,65 ****
*/
public final ISourceReference getName() {
! return this.name;
}
--- 61,65 ----
*/
public final ISourceReference getName() {
! return name;
}
***************
*** 68,72 ****
*/
public final ISourceReference getValue() {
! return this.value;
}
--- 68,72 ----
*/
public final ISourceReference getValue() {
! return value;
}
Index: PropertyInfo.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/PropertyInfo.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PropertyInfo.java 14 Dec 2003 21:59:39 -0000 1.1.1.1
--- PropertyInfo.java 13 Jan 2004 13:54:05 -0000 1.2
***************
*** 76,80 ****
*/
public String getName() {
! return this.name;
}
--- 76,80 ----
*/
public String getName() {
! return name;
}
***************
*** 83,87 ****
*/
public String getCategory() {
! return this.category;
}
--- 83,87 ----
*/
public String getCategory() {
! return category;
}
***************
*** 90,94 ****
*/
public String getDescription() {
! return this.description;
}
--- 90,94 ----
*/
public String getDescription() {
! return description;
}
***************
*** 97,101 ****
*/
public boolean isShorthand() {
! return this.shorthand;
}
--- 97,101 ----
*/
public boolean isShorthand() {
! return shorthand;
}
Index: Declaration.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/Declaration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Declaration.java 27 Dec 2003 18:46:55 -0000 1.2
--- Declaration.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 68,72 ****
*/
public final IRule getRule() {
! return this.rule;
}
--- 68,72 ----
*/
public final IRule getRule() {
! return rule;
}
***************
*** 75,79 ****
*/
public final ISourceReference getProperty() {
! return this.property;
}
--- 75,79 ----
*/
public final ISourceReference getProperty() {
! return property;
}
***************
*** 82,86 ****
*/
public final ISourceReference getValue() {
! return this.value;
}
--- 82,86 ----
*/
public final ISourceReference getValue() {
! return value;
}
***************
*** 89,93 ****
*/
public final ISourceReference getPriority() {
! return this.priority;
}
--- 89,93 ----
*/
public final ISourceReference getPriority() {
! return priority;
}
***************
*** 97,104 ****
* Sets the property.
*
! * @param name The property to set
*/
! public final void setProperty(ISourceReference name) {
! this.property = name;
}
--- 97,104 ----
* Sets the property.
*
! * @param property The property to set
*/
! public final void setProperty(ISourceReference property) {
! this.property = property;
}
Index: AbstractRule.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/AbstractRule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AbstractRule.java 27 Dec 2003 18:46:55 -0000 1.2
--- AbstractRule.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 79,83 ****
*/
public final IStyleSheet getStyleSheet() {
! return this.styleSheet;
}
--- 79,83 ----
*/
public final IStyleSheet getStyleSheet() {
! return styleSheet;
}
***************
*** 86,90 ****
*/
public final IRule getParent() {
! return this.parent;
}
--- 86,90 ----
*/
public final IRule getParent() {
! return parent;
}
***************
*** 93,98 ****
*/
public final IRule[] getChildren() {
! return (IRule[]) this.children.toArray(
! new IRule[this.children.size()]);
}
--- 93,97 ----
*/
public final IRule[] getChildren() {
! return (IRule[]) children.toArray(new IRule[children.size()]);
}
***************
*** 101,105 ****
*/
public final IDeclaration getDeclarationAt(int offset) {
! for (Iterator i = this.declarations.iterator(); i.hasNext(); ) {
IDeclaration declaration = (IDeclaration) i.next();
IRegion region = declaration.getSourceRegion();
--- 100,104 ----
*/
public final IDeclaration getDeclarationAt(int offset) {
! for (Iterator i = declarations.iterator(); i.hasNext(); ) {
IDeclaration declaration = (IDeclaration) i.next();
IRegion region = declaration.getSourceRegion();
***************
*** 116,121 ****
*/
public final IDeclaration[] getDeclarations() {
! return (IDeclaration[]) this.declarations.toArray(
! new IDeclaration[this.declarations.size()]);
}
--- 115,120 ----
*/
public final IDeclaration[] getDeclarations() {
! return (IDeclaration[]) declarations.toArray(
! new IDeclaration[declarations.size()]);
}
***************
*** 127,134 ****
public Object getAdapter(Class adapter) {
if (adapter == IPropertySource.class) {
! if (this.propertySource == null) {
! this.propertySource = new CssRulePropertySource(this);
}
! return this.propertySource;
}
return null;
--- 126,133 ----
public Object getAdapter(Class adapter) {
if (adapter == IPropertySource.class) {
! if (propertySource == null) {
! propertySource = new CssRulePropertySource(this);
}
! return propertySource;
}
return null;
***************
*** 138,146 ****
public final void addChild(IRule rule) {
! this.children.add(rule);
}
public final void addDeclaration(IDeclaration declaration) {
! this.declarations.add(declaration);
}
--- 137,145 ----
public final void addChild(IRule rule) {
! children.add(rule);
}
public final void addDeclaration(IDeclaration declaration) {
! declarations.add(declaration);
}
|