Search in sources :

Example 1 with Contractors

use of eu.ggnet.dwoss.mandator.api.value.Contractors in project dwoss by gg-net.

the class ResolveRepaymentAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    Ui.exec(() -> {
        Contractors contractors = Ui.progress().call(() -> Dl.local().lookup(CachedMandators.class).loadContractors());
        Ui.exec(() -> {
            Ui.build().dialog().eval(() -> {
                ChoiceDialog<TradeName> dialog = new ChoiceDialog<>(contractors.all().iterator().next(), contractors.all());
                dialog.setTitle("Gutschriften");
                dialog.setHeaderText(RESOLVE_REPAYMENT.toName());
                dialog.setContentText("Lieferant auswählen:");
                return dialog;
            }).opt().ifPresent(c -> Ui.build().fxml().show(() -> c, ResolveRepaymentController.class));
        });
    });
}
Also used : TradeName(eu.ggnet.dwoss.rules.TradeName) ChoiceDialog(javafx.scene.control.ChoiceDialog) Contractors(eu.ggnet.dwoss.mandator.api.value.Contractors) ResolveRepaymentController(eu.ggnet.dwoss.misc.repayment.ResolveRepaymentController)

Example 2 with Contractors

use of eu.ggnet.dwoss.mandator.api.value.Contractors in project dwoss by gg-net.

the class RevenueReportSelectionViewTryout method main.

public static void main(String[] args) {
    Mandators mandatorSupporterMock = mock(Mandators.class);
    when(mandatorSupporterMock.loadContractors()).thenReturn(new Contractors(EnumSet.of(TradeName.FUJITSU), EnumSet.of(TradeName.FUJITSU)));
    // Not yet implemented
    Dl.remote().add(Mandators.class, mandatorSupporterMock);
    Ui.exec(() -> {
        UiCore.startSwing(() -> new JLabel("Main Applikation"));
        Ui.build().fx().eval(() -> new RevenueReportSelectionView()).opt().ifPresent(System.out::println);
    });
}
Also used : Mandators(eu.ggnet.dwoss.mandator.Mandators) Contractors(eu.ggnet.dwoss.mandator.api.value.Contractors) RevenueReportSelectionView(eu.ggnet.dwoss.report.ui.cap.support.RevenueReportSelectionView) JLabel(javax.swing.JLabel)

Example 3 with Contractors

use of eu.ggnet.dwoss.mandator.api.value.Contractors in project dwoss by gg-net.

the class CreateNewReportViewTryout method main.

public static void main(String[] args) {
    Mandators mandators = mock(Mandators.class);
    when(mandators.loadContractors()).thenReturn(new Contractors(EnumSet.allOf(TradeName.class), EnumSet.allOf(TradeName.class)));
    Dl.remote().add(Mandators.class, mandators);
    Ui.exec(() -> {
        UiCore.startSwing(() -> new JLabel("Application"));
        Ui.build().swing().eval(() -> OkCancelWrap.vetoResult(new CreateNewReportView())).opt().ifPresent(v -> System.out.println(v.getPayload().getParameter()));
    });
}
Also used : Mandators(eu.ggnet.dwoss.mandator.Mandators) Contractors(eu.ggnet.dwoss.mandator.api.value.Contractors) JLabel(javax.swing.JLabel) CreateNewReportView(eu.ggnet.dwoss.report.ui.cap.support.CreateNewReportView)

Aggregations

Contractors (eu.ggnet.dwoss.mandator.api.value.Contractors)3 Mandators (eu.ggnet.dwoss.mandator.Mandators)2 JLabel (javax.swing.JLabel)2 ResolveRepaymentController (eu.ggnet.dwoss.misc.repayment.ResolveRepaymentController)1 CreateNewReportView (eu.ggnet.dwoss.report.ui.cap.support.CreateNewReportView)1 RevenueReportSelectionView (eu.ggnet.dwoss.report.ui.cap.support.RevenueReportSelectionView)1 TradeName (eu.ggnet.dwoss.rules.TradeName)1 ChoiceDialog (javafx.scene.control.ChoiceDialog)1