Finalized forwarding UI
This commit is contained in:
parent
1dbc818019
commit
31f9d5bcef
@ -71,19 +71,19 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
dialog.setTitle(title);
|
dialog.setTitle(title);
|
||||||
dialog.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
dialog.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||||
dialog.addCancelButtonActionListener(e -> dialog.dispose());
|
dialog.addCancelButtonActionListener(e -> dialog.dispose());
|
||||||
// dialog.getContentPanel()
|
|
||||||
// .add(new
|
|
||||||
// MessageListRenderer(client.getSender().getId()).getListCellComponent(null,
|
|
||||||
// message, false), BorderLayout.NORTH);
|
|
||||||
List<User> results = new ArrayList<>();
|
List<User> results = new ArrayList<>();
|
||||||
dialog.addOkButtonActionListener(e -> { results.addAll(dialog.getContactList().getSelectedElements()); dialog.dispose(); });
|
dialog.addOkButtonActionListener(e -> {
|
||||||
|
results.addAll(dialog.getContactList().getSelectedElements());
|
||||||
|
dialog.dispose();
|
||||||
|
});
|
||||||
Model<User> contactListModel = dialog.getContactList().getModel();
|
Model<User> contactListModel = dialog.getContactList().getModel();
|
||||||
users.forEach(contactListModel::add);
|
users.forEach(contactListModel::add);
|
||||||
|
|
||||||
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
|
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
dialog.repaint();
|
|
||||||
dialog.revalidate();
|
return results;
|
||||||
return results.size() > 0 ? results : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,7 +97,6 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
final var theme = Settings.getInstance().getCurrentTheme();
|
final var theme = Settings.getInstance().getCurrentTheme();
|
||||||
comp.setBackground(isSelected ? theme.getSelectionColor() : theme.getCellColor());
|
comp.setBackground(isSelected ? theme.getSelectionColor() : theme.getCellColor());
|
||||||
});
|
});
|
||||||
// setBounds(100, 100, 450, 300);
|
|
||||||
setLocationRelativeTo(parent);
|
setLocationRelativeTo(parent);
|
||||||
getContentPane().setLayout(new BorderLayout());
|
getContentPane().setLayout(new BorderLayout());
|
||||||
setBackground(theme.getBackgroundColor());
|
setBackground(theme.getBackgroundColor());
|
||||||
@ -111,7 +110,7 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
JPanel buttonPane = new JPanel();
|
JPanel buttonPane = new JPanel();
|
||||||
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
getContentPane().add(buttonPane, BorderLayout.SOUTH);
|
||||||
{
|
{
|
||||||
JButton okButton = new JButton("OK");
|
okButton = new JButton("OK");
|
||||||
okButton.setMnemonic(KeyEvent.VK_ENTER);
|
okButton.setMnemonic(KeyEvent.VK_ENTER);
|
||||||
okButton.setActionCommand("OK");
|
okButton.setActionCommand("OK");
|
||||||
buttonPane.setLayout(new BorderLayout(0, 0));
|
buttonPane.setLayout(new BorderLayout(0, 0));
|
||||||
@ -119,7 +118,7 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
getRootPane().setDefaultButton(okButton);
|
getRootPane().setDefaultButton(okButton);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
JButton cancelButton = new JButton("Cancel");
|
cancelButton = new JButton("Cancel");
|
||||||
cancelButton.setActionCommand("Cancel");
|
cancelButton.setActionCommand("Cancel");
|
||||||
buttonPane.add(cancelButton, BorderLayout.WEST);
|
buttonPane.add(cancelButton, BorderLayout.WEST);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ package envoy.client.ui.list_component;
|
|||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import envoy.client.data.Settings;
|
import envoy.client.data.Settings;
|
||||||
import envoy.client.ui.Color;
|
import envoy.client.ui.Color;
|
||||||
@ -22,7 +22,7 @@ import envoy.data.User.UserStatus;
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class UserComponent extends JComponent {
|
public class UserComponent extends JPanel {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8450602172939729585L;
|
private static final long serialVersionUID = 8450602172939729585L;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user