Search in sources :

Example 1 with ListChangeListener

use of javafx.collections.ListChangeListener in project Gargoyle by callakrsos.

the class SqlMultiplePane method addNewTabResult.

/********************************
	 * 작성일 : 2016. 4. 20. 작성자 : KYJ
	 *
	 *
	 * @return
	 ********************************/
private Tab addNewTabResult() {
    TableView<Map<String, Object>> tbResult = new TableView<>();
    // Cell 단위로 선택
    tbResult.getSelectionModel().setCellSelectionEnabled(true);
    tbResult.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    tbResult.getItems().addListener((ListChangeListener<Map<String, Object>>) arg0 -> {
        int size = arg0.getList().size();
        lblStatus.textProperty().set(size + " row");
    });
    tbResult.setOnKeyPressed(this::tbResultOnKeyClick);
    {
        tcSelectRow = new TableColumn<>("↓");
        tcSelectRow.setMaxWidth(20);
        tcSelectRow.setSortable(false);
        tcSelectRow.setCellFactory(cell -> {
            return new DragSelectionCell(tbResult);
        });
        // Table Select Drag 처리
        endRowIndexProperty.addListener(event -> tableSelectCell());
        endColIndexProperty.addListener(event -> tableSelectCell());
    }
    BorderPane tbResultLayout = new BorderPane(tbResult);
    lblStatus = new Label("Ready...");
    lblStatus.setMaxHeight(50d);
    tbResultLayout.setBottom(lblStatus);
    createResultTableContextMenu(tbResult);
    Tab tab = new Tab("Example", tbResultLayout);
    return tab;
}
Also used : Button(javafx.scene.control.Button) SystemLayoutViewController(com.kyj.fx.voeditor.visual.main.layout.SystemLayoutViewController) CheckComboBox(org.controlsfx.control.CheckComboBox) Connection(java.sql.Connection) DbUtil(com.kyj.fx.voeditor.visual.util.DbUtil) LoggerFactory(org.slf4j.LoggerFactory) NullExpresion(com.kyj.fx.voeditor.visual.util.NullExpresion) ToExcelFileFunction(com.kyj.fx.voeditor.visual.functions.ToExcelFileFunction) Application(javafx.application.Application) TabPane(javafx.scene.control.TabPane) ListChangeListener(javafx.collections.ListChangeListener) EncrypUtil(com.kyj.fx.voeditor.visual.util.EncrypUtil) ContextMenu(javafx.scene.control.ContextMenu) Map(java.util.Map) SQLPaneMotionable(com.kyj.fx.voeditor.visual.component.sql.functions.SQLPaneMotionable) GargoyleExtensionFilters(com.kyj.fx.voeditor.visual.util.GargoyleExtensionFilters) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) VariableMappingView(com.kyj.fx.voeditor.visual.component.popup.VariableMappingView) DockPos(com.kyj.fx.voeditor.visual.component.dock.pane.DockPos) DockPane(com.kyj.fx.voeditor.visual.component.dock.pane.DockPane) TableView(javafx.scene.control.TableView) SystemUtils(org.apache.commons.lang.SystemUtils) HBox(javafx.scene.layout.HBox) Pair(javafx.util.Pair) MenuItem(javafx.scene.control.MenuItem) KeyEvent(javafx.scene.input.KeyEvent) SimpleTextView(com.kyj.fx.voeditor.visual.component.text.SimpleTextView) ConfigResourceLoader(com.kyj.fx.voeditor.visual.momory.ConfigResourceLoader) Collectors(java.util.stream.Collectors) TreeView(javafx.scene.control.TreeView) ISchemaTreeItem(com.kyj.fx.voeditor.visual.component.sql.functions.ISchemaTreeItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) List(java.util.List) ResourceLoader(com.kyj.fx.voeditor.visual.momory.ResourceLoader) SqlTab(com.kyj.fx.voeditor.visual.component.sql.tab.SqlTab) RowMapper(org.springframework.jdbc.core.RowMapper) Optional(java.util.Optional) DateUtil(com.kyj.fx.voeditor.visual.util.DateUtil) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) TableViewSelectionModel(javafx.scene.control.TableView.TableViewSelectionModel) MouseButton(javafx.scene.input.MouseButton) TreeItem(javafx.scene.control.TreeItem) MouseEvent(javafx.scene.input.MouseEvent) FXCollections(javafx.collections.FXCollections) HashMap(java.util.HashMap) TextFieldTableCell(javafx.scene.control.cell.TextFieldTableCell) DockNode(com.kyj.fx.voeditor.visual.component.dock.pane.DockNode) GagoyleTabProxy(com.kyj.fx.voeditor.visual.main.layout.GagoyleTabProxy) DialogUtil(com.kyj.fx.voeditor.visual.util.DialogUtil) Supplier(java.util.function.Supplier) IntegerProperty(javafx.beans.property.IntegerProperty) BigDataDVO(com.kyj.fx.voeditor.visual.framework.BigDataDVO) TableColumn(javafx.scene.control.TableColumn) Tooltip(javafx.scene.control.Tooltip) KeyCode(javafx.scene.input.KeyCode) Color(javafx.scene.paint.Color) Modality(javafx.stage.Modality) Logger(org.slf4j.Logger) Label(javafx.scene.control.Label) Iterator(java.util.Iterator) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) StringConverter(javafx.util.StringConverter) SchoolMgrerSpreadSheetView(com.kyj.fx.voeditor.visual.main.layout.SchoolMgrerSpreadSheetView) File(java.io.File) SqlTabPane(com.kyj.fx.voeditor.visual.component.sql.tab.SqlTabPane) Menu(javafx.scene.control.Menu) Consumer(java.util.function.Consumer) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) ActionEvent(javafx.event.ActionEvent) SelectionMode(javafx.scene.control.SelectionMode) Stage(javafx.stage.Stage) SimpleObjectProperty(javafx.beans.property.SimpleObjectProperty) Tab(javafx.scene.control.Tab) ExtensionFilter(javafx.stage.FileChooser.ExtensionFilter) Collections(java.util.Collections) SharedMemory(com.kyj.fx.voeditor.visual.momory.SharedMemory) BorderPane(javafx.scene.layout.BorderPane) SqlTab(com.kyj.fx.voeditor.visual.component.sql.tab.SqlTab) Tab(javafx.scene.control.Tab) Label(javafx.scene.control.Label) Map(java.util.Map) HashMap(java.util.HashMap) TableColumn(javafx.scene.control.TableColumn) TableView(javafx.scene.control.TableView)

Example 2 with ListChangeListener

use of javafx.collections.ListChangeListener in project Gargoyle by callakrsos.

the class ProjectInfoBaseInfoTab method supplyNode.

@Override
public BorderPane supplyNode() throws Exception {
    BorderPane root = new BorderPane();
    try {
        /* BaseInfo */
        baseInfoController = new BaseInfoComposite(this);
        //			FXMLLoader loader = new FXMLLoader();
        //			loader.setLocation(BaseInfoComposite.class.getResource("BaseInfoApp.fxml"));
        //			BorderPane supplyNode = loader.load();
        //			supplyNode.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);
        //			BaseInfoComposite baseInfoController = loader.getController();
        /* 버튼박스 */
        HBox hboxButton = new HBox(5);
        hboxButton.setPrefHeight(HBox.USE_COMPUTED_SIZE);
        HBox.setHgrow(hboxButton, Priority.NEVER);
        btnGenerate = new Button("사양서 생성");
        btnGenerate.setOnMouseClicked(this::btnGenerateOnMouseClick);
        btnGenerate.setPrefWidth(120);
        hboxButton.getChildren().add(btnGenerate);
        /* TableInfo */
        gv = new CrudBaseGridView<MethodDVO>(MethodDVO.class, new AnnotateBizOptions<MethodDVO>(MethodDVO.class) {

            @Override
            public boolean isCreateColumn(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                //						return false;
                return super.isCreateColumn(columnName);
            }

            @Override
            public boolean visible(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                return super.visible(columnName);
            }
        });
        //이벤트 리스너로 그리드에 추가되는 항목이 존재하면 추가.
        ObservableList<MethodDVO> methodData = baseInfoController.getMethodData();
        methodData.addListener(new ListChangeListener<MethodDVO>() {

            @Override
            public void onChanged(javafx.collections.ListChangeListener.Change<? extends MethodDVO> c) {
                if (c.next()) {
                    if (c.wasAdded()) {
                        gv.getItems().addAll(c.getAddedSubList());
                    } else if (c.wasRemoved()) {
                        gv.getItems().removeAll(c.getRemoved());
                    }
                }
            }
        });
        //			ObservableList<MethodDVO> items = gv.getItems();
        //			gv.getItems().addAll(methodData);
        baseInfoController.setBottom(hboxButton);
        root.setTop(baseInfoController);
        root.setCenter(gv);
        baseInfoController.start();
    } catch (IOException | NullPointerException e) {
        LOGGER.error(ValueUtil.toString(e));
    }
    root.setPrefSize(BorderPane.USE_COMPUTED_SIZE, BorderPane.USE_COMPUTED_SIZE);
    root.setPadding(new Insets(5, 5, 5, 5));
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) BaseInfoComposite(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite) IOException(java.io.IOException) ListChangeListener(javafx.collections.ListChangeListener) AnnotateBizOptions(com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions) Button(javafx.scene.control.Button) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Example 3 with ListChangeListener

use of javafx.collections.ListChangeListener in project bitsquare by bitsquare.

the class NotificationCenter method onAllServicesAndViewsInitialized.

public void onAllServicesAndViewsInitialized() {
    tradeManager.getTrades().addListener((ListChangeListener<Trade>) change -> {
        change.next();
        if (change.wasRemoved()) {
            change.getRemoved().stream().forEach(trade -> {
                String tradeId = trade.getId();
                if (disputeStateSubscriptionsMap.containsKey(tradeId)) {
                    disputeStateSubscriptionsMap.get(tradeId).unsubscribe();
                    disputeStateSubscriptionsMap.remove(tradeId);
                }
                if (tradeStateSubscriptionsMap.containsKey(tradeId)) {
                    tradeStateSubscriptionsMap.get(tradeId).unsubscribe();
                    tradeStateSubscriptionsMap.remove(tradeId);
                }
            });
        }
        if (change.wasAdded()) {
            change.getAddedSubList().stream().forEach(trade -> {
                String tradeId = trade.getId();
                if (disputeStateSubscriptionsMap.containsKey(tradeId)) {
                    log.debug("We have already an entry in disputeStateSubscriptionsMap.");
                } else {
                    Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(), disputeState -> onDisputeStateChanged(trade, disputeState));
                    disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription);
                }
                if (tradeStateSubscriptionsMap.containsKey(tradeId)) {
                    log.debug("We have already an entry in tradeStateSubscriptionsMap.");
                } else {
                    Subscription tradeStateSubscription = EasyBind.subscribe(trade.stateProperty(), tradeState -> onTradeStateChanged(trade, tradeState));
                    tradeStateSubscriptionsMap.put(tradeId, tradeStateSubscription);
                }
            });
        }
    });
    tradeManager.getTrades().stream().forEach(trade -> {
        String tradeId = trade.getId();
        Subscription disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(), disputeState -> onDisputeStateChanged(trade, disputeState));
        disputeStateSubscriptionsMap.put(tradeId, disputeStateSubscription);
        Subscription tradeStateSubscription = EasyBind.subscribe(trade.stateProperty(), tradeState -> onTradeStateChanged(trade, tradeState));
        tradeStateSubscriptionsMap.put(tradeId, tradeStateSubscription);
    });
}
Also used : MainView(io.bitsquare.gui.main.MainView) Logger(org.slf4j.Logger) Inject(com.google.inject.Inject) UserThread(io.bitsquare.common.UserThread) LoggerFactory(org.slf4j.LoggerFactory) DisputeManager(io.bitsquare.arbitration.DisputeManager) Trade(io.bitsquare.trade.Trade) HashMap(java.util.HashMap) Subscription(org.fxmisc.easybind.Subscription) ArrayList(java.util.ArrayList) DisputesView(io.bitsquare.gui.main.disputes.DisputesView) Consumer(java.util.function.Consumer) TradeManager(io.bitsquare.trade.TradeManager) Preferences(io.bitsquare.user.Preferences) PortfolioView(io.bitsquare.gui.main.portfolio.PortfolioView) List(java.util.List) ListChangeListener(javafx.collections.ListChangeListener) EasyBind(org.fxmisc.easybind.EasyBind) Navigation(io.bitsquare.gui.Navigation) TraderDisputeView(io.bitsquare.gui.main.disputes.trader.TraderDisputeView) Map(java.util.Map) PendingTradesView(io.bitsquare.gui.main.portfolio.pendingtrades.PendingTradesView) Nullable(javax.annotation.Nullable) Log(io.bitsquare.app.Log) Trade(io.bitsquare.trade.Trade) Subscription(org.fxmisc.easybind.Subscription)

