Package javafx.scene.control

Examples of javafx.scene.control.TabPane


    super(parent, style);
  }
 
  @Override
  protected void createWidget() {
    tabPane = new TabPane();
  }
View Full Code Here


  @Override
  protected void jfxStart(IApplicationContext applicationContext, javafx.application.Application jfxApplication, Stage primaryStage) {
    primaryStage.setTitle("Hello JavaFX");
   
    TabPane root = new TabPane();
    root.getTabs().add(createFillLayout());
    root.getTabs().add(createSashLayout());
    root.getTabs().add(createBorderLayout());
    root.getTabs().add(createHBoxLayout());
   
    Scene scene = new Scene(root, 800, 800);
    primaryStage.setScene(scene);
    primaryStage.show();
  }
View Full Code Here

//      getWidget().setMinMaxState(t);
    }
   
    @Override
    protected TabPane  createWidget() {
      TabPane  p = FXTabFactory.createTabPane();
     
//      ContextMenu m = new ContextMenu();
//     
//      {
//        MenuItem item = new MenuItem("Detach");
//        item.setOnAction(new EventHandler<ActionEvent>() {
//         
//          @Override
//          public void handle(ActionEvent event) {
//            DetachView d = new DetachView();
//            d.detach((MPart) getDomElement().getSelectedElement(), modelService);
//          }
//        });
//        m.getItems().add(item); 
//      }
//     
//      {
//        MenuItem item = new MenuItem("Move To First");
//        item.setOnAction(new EventHandler<ActionEvent>() {
//         
//          @Override
//          public void handle(ActionEvent event) {
//            MoveToFirst d = new MoveToFirst();
//            d.move((MPart) getDomElement().getSelectedElement());
//          }
//        });
//        m.getItems().add(item); 
//      }
//     
//      {
//        MenuItem item = new MenuItem("Move To Last");
//        item.setOnAction(new EventHandler<ActionEvent>() {
//         
//          @Override
//          public void handle(ActionEvent event) {
//            MoveToLast d = new MoveToLast();
//            d.move((MPart) getDomElement().getSelectedElement());
//          }
//        });
//        m.getItems().add(item); 
//      }
//     
//      {
//        MenuItem item = new MenuItem("Pin To Bottom");
//        item.setOnAction(new EventHandler<ActionEvent>() {
//         
//          @Override
//          public void handle(ActionEvent event) {
//            PinToBottom d = new PinToBottom();
//            d.pin((MPart) getDomElement().getSelectedElement());
//          }
//        });
//        m.getItems().add(item); 
//      }
//     
//      p.setContextMenu(m);
//      (FXTabPane)p.minMaxStateProperty().addListener(new ChangeListener<MinMaxState>() {
//
//        @Override
//        public void changed(ObservableValue<? extends MinMaxState> observable, MinMaxState oldValue, MinMaxState newValue) {
//          if( minMaxCallback != null ) {
//            switch (newValue) {
//            case RESTORED:
//              minMaxCallback.call(WMinMaxState.RESTORED);
//              break;
//            case MAXIMIZED:
//              minMaxCallback.call(WMinMaxState.MAXIMIZED);
//              break;
//            case MINIMIZED:
//              minMaxCallback.call(WMinMaxState.MINIMIZED);
//              break;
//            case NONE:
//              // Nothing to do
//              break;
//            } 
//          }
//        }
//      });
      p.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {

        @Override
        public void handle(KeyEvent event) {
          inKeyTraversal = true;
        }
       
      });
      p.addEventFilter(KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() {

        @Override
        public void handle(KeyEvent event) {
          inKeyTraversal = false;
        }
       
      });

      p.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Tab>() {

        @Override
        public void changed(ObservableValue<? extends Tab> observable, Tab oldValue, Tab newValue) {
          if( newValue == null || (getWidgetState() != WidgetState.CREATED && getWidgetState() != WidgetState.IN_SETUP ) ) {
            return;
View Full Code Here

TOP

Related Classes of javafx.scene.control.TabPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.