Search in sources :

Example 6 with TabPane

use of javafx.scene.control.TabPane in project POL-POM-5 by PlayOnLinux.

the class ViewLibrary method drawContent.

private void drawContent() {
    libraryTabs = new TabPane();
    libraryTabs.getStyleClass().add("rightPane");
    final Tab installedApplication = new Tab();
    installedApplication.setClosable(false);
    installedApplication.setText(tr("My applications"));
    libraryTabs.getTabs().add(installedApplication);
    installedApplication.setContent(availableShortcuts);
    this.setCenter(libraryTabs);
}
Also used : TabPane(javafx.scene.control.TabPane) Tab(javafx.scene.control.Tab)

Example 7 with TabPane

use of javafx.scene.control.TabPane in project bitsquare by bitsquare.

the class OfferView method loadView.

private void loadView(Class<? extends View> viewClass) {
    TabPane tabPane = root;
    View view;
    boolean isBuy = direction == Offer.Direction.BUY;
    if (viewClass == OfferBookView.class && offerBookView == null) {
        view = viewLoader.load(viewClass);
        // Offerbook must not be cached by ViewLoader as we use 2 instances for sell and buy screens.
        offerBookTab = new Tab(isBuy ? "Buy bitcoin" : "Sell bitcoin");
        offerBookTab.setClosable(false);
        offerBookTab.setContent(view.getRoot());
        tabPane.getTabs().add(offerBookTab);
        offerBookView = (OfferBookView) view;
        offerBookView.onTabSelected(true);
        OfferActionHandler offerActionHandler = new OfferActionHandler() {

            @Override
            public void onCreateOffer(TradeCurrency tradeCurrency) {
                if (!createOfferViewOpen) {
                    OfferView.this.createOfferViewOpen = true;
                    OfferView.this.tradeCurrency = tradeCurrency;
                    OfferView.this.navigation.navigateTo(MainView.class, OfferView.this.getClass(), CreateOfferView.class);
                } else {
                    new Popup().information("You have already a \"Create offer\" tab open.").show();
                }
            }

            @Override
            public void onTakeOffer(Offer offer) {
                if (!takeOfferViewOpen) {
                    OfferView.this.takeOfferViewOpen = true;
                    OfferView.this.offer = offer;
                    OfferView.this.navigation.navigateTo(MainView.class, OfferView.this.getClass(), TakeOfferView.class);
                } else {
                    new Popup().information("You have already a \"Take offer\" tab open.").show();
                }
            }
        };
        offerBookView.setOfferActionHandler(offerActionHandler);
        offerBookView.setDirection(direction);
    } else if (viewClass == CreateOfferView.class && createOfferView == null) {
        view = viewLoader.load(viewClass);
        // CreateOffer and TakeOffer must not be cached by ViewLoader as we cannot use a view multiple times
        // in different graphs
        createOfferView = (CreateOfferView) view;
        createOfferView.initWithData(direction, tradeCurrency);
        createOfferPane = createOfferView.getRoot();
        createOfferTab = new Tab(getCreateOfferTabName());
        // close handler from close on create offer action
        createOfferView.setCloseHandler(() -> tabPane.getTabs().remove(createOfferTab));
        createOfferTab.setContent(createOfferPane);
        tabPane.getTabs().add(createOfferTab);
        tabPane.getSelectionModel().select(createOfferTab);
    } else if (viewClass == TakeOfferView.class && takeOfferView == null && offer != null) {
        view = viewLoader.load(viewClass);
        // CreateOffer and TakeOffer must not be cached by ViewLoader as we cannot use a view multiple times
        // in different graphs
        takeOfferView = (TakeOfferView) view;
        takeOfferView.initWithData(offer);
        takeOfferPane = ((TakeOfferView) view).getRoot();
        takeOfferTab = new Tab(getTakeOfferTabName());
        // close handler from close on take offer action
        takeOfferView.setCloseHandler(() -> tabPane.getTabs().remove(takeOfferTab));
        takeOfferTab.setContent(takeOfferPane);
        tabPane.getTabs().add(takeOfferTab);
        tabPane.getSelectionModel().select(takeOfferTab);
    }
}
Also used : TabPane(javafx.scene.control.TabPane) TradeCurrency(io.bitsquare.locale.TradeCurrency) CreateOfferView(io.bitsquare.gui.main.offer.createoffer.CreateOfferView) Tab(javafx.scene.control.Tab) Offer(io.bitsquare.trade.offer.Offer) Popup(io.bitsquare.gui.main.overlays.popups.Popup) OfferBookView(io.bitsquare.gui.main.offer.offerbook.OfferBookView) MainView(io.bitsquare.gui.main.MainView) TakeOfferView(io.bitsquare.gui.main.offer.takeoffer.TakeOfferView) View(io.bitsquare.gui.common.view.View) ActivatableView(io.bitsquare.gui.common.view.ActivatableView) CreateOfferView(io.bitsquare.gui.main.offer.createoffer.CreateOfferView) OfferBookView(io.bitsquare.gui.main.offer.offerbook.OfferBookView)

