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