Commit b60192a1 authored by Michael Schwarz's avatar Michael Schwarz

cleanup after refactoring

parent b6f13e22
......@@ -115,7 +115,7 @@ class ConflictPanel extends Composite {
if (conflict == null)
return;
ConflictPanel.this.cupConflictsView.jumper.jumpToConflictGraphState(conflict.getType(), Integer
cupConflictsView.jumper.jumpToConflictGraphState(conflict.getType(), Integer
.parseInt(e.text));
}
});
......@@ -125,7 +125,7 @@ class ConflictPanel extends Composite {
detailText.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ConflictPanel.this.cupConflictsView.jumper.jumpToEditorSelection(links.get(Integer
cupConflictsView.jumper.jumpToEditorSelection(links.get(Integer
.parseInt(e.text)));
System.out.println(e.text);
}
......@@ -377,9 +377,6 @@ class ConflictPanel extends Composite {
// RHS is only nonterminal and no %prec directive => sourceOfReducePrec == null
int reducePred = src.getConflictItem1().the_production().precedence_num();
int shiftPred = src.getTerminal().precedence_num();
resolutionOptions.removeAll();
resolutionOptions.add("-- Choose an option --");
resolutionOptions.select(0);
......@@ -498,7 +495,7 @@ class ConflictPanel extends Composite {
return;
}
if(ConflictPanel.this.cupConflictsView.currentPrecs != null && ConflictPanel.this.cupConflictsView.currentPrecs.isActive()) {
if(cupConflictsView.currentPrecs != null && cupConflictsView.currentPrecs.isActive()) {
// That should not happen, if we are inside a connected conflict, button is disabled
return;
}
......@@ -507,23 +504,23 @@ class ConflictPanel extends Composite {
if(!srdetails.reduce.equals(srdetails.shift)){
// The user wants to shift, but shifting affects other conflicts
if(srdetails.shiftAffectsOthers && resolutionOptions.getSelectionIndex() == 1){
ConflictPanel.this.cupConflictsView.beginConnectedResolution();
ConflictPanel.this.cupConflictsView.add(srdetails.shift,srdetails.reduce);
cupConflictsView.beginConnectedResolution();
cupConflictsView.add(srdetails.shift,srdetails.reduce);
return;
}
// The user wants to reduce, but reduce affects other conflicts
if(srdetails.reduceAffectsOthers && resolutionOptions.getSelectionIndex() == 2){
ConflictPanel.this.cupConflictsView.beginConnectedResolution();
ConflictPanel.this.cupConflictsView.add(srdetails.reduce,srdetails.shift);
cupConflictsView.beginConnectedResolution();
cupConflictsView.add(srdetails.reduce,srdetails.shift);
return;
}
// These are the cases where nothing is affected
if(resolutionOptions.getSelectionIndex() == 1) // Shift
ConflictPanel.this.cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left);
cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left);
else if (resolutionOptions.getSelectionIndex() == 2) // Reduce
ConflictPanel.this.cupConflictsView.insertPrecedence(srdetails.reduce,Precedence.Type.Left);
cupConflictsView.insertPrecedence(srdetails.reduce,Precedence.Type.Left);
}
else {
......@@ -531,18 +528,18 @@ class ConflictPanel extends Composite {
if(srdetails.shiftAffectsOthers){
if(resolutionOptions.getSelectionIndex() == 1) { //Shift
forceEnableDropdown = true;
ConflictPanel.this.cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Right);
cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Right);
}
else if (resolutionOptions.getSelectionIndex() == 2) { // Reduce
forceEnableDropdown = true;
ConflictPanel.this.cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Left);
cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Left);
}
}
else {
if(resolutionOptions.getSelectionIndex() == 1) // Shift
ConflictPanel.this.cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Right);
cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Right);
else if (resolutionOptions.getSelectionIndex() == 2) // Reduce
ConflictPanel.this.cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left);
cupConflictsView.insertPrecedence(srdetails.shift,Precedence.Type.Left);
}
}
}
......@@ -559,7 +556,7 @@ class ConflictPanel extends Composite {
if(partOfCurrentConnected && resolutionOptions.getSelectionIndex() == 0){
//Disallow switching back to the 'select what to do' item
markIfAffected(ConflictPanel.this.cupConflictsView.currentPrecs);
markIfAffected(cupConflictsView.currentPrecs);
return;
}
......@@ -567,23 +564,23 @@ class ConflictPanel extends Composite {
// We need to insert a assoc
if(resolutionOptions.getSelectionIndex() == 1) { //Shift
forceEnableDropdown = true;
ConflictPanel.this.cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Right);
cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Right);
}
else if (resolutionOptions.getSelectionIndex() == 2) { // Reduce
forceEnableDropdown = true;
ConflictPanel.this.cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Left);
cupConflictsView.setAssoc(srdetails.shift,Precedence.Type.Left);
}
}
else {
if((resolutionOptions.getSelectionIndex() == 1 && ConflictPanel.this.cupConflictsView.currentPrecs.isResolvedInFavorOfShift(srdetails))
|| (resolutionOptions.getSelectionIndex() == 2 && ConflictPanel.this.cupConflictsView.currentPrecs.isResolvedInFavorOfReduce(srdetails))) {
if((resolutionOptions.getSelectionIndex() == 1 && cupConflictsView.currentPrecs.isResolvedInFavorOfShift(srdetails))
|| (resolutionOptions.getSelectionIndex() == 2 && cupConflictsView.currentPrecs.isResolvedInFavorOfReduce(srdetails))) {
//Current action is desired -> Do nothing
return;
}
if(resolutionOptions.getSelectionIndex() == 1){ //Shift
try {
ConflictPanel.this.cupConflictsView.addPrecedence(srdetails.shift, srdetails.reduce);
cupConflictsView.addPrecedence(srdetails.shift, srdetails.reduce);
} catch (PrecedenceCyclicException e1) {
showCyclicMessageAndResetDropdown(e1);
return;
......@@ -592,7 +589,7 @@ class ConflictPanel extends Composite {
if(resolutionOptions.getSelectionIndex() == 2){ // Reduce
try {
ConflictPanel.this.cupConflictsView.addPrecedence(srdetails.reduce, srdetails.shift);
cupConflictsView.addPrecedence(srdetails.reduce, srdetails.shift);
} catch (PrecedenceCyclicException e1) {
showCyclicMessageAndResetDropdown(e1);
return;
......@@ -615,6 +612,6 @@ class ConflictPanel extends Composite {
box.setMessage("These precedences are inconsistent because they contain a cycle.\nThe precedence that was inserted last is undone.");
box.open();
markIfAffected(this.cupConflictsView.currentPrecs);
markIfAffected(cupConflictsView.currentPrecs);
}
}
\ No newline at end of file
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