Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Autopsy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Autopsy
Commits
2228394e
Commit
2228394e
authored
12 years ago
by
adam-m
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/Devin148/autopsy
parents
54ddf8e3
0e94bbdf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java
+38
-1
38 additions, 1 deletion
.../src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java
with
38 additions
and
1 deletion
Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java
+
38
−
1
View file @
2228394e
...
...
@@ -18,11 +18,19 @@
*/
package
org.sleuthkit.autopsy.casemodule
;
import
java.awt.BorderLayout
;
import
java.awt.Component
;
import
java.beans.PropertyChangeListener
;
import
java.beans.PropertyChangeSupport
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.swing.ComboBoxModel
;
import
javax.swing.JLabel
;
import
javax.swing.JList
;
import
javax.swing.JPanel
;
import
javax.swing.JSeparator
;
import
javax.swing.ListCellRenderer
;
import
javax.swing.border.EmptyBorder
;
import
javax.swing.event.ListDataListener
;
import
org.sleuthkit.autopsy.coreutils.PlatformUtil
;
...
...
@@ -34,6 +42,7 @@ public class LocalDiskPanel extends ImageTypePanel {
private
final
PropertyChangeSupport
pcs
=
new
PropertyChangeSupport
(
this
);
private
List
<
LocalDisk
>
disks
;
private
LocalDiskModel
model
;
private
int
separatorIndex
;
/**
* Creates new form LocalDiskPanel
...
...
@@ -62,6 +71,7 @@ private void updateDisks() {
disks
=
new
ArrayList
<
LocalDisk
>();
List
<
LocalDisk
>
physical
=
PlatformUtil
.
getPhysicalDrives
();
List
<
LocalDisk
>
partitions
=
PlatformUtil
.
getPartitions
();
separatorIndex
=
physical
.
size
()
-
1
;
if
(
physical
.
isEmpty
())
{
errorLabel
.
setText
(
"Physical drives were not detected. On some systems it requires admin permissions (or \"Run as administrator\")."
);
}
...
...
@@ -70,6 +80,7 @@ private void updateDisks() {
disks
.
addAll
(
partitions
);
model
=
new
LocalDiskModel
();
diskComboBox
.
setModel
(
model
);
diskComboBox
.
setRenderer
(
model
);
if
(
physical
.
isEmpty
()
&&
partitions
.
isEmpty
())
{
if
(
PlatformUtil
.
isWindowsOS
())
{
...
...
@@ -193,7 +204,7 @@ public void removePropertyChangeListener(PropertyChangeListener pcl) {
pcs
.
removePropertyChangeListener
(
pcl
);
}
private
class
LocalDiskModel
implements
ComboBoxModel
{
private
class
LocalDiskModel
implements
ComboBoxModel
,
ListCellRenderer
{
LocalDisk
selected
;
@Override
...
...
@@ -224,5 +235,31 @@ public void addListDataListener(ListDataListener l) {
@Override
public
void
removeListDataListener
(
ListDataListener
l
)
{
}
@Override
public
Component
getListCellRendererComponent
(
JList
list
,
Object
value
,
int
index
,
boolean
isSelected
,
boolean
cellHasFocus
)
{
JPanel
panel
=
new
JPanel
(
new
BorderLayout
());
panel
.
setBorder
(
new
EmptyBorder
(
0
,
2
,
0
,
2
));
JLabel
label
=
new
JLabel
();
if
(
index
==
separatorIndex
)
{
panel
.
add
(
new
JSeparator
(
JSeparator
.
HORIZONTAL
),
BorderLayout
.
SOUTH
);
}
if
(
isSelected
)
{
label
.
setBackground
(
list
.
getSelectionBackground
());
label
.
setForeground
(
list
.
getSelectionForeground
());
panel
.
setBackground
(
list
.
getSelectionBackground
());
panel
.
setForeground
(
list
.
getSelectionForeground
());
}
else
{
label
.
setBackground
(
list
.
getBackground
());
label
.
setForeground
(
list
.
getForeground
());
panel
.
setBackground
(
list
.
getBackground
());
panel
.
setForeground
(
list
.
getForeground
());
}
label
.
setText
(
value
.
toString
());
label
.
setOpaque
(
true
);
panel
.
add
(
label
,
BorderLayout
.
CENTER
);
return
panel
;
}
}
}
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