use of eu.ggnet.dwoss.util.HtmlPane in project dwoss by gg-net.
the class CustomerSearchController method buildContextMenu.
/**
* Build a ContextMenu for ListView of the search results for a better navigation
*
* @return ContextMenu the filled ContextMenu
*/
private ContextMenu buildContextMenu() {
// Create a ContextMenu
ContextMenu contextMenu = new ContextMenu();
MenuItem viewCustomer = new MenuItem("Detailansicht");
MenuItem viewCompleteCustomer = new MenuItem("Detailansicht inc. aller Mandatendetails");
MenuItem editCustomer = new MenuItem("Bearbeiten");
// adding actions to the context menu
viewCustomer.setOnAction((ActionEvent event) -> {
// open toHtml(String matchcode, DefaultCustomerSalesdata defaults)
if (resultListView.getSelectionModel().getSelectedItem() == null)
return;
PicoCustomer selectedCustomer = resultListView.getSelectionModel().getSelectedItem();
Ui.exec(() -> {
Ui.build(statusHbox).title("Kunde mit Mandant").fx().show(() -> Css.toHtml5WithStyle(AGENT.findCustomerAsMandatorHtml(selectedCustomer.getId())), () -> new HtmlPane());
});
});
viewCompleteCustomer.setOnAction((ActionEvent event) -> {
// open toHtml(String salesRow, String comment)
if (resultListView.getSelectionModel().getSelectedItem() == null)
return;
PicoCustomer selectedCustomer = resultListView.getSelectionModel().getSelectedItem();
Ui.exec(() -> {
Ui.build(statusHbox).title("Kunden Ansicht").fx().show(() -> Css.toHtml5WithStyle(AGENT.findCustomerAsHtml(selectedCustomer.getId())), () -> new HtmlPane());
});
});
editCustomer.setOnAction((ActionEvent event) -> {
if (resultListView.getSelectionModel().getSelectedItem() == null)
return;
PicoCustomer picoCustomer = resultListView.getSelectionModel().getSelectedItem();
Ui.exec(() -> {
Customer customer = Ui.progress().call(() -> AGENT.findByIdEager(Customer.class, picoCustomer.getId()));
if (!customer.isValid()) {
Ui.build(resultListView).title("Fehlerhafter Datensatz").alert().message("Kundendaten sind invalid (aktuell normal): " + customer.getViolationMessage()).show(AlertType.WARNING);
} else if (customer.isSimple()) {
L.info("Edit Simple Customer {}", customer.getId());
Optional<CustomerContinue> result = Ui.build(resultListView).fxml().eval(() -> customer, CustomerSimpleController.class).opt();
if (!result.isPresent())
return;
Reply<Customer> reply = Dl.remote().lookup(CustomerAgent.class).store(result.get().simpleCustomer);
if (!Ui.failure().handle(reply))
return;
if (!result.get().continueEnhance)
return;
Ui.build(statusHbox).fxml().eval(() -> reply.getPayload(), CustomerEnhanceController.class).opt().ifPresent(c -> Ui.build(statusHbox).alert("Would store + " + c));
} else if (customer.isBusiness()) {
L.info("Edit (Complex) Customer {}", customer.getId());
Ui.build(statusHbox).fxml().eval(() -> customer, CustomerEnhanceController.class).opt().ifPresent(c -> Ui.build(statusHbox).alert("Would store + " + c));
}
});
});
// add MenuItemes to ContextMenu
contextMenu.getItems().addAll(viewCustomer, viewCompleteCustomer, editCustomer);
return contextMenu;
}
use of eu.ggnet.dwoss.util.HtmlPane in project dwoss by gg-net.
the class UnitAvailabilityViewCask method resultListMouseClicked.
// </editor-fold>//GEN-END:initComponents
private void resultListMouseClicked(java.awt.event.MouseEvent evt) {
// GEN-FIRST:event_resultListMouseClicked
if (evt.getClickCount() != 2)
return;
UnitShard us = resultList.getSelectedValue();
if (us == null || us.getAvailable() == null)
return;
Ui.exec(() -> {
Ui.build().id(us.getRefurbishedId()).fx().show(() -> Dl.remote().lookup(UnitOverseer.class).toDetailedHtml(us.getRefurbishedId(), Dl.local().lookup(Guardian.class).getUsername()), () -> new HtmlPane());
});
}
use of eu.ggnet.dwoss.util.HtmlPane in project dwoss by gg-net.
the class ReturnsReportViewComponent method reportLineTableMouseClicked.
// </editor-fold>//GEN-END:initComponents
private void reportLineTableMouseClicked(java.awt.event.MouseEvent evt) {
// GEN-FIRST:event_reportLineTableMouseClicked
if (evt.getClickCount() != 2)
return;
int convertRowIndexToModel = reportLineTable.convertRowIndexToModel(reportLineTable.getSelectedRow());
Ui.exec(() -> {
Ui.build().parent(this).fx().show(() -> model.getLines().get(convertRowIndexToModel).getReportLine().toHtml(), () -> new HtmlPane());
});
}
use of eu.ggnet.dwoss.util.HtmlPane in project dwoss by gg-net.
the class HtmlPaneTryout method main.
public static void main(String[] args) {
UiCore.startSwing(() -> new JLabel("Main Application"));
Ui.exec(() -> {
Ui.build().fx().show(() -> "<h1>Hallo HTML Pane</h1>", () -> new HtmlPane());
});
}
use of eu.ggnet.dwoss.util.HtmlPane in project dwoss by gg-net.
the class GenerateOnePriceAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Ui.build().title("Bitte SopoNr eingeben :").dialog().eval(() -> {
TextInputDialog dialog = new TextInputDialog();
dialog.setContentText("Bitte SopoNr eingeben :");
return dialog;
}).opt().filter(s -> !StringUtils.isBlank(s)).map(r -> ReplyUtil.wrap(() -> Dl.remote().lookup(Exporter.class).onePrice(r))).filter(Ui.failure()::handle).map(Reply::getPayload).ifPresent(p -> Ui.build().modality(WINDOW_MODAL).title("SopoNr").fx().show(() -> Css.toHtml5WithStyle(PriceEngineResultFormater.toSimpleHtml(p)), () -> new HtmlPane()));
});
}
Aggregations