Lines 61-67
Link Here
|
61 |
private JButton button; |
61 |
private JButton button; |
62 |
private JButton button2; |
62 |
private JButton button2; |
63 |
private JPanel rightCornerHeader; |
63 |
private JPanel rightCornerHeader; |
64 |
private HyperlinkListener hyperlinkListener; |
64 |
private HyperlinkListener hyperlinkListener; |
|
|
65 |
private Border defaultBorder; |
65 |
|
66 |
|
66 |
public DetailsPanel() { |
67 |
public DetailsPanel() { |
67 |
initComponents2(); |
68 |
initComponents2(); |
Lines 138-148
Link Here
|
138 |
title.setText("<html><h3>"+value+"</h3></html>"); // NOI18N |
139 |
title.setText("<html><h3>"+value+"</h3></html>"); // NOI18N |
139 |
} |
140 |
} |
140 |
} |
141 |
} |
|
|
142 |
|
143 |
private void setButtonBorder(JButton b, Action action) { |
144 |
boolean useDefaultBorder = true; |
145 |
button.setBorder(defaultBorder); |
146 |
if(action !=null) { |
147 |
Object o = action.getValue("highlightColor"); |
148 |
if (o!=null && o instanceof Color) { |
149 |
int height = (header.getMinimumSize().height - button.getMinimumSize().height) / 2 - 3; |
150 |
int width = 8; |
151 |
Border highlightBorderO = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(height, width, height, width, new Color(98,162,82)), |
152 |
BorderFactory.createEmptyBorder(0, 3, 0, 3)); |
153 |
Border highlightBorder = BorderFactory.createCompoundBorder(highlightBorderO, button.getBorder()); |
154 |
|
155 |
button.setBorder(highlightBorder); |
156 |
useDefaultBorder = false; |
157 |
} |
158 |
} |
159 |
if(useDefaultBorder) { |
160 |
button.setBorder(defaultBorder); |
161 |
} |
162 |
} |
141 |
public void setActionListener(Action action) { |
163 |
public void setActionListener(Action action) { |
142 |
button.setVisible(action != null); |
164 |
button.setVisible(action != null); |
143 |
button.setEnabled(action != null); |
165 |
button.setEnabled(action != null); |
144 |
if (action != null) { |
166 |
if (action != null) { |
145 |
button.setAction(action); |
167 |
button.setAction(action); |
|
|
168 |
setButtonBorder(button, action); |
146 |
button.getAccessibleContext ().setAccessibleDescription ( |
169 |
button.getAccessibleContext ().setAccessibleDescription ( |
147 |
NbBundle.getMessage (DetailsPanel.class, "ACN_DetailsPanel_Button", button.getName ())); // NOI18N |
170 |
NbBundle.getMessage (DetailsPanel.class, "ACN_DetailsPanel_Button", button.getName ())); // NOI18N |
148 |
} |
171 |
} |
Lines 153-163
Link Here
|
153 |
button2.setEnabled(action != null); |
176 |
button2.setEnabled(action != null); |
154 |
if (action != null) { |
177 |
if (action != null) { |
155 |
button2.setAction(action); |
178 |
button2.setAction(action); |
|
|
179 |
setButtonBorder(button2, action); |
156 |
button2.getAccessibleContext ().setAccessibleDescription ( |
180 |
button2.getAccessibleContext ().setAccessibleDescription ( |
157 |
NbBundle.getMessage (DetailsPanel.class, "ACN_DetailsPanel_Button", button2.getName ())); // NOI18N |
181 |
NbBundle.getMessage (DetailsPanel.class, "ACN_DetailsPanel_Button", button2.getName ())); // NOI18N |
158 |
} |
182 |
} |
159 |
} |
183 |
} |
160 |
|
|
|
161 |
|
184 |
|
162 |
@Override |
185 |
@Override |
163 |
public void setEnabled(boolean enabled) { |
186 |
public void setEnabled(boolean enabled) { |
Lines 191-196
Link Here
|
191 |
CompoundBorder compoundBorder = BorderFactory.createCompoundBorder(outsideBorder, insideBorder); |
214 |
CompoundBorder compoundBorder = BorderFactory.createCompoundBorder(outsideBorder, insideBorder); |
192 |
header.setBorder(compoundBorder); |
215 |
header.setBorder(compoundBorder); |
193 |
button.setVisible(false); |
216 |
button.setVisible(false); |
|
|
217 |
defaultBorder = button.getBorder(); |
194 |
button2.setVisible(false); |
218 |
button2.setVisible(false); |
195 |
rightCornerHeader = new JPanel(); |
219 |
rightCornerHeader = new JPanel(); |
196 |
rightCornerHeader.setBorder(compoundBorder); |
220 |
rightCornerHeader.setBorder(compoundBorder); |