Commit 005bdfee authored by Michael Schwarz's avatar Michael Schwarz

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