Skip to content
Snippets Groups Projects
Commit 49facb63 authored by Sudeep Kanav's avatar Sudeep Kanav
Browse files

Code review comments implemented: YELLOW


Issue-Ref: 3536
Signed-off-by: default avatarSudeep Kanav <kanav@fortiss.org>
parent f5dc216f
No related branches found
No related tags found
1 merge request!40Moved the abstract source editor to tooling base.
......@@ -3,10 +3,10 @@ AllocationDiagramEditorBase.java fa544546f73eea1150d90b7257b0e6bce82c288c GREEN
CommonDiagramEditorBase.java 69994faea09eec342b8dfaa484ffc03b60978496 GREEN
ConstraintBasedProcessEditor.java 155a5a7ac41c668ae7ef978e8be13b83f5abd67d GREEN
ConstraintBasedProcessEditorHelper.java 11d48e8a2aecd48eea259a42ef1192c4b292a334 GREEN
CustomUndoRedoForSourceEditor.java 3bf49cf31d99482ac4b102132450ab05faf7c22c RED
DiagramEditorBase.java 09663ce095074d1a8eef086284eea0a7776e0431 GREEN
DiagramKeyHandler.java cfd15ac8f9fc933739cef5e7039960e19826d1ce GREEN
FormsEditorBase.java 4046d340913d951340084ae7240d79f8e75cb8d4 GREEN
GEFEditorBase.java e668f596f45f07215994cbbd3929a9438331718f GREEN
SourceEditorBase.java be8c65507ff54ad79d1a5b5a35de649a3f86deb9 RED
SourceEditorBase.java 347d6b45d577abd7e23a7234904be118e82469f1 YELLOW
SourceEditorUndoRedo.java a55e316ffe97be64ddc4425807f2b43ffd44e66a YELLOW
TreeViewerEditorBase.java 1c59689ff57c4f3cc180d85f13021fc03461ecb0 GREEN
......@@ -259,7 +259,7 @@ public abstract class SourceEditorBase<T extends EObject> extends EditorBase<T>
sourceViewer.configure(getSourceViewerConfig());
Font font = createFont(CODEFONT_11PT);
sourceViewer.getTextWidget().setFont(font);
new CustomUndoRedoForSourceEditor(sourceViewer.getTextWidget());
new SourceEditorUndoRedo(sourceViewer.getTextWidget());
sourceViewer.addTextListener(new ITextListener() {
@Override
public void textChanged(TextEvent event) {
......@@ -273,7 +273,7 @@ public abstract class SourceEditorBase<T extends EObject> extends EditorBase<T>
editSource.editor = true;
ITopLevelElement modelContext = IPersistencyService.getInstance()
.getTopLevelElementFor(getEditedObject());
modelContext.runAsCommand(() -> updateTheStringInTheModel(
modelContext.runAsCommand(() -> setStringRepresentation(
sourceViewer.getTextWidget().getText()));
editSource.editor = false;
}
......@@ -307,9 +307,7 @@ public abstract class SourceEditorBase<T extends EObject> extends EditorBase<T>
abstract protected String getStringRepresentation();
/** Update the string representation in the model element. */
// TODO(AD): Please reuse the the "setStringRepresentation": It is really a string representation
// of the source code model.
abstract protected void updateTheStringInTheModel(String s);
abstract protected void setStringRepresentation(String s);
/** Displays the actual error in the editor. */
public abstract void showErrors();
......
......@@ -30,7 +30,7 @@ import org.eclipse.swt.events.KeyListener;
* @author aravantinos
*/
// TODO (AD): Please rename to SourceEditorUndoRedo (Easier to read).
public class CustomUndoRedoForSourceEditor implements KeyListener, ExtendedModifyListener {
public class SourceEditorUndoRedo implements KeyListener, ExtendedModifyListener {
/**
* Encapsulation of the Undo and Redo stack(s).
*/
......@@ -107,7 +107,7 @@ public class CustomUndoRedoForSourceEditor implements KeyListener, ExtendedModif
* the text field to which the Undo-Redo functionality should be
* added
*/
public CustomUndoRedoForSourceEditor(StyledText editor) {
public SourceEditorUndoRedo(StyledText editor) {
editor.addExtendedModifyListener(this);
editor.addKeyListener(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment