Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CUP Eclipse Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr. Michael Petter
CUP Eclipse Plugin
Commits
dc29a25d
Commit
dc29a25d
authored
Feb 21, 2016
by
Michael Schwarz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panel for RR has buttons, deactivated when resolving other conflict +
bugfix
parent
e183076d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
CupPlugin/src/de/tum/in/www2/cupplugin/views/ConflictPanel.java
...gin/src/de/tum/in/www2/cupplugin/views/ConflictPanel.java
+25
-15
CupPlugin/src/de/tum/in/www2/cupplugin/views/PrecedenceToInsert.java
...rc/de/tum/in/www2/cupplugin/views/PrecedenceToInsert.java
+2
-2
No files found.
CupPlugin/src/de/tum/in/www2/cupplugin/views/ConflictPanel.java
View file @
dc29a25d
...
...
@@ -69,8 +69,8 @@ class ConflictPanel extends Composite {
private
Color
foregroundColorShiftReduce
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictFgYellow
);
private
Color
backgroundColorShiftReduceAffected
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictBgRed
);
private
Color
foregroundColorShiftReduceAffected
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictFgRed
);
private
Color
backgroundColor
ShiftReduce
Unrelated
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictBgGray
);
private
Color
foregroundColor
ShiftReduce
Unrelated
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictFgGray
);
private
Color
backgroundColorUnrelated
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictBgGray
);
private
Color
foregroundColorUnrelated
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
conflictFgGray
);
private
Color
textConflictFixResolved
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
green
);
private
Color
textDefault
=
new
Color
(
Display
.
getCurrent
(),
Colors
.
black
);
...
...
@@ -244,9 +244,9 @@ class ConflictPanel extends Composite {
detailText
.
setText
(
makeReduceReduceDetailText
(
rrc
,
linkCounter
));
gridData
.
heightHint
+=
detailText
.
computeSize
(
SWT
.
DEFAULT
,
SWT
.
DEFAULT
).
y
;
resolutionOptions
.
setVisible
(
fals
e
);
resolutionButton
.
setVisible
(
fals
e
);
resolutionOptions
.
removeAll
();
resolutionOptions
.
setVisible
(
tru
e
);
resolutionButton
.
setVisible
(
tru
e
);
setReduceReduceResolutionOptions
();
}
else
if
(
conflict
instanceof
ShiftReduceConflict
)
{
ShiftReduceConflict
src
=
(
ShiftReduceConflict
)
conflict
;
...
...
@@ -392,6 +392,14 @@ class ConflictPanel extends Composite {
}
}
private
void
setReduceReduceResolutionOptions
(){
resolutionOptions
.
removeAll
();
resolutionOptions
.
add
(
"-- Choose an option --"
);
resolutionOptions
.
select
(
0
);
resolutionOptions
.
add
(
"Reduce with production 1"
);
resolutionOptions
.
add
(
"Reduce with production 2"
);
}
/**
* Marks the conflict as affected if it is by the precedences to be inserted
* This entails setting the background color and hiding/showing/disabling the dropdown
...
...
@@ -471,12 +479,10 @@ class ConflictPanel extends Composite {
partOfCurrentConnected
=
false
;
forceEnableDropdown
=
false
;
if
(
conflict
instanceof
ShiftReduceConflict
){
resolutionButton
.
setEnabled
(
false
);
resolutionOptions
.
setEnabled
(
false
);
changeColors
(
backgroundColorShiftReduceUnrelated
,
foregroundColorShiftReduceUnrelated
);
}
resolutionButton
.
setEnabled
(
false
);
resolutionOptions
.
setEnabled
(
false
);
changeColors
(
backgroundColorUnrelated
,
foregroundColorUnrelated
);
return
false
;
}
...
...
@@ -486,12 +492,16 @@ class ConflictPanel extends Composite {
* Abort a connected resolution. Enable dropdown and set to default values
*/
public
void
connectedEditAborted
(){
resolutionButton
.
setEnabled
(
true
);
resolutionOptions
.
setEnabled
(
true
);
resolutionOptions
.
select
(
0
);
resolutionOptions
.
setForeground
(
textDefault
);
if
(
conflict
instanceof
ShiftReduceConflict
){
resolutionButton
.
setEnabled
(
true
);
resolutionOptions
.
setEnabled
(
true
);
resolutionOptions
.
select
(
0
);
changeColors
(
backgroundColorShiftReduce
,
foregroundColorShiftReduce
);
resolutionOptions
.
setForeground
(
textDefault
);
}
else
{
changeColors
(
backgroundColorReduceReduce
,
foregroundColorReduceReduce
);
}
partOfCurrentConnected
=
false
;
...
...
CupPlugin/src/de/tum/in/www2/cupplugin/views/PrecedenceToInsert.java
View file @
dc29a25d
...
...
@@ -123,8 +123,8 @@ class PrecedenceToInsert {
* @return true iff it can be changed
*/
public
boolean
canChangeDefaultResolution
(
ShiftReduceDetails
srd
){
return
!((
precs
.
containsKey
(
srd
.
shift
)
||
originalEdge
.
getFirst
().
equals
(
srd
.
shift
))
&&
(
precs
.
containsKey
(
srd
.
reduce
)
||
originalEdge
.
getFirst
().
equals
(
srd
.
reduce
)));
return
!((
precs
.
containsKey
(
srd
.
shift
)
||
(
originalEdge
!=
null
&&
originalEdge
.
getFirst
().
equals
(
srd
.
shift
)
))
&&
(
precs
.
containsKey
(
srd
.
reduce
)
||
(
originalEdge
!=
null
&&
originalEdge
.
getFirst
().
equals
(
srd
.
reduce
)
)));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment