Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sfp-plus-i2c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
sfp-plus-i2c
Commits
3dc0a5ff
Commit
3dc0a5ff
authored
Feb 22, 2017
by
Vincent van Beveren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added icons to edit pane toolbar
parent
710ff2f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
EditPane.java
...afaripark/src/nl/nikhef/safaripark/editpane/EditPane.java
+21
-5
dialog-apply.png
sw/safaripark/src/nl/nikhef/safaripark/res/dialog-apply.png
+0
-0
dialog-cancel.png
sw/safaripark/src/nl/nikhef/safaripark/res/dialog-cancel.png
+0
-0
No files found.
sw/safaripark/src/nl/nikhef/safaripark/editpane/EditPane.java
View file @
3dc0a5ff
...
...
@@ -3,17 +3,22 @@ package nl.nikhef.safaripark.editpane;
import
java.awt.BorderLayout
;
import
java.awt.event.ActionEvent
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.swing.AbstractAction
;
import
javax.swing.Action
;
import
javax.swing.BorderFactory
;
import
javax.swing.JButton
;
import
javax.swing.JOptionPane
;
import
javax.swing.JPanel
;
import
javax.swing.JScrollPane
;
import
javax.swing.JTabbedPane
;
import
javax.swing.JToolBar
;
import
javax.swing.SwingConstants
;
import
nl.nikhef.safaripark.ContextCache
;
import
nl.nikhef.safaripark.res.Resources
;
import
nl.nikhef.sfp.SFPDevice
;
import
nl.nikhef.sfp.ddmi.DDMI
;
import
nl.nikhef.sfp.ddmi.DDMIContext
;
...
...
@@ -28,7 +33,7 @@ public class EditPane extends JPanel {
private
JToolBar
_tbar
;
private
EditorContext
_ctx
;
private
Action
_apply
=
new
AbstractAction
(
"Apply"
)
{
private
Action
_apply
=
new
AbstractAction
(
"Apply"
,
Resources
.
getIcon
(
"dialog-apply"
)
)
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
...
...
@@ -38,7 +43,7 @@ public class EditPane extends JPanel {
};
private
Action
_revert
=
new
AbstractAction
(
"Revert"
)
{
private
Action
_revert
=
new
AbstractAction
(
"Revert"
,
Resources
.
getIcon
(
"dialog-cancel"
)
)
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
...
...
@@ -63,9 +68,20 @@ public class EditPane extends JPanel {
_apply
.
setEnabled
(
false
);
_revert
.
setEnabled
(
false
);
_tbar
.
add
(
_apply
).
setBorder
(
BorderFactory
.
createEmptyBorder
(
4
,
4
,
4
,
4
));
_tbar
.
add
(
_revert
).
setBorder
(
BorderFactory
.
createEmptyBorder
(
4
,
4
,
4
,
4
));
//_tbar.set
List
<
JButton
>
buttons
=
new
ArrayList
<
JButton
>();
buttons
.
add
(
_tbar
.
add
(
_apply
));
buttons
.
add
(
_tbar
.
add
(
_revert
));
for
(
JButton
but
:
buttons
)
{
but
.
setBorder
(
BorderFactory
.
createEmptyBorder
(
4
,
4
,
4
,
4
));
but
.
setHideActionText
(
false
);
but
.
setHorizontalTextPosition
(
SwingConstants
.
TRAILING
);
but
.
setVerticalTextPosition
(
SwingConstants
.
CENTER
);
}
add
(
_tbar
,
BorderLayout
.
NORTH
);
_tab
=
new
JTabbedPane
();
...
...
sw/safaripark/src/nl/nikhef/safaripark/res/dialog-apply.png
0 → 100644
View file @
3dc0a5ff
1022 Bytes
sw/safaripark/src/nl/nikhef/safaripark/res/dialog-cancel.png
0 → 100644
View file @
3dc0a5ff
991 Bytes
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