Package javafx.scene.control

Examples of javafx.scene.control.MenuButton


    return result;
  }
 
  @Override
  public ButtonBase createShowFormButton() {
    MenuButton menuButton = new MenuButton();
    menuButton.setText(staticTitle);
    for (final FormCreator form: forms){
      menuButton.getItems().add(form.createShowFormMenuItem());
    }
    return menuButton;
  }
View Full Code Here


        }
      }
    });
   
    hbox.getChildren().add(textfield);
    MenuButton defaultFilterButton = new MenuButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/date.png"))));
    defaultFilterButton.setPrefWidth(20);
    CustomMenuItem popUpMenueItem = new CustomMenuItem();
    popUpMenueItem.setHideOnClick(false);
    defaultFilterButton.getItems().add(popUpMenueItem);
    popUpMenueItem.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
    hbox.getChildren().add(defaultFilterButton);
    popUpMenueItem.setContent(createPopupContent());
   
    setModelDate(null);
View Full Code Here

    Orientation orientation = verticalRightButton?Orientation.HORIZONTAL:Orientation.VERTICAL;

    buttonsPane.getChildren().addAll(resultForm.getController().getContributedButtons(messageProvider));   
    buttonsPane.getChildren().add(new Separator(orientation));
   
    MenuButton defaultFilterButton = new MenuButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/filter.png"))));
    defaultFilterButton.setPrefWidth(20);
    CustomMenuItem defaultFilterContent = new CustomMenuItem();
    defaultFilterContent.setHideOnClick(false);
    defaultFilterButton.getItems().add(defaultFilterContent);
    defaultFilterContent.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
    buttonsPane.getChildren().add(defaultFilterButton);
    if (filterForm.getController().createDefaultFilter()!=null){
      defaultFilterContent.setContent(filterForm.getController().createDefaultFilter());
    } else {
      defaultFilterButton.setDisable(true);
    }
   
    buttonsPane.getChildren().add(new Separator(orientation));
   
 
    final Button clearButton = new Button("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/clear.png"))));
    clearButton.setTooltip(new Tooltip(messageProvider.getText(MessageKey.filterAbleForm_button_clear)));
    clearButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override public void handle(ActionEvent e) {
          resultForm.getController().clear();
        }
    });
    if(resultForm.getController().supportsClear()) {
      buttonsPane.getChildren().add(clearButton);
    }

    final Button refreshButton = new Button("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/refresh.png"))));
    refreshButton.setId(REFRESH_BUTTON_ID);
    HBox.setMargin(refreshButton, new Insets(4,0,4,0));
    refreshButton.setTooltip(new Tooltip(messageProvider.getText(MessageKey.filterAbleForm_button_refresh)));
    refreshButton.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
          refresh();
        }
    });
    buttonsPane.getChildren().add(refreshButton);
   
    final ProgressIndicator repeatProgressIndicator = new ProgressBar();
    progressbarDisplayTarget.getChildren().add(repeatProgressIndicator);
    final ToggleButton toggleButton = new ToggleButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/repeat.png"))));
    repeatProgressIndicator.setVisible(false);
    repeatProgressIndicator.setPrefWidth(300);
    repeatProgressIndicator.progressProperty().bind(repeatFilterService.progressProperty());
    toggleButton.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        if (toggleButton.isSelected()){
          repeatFilterService.setRefreshIntervall(Long.valueOf(refreshRateInMs.get()));
          repeatFilterService.reset();
          repeatFilterService.start();
        } else {
          repeatFilterService.cancel();
        }
      }
    });
    repeatFilterService.setOnCancelled(new EventHandler<WorkerStateEvent>() {
      @Override
      public void handle(WorkerStateEvent event) {
        repeatProgressIndicator.setVisible(false);
      }
    });
    repeatFilterService.stateProperty().addListener(new ChangeListener<State>() {
      @Override
      public void changed(ObservableValue<? extends State> observable, State oldValue, State newValue) {
        if (newValue==State.CANCELLED || newValue == State.FAILED || newValue == State.SUCCEEDED){
          repeatProgressIndicator.setVisible(false);
        } else {
          repeatProgressIndicator.setVisible(true);
        }
       
      }
    });
   
    repeatFilterService.runningProperty().addListener(new ChangeListener<Boolean>() {
      @Override
      public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
        if (newValue!=null){
          toggleButton.setSelected(newValue);
        }
      }
    });
    buttonsPane.getChildren().add(toggleButton);
   
   
    MenuButton settings = new MenuButton("",new ImageView(new Image(getClass().getResourceAsStream("/de/scoopgmbh/copper/gui/icon/settings.png"))));
    settings.setPrefWidth(20);
    CustomMenuItem customMenuItem = new CustomMenuItem();
    settings.getItems().add(customMenuItem);
    customMenuItem.getStyleClass().setAll("noSelectAnimationMenueItem","menu-item");
    HBox hbox = new HBox(3);
    hbox.setAlignment(Pos.CENTER_LEFT);
    hbox.getChildren().add(new Label("Refresh Interval"));
    TextField interval = new NumberOnlyTextField();
    interval.setPrefWidth(100);
    interval.textProperty().bindBidirectional(refreshRateInMs);
    hbox.getChildren().add(interval);
    hbox.getChildren().add(new Label("ms"));
    customMenuItem.setContent(hbox);
    buttonsPane.getChildren().add(settings);
   
   
    refreshButton.disableProperty().bind(toggleButton.selectedProperty());
    clearButton.disableProperty().bind(toggleButton.selectedProperty());
    filterContent.disableProperty().bind(toggleButton.selectedProperty());
    leftFilterPart.disableProperty().bind(toggleButton.selectedProperty());
    settings.disableProperty().bind(toggleButton.selectedProperty());
    return buttonsPane;
  }
View Full Code Here

        AnchorPane.setLeftAnchor(statusLabel, 30.0);

        updateStatusLabel = new Label("Loading Update");
        updateStatusLabel.getStyleClass().add("application-status-label");

        applicationActionMenuButton = new MenuButton();
        AwesomeDude.setIcon(applicationActionMenuButton, AwesomeIcon.GEARS, "2em");
        applicationActionMenuButton.setVisible(true);
        applicationActionMenuButton.getStyleClass().add("navigation-button");
        addApplicationActionsMethods();
        AnchorPane.setBottomAnchor(applicationActionMenuButton, 0.0);
View Full Code Here

        ComboBox<String> combo = new ComboBox<String>(FXCollections.observableArrayList("Combo A", "Combo B", "Combo C"));
        ComboBox<String> combo2 = new ComboBox<String>(FXCollections.observableArrayList("Combo A", "Combo B", "Combo C"));
        combo2.setEditable(true);
        ChoiceBox<String> choice = new ChoiceBox<String>(FXCollections.observableArrayList("Choice A", "Choice B", "Choice C"));
        MenuButton m = new MenuButton("Eats");
        m.getItems().addAll(new MenuItem("Burger"), new MenuItem("Hot Dog"));
        m.setPopupSide(Side.RIGHT);

        SplitMenuButton m2 = new SplitMenuButton();
        m2.setText("Shutdown");
        m2.getItems().addAll(new MenuItem("Logout"), new MenuItem("Sleep"));
        m2.setPopupSide(Side.RIGHT);
View Full Code Here

TOP

Related Classes of javafx.scene.control.MenuButton

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.