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; }
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 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 invokeExpressionEditor(final int colorIndex) { final Window window = SwingUtilities.getWindowAncestor(this); final String title = "Edit " + getComponentName(colorIndex) + " Expression"; if (product != null) { final ExpressionPane pane; final Product[] products = getCompatibleProducts(product, openedProducts); pane = ProductExpressionPane.createGeneralExpressionPane(products, 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()); } } }
dialog.setContent(parameterPanel); if (dialog.show() == ModalDialog.ID_OK) { return dialogData;
dialog.setContent(parameterPanel); if (dialog.show() == ModalDialog.ID_OK) { return dialogData;
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); } } }
Bundle.CTL_InsertWktGeometryAction_DialogTitle(), ModalDialog.ID_OK_CANCEL, null); modalDialog.setContent(contentPanel); modalDialog.center(); if (modalDialog.show() == ModalDialog.ID_OK) {
final ModalDialog outputParametersDialog = new OutputParametersDialog(appContext.getApplicationWindow(), sourceProduct, workCopy); outputParametersDialog.setContent(form); if (outputParametersDialog.show() == ModalDialog.ID_OK) { outputGeometryModel = workCopy;
information = "The forest cover change output product will take in consideration the cloud masks from these products."; modalDialog.setContent(getModalDialogContent(message, information)); final int show = modalDialog.show(); if (show == ModalDialog.ID_CANCEL) { modalDialog.setContent(getModalDialogContent(message, information)); final int show = modalDialog.show(); if (show == ModalDialog.ID_CANCEL) { modalDialog.setContent(getModalDialogContent(message, information)); final int show = modalDialog.show(); if (show == ModalDialog.ID_CANCEL) {
final ModalDialog outputParametersDialog = new OutputParametersDialog(appContext.getApplicationWindow(), sourceProduct, workCopy); outputParametersDialog.setContent(form); if (outputParametersDialog.show() == ModalDialog.ID_OK) { outputGeometryModel = workCopy;
if (products.length > 1) { ModalDialog dialog = new ModalDialog(null, "Product Selector", ModalDialog.ID_OK_CANCEL, ""); dialog.setContent(createDialogContent(products)); final int show = dialog.show(); if (show == ModalDialog.ID_CANCEL) {
@Override public void actionPerformed(ActionEvent e) { ProductNode productNode = SnapApp.getDefault().getSelectedProductNode(SnapApp.SelectionSourceHint.VIEW); if (productNode == null) { return; } Product product = productNode.getProduct(); if (product != null) { 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) { createDefaultVectorDataNode(product, dialogData.name, dialogData.description); } } }