mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-12-22 23:41:09 +00:00
Module Client : Ajout méthodes GUICssTool et GUIStringTool
This commit is contained in:
parent
bf089d325c
commit
3efe9476b7
@ -12,4 +12,20 @@ public class GUICssTool {
|
|||||||
public static String getExpandedSideBarCssStyle() {
|
public static String getExpandedSideBarCssStyle() {
|
||||||
return "sidebar-expanded";
|
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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.pqt.client.gui.ressources.strings;
|
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.product.Product;
|
||||||
import com.pqt.core.entities.sale.SaleStatus;
|
import com.pqt.core.entities.sale.SaleStatus;
|
||||||
import com.pqt.core.entities.sale.SaleType;
|
import com.pqt.core.entities.sale.SaleType;
|
||||||
@ -33,7 +34,7 @@ public class GUIStringTool {
|
|||||||
return "Produits";
|
return "Produits";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IObjectStringRenderer<Product> getProductStringRenderer(){
|
public static IObjectStringRenderer<Product> getDetailledProductStringRenderer(){
|
||||||
return product->{
|
return product->{
|
||||||
if(product!=null)
|
if(product!=null)
|
||||||
return String.format("%s - %.2f€ (%s)", product.getName(), product.getPrice(), (product.getAmountRemaining()>=30?"30+": Integer.toString(product.getAmountRemaining())));
|
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() {
|
public static String getCommandComposerTitleTitle() {
|
||||||
return "Commande";
|
return "Commande";
|
||||||
}
|
}
|
||||||
@ -218,6 +228,54 @@ public class GUIStringTool {
|
|||||||
public static String getStatGuiModuleName() {
|
public static String getStatGuiModuleName() {
|
||||||
return "Statistiques";
|
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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user