Example 8 with TabPane

use of javafx.scene.control.TabPane in project Gargoyle by callakrsos.

the class FxUtil method createSVNGraph.

/**
	 * @작성자 : KYJ
	 * @작성일 : 2016. 7. 21.
	 * @param manager
	 * @throws Exception
	 */
public static TabPane createSVNGraph(JavaSVNManager manager) throws Exception {
    FxSVNHistoryDataSupplier svnDataSupplier = new FxSVNHistoryDataSupplier(manager);
    SvnChagnedCodeComposite svnChagnedCodeComposite = new SvnChagnedCodeComposite(svnDataSupplier);
    ScmCommitComposite scmCommitComposite = new ScmCommitComposite(svnDataSupplier);
    TabPane tabPane = new TabPane();
    tabPane.getTabs().addAll(new Tab("Chagned Codes.", svnChagnedCodeComposite), new Tab("Commit Hist.", scmCommitComposite));
    return tabPane;
}
Also used : TabPane(javafx.scene.control.TabPane) Tab(javafx.scene.control.Tab) ScmCommitComposite(com.kyj.fx.voeditor.visual.component.scm.ScmCommitComposite) SvnChagnedCodeComposite(com.kyj.fx.voeditor.visual.component.scm.SvnChagnedCodeComposite) FxSVNHistoryDataSupplier(com.kyj.fx.voeditor.visual.component.scm.FxSVNHistoryDataSupplier)

Aggregations

TabPane (javafx.scene.control.TabPane)8 Tab (javafx.scene.control.Tab)6 FxSVNHistoryDataSupplier (com.kyj.fx.voeditor.visual.component.scm.FxSVNHistoryDataSupplier)2 ScmCommitComposite (com.kyj.fx.voeditor.visual.component.scm.ScmCommitComposite)2 SvnChagnedCodeComposite (com.kyj.fx.voeditor.visual.component.scm.SvnChagnedCodeComposite)2 HOGMCodeArea (com.sri.ai.praise.sgsolver.demo.editor.HOGMCodeArea)2 Node (javafx.scene.Node)2 TitledPane (javafx.scene.control.TitledPane)2 JavaSVNManager (com.kyj.scm.manager.svn.java.JavaSVNManager)1 HOGMQueryError (com.sri.ai.praise.sgsolver.solver.HOGMQueryError)1 ActivatableView (io.bitsquare.gui.common.view.ActivatableView)1 View (io.bitsquare.gui.common.view.View)1 MainView (io.bitsquare.gui.main.MainView)1 CreateOfferView (io.bitsquare.gui.main.offer.createoffer.CreateOfferView)1 OfferBookView (io.bitsquare.gui.main.offer.offerbook.OfferBookView)1 TakeOfferView (io.bitsquare.gui.main.offer.takeoffer.TakeOfferView)1 Popup (io.bitsquare.gui.main.overlays.popups.Popup)1 TradeCurrency (io.bitsquare.locale.TradeCurrency)1 Offer (io.bitsquare.trade.offer.Offer)1 IOException (java.io.IOException)1