use of eu.ggnet.dwoss.uniqueunit.ee.entity.UnitCollection in project dwoss by gg-net.
the class TreeTableController method getUnitCollections.
private ObservableList<TreeItem<DataWrapper>> getUnitCollections(Product product) {
ObservableList<TreeItem<DataWrapper>> result = FXCollections.observableArrayList();
for (UnitCollection uc : loadUnitCollections(product)) {
TreeItem<DataWrapper> item = new TreeItem<>();
UnitCollectionWrapper unitCollectionWrapper = new UnitCollectionWrapper(item, uc);
item.setValue(unitCollectionWrapper);
result.add(item);
}
return result;
}
use of eu.ggnet.dwoss.uniqueunit.ee.entity.UnitCollection in project dwoss by gg-net.
the class UnitCollectionGenerator method generateUnitCollections.
public List<UnitCollection> generateUnitCollections() {
List<UnitCollection> collections = new ArrayList<>();
for (int i = 0; i < names.size(); i++) {
UnitCollection uc = new UnitCollection();
uc.setNameExtension(names.get(i));
uc.setSalesChannel(SalesChannel.RETAILER);
uc.setDescriptionExtension("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");
uc.setPrice(PriceType.SALE, 350.00, "comment");
for (int j = 0; j < 3; j++) {
uc.getUnits().add(uuGen.makeUniqueUnit(tradeName.get(rand.nextInt(tradeName.size())), productGroup.get(rand.nextInt(productGroup.size()))));
}
collections.add(uc);
}
return collections;
}
use of eu.ggnet.dwoss.uniqueunit.ee.entity.UnitCollection in project dwoss by gg-net.
the class AssignmentController method addUnitCollection.
@FXML
private void addUnitCollection() {
final PicoProduct selectedProduct = productList.getSelectionModel().getSelectedItem();
if (selectedProduct == null)
return;
Ui.exec(() -> {
Ui.build(root).fxml().eval(() -> new UnitCollection(), UnitCollectionEditorController.class).opt().map(dto -> Dl.remote().lookup(UniqueUnitAgent.class).createOnProduct(selectedProduct.getId(), dto, Dl.local().lookup(Guardian.class).getUsername())).filter(Ui.failure()::handle).map(Reply::getPayload).ifPresent(uc -> {
unitCollectionList.getItems().add(uc);
});
});
}
use of eu.ggnet.dwoss.uniqueunit.ee.entity.UnitCollection in project dwoss by gg-net.
the class UnitCollectionGenerator method generateUnitCollections.
public List<UnitCollection> generateUnitCollections() {
List<UnitCollection> collections = new ArrayList<>();
for (int i = 0; i < names.size(); i++) {
UnitCollection uc = new UnitCollection();
uc.setNameExtension(names.get(i));
uc.setSalesChannel(SalesChannel.RETAILER);
uc.setDescriptionExtension("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");
uc.setPrice(PriceType.SALE, 350.00, "comment");
for (int j = 0; j < 3; j++) {
uc.getUnits().add(uuGen.makeUniqueUnit(tradeName.get(rand.nextInt(tradeName.size())), productGroup.get(rand.nextInt(productGroup.size()))));
}
collections.add(uc);
}
return collections;
}
use of eu.ggnet.dwoss.uniqueunit.ee.entity.UnitCollection in project dwoss by gg-net.
the class UnitCollectionEditorTryout method main.
/**
* The main() method is ignored in correctly deployed JavaFX application.
* main() serves only as fallback in case the application can not be
* launched through deployment artifacts, e.g., in IDEs with limited FX
* support. NetBeans ignores main().
*
* @param args the command line arguments
* @throws java.lang.InterruptedException
*/
public static void main(String[] args) throws InterruptedException {
UnitCollectionGenerator ucg = new UnitCollectionGenerator();
UnitCollection uc = ucg.generateUnitCollections().get(0);
JButton close = new JButton("Schliessen");
close.addActionListener(e -> Ui.closeWindowOf(close));
JButton run = new JButton("OpenUi");
run.addActionListener(ev -> {
Ui.exec(() -> {
Ui.build().fxml().eval(() -> uc, UnitCollectionEditorController.class).opt().ifPresent(System.out::println);
});
});
JPanel p = new JPanel();
p.add(run);
p.add(close);
UiCore.startSwing(() -> p);
}
Aggregations