@Override public void initialize(URL location, ResourceBundle resources) { fieldFileBtn.setGraphic(FontAwesome.FOLDER_OPEN.view()); buttonConnect.setGraphic(FontAwesome.SIGN_IN.view());
@Override public void initialize(URL location, ResourceBundle resources) { okey.setGraphic(FontAwesome.CHECK.view()); okey.disableProperty().bind(Bindings.createBooleanBinding( () -> IS_INVALID_MAIL.test(email.getText()),
OpenWithDialog initFor(InputPdfArgumentsLoadRequest event) { this.messageTitle .setText(DefaultI18nContext.getInstance().i18n("Select the task to perform on the following files")); filesList .setItems(FXCollections.observableArrayList(event.pdfs.stream().map(Path::toString).collect(toList()))); modules.forEach(m -> { if (m.descriptor().hasInputType(event.requiredInputTyle())) { Button current = new Button(m.descriptor().getName()); current.getStyleClass().addAll(Style.FOOTER_BUTTON.css()); Optional.ofNullable(m.graphic()).ifPresent(g -> { g.setScaleX(0.7); g.setScaleY(0.7); current.setGraphic(g); }); current.setOnAction((e) -> { eventStudio().broadcast(new ClearModuleEvent(), m.id()); eventStudio().broadcast(activeteModule(m.id())); hide(); PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(m.id()); event.pdfs.stream().map(Path::toFile).map(PdfDocumentDescriptor::newDescriptorNoPassword) .forEach(loadEvent::add); eventStudio().broadcast(loadEvent, m.id()); }); buttons.getChildren().add(current); } }); return this; }
Image image = new Image(getClass().getResourceAsStream("play3.jpg")); button.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent e) { Button button = (Button) e.getSource(); button.setGraphic(new ImageView(image)); } });
private void setButtonIcon(Button button, String icon, int size) { InputStream is = getClass().getResourceAsStream("icons/" + icon + "_" + size + ".png"); Image block = new Image(is); ImageView iv = new ImageView(block); button.setGraphic(iv); }
public Button createIconButton(GlyphIcons icon, String text) { Text label = createIcon(icon, GlyphIcon.DEFAULT_FONT_SIZE); Button button = new Button(text); button.setGraphic(label); return button; }
btBuscaOrdem.setGraphic(icons[0]); btBuscaLote.setGraphic(icons[1]);
/** * * @param locked */ public void toggleSecurizedLock(boolean locked) { try { if (!locked) { securizedLock.setGraphic(new ImageView(new Image(securizedLock_open.openStream()))); } else { securizedLock.setGraphic(new ImageView(new Image(securizedLock_locked.openStream()))); } } catch (IOException ex) { Logger.getLogger(JXAenvUtils.class.getName()).log(Level.SEVERE, null, ex); } }
/** * */ public void initialize() { SVGImageUtils.installSvgLoader(); this.btnNew.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/new.svg", IMG_WIDTH, IMG_HEIGHT))); this.btnNew.setText(RESOURCES.getString("new")); this.btnOpen.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/open.svg", IMG_WIDTH, IMG_HEIGHT))); this.btnOpen.setText(RESOURCES.getString("open")); this.btnSave.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/save.svg", IMG_WIDTH, IMG_HEIGHT))); this.btnSave.setText(RESOURCES.getString("save")); this.btnSave.setDisable(true); }
public void initialize(URL location, ResourceBundle resources) { buttonGraphic = new ImageView(); myButton.setGraphic(buttonGraphic); model.setPaused(true); buttonGraphic.imageProperty().bind(Bindings
public Button createIconButton(GlyphIcons icon, String text, String iconSize, String fontSize, ContentDisplay contentDisplay) { Text label = createIcon(icon, iconSize); Button button = new Button(text); button.setStyle("-fx-font-size: " + fontSize); button.setGraphic(label); button.setContentDisplay(contentDisplay); return button; }
/** * */ public void initialize() { SVGImageUtils.installSvgLoader(); this.run.setGraphic(new ImageView(SVGImageUtils.getSvgImage("icon/run.svg", RUN_WIDTH, RUN_HEIGHT))); this.run.setText(RESOURCES.getString("run")); this.run.setDisable(true); this.folder = SVGImageUtils.getSvgImage("icon/folder.svg", TREE_ICON_WIDTH, TREE_ICON_HEIGHT); this.file = SVGImageUtils.getSvgImage("icon/file.svg", TREE_ICON_WIDTH, TREE_ICON_HEIGHT); }
/** * construct an ImageButton with to Images * * @param pushed * @param unpushed */ public ImageButton(final Image pushed, final Image unpushed) { iv=new ImageView(unpushed); //this.getChildren().add(iv); super.setGraphic(iv); super.setStyle("-fx-background-color: rgba(255, 255, 255, 0);"); setOnMousePressed(new EventHandler<MouseEvent>() { public void handle(MouseEvent evt) { iv.setImage(pushed); } }); setOnMouseReleased(new EventHandler<MouseEvent>() { public void handle(MouseEvent evt) { iv.setImage(unpushed); } }); }
public NaviSelect() { getStyleClass().add("navi-select"); editButton.getStyleClass().add("edit-button"); editButton.valueProperty().bind(visualBinding); HBox.setHgrow(editButton, Priority.ALWAYS); editButton.setTooltip(new Tooltip("Edit")); Pane gotoButtonGraphic = new Pane(); gotoButtonGraphic.getStyleClass().add("icon"); gotoButton.setGraphic(gotoButtonGraphic); gotoButton.setTooltip(new Tooltip("Goto")); gotoButton.getStyleClass().add("goto-button"); getChildren().addAll(editButton, gotoButton); }
@Override public void changed(ObservableValue<? extends MacOSDefaultIcons> observable, MacOSDefaultIcons oldValue, MacOSDefaultIcons newValue) { if (newValue != null && newValue != oldValue) { if (newValue == MacOSDefaultIcons.SHARE) { StackPane stack = new StackPane(); String iconBase = MacOSDefaultIcons.SHARE.getStyleName(); stack.getStyleClass().add("aquaicon"); Region svgIcon = new Region(); svgIcon.getStyleClass().add(iconBase + "-square"); stack.getChildren().add(svgIcon); Region svgIcon2 = new Region(); svgIcon2.getStyleClass().add(iconBase + "-arrow"); stack.getChildren().add(svgIcon2); getSkinnable().setGraphic(stack); } else { Region svgIcon = new Region(); svgIcon.getStyleClass().add("aqua-" + newValue.getStyleName()); svgIcon.getStyleClass().add("aquaicon"); getSkinnable().setGraphic(svgIcon); getSkinnable().getStyleClass().add("button-" + newValue.getStyleName()); } getSkinnable().requestLayout(); } } });
/** * set the Help * * @param help */ public void setHelp(String help) { //this.getButtonTypes().add(helpButtonType); //helpButton = this.findButton(helpButtonType); helpButton=new Button(wizard.getI18n("help")); //wizard.getPrivateDialog().getDialogPane().getButtonTypes().add(helpButtonType); //getPrivateButtonBar().getButtons().add(0, helpButton); gridPane.add(helpButton, 0, 1); Glyph helpIcon = fontAwesome.create(FontAwesome.Glyph.QUESTION_CIRCLE); helpButton.setGraphic(helpIcon); helpButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(final ActionEvent actionEvent) { linker.browse(help); actionEvent.consume(); } }); }
/** * fix the encoding problems with controlfx buttons * https://bitbucket.org/controlsfx/controlsfx/issues/769/encoding-problem-all-german-umlauts-are */ protected void fixButtons() { ButtonType buttonTypes[] = { ButtonType.NEXT, ButtonType.PREVIOUS, ButtonType.CANCEL, ButtonType.FINISH }; Glyph glyphs[] = { fontAwesome.create(FontAwesome.Glyph.CHEVRON_RIGHT), fontAwesome.create(FontAwesome.Glyph.CHEVRON_LEFT), fontAwesome.create(FontAwesome.Glyph.TIMES), fontAwesome.create(FontAwesome.Glyph.CHECK) }; int index = 0; for (ButtonType buttonType : buttonTypes) { Button button = findButton(buttonType); if (button != null) { button.setText(buttonType.getText()); button.setGraphic(glyphs[index]); } index++; } if (helpButton!=null) helpButton.setText(wizard.getI18n("help")); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); final String title = configuration.getPropertyValue(XMLConstants.LABEL); NodeHelper.setLabel(button, configuration, (AbstractViewController) controller); if (!StringUtils.isEmpty(title)) { // ad fake indicator to the button to occupy the place // so when the task is runned, the label do not move final ProgressIndicator fakewaiting = new ProgressIndicator(); fakewaiting.managedProperty().bind(fakewaiting.visibleProperty()); fakewaiting.setVisible(false); // fakewaiting.getStyleClass().add(BUTTON_PROCESSING_PROGRESS); fakewaiting.maxHeight(8); fakewaiting.maxWidth(8); button.setGraphic(fakewaiting); } button.setDefaultButton(configuration.booleanPropertyValueOf(XMLConstants.DEFAULT).orElse(false)); ComponentToLabeledHelper.setTooltip(configuration, button, (AbstractViewController) controller); NodeHelper.styleClassAddAll(button, configuration, XMLConstants.STYLE_CLASS); }
xyTabPane.getIconSize()); powerButton.setTooltip(new Tooltip(I18n.get(JavaFxI18n.POWER_OFF))); powerButton.setGraphic(icon); powerButton.setDisable(false); powerButton.setOnAction(new EventHandler<ActionEvent>() {
cancelButton.setGraphic(new ImageView(new Image(TaskProgressDialog.class.getResourceAsStream("cancel.png")))); //$NON-NLS-1$ cancelButton.setCancelButton(true); cancelButton.setOnAction((event) -> {