This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 198417
Collapse All | Expand All

(-)openide.dialogs/src/org/openide/Bundle.properties (+2 lines)
Lines 62-67 Link Here
62
NTF_InformationTitle=Information
62
NTF_InformationTitle=Information
63
NTF_WarningTitle=Warning
63
NTF_WarningTitle=Warning
64
64
65
NTF_WholeMessage_Title=Notification Message
66
65
#
67
#
66
# Dialog system
68
# Dialog system
67
#
69
#
(-)openide.dialogs/src/org/openide/WizardDescriptor.java (-2 / +50 lines)
Lines 2518-2523 Link Here
2518
    /** Wizard panel. Allows auto layout of content, wizard panel name and input panel.
2518
    /** Wizard panel. Allows auto layout of content, wizard panel name and input panel.
2519
     */
2519
     */
2520
    private static class WizardPanel extends JPanel {
2520
    private static class WizardPanel extends JPanel {
2521
        /** Ellipsis Character */
2522
        public static final String ELLIPSE = "\u2026";
2523
        
2524
        /** Panel to show error messages */
2525
        private JPanel errorPanel = new JPanel(new BorderLayout());
2526
        
2527
        /** Hold error/warning/info messages */
2528
        private String message;
2529
        private int messageType;
2530
        
2521
        /** Users panel is inserted into this panel. */
2531
        /** Users panel is inserted into this panel. */
2522
        private JPanel rightPanel = new JPanel(new BorderLayout());
2532
        private JPanel rightPanel = new JPanel(new BorderLayout());
2523
2533
Lines 2637-2649 Link Here
2637
                nbInfoForeground = UIManager.getColor("Label.foreground"); //NOI18N
2647
                nbInfoForeground = UIManager.getColor("Label.foreground"); //NOI18N
2638
            }
2648
            }
2639
2649
2640
            JPanel errorPanel = new JPanel(new BorderLayout());
2641
            errorPanel.setBorder(BorderFactory.createEmptyBorder(0, 12, 12, 11));
2650
            errorPanel.setBorder(BorderFactory.createEmptyBorder(0, 12, 12, 11));
2642
            messagePane = new FixedHeightPane ();
2651
            messagePane = new FixedHeightPane ();
2643
            messagePane.setForeground (nbErrorForeground);
2652
            messagePane.setForeground (nbErrorForeground);
2644
            iconLabel = new FixedHeightLabel ();
2653
            iconLabel = new FixedHeightLabel ();
2654
            JButton ellipsisbutton = new JButton(ELLIPSE);
2655
            ellipsisbutton.setMargin(new Insets(0, 0, 0, 0));
2656
            ellipsisbutton.addActionListener(new ActionListener() {
2657
                @Override
2658
                public void actionPerformed(ActionEvent ae) {
2659
                    showFullMessage();
2660
                }
2661
            });
2645
            errorPanel.add(iconLabel, BorderLayout.LINE_START);
2662
            errorPanel.add(iconLabel, BorderLayout.LINE_START);
2646
            errorPanel.add(messagePane, BorderLayout.CENTER);
2663
            errorPanel.add(messagePane, BorderLayout.CENTER);
2664
            errorPanel.add(ellipsisbutton, BorderLayout.LINE_END);
2647
2665
2648
            progressBarPanel = new JPanel (new BorderLayout ());
2666
            progressBarPanel = new JPanel (new BorderLayout ());
2649
            progressBarPanel.setVisible (false);
2667
            progressBarPanel.setVisible (false);
Lines 2671-2676 Link Here
2671
            fullRightPanel.add(labelPanel, BorderLayout.NORTH);
2689
            fullRightPanel.add(labelPanel, BorderLayout.NORTH);
2672
            fullRightPanel.add(rightPanel, BorderLayout.CENTER);
2690
            fullRightPanel.add(rightPanel, BorderLayout.CENTER);
2673
            fullRightPanel.add(errorPanel, BorderLayout.SOUTH);
2691
            fullRightPanel.add(errorPanel, BorderLayout.SOUTH);
2692
            errorPanel.setVisible(false);
2674
2693
2675
            // #65506: the wizard panel should fit into window w/o scrollbar
2694
            // #65506: the wizard panel should fit into window w/o scrollbar
2676
            add(fullRightPanel, BorderLayout.CENTER);
2695
            add(fullRightPanel, BorderLayout.CENTER);
Lines 2683-2689 Link Here
2683
            }
2702
            }
2684
        }
2703
        }
2685
2704
2705
        private void showFullMessage() {
2706
            String text = message;
2707
            if (!text.toUpperCase().startsWith("<HTML>")) { // NOI18N
2708
                text = "<HTML>" + text; // NOI18N
2709
            }
2710
            NotifyDescriptor nd = new NotifyDescriptor(
2711
                    text,
2712
                    NbBundle.getBundle(WizardDescriptor.class).getString("NTF_WholeMessage_Title"),
2713
                    NotifyDescriptor.OK_CANCEL_OPTION,
2714
                    NotifyDescriptor.INFORMATION_MESSAGE,
2715
                    new Object[]{OK_OPTION},
2716
                    OK_OPTION);
2717
            switch (messageType) {
2718
                default:
2719
                case MSG_TYPE_INFO:
2720
                    // already done
2721
                    break;
2722
                case MSG_TYPE_WARNING:
2723
                    nd.setMessageType(NotifyDescriptor.WARNING_MESSAGE);
2724
                    break;
2725
                case MSG_TYPE_ERROR:
2726
                    nd.setMessageType(NotifyDescriptor.ERROR_MESSAGE);
2727
                    break;
2728
            }
2729
            DialogDisplayer.getDefault().notify(nd);
2730
        }
2731
        
2686
        public void setMessage(int msgType, String msg) {
2732
        public void setMessage(int msgType, String msg) {
2733
            this.message = msg;
2734
            this.messageType = msgType;
2687
            if (msg != null && msg.trim().length() > 0) {
2735
            if (msg != null && msg.trim().length() > 0) {
2688
                switch (msgType) {
2736
                switch (msgType) {
2689
                    case MSG_TYPE_ERROR:
2737
                    case MSG_TYPE_ERROR:
Lines 2727-2733 Link Here
2727
            iconLabel.setForeground(fgColor);
2775
            iconLabel.setForeground(fgColor);
2728
            messagePane.setForeground(fgColor);
2776
            messagePane.setForeground(fgColor);
2729
            messagePane.setText(message);
2777
            messagePane.setText(message);
2730
            messagePane.setFocusable(message != null);
2778
            errorPanel.setVisible(message != null);
2731
        }
2779
        }
2732
2780
2733
        private void setProgressComponent (JComponent progressComp, final JLabel progressLabel) {
2781
        private void setProgressComponent (JComponent progressComp, final JLabel progressLabel) {

Return to bug 198417