• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Dialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.controlsfx.dialog.Dialog的典型用法代码示例。如果您正苦于以下问题:Java Dialog类的具体用法?Java Dialog怎么用?Java Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Dialog类属于org.controlsfx.dialog包,在下文中一共展示了Dialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: show

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public void show() {
	Dialog dlg = new Dialog(null, getTranslation("label.preferences"));
       
       final GridPane content = new GridPane();
       content.setHgap(10);
       content.setVgap(10);
       
       content.add(new Label(getTranslation("label.portals")), 0, 0);
       content.add(portals, 1, 0);
       GridPane.setHgrow(portals, Priority.ALWAYS);
       
       content.add(autosave, 1, 1);
       content.add(autoupdate, 1, 2);
       
       dlg.setResizable(false);
       dlg.setIconifiable(false);
       dlg.setContent(content);
       dlg.getActions().addAll(Dialog.Actions.CLOSE);
         
       dlg.show();
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:22,代码来源:PreferencesDialog.java


示例2: show

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public void show() {
	CommandLink github = new CommandLink(
		getTranslation("label.report.github"),
		getTranslation("message.report.github")
	);
	
	CommandLink form = new CommandLink(
		getTranslation("label.report.form"),
		getTranslation("message.report.form")
	);
	
	Action response = Dialogs.create()
	        .title(getTranslation("menu.bug"))
	        .masthead(null)
	        .message(getTranslation("label.select.option"))
	        .showCommandLinks(form, github, form);
	
	if(!response.equals(Dialog.Actions.CANCEL)){
		if(response.equals(github)){
			JavaFXUtils.openWebpage(GITHUB_URI);
		}else{
			JavaFXUtils.openWebpage(FORM_URI);
		}
	}
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:26,代码来源:BugReportDialog.java


示例3: newFile

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
@FXML
void newFile(ActionEvent e) {
	if(ApplicationState.changesPending()) {
		Action response = DialogFactory.pendingChanges();
		
		if (response.equals(Dialog.Actions.YES)){
			save(e);
		}else if (response.equals(Dialog.Actions.CANCEL)){
			return;
		}
	}
	
	PreferencesController.setLastFilePath("");
	ProfileRepository.clear();
	SubscriptionRepository.clear();
	refresh();
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:18,代码来源:FXMLController.java


示例4: quit

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
@FXML
void quit(ActionEvent event) {
	if(ApplicationState.changesPending()) {
		Action response = DialogFactory.quit(this.parent);
    	
    	// Cancel so no action is done
    	if(response.equals(Dialog.Actions.CANCEL)) return;
    	
    	// Don't save changes, then quit
    	if(response.equals(Dialog.Actions.NO)){
    		Platform.exit(); 
    		return;
    	}
    	
    	// Lets save and then quit
    	save(null);
    	Platform.exit();
	}else{
		Platform.exit();
	}
	
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:23,代码来源:FXMLController.java


示例5: MessageTypeDialog

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public MessageTypeDialog() {
    super(null, "Choose message type", false, DialogStyle.NATIVE);
    setMasthead("Choose message type");

    group = new ToggleGroup();

    RadioButton textButton = new RadioButton("Text");
    textButton.setUserData(new JmsTextMessage());
    textButton.setToggleGroup(group);
    textButton.setSelected(true);
    RadioButton bytesButton = new RadioButton("Bytes");
    bytesButton.setUserData(new JmsBytesMessage());
    bytesButton.setToggleGroup(group);

    HBox hbox = new HBox(5);
    hbox.getChildren().add(textButton);
    hbox.getChildren().add(bytesButton);
    setContent(hbox);

    Action action = new JmsMessageAction();
    action.disabledProperty().bind(group.selectedToggleProperty().isNull());

    ButtonBar.setType(action, ButtonBar.ButtonType.OK_DONE);
    getActions().addAll(action, Dialog.Actions.CANCEL);
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:26,代码来源:MessageTypeDialog.java


示例6: createDocumentEditor

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
@ActionProxy(
	id="newdoc", 
	text="New", 
	graphic="font>icomoon|FILE2", 
	longText = "Create New Document")
private DocumentEditor createDocumentEditor() {
    final DocumentEditor editor = new DocumentEditor("");
    Tab tab = new Tab( "New Document" );
    tab.setContent(editor);
    tab.setOnCloseRequest(new EventHandler<Event>() {
        
        public void handle(Event e) {
            
           Dialogs dlg = Dialogs.create().title("Confirmation").message("Close tab?");
           if ( editor.isDirty() && dlg.showConfirm() != Dialog.Actions.YES ){
              e.consume();
           }
            
        }
    });
    
    tabs.getTabs().add(tab);
    tabs.getSelectionModel().select(tab);
    return editor;
}
 
开发者ID:eugener,项目名称:markdown-pad-fx,代码行数:26,代码来源:Start.java


示例7: editFeed

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public void editFeed(Optional<Subscription> feed) {
	SubscriptionForm dialog = SubscriptionForm.create(getBundle())
			.setSubscription(feed.orElse(Subscription.create()));
    	
   	Optional<Action> action = dialog.show();
	if(action.isPresent() && action.get() != Dialog.Actions.CANCEL){
   		l.debug("Got response from dialog");
   		Subscription sub = dialog.getSubscription();
   		SubscriptionRepository.add(sub);
	}
	
	this.onAdd.handle(dumbEvent);
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:14,代码来源:SubscriptionController.java


示例8: show

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public Actions show(final File file) {
	CommandLink overwrite = new CommandLink(
		getTranslation("label.overwrite"),
		getTranslation("message.overwrite")
	);
	
	CommandLink reload = new CommandLink(
		getTranslation("label.reload"),
		getTranslation("message.reload")
	);
	
	CommandLink save = new CommandLink(
		getTranslation("label.save.as"),
		getTranslation("message.save.as")
	);
	
	CommandLink cancel = new CommandLink(
		getTranslation("label.cancel"),
		getTranslation("message.cancel")
	);
	
	Action response = Dialogs.create()
	        .title(getTranslation("label.file.modified"))
	        .masthead(getTranslation("message.file.modified", file.toString()))
	        .message(getTranslation("label.select.option"))
	        .actions(Dialog.Actions.CANCEL)
	        .showCommandLinks(cancel, cancel, save, overwrite, reload);
	
	if(response.equals(overwrite)) return Actions.OVERWRITE;
	if(response.equals(reload)) return Actions.RELOAD;
	if(response.equals(save)) return Actions.SAVE;
	
	return Actions.CANCEL;
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:35,代码来源:ConcurrentFileModificationDialog.java


示例9: deleteMessages

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
private void deleteMessages() {
    ObservableList<JmsMessageViewModel> messagesToDelete = getSelectionModel().getSelectedItems();
    Action response = Dialogs.create().
            title("Delete message").
            message("Delete " + messagesToDelete.size() + " messages?").
            showConfirm();

    if (response != Dialog.Actions.YES) {
        return;
    }

    new HashSet<>(messagesToDelete).forEach(message -> {
        try {
            if (jmsDestinationViewModel.isQueue()) {
                jmsDestinationViewModel.deleteMessage(message);
                getSelectionModel().select(null);
            }
            getItems().remove(message);
        } catch (Exception ex) {
            Dialogs.create()
                    .style(DialogStyle.NATIVE)
                    .owner(null)
                    .title("Delete message")
                    .masthead("Unable to delete message")
                    .message(ex.getMessage())
                    .showWarning();
        }
    });
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:30,代码来源:JmsMessagesTableView.java


示例10: JmsConnectionDialog

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public JmsConnectionDialog() {
    super(null, "Create connection", false, DialogStyle.NATIVE);

    JmsConnection config = new JmsConnection();
    JmsConnectionPanel connectionPanel = new JmsConnectionPanel(jmsProviderManager, config);
    ScrollPane scrollPane = new ScrollPane(connectionPanel);
    scrollPane.setMinHeight(300);
    setContent(scrollPane);

    CreateJmsConnectionAction createAction = new CreateJmsConnectionAction(config);
    ButtonBar.setType(createAction, ButtonBar.ButtonType.OK_DONE);
    getActions().addAll(createAction, Dialog.Actions.CANCEL);

    createAction.disabledProperty().bind(connectionPanel.isValidPropertyProperty().not());
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:16,代码来源:JmsConnectionDialog.java


示例11: handle

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public void handle(ActionEvent event) {
    originalJmsConnectionConfig.setName(clonedJmsConnectionConfig.getName());
    originalJmsConnectionConfig.setJmsProviderId(clonedJmsConnectionConfig.getJmsProviderId());
    originalJmsConnectionConfig.setUserName(clonedJmsConnectionConfig.getUserName());
    originalJmsConnectionConfig.setPassword(clonedJmsConnectionConfig.getPassword());
    originalJmsConnectionConfig.getJmsConnectionProviderParams().clear();
    originalJmsConnectionConfig.getJmsConnectionProviderParams().
            addAll(clonedJmsConnectionConfig.getJmsConnectionProviderParams());

    Dialog d = (Dialog) event.getSource();
    d.hide();
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:13,代码来源:JmsConnectionDialog.java


示例12: handle

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public void handle(ActionEvent event) {
    originalJmsConnectionConfig.setName(clonedJmsConnectionConfig.getName());
    originalJmsConnectionConfig.setRegexp(clonedJmsConnectionConfig.getRegexp());

    Dialog d = (Dialog) event.getSource();
    d.hide();
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:8,代码来源:JmsDestinationFilterDialog.java


示例13: command

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public static String command(Window window, JSObject parameters) {
    if (parameters == null)
        return null;

    Dialogs dialogs = createDefaultDialogs(window);
    applyParameter(dialogs, parameters);

    Action action = dialogs.showCommandLinks(convertToCommandLink(parameters).collect(Collectors.toList()));

    if (Dialog.Actions.CANCEL.equals(action))
        return null;
    else
        return action.textProperty().get();
}
 
开发者ID:nanase,项目名称:Nanasetter,代码行数:15,代码来源:DialogImpl.java


示例14: showAboutDialog

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
@FXML
public void showAboutDialog(ActionEvent actionEvent) {
  Dialog dialog = new Dialog(null, resourceBundle.getString("dialog.title.about"));
  dialog.setMasthead(MASTHEAD_TEXT);
  dialog.setContent(ABOUT_TEXT);
  dialog.setExpandableContent(new TextArea(LICENSE));
  dialog.show();
}
 
开发者ID:frosch95,项目名称:GeoFroggerFX-v1,代码行数:9,代码来源:GeofroggerController.java


示例15: show

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public Optional<Action> show() {
      Dialog dlg = new Dialog(null, getTranslation("message.add.subscription"));
      
      final GridPane content = new GridPane();
      content.setHgap(10);
      content.setVgap(10);
      
      ObservableList<String> portals = FXCollections.observableArrayList(
	PreferencesController.getPortalsList()
);

portalField.setItems(portals);
      portalField.setPrefWidth(400.0);
      portalField.setEditable(true);
      
      portalField.setValue(subscription.getPortal());
portalField.valueProperty().addListener((observable, old, neu) -> {
	subscription.setPortal(neu);
	save.disabledProperty().set(!isValid());
   });

urlField.setText(subscription.getUri());
urlField.textProperty().addListener((observable, old, neu) -> {
	subscription.setURI(neu);
	save.disabledProperty().set(!isValid());
   });

titleField.setText(subscription.getTitle());
titleField.textProperty().addListener((observable, old, neu) -> {
	subscription.setTitle(neu);
	save.disabledProperty().set(!isValid());
   });

historyField.setText(subscription.getHistory().toString());
historyField.textProperty().addListener((observable, old, neu) -> {
	subscription.setHistory(Integer.valueOf(neu));
	save.disabledProperty().set(!isValid());
   });

content.add(new Label(getTranslation("label.title")), 0, 0);
      content.add(titleField, 1, 0);
      GridPane.setHgrow(titleField, Priority.ALWAYS);

      content.add(new Label(getTranslation("label.portal")), 0, 1);
      content.add(portalField, 1, 1);
      
      content.add(new Label(getTranslation("label.feed.url")), 0, 2);
      content.add(urlField, 1, 2);
      GridPane.setHgrow(urlField, Priority.ALWAYS);
      
      content.add(new Label(getTranslation("label.history")), 0, 3);
      content.add(historyField, 1, 3);
      GridPane.setHgrow(historyField, Priority.ALWAYS);
      
      dlg.setResizable(false);
      dlg.setIconifiable(false);
      dlg.setContent(content);
      dlg.getActions().addAll(save, Dialog.Actions.CANCEL);
        
      Platform.runLater(() -> titleField.requestFocus());
      
      l.debug("Showing dialog");
      return Optional.of(dlg.show());
  }
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:65,代码来源:SubscriptionForm.java


示例16: handle

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
@Override
public void handle(ActionEvent event) {
	Dialog d = (Dialog) event.getSource();
       d.hide();
}
 
开发者ID:Eldelshell,项目名称:JobHunter,代码行数:6,代码来源:SubscriptionForm.java


示例17: handle

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
public void handle(ActionEvent event) {
    Dialog d = (Dialog) event.getSource();
    d.hide();
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:5,代码来源:JmsMessagePlaceholderDialog.java


示例18: handle

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
@Override
public void handle(ActionEvent event) {
    Dialog d = (Dialog) event.getSource();
    d.hide();
}
 
开发者ID:Mykolas-Molis,项目名称:mq-visualizer,代码行数:6,代码来源:MessageTypeDialog.java


示例19: ButtonCell

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
ButtonCell(final TableView tableView)
{
    cellButton.setId("button-cell");
    vendaCellbutton.setId("button-cell");

    vendaCellbutton.setOnAction(s ->
    {
        try
        {
            daoVeiculo = new VeiculoDAO();
            
            selectedVeiculo.setVendido(true);
            
            daoVeiculo.save(selectedVeiculo);
            
            String masthead = "Veiculo: "+ selectedVeiculo.getPlaca() +
                    " | " + " Preço: R$" + selectedVeiculo.getValorVeiculo().toString()
                    + " ";
            boolean response;
            response = DialogsHelper.createQuestionDialog(this.getParent()
                    , PrimaryStage.TITTLE, masthead, "Deseja Vender este"
                            + " Veiculo?", Dialog.ACTION_YES
                    , Dialog.ACTION_YES, Dialog.ACTION_NO);
            
            if(response)
            {
                DialogsHelper.createInfoDialog(this.getParent(), PrimaryStage.TITTLE
                        , "", "O Veiculo ["+ selectedVeiculo.getPlaca() + 
                                "] foi vendido com sucesso!");
            }
            else
                return;
            update();
        } 
        catch (Exception e)
        {
            e.printStackTrace();
        }
    });      
    
    cellButton.setOnAction(s ->
    {
        ObservableList<FichaVeiculoTableModel> subTableList 
                = getField_ValueList(selectedVeiculo);
        
        TableColumn colField = new TableColumn("Campo");
        colField.setCellValueFactory(new PropertyValueFactory("field"));
        
        TableColumn colValue = new TableColumn("Valor");
        colValue.setCellValueFactory(new PropertyValueFactory("value"));
        
        TableView<FichaVeiculoTableModel> subTable = new TableView<>();
        subTable.setItems(subTableList);
        subTable.getColumns().addAll(colField, colValue);
        subTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        subTable.setPlaceholder(new Label("Não há veiculos com essa placa!"));
        
        Stage tableDialog = new Stage();
        tableDialog.initModality(Modality.APPLICATION_MODAL);
        tableDialog.getIcons().add(new Image(RESOURCES + "shopcar1.png"));
        
        VBox vBox = new VBox();
        vBox.getChildren().addAll(new Label("Veiculo"), subTable);
        vBox.setAlignment(Pos.CENTER);
        vBox.setPadding(new Insets(10));
        vBox.setPrefSize(400, 400);
        
        vBox.autosize();
        
        Scene tableDialogScene = new Scene(vBox);
        tableDialogScene.setFill(null);
        tableDialogScene.getStylesheets().add(PrimaryStage.STYLESHEET);
        
        tableDialog.setScene(tableDialogScene);
        tableDialog.show();
    });
    
    hBox = new HBox(10);
    hBox.getChildren().addAll(cellButton, vendaCellbutton);
}
 
开发者ID:vfreitas-,项目名称:ShopCarFX-2.0,代码行数:81,代码来源:FichaVeiculoPane.java


示例20: handle

import org.controlsfx.dialog.Dialog; //导入依赖的package包/类
/**
 * Invoked when a specific event of the type for which this handler is
 * registered happens.
 *
 * @param event the event which occurred
 */
@Override
public void handle(ActionEvent event) {
    ((Dialog) event.getSource()).hide();
}
 
开发者ID:nanase,项目名称:Nanasetter,代码行数:11,代码来源:ClosingAction.java



注:本文中的org.controlsfx.dialog.Dialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IChildProcessCallback类代码示例发布时间:2022-05-22
下一篇:
Java ContainerManagerEventType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap