Commit eb22c744 authored by Johannes Roith's avatar Johannes Roith

Rename interfaces.

parent f003f673
......@@ -51,7 +51,7 @@ public class Controller {
private long currentRevisionNumber = 0;
private List<RegisterForControllerChanges> controllerObservers;
private List<IRegisterForControllerChanges> controllerObservers;
/*
* Static singleton getter
......@@ -93,7 +93,7 @@ public class Controller {
myJob.setSystem(true);
documentEvents = new LinkedList<DocumentEvent>();
Debugger.getInstance(editor);
controllerObservers = new LinkedList<RegisterForControllerChanges>();
controllerObservers = new LinkedList<IRegisterForControllerChanges>();
}
public void addDocumentEvent(DocumentEvent e) {
......@@ -137,7 +137,7 @@ public class Controller {
myJob.schedule(0);
}
public void registerObserver(RegisterForControllerChanges observer) {
public void registerObserver(IRegisterForControllerChanges observer) {
synchronized (controllerObservers) {
controllerObservers.add(observer);
}
......@@ -158,7 +158,7 @@ public class Controller {
EnumSet<JobsToDo> observedJobs = EnumSet.noneOf(JobsToDo.class);
synchronized (controllerObservers) {
for (RegisterForControllerChanges observer : controllerObservers) {
for (IRegisterForControllerChanges observer : controllerObservers) {
observedJobs.addAll(observer.getRequiredJobs());
}
}
......@@ -279,7 +279,7 @@ public class Controller {
EnumSet<JobsToDo> observedJobs = EnumSet.noneOf(JobsToDo.class);
synchronized (controllerObservers) {
for (RegisterForControllerChanges observer : controllerObservers) {
for (IRegisterForControllerChanges observer : controllerObservers) {
observedJobs.addAll(observer.getRequiredJobs());
}
}
......
......@@ -4,7 +4,7 @@ import java.util.EnumSet;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
public interface RegisterForControllerChanges {
public interface IRegisterForControllerChanges {
EnumSet<JobsToDo> getRequiredJobs();
......
......@@ -55,19 +55,19 @@ import de.in.tum.www2.cup.internal.lalr_state;
import de.in.tum.www2.cup.internal.lalr_transition;
import de.tum.in.www2.cupplugin.controller.Controller;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
import de.tum.in.www2.cupplugin.controller.RegisterForControllerChanges;
import de.tum.in.www2.cupplugin.controller.IRegisterForControllerChanges;
import de.tum.in.www2.cupplugin.editors.CupReduceGraphView.GraphNodeContentProvider;
import de.tum.in.www2.cupplugin.editors.CupReduceGraphView.ModelRebuildJob;
import de.tum.in.www2.cupplugin.editors.CupReduceGraphView.ParserNodeModelContentProvider;
import de.tum.in.www2.cupplugin.editors.CupReduceGraphView.ParserReduceConnection;
import de.tum.in.www2.cupplugin.editors.CupReduceGraphView.ParserReduceLabelProvider;
import de.tum.in.www2.cupplugin.editors.CupReduceGraphView.ParserReduceNode;
import de.tum.in.www2.cupplugin.model.CupParserLaLrChangeObserver;
import de.tum.in.www2.cupplugin.model.ICupParserLaLrChangeObserver;
import de.tum.in.www2.cupplugin.model.Model;
public class CupConflictGraphView implements CupParserLaLrChangeObserver,
public class CupConflictGraphView implements ICupParserLaLrChangeObserver,
IZoomableWorkbenchPart, CupEditorPageVisibility,
RegisterForControllerChanges {
IRegisterForControllerChanges {
private static final int BUTTON_WIDTH = 120;
private static final int LABEL_WIDTH = 40;
......
......@@ -16,7 +16,7 @@ import de.in.tum.www2.cup.analysis.DeclarationsExtractorVisitor;
import de.in.tum.www2.cup.ast.ParserResult;
import de.tum.in.www2.cupplugin.model.*;
public class CupContentAssistProcessor implements IContentAssistProcessor, CupParserASTChangeObserver {
public class CupContentAssistProcessor implements IContentAssistProcessor, ICupParserASTChangeObserver {
private Declarations decls;
private IDocument doc;
......
......@@ -36,12 +36,12 @@ import de.in.tum.www2.cup.ast.*;
import de.in.tum.www2.cup.ast.Package;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
import de.tum.in.www2.cupplugin.controller.Controller;
import de.tum.in.www2.cupplugin.controller.RegisterForControllerChanges;
import de.tum.in.www2.cupplugin.controller.IRegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.*;
// TODO: try changing to IContentOutlinePage and using a virtual view!
public class CupContentOutlinePage extends ContentOutlinePage implements
CupParserASTChangeObserver, RegisterForControllerChanges {
ICupParserASTChangeObserver, IRegisterForControllerChanges {
private static final int AUTO_EXPAND_L3_MAX_ITEMS = 100;
private static final int AUTO_EXPAND_L2_MAX_ITEMS = 500;
......
......@@ -76,13 +76,13 @@ import de.in.tum.www2.cup.internal.parse_reduce_row;
import de.in.tum.www2.cup.internal.parse_reduce_table;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
import de.tum.in.www2.cupplugin.controller.Controller;
import de.tum.in.www2.cupplugin.controller.RegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.CupParserLaLrChangeObserver;
import de.tum.in.www2.cupplugin.controller.IRegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.ICupParserLaLrChangeObserver;
import de.tum.in.www2.cupplugin.model.Model;
public class CupReduceGraphView implements CupParserLaLrChangeObserver,
public class CupReduceGraphView implements ICupParserLaLrChangeObserver,
IZoomableWorkbenchPart, CupEditorPageVisibility,
RegisterForControllerChanges {
IRegisterForControllerChanges {
// Some Constants
private static final int BUTTON_WIDTH = 120;
......
......@@ -44,8 +44,8 @@ import de.in.tum.www2.java.JavaScanner;
import de.in.tum.www2.java.JavaSymbol;
import de.tum.in.www2.cupplugin.PluginUtility;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
import de.tum.in.www2.cupplugin.controller.RegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.CupParserASTChangeObserver;
import de.tum.in.www2.cupplugin.controller.IRegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.ICupParserASTChangeObserver;
import de.tum.in.www2.cupplugin.model.Model;
public class CupSourceViewerConfiguration extends SourceViewerConfiguration {
......@@ -95,7 +95,7 @@ public class CupSourceViewerConfiguration extends SourceViewerConfiguration {
}
public class PresentationModelObserver implements
CupParserASTChangeObserver, RegisterForControllerChanges {
ICupParserASTChangeObserver, IRegisterForControllerChanges {
private CupTokenScanner cupTokenScanner;
private JavaTokenScanner javaTokenScanner;
private ISourceViewer sourceViewer;
......@@ -121,7 +121,7 @@ public class CupSourceViewerConfiguration extends SourceViewerConfiguration {
public EnumSet<JobsToDo> getRequiredJobs() {
return EnumSet.of(JobsToDo.parseCode);
}
@Override
public void modelChanged(Model model) {
ParserResult result = model.getAstModel();
......
package de.tum.in.www2.cupplugin.editors;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.ui.actions.ToggleBreakpointAction;
import org.eclipse.jface.action.IAction;
......@@ -22,7 +21,6 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import de.in.tum.www2.cup.Position;
import de.in.tum.www2.cup.ast.ParserResult;
import de.tum.in.www2.cupplugin.PluginUtility;
import de.tum.in.www2.cupplugin.controller.Controller;
import de.tum.in.www2.cupplugin.model.Model;
......@@ -76,10 +74,7 @@ public class CupTextEditor extends TextEditor {
public CupTextEditor() {
super();
setSourceViewerConfiguration(new CupSourceViewerConfiguration(this));
//create controller for this editor
Controller.getInstance(this);
// ComplexSymbolFactory f = new ComplexSymbolFactory();
// java_cup.Lexer = new java_cup.Lexer(arg0, f);
}
public Model getModel() {
......@@ -125,6 +120,7 @@ public class CupTextEditor extends TextEditor {
}
// TODO: maybe synchronize the debug breakpoints here.
PluginUtility.fullSyntaxRefresh(getSourceViewer());
}
@Override
......
......@@ -12,13 +12,13 @@ import de.in.tum.www2.cup.analysis.FindAtPositionVisitor;
import de.in.tum.www2.cup.ast.AbstractNode;
import de.in.tum.www2.cup.ast.ParserResult;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
import de.tum.in.www2.cupplugin.controller.RegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.CupParserASTChangeObserver;
import de.tum.in.www2.cupplugin.controller.IRegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.ICupParserASTChangeObserver;
import de.tum.in.www2.cupplugin.model.Model;
public class CupTextHover implements ITextHover,
CupParserASTChangeObserver,
RegisterForControllerChanges {
ICupParserASTChangeObserver,
IRegisterForControllerChanges {
private AbstractNode prevRequestedNode;
private ParserResult ast;
......
package de.tum.in.www2.cupplugin.model;
public interface CupGraphModelObserver {
public interface ICupGraphModelObserver {
public void modelChanged(Model model);
......
package de.tum.in.www2.cupplugin.model;
public interface CupParserASTChangeObserver {
public interface ICupParserASTChangeObserver {
public void modelChanged(Model model);
......
package de.tum.in.www2.cupplugin.model;
public interface CupParserLaLrChangeObserver {
public interface ICupParserLaLrChangeObserver {
public void ModelChange(Model model);
......
......@@ -99,8 +99,8 @@ public class Model {
this.astModel = result;
this.astModelRevisionNumber = revisionNumber;
for(Object observer : modelObservers) {
if(observer instanceof CupParserASTChangeObserver) {
((CupParserASTChangeObserver)observer).modelChanged(this);
if(observer instanceof ICupParserASTChangeObserver) {
((ICupParserASTChangeObserver)observer).modelChanged(this);
}
}
}
......@@ -128,8 +128,8 @@ public class Model {
this.lalrModelRevisionNumber = revisionNumber;
this.lalrContext = lalrContext;
for(Object observer : modelObservers) {
if (observer instanceof CupParserLaLrChangeObserver) {
((CupParserLaLrChangeObserver)observer).ModelChange(this);
if (observer instanceof ICupParserLaLrChangeObserver) {
((ICupParserLaLrChangeObserver)observer).ModelChange(this);
}
}
//System.out.println(lalrModel.getReduceTable().toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment