Added Tabs Constant

This commit is contained in:
Maximilian P. Käfer 2020-08-30 15:33:19 +02:00
parent 6c32cf650e
commit 74025c6111
2 changed files with 21 additions and 3 deletions

View File

@ -45,6 +45,7 @@ import envoy.client.net.WriteProxy;
import envoy.client.ui.*;
import envoy.client.ui.listcell.*;
import envoy.client.util.ReflectionUtil;
import envoy.constant.Tabs;
import envoy.data.*;
import envoy.data.Attachment.AttachmentType;
import envoy.event.*;
@ -193,7 +194,7 @@ public final class ChatScene implements Restorable {
});
//Listen to backEvents
eventBus.register(BackEvent.class, e -> tabPane.getSelectionModel().select(0));
eventBus.register(BackEvent.class, e -> tabPane.getSelectionModel().select(Tabs.CONTANCT_LIST));
// Listen to received messages
eventBus.register(MessageCreationEvent.class, e -> {
@ -416,13 +417,13 @@ public final class ChatScene implements Restorable {
*/
@FXML
private void addContactButtonClicked() {
tabPane.getSelectionModel().select(1);
tabPane.getSelectionModel().select(Tabs.CONTACT_SEARCH);
}
@FXML
private void groupCreationButtonClicked() {
eventBus.dispatch(new LoadGroupCreationEvent(localDB));
tabPane.getSelectionModel().select(2);
tabPane.getSelectionModel().select(Tabs.GROUP_CREATION);
}
@FXML

View File

@ -0,0 +1,17 @@
package envoy.constant;
/**
* Project: <strong>client</strong><br>
* File: <strong>Tabs.java</strong><br>
* Created: <strong>Aug 30, 2020</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy Client v0.2-beta
*/
public class Tabs {
private Tabs() {}
public static int CONTANCT_LIST = 0;
public static int CONTACT_SEARCH = 1;
public static int GROUP_CREATION = 2;
}