Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
b3c2b095
Commit
b3c2b095
authored
4 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] Rename MultipleSelection into Locations.
parent
39b9be48
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ivette/src/frama-c/states.ts
+4
-1
4 additions, 1 deletion
ivette/src/frama-c/states.ts
ivette/src/renderer/Application.tsx
+2
-2
2 additions, 2 deletions
ivette/src/renderer/Application.tsx
ivette/src/renderer/Locations.tsx
+19
-19
19 additions, 19 deletions
ivette/src/renderer/Locations.tsx
with
25 additions
and
22 deletions
ivette/src/frama-c/states.ts
+
4
−
1
View file @
b3c2b095
...
@@ -684,7 +684,10 @@ const GlobalSelection = new GlobalStates.State<Selection>({
...
@@ -684,7 +684,10 @@ const GlobalSelection = new GlobalStates.State<Selection>({
prevSelections
:
[],
prevSelections
:
[],
nextSelections
:
[],
nextSelections
:
[],
},
},
multiple
:
{
index
:
0
,
allSelections
:
[]
},
multiple
:
{
index
:
0
,
allSelections
:
[],
},
});
});
/**
/**
...
...
This diff is collapsed.
Click to expand it.
ivette/src/renderer/Application.tsx
+
2
−
2
View file @
b3c2b095
...
@@ -20,7 +20,7 @@ import ASTview from './ASTview';
...
@@ -20,7 +20,7 @@ import ASTview from './ASTview';
import
ASTinfo
from
'
./ASTinfo
'
;
import
ASTinfo
from
'
./ASTinfo
'
;
import
Globals
from
'
./Globals
'
;
import
Globals
from
'
./Globals
'
;
import
Properties
from
'
./Properties
'
;
import
Properties
from
'
./Properties
'
;
import
MultipleSelec
tion
from
'
./
MultipleSelec
tion
'
;
import
Loca
tion
s
from
'
./
Loca
tion
s
'
;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// --- Selection Controls
// --- Selection Controls
...
@@ -100,7 +100,7 @@ export default (() => {
...
@@ -100,7 +100,7 @@ export default (() => {
<
Properties
/>
<
Properties
/>
<
ASTview
/>
<
ASTview
/>
<
ASTinfo
/>
<
ASTinfo
/>
<
MultipleSelec
tion
/>
<
Loca
tion
s
/>
</
Group
>
</
Group
>
</
LabView
>
</
LabView
>
</
Splitter
>
</
Splitter
>
...
...
This diff is collapsed.
Click to expand it.
ivette/src/renderer/
MultipleSelec
tion.tsx
→
ivette/src/renderer/
Loca
tion
s
.tsx
+
19
−
19
View file @
b3c2b095
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// --- Table of multiple
selec
tion
// --- Table of
(
multiple
) loca
tion
s
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -12,30 +12,30 @@ import * as Toolbar from 'dome/frame/toolbars';
...
@@ -12,30 +12,30 @@ import * as Toolbar from 'dome/frame/toolbars';
import
{
Component
}
from
'
frama-c/LabViews
'
;
import
{
Component
}
from
'
frama-c/LabViews
'
;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// ---
Multiple Selec
tion Panel
// ---
Loca
tion
s
Panel
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
type
Selec
tionId
=
States
.
Location
&
{
id
:
number
};
type
Loca
tionId
=
States
.
Location
&
{
id
:
number
};
const
Selec
tionTable
=
()
=>
{
const
Loca
tion
s
Table
=
()
=>
{
// Hooks
// Hooks
const
[
selection
,
updateSelection
]
=
States
.
useSelection
();
const
[
selection
,
updateSelection
]
=
States
.
useSelection
();
const
model
=
React
.
useMemo
(()
=>
(
const
model
=
React
.
useMemo
(()
=>
(
new
CompactModel
<
number
,
Selec
tionId
>
(({
id
}:
Selec
tionId
)
=>
id
)
new
CompactModel
<
number
,
Loca
tionId
>
(({
id
}:
Loca
tionId
)
=>
id
)
),
[]);
),
[]);
const
multiple
:
States
.
MultipleSelection
=
selection
?.
multiple
;
const
multiple
:
States
.
MultipleSelection
=
selection
?.
multiple
;
const
numb
l
erOfSelections
=
multiple
?.
allSelections
?.
length
;
const
numberOfSelections
=
multiple
?.
allSelections
?.
length
;
// Updates [[model]] with the current multiple selection.
// Updates [[model]] with the current multiple selection.
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
(
numb
l
erOfSelections
>
0
)
{
if
(
numberOfSelections
>
0
)
{
const
data
:
Selec
tionId
[]
=
const
data
:
Loca
tionId
[]
=
multiple
.
allSelections
.
map
((
d
,
i
)
=>
({
...
d
,
id
:
i
}));
multiple
.
allSelections
.
map
((
d
,
i
)
=>
({
...
d
,
id
:
i
}));
model
.
replaceAllDataWith
(
data
);
model
.
replaceAllDataWith
(
data
);
}
else
}
else
model
.
clear
();
model
.
clear
();
},
[
numb
l
erOfSelections
,
multiple
,
model
]);
},
[
numberOfSelections
,
multiple
,
model
]);
// Callbacks
// Callbacks
const
onTableSelection
=
React
.
useCallback
(
const
onTableSelection
=
React
.
useCallback
(
...
@@ -55,38 +55,38 @@ const SelectionTable = () => {
...
@@ -55,38 +55,38 @@ const SelectionTable = () => {
<
Toolbar
.
Button
<
Toolbar
.
Button
icon
=
"RELOAD"
icon
=
"RELOAD"
onClick
=
{
reload
}
onClick
=
{
reload
}
enabled
=
{
numb
l
erOfSelections
>
1
}
enabled
=
{
numberOfSelections
>
1
}
title
=
"Reload the current location of the multiple selection"
title
=
"Reload the current location of the multiple selection"
/>
/>
<
Toolbar
.
ButtonGroup
>
<
Toolbar
.
ButtonGroup
>
<
Toolbar
.
Button
<
Toolbar
.
Button
icon
=
"ANGLE.LEFT"
icon
=
"ANGLE.LEFT"
onClick
=
{
()
=>
updateSelection
(
'
MULTIPLE_PREV
'
)
}
onClick
=
{
()
=>
updateSelection
(
'
MULTIPLE_PREV
'
)
}
enabled
=
{
numb
l
erOfSelections
>
1
&&
multiple
?.
index
>
0
}
enabled
=
{
numberOfSelections
>
1
&&
multiple
?.
index
>
0
}
title
=
"Previous location of the multiple selection"
title
=
"Previous location of the multiple selection"
/>
/>
<
Toolbar
.
Button
<
Toolbar
.
Button
icon
=
"ANGLE.RIGHT"
icon
=
"ANGLE.RIGHT"
onClick
=
{
()
=>
updateSelection
(
'
MULTIPLE_NEXT
'
)
}
onClick
=
{
()
=>
updateSelection
(
'
MULTIPLE_NEXT
'
)
}
enabled
=
{
enabled
=
{
numb
l
erOfSelections
>
1
&&
numberOfSelections
>
1
&&
multiple
?.
index
<
numb
l
erOfSelections
-
1
multiple
?.
index
<
numberOfSelections
-
1
}
}
title
=
"Next location of the multiple selection"
title
=
"Next location of the multiple selection"
/>
/>
</
Toolbar
.
ButtonGroup
>
</
Toolbar
.
ButtonGroup
>
<
Label
<
Label
className
=
"component-info"
className
=
"component-info"
title
=
{
`
${
numb
l
erOfSelections
}
selected locations`
}
title
=
{
`
${
numberOfSelections
}
selected locations`
}
display
=
{
numb
l
erOfSelections
>
1
}
display
=
{
numberOfSelections
>
1
}
>
>
{
multiple
?.
index
+
1
}
/
{
numb
l
erOfSelections
}
{
multiple
?.
index
+
1
}
/
{
numberOfSelections
}
</
Label
>
</
Label
>
<
Toolbar
.
Filler
/>
<
Toolbar
.
Filler
/>
<
Toolbar
.
Button
<
Toolbar
.
Button
icon
=
"CIRC.CLOSE"
icon
=
"CIRC.CLOSE"
onClick
=
{
()
=>
updateSelection
(
'
MULTIPLE_CLEAR
'
)
}
onClick
=
{
()
=>
updateSelection
(
'
MULTIPLE_CLEAR
'
)
}
enabled
=
{
numb
l
erOfSelections
>
1
}
enabled
=
{
numberOfSelections
>
1
}
title
=
"Clear the multiple selection"
title
=
"Clear the multiple selection"
/>
/>
</
Toolbar
.
ToolBar
>
</
Toolbar
.
ToolBar
>
...
@@ -116,10 +116,10 @@ const SelectionTable = () => {
...
@@ -116,10 +116,10 @@ const SelectionTable = () => {
export
default
()
=>
(
export
default
()
=>
(
<
Component
<
Component
id
=
"frama-c.selection"
id
=
"frama-c.selection"
label
=
"
Multiple Selec
tion"
label
=
"
Loca
tion
s
"
title
=
"Browse a selection of multiple locations"
title
=
"Browse a selection of multiple locations"
>
>
<
Selec
tionTable
/>
<
Loca
tion
s
Table
/>
</
Component
>
</
Component
>
);
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment