Module Client : Ajout méthodes GUICssTool et GUIStringTool

This commit is contained in:
Notmoo 2017-08-17 23:47:42 +02:00
parent bf089d325c
commit 3efe9476b7
2 changed files with 75 additions and 1 deletions

View File

@ -12,4 +12,20 @@ public class GUICssTool {
public static String getExpandedSideBarCssStyle() {
return "sidebar-expanded";
}
public static String getMainModulePaneCssClass() {
return "main-module-pane";
}
public static String getIntermediaryPaneStyleClass() {
return "grey-intermediary-pane";
}
public static String getTitleTextStyleClass() {
return "label-header";
}
public static String getContainerStyleClass() {
return "pqt-container";
}
}

View File

@ -1,5 +1,6 @@
package com.pqt.client.gui.ressources.strings;
import com.pqt.core.entities.product.Category;
import com.pqt.core.entities.product.Product;
import com.pqt.core.entities.sale.SaleStatus;
import com.pqt.core.entities.sale.SaleType;
@ -33,7 +34,7 @@ public class GUIStringTool {
return "Produits";
}
public static IObjectStringRenderer<Product> getProductStringRenderer(){
public static IObjectStringRenderer<Product> getDetailledProductStringRenderer(){
return product->{
if(product!=null)
return String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining())));
@ -42,6 +43,15 @@ public class GUIStringTool {
};
}
public static IObjectStringRenderer<Product> getSimpleProductStringRenderer(){
return product->{
if(product!=null)
return String.format("%s - %.2f€", product.getName(), product.getPrice());
else
return "null";
};
}
public static String getCommandComposerTitleTitle() {
return "Commande";
}
@ -218,6 +228,54 @@ public class GUIStringTool {
public static String getStatGuiModuleName() {
return "Statistiques";
}
public static String getProductNameLabel() {
return "Nom : ";
}
public static String getProductCategoryLabel() {
return "Catégorie : ";
}
public static String getProductAmountRemainingLabel() {
return "En stock : ";
}
public static String getProductAmountSoldLabel() {
return "Vendu : ";
}
public static String getProductSellableLabel() {
return "Vendable : ";
}
public static String getProductPriceLabel() {
return "Prix : ";
}
public static StringConverter<Category> getCategoryStringConverter() {
return new StringConverter<Category>() {
@Override
public String toString(Category object) {
if(object!=null)
return object.getName();
else
return "";
}
@Override
public Category fromString(String string) {
if(string!=null)
return new Category(-1, string);
else
return null;
}
};
}
public static String getComponentListTitleLabel() {
return "Composants";
}
}