Commit 005bdfee authored by Michael Schwarz's avatar Michael Schwarz 🤔
Browse files

If choice can no longer be changed make green to indicate that it is not

an error
parent 4004e645
...@@ -71,7 +71,10 @@ class ConflictPanel extends Composite { ...@@ -71,7 +71,10 @@ class ConflictPanel extends Composite {
private Color foregroundColorShiftReduceAffected = new Color(Display.getCurrent(), Colors.conflictFgRed); private Color foregroundColorShiftReduceAffected = new Color(Display.getCurrent(), Colors.conflictFgRed);
private Color backgroundColorShiftReduceUnrelated = new Color(Display.getCurrent(), Colors.conflictBgGray); private Color backgroundColorShiftReduceUnrelated = new Color(Display.getCurrent(), Colors.conflictBgGray);
private Color foregroundColorShiftReduceUnrelated = new Color(Display.getCurrent(), Colors.conflictFgGray); private Color foregroundColorShiftReduceUnrelated = new Color(Display.getCurrent(), Colors.conflictFgGray);
private Color textConflictFixResolved = new Color(Display.getCurrent(), Colors.green);
private Color textDefault = new Color(Display.getCurrent(), Colors.black);
private GridData gridData; private GridData gridData;
public ConflictPanel(CupConflictsView cupConflictsView, Composite parent, int style) { public ConflictPanel(CupConflictsView cupConflictsView, Composite parent, int style) {
...@@ -397,7 +400,7 @@ class ConflictPanel extends Composite { ...@@ -397,7 +400,7 @@ class ConflictPanel extends Composite {
*/ */
public boolean markIfAffected(PrecedenceToInsert pti){ public boolean markIfAffected(PrecedenceToInsert pti){
if(conflict instanceof ShiftReduceConflict && pti.isAffected(srdetails)){ if(conflict instanceof ShiftReduceConflict && pti.isAffected(srdetails)){
resolutionOptions.setForeground(textDefault);
partOfCurrentConnected = true; partOfCurrentConnected = true;
changeColors(backgroundColorShiftReduceAffected,foregroundColorShiftReduceAffected); changeColors(backgroundColorShiftReduceAffected,foregroundColorShiftReduceAffected);
...@@ -408,9 +411,15 @@ class ConflictPanel extends Composite { ...@@ -408,9 +411,15 @@ class ConflictPanel extends Composite {
// Used assoc to sort out. Can't be changed anymore (unless this is the start) // Used assoc to sort out. Can't be changed anymore (unless this is the start)
if(srdetails.shiftAndReducePrecedenceFromSameTerminal()){ if(srdetails.shiftAndReducePrecedenceFromSameTerminal()){
resolutionOptions.setEnabled(forceEnableDropdown); resolutionOptions.setEnabled(forceEnableDropdown);
if(!forceEnableDropdown){
resolutionOptions.setForeground(textConflictFixResolved);
}
} }
else { else {
resolutionOptions.setEnabled(pti.canChangeDefaultResolution(srdetails)); if(!pti.canChangeDefaultResolution(srdetails)){
resolutionOptions.setEnabled(false);
resolutionOptions.setForeground(textConflictFixResolved);
}
} }
} }
else if(pti.isResolvedInFavorOfShift(srdetails)){ else if(pti.isResolvedInFavorOfShift(srdetails)){
...@@ -420,9 +429,15 @@ class ConflictPanel extends Composite { ...@@ -420,9 +429,15 @@ class ConflictPanel extends Composite {
// Used assoc to sort out. Can't be changed anymore // Used assoc to sort out. Can't be changed anymore
if(srdetails.shiftAndReducePrecedenceFromSameTerminal()){ if(srdetails.shiftAndReducePrecedenceFromSameTerminal()){
resolutionOptions.setEnabled(forceEnableDropdown); resolutionOptions.setEnabled(forceEnableDropdown);
if(!forceEnableDropdown){
resolutionOptions.setForeground(textConflictFixResolved);
}
} }
else { else {
resolutionOptions.setEnabled(pti.canChangeDefaultResolution(srdetails)); if(!pti.canChangeDefaultResolution(srdetails)){
resolutionOptions.setEnabled(false);
resolutionOptions.setForeground(textConflictFixResolved);
}
} }
} }
...@@ -433,9 +448,15 @@ class ConflictPanel extends Composite { ...@@ -433,9 +448,15 @@ class ConflictPanel extends Composite {
// Used assoc to sort out. Can't be changed anymore (unless this is the start) // Used assoc to sort out. Can't be changed anymore (unless this is the start)
if(srdetails.shiftAndReducePrecedenceFromSameTerminal()){ if(srdetails.shiftAndReducePrecedenceFromSameTerminal()){
resolutionOptions.setEnabled(forceEnableDropdown); resolutionOptions.setEnabled(forceEnableDropdown);
if(!forceEnableDropdown){
resolutionOptions.setForeground(textConflictFixResolved);
}
} }
else { else {
resolutionOptions.setEnabled(pti.canChangeDefaultResolution(srdetails)); if(!pti.canChangeDefaultResolution(srdetails)){
resolutionOptions.setEnabled(false);
resolutionOptions.setForeground(textConflictFixResolved);
}
} }
} }
else { else {
...@@ -470,6 +491,7 @@ class ConflictPanel extends Composite { ...@@ -470,6 +491,7 @@ class ConflictPanel extends Composite {
resolutionOptions.setEnabled(true); resolutionOptions.setEnabled(true);
resolutionOptions.select(0); resolutionOptions.select(0);
changeColors(backgroundColorShiftReduce,foregroundColorShiftReduce); changeColors(backgroundColorShiftReduce,foregroundColorShiftReduce);
resolutionOptions.setForeground(textDefault);
} }
partOfCurrentConnected = false; partOfCurrentConnected = false;
......
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