Example 4 with ListChangeListener

use of javafx.collections.ListChangeListener in project bisq-api by mrosseel.

the class MainViewModelHeadless method onBasicServicesInitialized.

private void onBasicServicesInitialized() {
    log.info("onBasicServicesInitialized");
    clock.start();
    PaymentMethod.onAllServicesInitialized();
    // disputeManager
    disputeManager.onAllServicesInitialized();
    disputeManager.getDisputesAsObservableList().addListener((ListChangeListener<Dispute>) change -> {
        change.next();
        onDisputesChangeListener(change.getAddedSubList(), change.getRemoved());
    });
    onDisputesChangeListener(disputeManager.getDisputesAsObservableList(), null);
    // tradeManager
    tradeManager.onAllServicesInitialized();
    tradeManager.getTradableList().addListener((ListChangeListener<Trade>) c -> updateBalance());
    tradeManager.getTradableList().addListener((ListChangeListener<Trade>) change -> onTradesChanged());
    onTradesChanged();
    // We handle the trade period here as we display a global popup if we reached dispute time
    tradesAndUIReady = EasyBind.combine(isSplashScreenRemoved, tradeManager.pendingTradesInitializedProperty(), (a, b) -> a && b);
    tradesAndUIReady.subscribe((observable, oldValue, newValue) -> {
        if (newValue)
            applyTradePeriodState();
    });
    // tradeManager.setTakeOfferRequestErrorMessageHandler(errorMessage -> new Popup<>()
    // .warning(Res.get("popup.error.takeOfferRequestFailed", errorMessage))
    // .show());
    // walletService
    btcWalletService.addBalanceListener(new BalanceListener() {

        @Override
        public void onBalanceChanged(Coin balance, Transaction tx) {
            updateBalance();
        }
    });
    openOfferManager.getObservableList().addListener((ListChangeListener<OpenOffer>) c -> updateBalance());
    tradeManager.getTradableList().addListener((ListChangeListener<Trade>) c -> updateBalance());
    openOfferManager.onAllServicesInitialized();
    removeOffersWithoutAccountAgeWitness();
    arbitratorManager.onAllServicesInitialized();
    alertManager.alertMessageProperty().addListener((observable, oldValue, newValue) -> displayAlertIfPresent(newValue, false));
    privateNotificationManager.privateNotificationProperty().addListener((observable, oldValue, newValue) -> displayPrivateNotification(newValue));
    displayAlertIfPresent(alertManager.alertMessageProperty().get(), false);
    p2PService.onAllServicesInitialized();
    feeService.onAllServicesInitialized();
    GUIUtil.setFeeService(feeService);
    // daoManager.onAllServicesInitialized(errorMessage -> new Popup<>().error(errorMessage).show());
    tradeStatisticsManager.onAllServicesInitialized();
    accountAgeWitnessService.onAllServicesInitialized();
    priceFeedService.setCurrencyCodeOnInit();
    filterManager.onAllServicesInitialized();
    // filterManager.addListener(filter -> {
    // if (filter != null) {
    // if (filter.getSeedNodes() != null && !filter.getSeedNodes().isEmpty())
    // new Popup<>().warning(Res.get("popup.warning.nodeBanned", Res.get("popup.warning.seed"))).show();
    // 
    // if (filter.getPriceRelayNodes() != null && !filter.getPriceRelayNodes().isEmpty())
    // new Popup<>().warning(Res.get("popup.warning.nodeBanned", Res.get("popup.warning.priceRelay"))).show();
    // }
    // });
    setupBtcNumPeersWatcher();
    setupP2PNumPeersWatcher();
    updateBalance();
    if (DevEnv.DEV_MODE) {
        preferences.setShowOwnOffersInOfferBook(true);
        setupDevDummyPaymentAccounts();
    }
    fillPriceFeedComboBoxItems();
    setupMarketPriceFeed();
    swapPendingOfferFundingEntries();
    showAppScreen.set(true);
    // String key = "remindPasswordAndBackup";
    // user.getPaymentAccountsAsObservable().addListener((SetChangeListener<PaymentAccount>) change -> {
    // if (!walletsManager.areWalletsEncrypted() && preferences.showAgain(key) && change.wasAdded()) {
    // new Popup<>().headLine(Res.get("popup.securityRecommendation.headline"))
    // .information(Res.get("popup.securityRecommendation.msg"))
    // .dontShowAgainId(key)
    // .show();
    // }
    // });
    checkIfOpenOffersMatchTradeProtocolVersion();
    if (walletsSetup.downloadPercentageProperty().get() == 1)
        checkForLockedUpFunds();
    allBasicServicesInitialized = true;
}
Also used : Alert(io.bisq.core.alert.Alert) AccountAgeWitnessService(io.bisq.core.payment.AccountAgeWitnessService) Transaction(org.bitcoinj.core.Transaction) NotificationCenter(io.bisq.gui.main.overlays.notifications.NotificationCenter) Coin(org.bitcoinj.core.Coin) Inject(com.google.inject.Inject) User(io.bisq.core.user.User) UserThread(io.bisq.common.UserThread) Security(java.security.Security) TimeoutException(java.util.concurrent.TimeoutException) PrivateNotificationPayload(io.bisq.core.alert.PrivateNotificationPayload) ChainFileLockedException(org.bitcoinj.store.ChainFileLockedException) ListChangeListener(javafx.collections.ListChangeListener) FeeService(io.bisq.core.provider.fee.FeeService) ClosedTradableManager(io.bisq.core.trade.closed.ClosedTradableManager) DecryptedDataTuple(io.bisq.network.crypto.DecryptedDataTuple) DisputeManager(io.bisq.core.arbitration.DisputeManager) CurrencyUtil(io.bisq.common.locale.CurrencyUtil) BlockStoreException(org.bitcoinj.store.BlockStoreException) PaymentMethod(io.bisq.core.payment.payload.PaymentMethod) MonadicBinding(org.fxmisc.easybind.monadic.MonadicBinding) BootstrapListener(io.bisq.network.p2p.BootstrapListener) GUIUtil(io.bisq.gui.util.GUIUtil) PrivateNotificationManager(io.bisq.core.alert.PrivateNotificationManager) Ping(io.bisq.network.p2p.peers.keepalive.messages.Ping) DaoManager(io.bisq.core.dao.DaoManager) BSFormatter(io.bisq.gui.util.BSFormatter) PriceFeedComboBoxItem(io.bisq.gui.main.PriceFeedComboBoxItem) GlobalSettings(io.bisq.common.GlobalSettings) Res(io.bisq.common.locale.Res) WalletsManager(io.bisq.core.btc.wallet.WalletsManager) Subscription(org.fxmisc.easybind.Subscription) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) BtcWalletService(io.bisq.core.btc.wallet.BtcWalletService) EncryptionService(io.bisq.network.crypto.EncryptionService) Slf4j(lombok.extern.slf4j.Slf4j) Stream(java.util.stream.Stream) OpenOfferManager(io.bisq.core.offer.OpenOfferManager) Address(org.bitcoinj.core.Address) KeyRing(io.bisq.common.crypto.KeyRing) ObservableList(javafx.collections.ObservableList) PriceFeedService(io.bisq.core.provider.price.PriceFeedService) CryptoCurrencyAccount(io.bisq.core.payment.CryptoCurrencyAccount) TradeManager(io.bisq.core.trade.TradeManager) Socket(java.net.Socket) java.util(java.util) Dispute(io.bisq.core.arbitration.Dispute) ArbitratorManager(io.bisq.core.arbitration.ArbitratorManager) TradeCurrency(io.bisq.common.locale.TradeCurrency) Clock(io.bisq.common.Clock) Preferences(io.bisq.core.user.Preferences) FXCollections(javafx.collections.FXCollections) PerfectMoneyAccount(io.bisq.core.payment.PerfectMoneyAccount) TradeStatisticsManager(io.bisq.core.trade.statistics.TradeStatisticsManager) DontShowAgainLookup(io.bisq.core.user.DontShowAgainLookup) AlertManager(io.bisq.core.alert.AlertManager) FilterManager(io.bisq.core.filter.FilterManager) ConnectionListener(io.bisq.network.p2p.network.ConnectionListener) Trade(io.bisq.core.trade.Trade) FailedTradesManager(io.bisq.core.trade.failed.FailedTradesManager) MarketPrice(io.bisq.core.provider.price.MarketPrice) P2PServiceListener(io.bisq.network.p2p.P2PServiceListener) OpenOffer(io.bisq.core.offer.OpenOffer) Connection(io.bisq.network.p2p.network.Connection) Nullable(javax.annotation.Nullable) javafx.beans.property(javafx.beans.property) BisqEnvironment(io.bisq.core.app.BisqEnvironment) AddressEntry(io.bisq.core.btc.AddressEntry) SealedAndSigned(io.bisq.common.crypto.SealedAndSigned) SetupUtils(io.bisq.core.app.SetupUtils) AppOptionKeys(io.bisq.core.app.AppOptionKeys) IOException(java.io.IOException) CryptoException(io.bisq.common.crypto.CryptoException) TimeUnit(java.util.concurrent.TimeUnit) WalletsSetup(io.bisq.core.btc.wallet.WalletsSetup) CloseConnectionReason(io.bisq.network.p2p.network.CloseConnectionReason) BalanceListener(io.bisq.core.btc.listeners.BalanceListener) P2PService(io.bisq.network.p2p.P2PService) EasyBind(org.fxmisc.easybind.EasyBind) DevEnv(io.bisq.common.app.DevEnv) Timer(io.bisq.common.Timer) InetAddresses(com.google.common.net.InetAddresses) ChangeListener(javafx.beans.value.ChangeListener) Trade(io.bisq.core.trade.Trade) Coin(org.bitcoinj.core.Coin) BalanceListener(io.bisq.core.btc.listeners.BalanceListener) Transaction(org.bitcoinj.core.Transaction) OpenOffer(io.bisq.core.offer.OpenOffer) Dispute(io.bisq.core.arbitration.Dispute)

