Skip to content

Commit

Permalink
replaced SmallButtons with builder
Browse files Browse the repository at this point in the history
  • Loading branch information
grobmeier committed Oct 1, 2023
1 parent f9de9f9 commit 809821a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -773,19 +773,13 @@ private ReceiverToolbar() {

addSeparator();

Action closeAction =
new AbstractAction(null, LineIconFactory.createCloseIcon()) {
public void actionPerformed(ActionEvent e) {
ReceiversPanel.this.setVisible(false);
}
};

closeAction.putValue(
Action.SHORT_DESCRIPTION, "Closes the Receiver panel");

add(Box.createHorizontalGlue());

add(new SmallButton(closeAction));
SmallButton closeButton = new SmallButton.Builder()
.shortDescription("Closes the Receiver panel")
.action(() -> ReceiversPanel.this.setVisible(false))
.build();
add(closeButton);

add(Box.createHorizontalStrut(5));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,14 @@ private void activateOptions() throws IOException {
deviceTable.addMouseListener(new ConnectorMouseListener());

JToolBar toolbar = new JToolBar();
SmallButton helpButton = new SmallButton(helpItem.getAction());
helpButton.setText(helpItem.getText());

SmallButton helpButton = new SmallButton.Builder()
.text(helpItem.getText())
.icon(ChainsawIcons.ICON_HELP)
.action(() -> HelpManager.getInstance().showHelpForClass(ZeroConfPlugin.class))
.name("Learn more about ZeroConf...")
.build();

toolbar.add(helpButton);
toolbar.setFloatable(false);
add(toolbar, BorderLayout.NORTH);
Expand Down

0 comments on commit 809821a

Please sign in to comment.