Commit 77fa3826 authored by Michael Schwarz's avatar Michael Schwarz

fixed several freak bugs

parent 9b0f2d85
......@@ -536,8 +536,20 @@ class ConflictPanel extends Composite {
else {
// Checking this is sufficient since the terminals are identical
if(srdetails.shiftAffectsOthers){
cupConflictsView.beginConnectedResolution();
forceEnableDropdown = true;
cupConflictsView.beginConnectedResolution();
if(resolutionOptions.getSelectionIndex() == 1) { // Shift
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.Right);
}
else if (resolutionOptions.getSelectionIndex() == 2) { // Reduce
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.Left);
}
else if (resolutionOptions.getSelectionIndex() == 3) { // Non-Assoc
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.NonAssoc);
}
return;
}
if(resolutionOptions.getSelectionIndex() == 1) { // Shift
......@@ -547,7 +559,7 @@ class ConflictPanel extends Composite {
cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left);
}
else if (resolutionOptions.getSelectionIndex() == 3) { // Non-Assoc
cupConflictsView.setTerminalAssoc(srdetails.shift,Precedence.Type.NonAssoc);
cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.NonAssoc);
}
}
}
......
......@@ -162,7 +162,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
@Override
public void widgetSelected(SelectionEvent e) {
abortConnectedResolution();
abortConnectedResolution(true);
}
@Override
......@@ -208,6 +208,11 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
ConflictPanel panel = conflictPanels.get(i);
panel.update(crm, conflict);
}
if(this.connectedResolutionAbort.getVisible()) {
markAllAffected();
}
scrolled.setLayoutDeferred(false);
refreshScrolledLayout();
}
......@@ -330,14 +335,15 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
@Override
public void modelChanged(Model model) {
// TODO: only update if visible?
if(this.connectedResolutionAbort.getVisible()) {
// Connected resolution does no longer make sense
abortConnectedResolution(false);
}
handleModelUpdate(model);
}
@Override
public void becameHidden() {
//TODO: This is too drastic, if nothing changed we can allow the user to switch back and forth
abortConnectedResolution();
this.isVisible = false;
}
......@@ -401,7 +407,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
refreshScrolledLayout();
}
private void abortConnectedResolution(){
private void abortConnectedResolution(boolean refresh){
currentPrecs = new PrecedenceToInsert();
this.connectedResolutionLabel.setVisible(false);
this.connectedResolutionAbort.setVisible(false);
......@@ -411,7 +417,9 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
c.connectedEditAborted();
}
refreshScrolledLayout();
if(refresh){
refreshScrolledLayout();
}
}
private void applyConnectedResolution(){
......@@ -453,7 +461,7 @@ public class CupConflictsView extends FailableView implements ICupEditorPageVisi
e.printStackTrace();
}
finally{
abortConnectedResolution();
abortConnectedResolution(true);
}
}
......
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