Example 5 with ListChangeListener

use of javafx.collections.ListChangeListener in project Challenger4SysAdmins by fvarrui.

the class TreeItemFactory method createChallengeTreeItem.

/**
 * @param challenge un chellenge
 * @return un item
 */
public static TreeItem<Object> createChallengeTreeItem(Challenge challenge) {
    TreeItem<Object> challengeItem = new TreeItem<Object>();
    challengeItem.setExpanded(true);
    challengeItem.setValue(challenge);
    for (Goal goal : challenge.getGoals()) {
        challengeItem.getChildren().add(createGoalTreeItem(goal));
    }
    challenge.goalsProperty().addListener(new ListChangeListener<Goal>() {

        public void onChanged(Change<? extends Goal> c) {
            while (c.next()) {
                c.getAddedSubList().stream().forEach(g -> challengeItem.getChildren().add(createGoalTreeItem(g)));
                c.getRemoved().stream().forEach(g -> {
                    TreeItem<Object> item = challengeItem.getChildren().stream().filter(i -> i.getValue().equals(g)).findFirst().get();
                    challengeItem.getChildren().remove(item);
                });
            }
        }
    });
    return challengeItem;
}
Also used : TestGroup(fvarrui.sysadmin.challenger.test.TestGroup) Challenge(fvarrui.sysadmin.challenger.Challenge) Test(fvarrui.sysadmin.challenger.test.Test) Goal(fvarrui.sysadmin.challenger.Goal) ListChangeListener(javafx.collections.ListChangeListener) TreeItem(javafx.scene.control.TreeItem) CommandTest(fvarrui.sysadmin.challenger.test.CommandTest) Command(fvarrui.sysadmin.challenger.command.Command) Goal(fvarrui.sysadmin.challenger.Goal) TreeItem(javafx.scene.control.TreeItem)

Aggregations

ListChangeListener (javafx.collections.ListChangeListener)23 FXCollections (javafx.collections.FXCollections)14 List (java.util.List)13 ObservableList (javafx.collections.ObservableList)12 ArrayList (java.util.ArrayList)10 Collectors (java.util.stream.Collectors)9 Map (java.util.Map)8 Color (javafx.scene.paint.Color)8 SimpleObjectProperty (javafx.beans.property.SimpleObjectProperty)7 HashMap (java.util.HashMap)6 Node (javafx.scene.Node)6 Button (javafx.scene.control.Button)6 IntStream (java.util.stream.IntStream)5 IntegerProperty (javafx.beans.property.IntegerProperty)5 SimpleIntegerProperty (javafx.beans.property.SimpleIntegerProperty)5 SimpleStringProperty (javafx.beans.property.SimpleStringProperty)5 Label (javafx.scene.control.Label)5 MouseEvent (javafx.scene.input.MouseEvent)5 Pane (javafx.scene.layout.Pane)5 Inject (com.google.inject.Inject)4