Add ContactListCellFactory

- Refactor chatList to userList in ContactSearchScene and
  GroupCreationScene
- Narrow contact searches down to users on a datamodel basis
- Refactor ContactSearchRequest and ContactSearchResult to
  UserSearchRequest and UserSearchResult
This commit is contained in:
2020-07-13 19:02:40 +02:00
parent 062c9f418d
commit 659a468049
13 changed files with 188 additions and 152 deletions

View File

@ -8,19 +8,12 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="envoy.client.ui.controller.ContactSearchScene">
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="envoy.client.ui.controller.ContactSearchScene">
<children>
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
<children>
<ClearableTextField fx:id="searchBar"
prefWidth="310.0">
<textField onInputMethodTextChanged="#sendRequest"
onKeyTyped="#sendRequest" prefColumnCount="22"
promptText="Enter username to search for">
<ClearableTextField fx:id="searchBar" prefWidth="310.0">
<textField onInputMethodTextChanged="#sendRequest" onKeyTyped="#sendRequest" prefColumnCount="22" promptText="Enter username to search for">
</textField>
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="15.0" />
@ -29,14 +22,10 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<tooltip>
<Tooltip
text="Enter a name. If an account by that name exists, it will be displayed below."
wrapText="true" />
<Tooltip text="Enter a name. If an account by that name exists, it will be displayed below." wrapText="true" />
</tooltip>
</ClearableTextField>
<Button mnemonicParsing="false"
onAction="#newGroupButtonClicked" prefHeight="26.0"
prefWidth="139.0" text="New Group">
<Button mnemonicParsing="false" onAction="#newGroupButtonClicked" prefHeight="26.0" prefWidth="139.0" text="New Group">
<HBox.margin>
<Insets bottom="5.0" left="30.0" right="5.0" top="5.0" />
</HBox.margin>
@ -46,9 +35,7 @@
</Button>
</children>
</HBox>
<ListView fx:id="chatList"
onMouseClicked="#chatListClicked" prefHeight="314.0"
prefWidth="600.0">
<ListView fx:id="userList" onMouseClicked="#chatListClicked" prefHeight="314.0" prefWidth="600.0">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
@ -56,8 +43,7 @@
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</VBox.margin>
</ListView>
<Button cancelButton="true" mnemonicParsing="true"
onAction="#backButtonClicked" text="_Back">
<Button cancelButton="true" mnemonicParsing="true" onAction="#backButtonClicked" text="_Back">
<VBox.margin>
<Insets bottom="10.0" left="10.0" />
</VBox.margin>
@ -65,9 +51,7 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<tooltip>
<Tooltip autoHide="true"
text="Takes you back to the screen where you can chat with others"
wrapText="true" />
<Tooltip autoHide="true" text="Takes you back to the screen where you can chat with others" wrapText="true" />
</tooltip>
</Button>
</children>

View File

@ -11,18 +11,12 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity"
minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="envoy.client.ui.controller.GroupCreationScene">
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="envoy.client.ui.controller.GroupCreationScene">
<children>
<HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0">
<children>
<ClearableTextField fx:id="groupNameField">
<textField prefColumnCount="22"
promptText="Enter Group Name"
onInputMethodTextChanged="#textUpdated" onKeyTyped="#textUpdated" />
<textField onInputMethodTextChanged="#textUpdated" onKeyTyped="#textUpdated" prefColumnCount="22" promptText="Enter Group Name" />
<HBox.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
@ -30,9 +24,7 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<tooltip>
<Tooltip
text="Enter something. A group with this name will be created."
wrapText="true" />
<Tooltip text="Enter something. A group with this name will be created." wrapText="true" />
</tooltip>
</ClearableTextField>
</children>
@ -45,9 +37,7 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</Label>
<ListView fx:id="chatList"
onMouseClicked="#chatListClicked" prefHeight="314.0"
prefWidth="600.0">
<ListView fx:id="userList" onMouseClicked="#chatListClicked" prefHeight="314.0" prefWidth="600.0">
<VBox.margin>
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</VBox.margin>
@ -57,16 +47,12 @@
</ListView>
<BorderPane prefHeight="50.0">
<left>
<Button cancelButton="true" mnemonicParsing="true"
onAction="#backButtonClicked" text="_Back"
BorderPane.alignment="CENTER">
<Button cancelButton="true" mnemonicParsing="true" onAction="#backButtonClicked" text="_Back" BorderPane.alignment="CENTER">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
<tooltip>
<Tooltip autoHide="true"
text="Takes you back to the screen where you can chat with others"
wrapText="true" />
<Tooltip autoHide="true" text="Takes you back to the screen where you can chat with others" wrapText="true" />
</tooltip>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
@ -74,10 +60,7 @@
</Button>
</left>
<right>
<Button fx:id="createButton" alignment="CENTER_RIGHT"
defaultButton="true" disable="true" mnemonicParsing="false"
onAction="#createButtonClicked" text="Create"
BorderPane.alignment="CENTER">
<Button fx:id="createButton" alignment="CENTER_RIGHT" defaultButton="true" disable="true" mnemonicParsing="false" onAction="#createButtonClicked" text="Create" BorderPane.alignment="CENTER">
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>