public ModalDialog(Window parent, String title, Object content, int buttonMask, Object[] otherButtons, String helpID) { this(parent, title, buttonMask, otherButtons, helpID); setContent(content); }
static private VectorDataLayer showSelectLayerDialog(ProductSceneView productSceneView, List<Layer> layers) { String[] layerNames = new String[layers.size()]; for (int i = 0; i < layerNames.length; i++) { layerNames[i] = layers.get(i).getName(); } JList<String> listBox = new JList<>(layerNames); JPanel panel = new JPanel(new BorderLayout(4, 4)); panel.add(new JLabel("Please select a vector data container:"), BorderLayout.NORTH); panel.add(new JScrollPane(listBox), BorderLayout.CENTER); ModalDialog dialog = new ModalDialog(SwingUtilities.getWindowAncestor(productSceneView), "Select Vector Data Container", ModalDialog.ID_OK_CANCEL_HELP, ""); dialog.setContent(panel); int i = dialog.show(); if (i == ModalDialog.ID_OK) { final int index = listBox.getSelectedIndex(); if (index >= 0) { return (VectorDataLayer) layers.get(index); } } return null; }
private void showSystemDialog() { final ModalDialog modalDialog = new ModalDialog(getJDialog(), "System Info", ID_OK, null); final Object[][] sysInfo = getSystemInfo(); final JTable sysTable = new JTable(sysInfo, new String[]{"Property", "Value"}); /*I18N*/ final JScrollPane systemScroll = new JScrollPane(sysTable); systemScroll.setPreferredSize(new Dimension(400, 400)); modalDialog.setContent(systemScroll); modalDialog.show(); }
detailsWindow.setContent(content); return detailsWindow;
public boolean showDialog(Window parent, String title, String helpId) { ModalDialog modalDialog = new ModalDialog(parent, title, ModalDialog.ID_OK_CANCEL_HELP, helpId); modalDialog.setContent(this); final int status = modalDialog.show(); modalDialog.getJDialog().dispose(); return status == ModalDialog.ID_OK; }
private void showInformationDialog(String title, Component component) { final ModalDialog modalDialog = new ModalDialog(UIUtils.getRootWindow(parentComponent), title, AbstractDialog.ID_OK, null); /*I18N*/ modalDialog.setContent(component); modalDialog.show(); }
private void showCreditsDialog() { final ModalDialog modalDialog = new ModalDialog(getJDialog(), "Credits", ID_OK, null); /*I18N*/ final String credits = getCreditsHtml(); final JLabel creditsPane = new JLabel(credits); /*I18N*/ modalDialog.setContent(creditsPane); modalDialog.show(); }
private void invokeExpressionEditor(final int colorIndex) { final Window window = SwingUtilities.getWindowAncestor(this); final String title = "Edit " + COLOR_COMP_NAMES[colorIndex] + " Expression"; if (product != null) { final ExpressionPane pane; pane = ProductExpressionPane.createGeneralExpressionPane(new Product[]{product}, product, preferences); pane.setCode(getExpression(colorIndex)); int status = pane.showModalDialog(window, title); if (status == ModalDialog.ID_OK) { setExpression(colorIndex, pane.getCode()); } } else { final JTextArea textArea = new JTextArea(8, 48); textArea.setFont(EXPRESSION_FONT); textArea.setLineWrap(true); textArea.setWrapStyleWord(true); textArea.setText(getExpression(colorIndex)); final ModalDialog modalDialog = new ModalDialog(window, title, ModalDialog.ID_OK_CANCEL, ""); final JPanel panel = new JPanel(new BorderLayout(2, 2)); panel.add(new JLabel("Expression:"), BorderLayout.NORTH); panel.add(new JScrollPane(textArea), BorderLayout.CENTER); modalDialog.setContent(panel); final int status = modalDialog.show(); if (status == ModalDialog.ID_OK) { setExpression(colorIndex, textArea.getText()); } } }
modalDialog.setContent(contentPanel); modalDialog.center(); modalDialog.show();
@Override public void actionPerformed(ActionEvent e) { final String operationName = model.operationWrapper.getName(); final ModalDialog modalDialog = new ModalDialog(parent, operationName + " - Parameters", ModalDialog.ID_OK_CANCEL, null); final ParameterValueGroup workCopy = model.parameters.clone(); final PropertyContainer propertyContainer = createValueContainer(workCopy); modalDialog.setContent(new PropertyPane(propertyContainer).createPanel()); if (modalDialog.show() == AbstractDialog.ID_OK) { vc.setValue(PARAMETERS, workCopy); } } }
modalDialog.setContent(contentPanel); modalDialog.center(); if (modalDialog.show() == ModalDialog.ID_OK) {
dialog.setContent(parameterPanel); if (dialog.show() == ModalDialog.ID_OK) { return dialogData;
final ModalDialog outputParametersDialog = new OutputParametersDialog(appContext.getApplicationWindow(), sourceProduct, workCopy); outputParametersDialog.setContent(form); if (outputParametersDialog.show() == ModalDialog.ID_OK) { outputGeometryModel = workCopy;
public VectorDataNode run() { Product product = VisatApp.getApp().getSelectedProduct(); DialogData dialogData = new DialogData(product.getVectorDataGroup()); PropertySet propertySet = PropertyContainer.createObjectBacked(dialogData); propertySet.getDescriptor("name").setNotNull(true); propertySet.getDescriptor("name").setNotEmpty(true); propertySet.getDescriptor("name").setValidator(new NameValidator(product)); propertySet.getDescriptor("description").setNotNull(true); final PropertyPane propertyPane = new PropertyPane(propertySet); JPanel panel = propertyPane.createPanel(); panel.setPreferredSize(new Dimension(400, 100)); ModalDialog dialog = new MyModalDialog(propertyPane); dialog.setContent(panel); int i = dialog.show(); if (i == ModalDialog.ID_OK) { return createDefaultVectorDataNode(product, dialogData.name, dialogData.description); } else { return null; } }