Changeset 18 in default for trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui
- Timestamp:
- 10/26/10 11:53:37 (14 years ago)
- Location:
- trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring/autorenumber/AutoRenumberRefactoringProcessor.java
r5 r18 5 5 import org.eclipse.core.runtime.IProgressMonitor; 6 6 import org.eclipse.core.runtime.OperationCanceledException; 7 import org.eclipse.emf.ecore.EObject; 7 8 import org.eclipse.jface.text.BadLocationException; 8 9 import org.eclipse.ltk.core.refactoring.Change; … … 19 20 import org.eclipse.xtext.parsetree.AbstractNode; 20 21 import org.eclipse.xtext.parsetree.CompositeNode; 22 import org.eclipse.xtext.parsetree.NodeUtil; 21 23 import org.eclipse.xtext.ui.editor.XtextEditor; 22 24 import org.eclipse.xtext.ui.editor.model.XtextDocument; 23 25 24 import de.ugoe.cs.swe.bnftools.ebnf. Rule;26 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; 25 27 26 28 public class AutoRenumberRefactoringProcessor extends RefactoringProcessor { … … 113 115 for (int i=0; i < rootNode.getChildren().size(); i++) { 114 116 AbstractNode child = rootNode.getChildren().get(i); 115 if (!(child.getElement() instanceof Rule)) 117 EObject element = child.getElement(); 118 if (!(element instanceof BnfEntry)) 116 119 continue; 120 BnfEntry bnfEntry = (BnfEntry) element; 121 if (bnfEntry.getRule() == null) 122 continue; 123 124 child = NodeUtil.getNodeAdapter(bnfEntry.getRule()).getParserNode(); 125 117 126 String ruleText; 118 127 try { -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring/inlinesinglereferencedrules/InlineSingleReferencedRulesRefactoringHandler.java
r5 r18 22 22 import com.google.inject.Inject; 23 23 24 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; 24 25 import de.ugoe.cs.swe.bnftools.ebnf.Rule; 25 26 import de.ugoe.cs.swe.bnftools.ui.quickfix.processors.InlineRulesProcessor; … … 52 53 for (int i=0; i < rootNode.getParserNode().getChildren().size(); i++) { 53 54 AbstractNode currentNode = rootNode.getParserNode().getChildren().get(i); 55 56 EObject element = currentNode.getElement(); 57 if (!(element instanceof BnfEntry)) 58 continue; 59 BnfEntry bnfEntry = (BnfEntry) element; 60 if (bnfEntry.getRule() == null) 61 continue; 62 63 currentNode = NodeUtil.getNodeAdapter(bnfEntry.getRule()).getParserNode(); 64 54 65 if (currentNode.getElement() instanceof Rule) { 55 66 Rule rule = (Rule) currentNode.getElement(); -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring/inlinetokenrules/InlineTokenRulesRefactoringHandler.java
r5 r18 23 23 24 24 import de.ugoe.cs.swe.bnftools.analysis.EbnfAnalysisUtils; 25 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; 25 26 import de.ugoe.cs.swe.bnftools.ebnf.Rule; 26 27 import de.ugoe.cs.swe.bnftools.ui.refactoring.generic.GenericRefactoring; … … 51 52 for (int i=0; i < rootNode.getParserNode().getChildren().size(); i++) { 52 53 AbstractNode currentNode = rootNode.getParserNode().getChildren().get(i); 54 55 EObject element = currentNode.getElement(); 56 if (!(element instanceof BnfEntry)) 57 continue; 58 BnfEntry bnfEntry = (BnfEntry) element; 59 if (bnfEntry.getRule() == null) 60 continue; 61 62 currentNode = NodeUtil.getNodeAdapter(bnfEntry.getRule()).getParserNode(); 63 53 64 if (currentNode.getElement() instanceof Rule) { 54 65 Rule rule = (Rule) currentNode.getElement(); -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring/removeunusedrules/RemoveUnusedRulesRefactoringHandler.java
r5 r18 22 22 import com.google.inject.Inject; 23 23 24 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; 24 25 import de.ugoe.cs.swe.bnftools.ebnf.Rule; 25 26 import de.ugoe.cs.swe.bnftools.ui.quickfix.processors.RemoveUnusedRulesProcessor; … … 52 53 for (int i=0; i < rootNode.getParserNode().getChildren().size(); i++) { 53 54 AbstractNode currentNode = rootNode.getParserNode().getChildren().get(i); 55 56 EObject element = currentNode.getElement(); 57 if (!(element instanceof BnfEntry)) 58 continue; 59 BnfEntry bnfEntry = (BnfEntry) element; 60 if (bnfEntry.getRule() == null) 61 continue; 62 63 currentNode = NodeUtil.getNodeAdapter(bnfEntry.getRule()).getParserNode(); 64 54 65 if (currentNode.getElement() instanceof Rule) { 55 66 Rule rule = (Rule) currentNode.getElement(); -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring/replacepassthroughrules/ReplaceAllPassthroughRulesRefactoringHandler.java
r5 r18 23 23 24 24 import de.ugoe.cs.swe.bnftools.analysis.EbnfAnalysisUtils; 25 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; 25 26 import de.ugoe.cs.swe.bnftools.ebnf.Rule; 26 27 import de.ugoe.cs.swe.bnftools.ui.quickfix.processors.ReplacePassthroughRuleProcessor; … … 55 56 for (int i=0; i < rootNode.getParserNode().getChildren().size(); i++) { 56 57 AbstractNode currentNode = rootNode.getParserNode().getChildren().get(i); 58 59 EObject element = currentNode.getElement(); 60 if (!(element instanceof BnfEntry)) 61 continue; 62 BnfEntry bnfEntry = (BnfEntry) element; 63 if (bnfEntry.getRule() == null) 64 continue; 65 66 currentNode = NodeUtil.getNodeAdapter(bnfEntry.getRule()).getParserNode(); 67 57 68 if (currentNode.getElement() instanceof Rule) { 58 69 Rule rule = (Rule) currentNode.getElement(); -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/refactoring/uppercasetokenrules/UppercaseTokenRulesRefactoringHandler.java
r5 r18 23 23 24 24 import de.ugoe.cs.swe.bnftools.analysis.EbnfAnalysisUtils; 25 import de.ugoe.cs.swe.bnftools.ebnf.BnfEntry; 25 26 import de.ugoe.cs.swe.bnftools.ebnf.Rule; 26 27 import de.ugoe.cs.swe.bnftools.ui.refactoring.generic.GenericRefactoring; … … 51 52 for (int i=0; i < rootNode.getParserNode().getChildren().size(); i++) { 52 53 AbstractNode currentNode = rootNode.getParserNode().getChildren().get(i); 54 55 EObject element = currentNode.getElement(); 56 if (!(element instanceof BnfEntry)) 57 continue; 58 BnfEntry bnfEntry = (BnfEntry) element; 59 if (bnfEntry.getRule() == null) 60 continue; 61 62 currentNode = NodeUtil.getNodeAdapter(bnfEntry.getRule()).getParserNode(); 63 64 53 65 if (currentNode.getElement() instanceof Rule) { 54 66 Rule rule = (Rule) currentNode.getElement();
Note: See TracChangeset
for help on using the changeset viewer.