Package java.awt

Examples of java.awt.Dialog$AccessibleAWTDialog


    }

    @Test
    public void testShouldIgnoreOnIgnoredNames() {
        new JFrame();
        Dialog window1 = new MockWindow("window1");
        assertTrue(!WindowMonitor.getInstance().shouldIgnore(window1));
        window1.setName(WindowMonitor.IGNORED_COMPONENT_NAME);
        assertTrue(WindowMonitor.getInstance().shouldIgnore(window1));
        Dialog window2 = new MockWindow("window2", window1);
        assertTrue(WindowMonitor.getInstance().shouldIgnore(window2));
    }
View Full Code Here


                if (w.isResizable()) {
                    bounds = w.getBounds();
                }
            }
        } else if (window instanceof Dialog) {
            Dialog w = (Dialog) window;
            if (w.isUndecorated()) {
                // take this to mean: resizing and maximising isn't allowed
            } else {
                if (w.isResizable()) {
                    bounds = w.getBounds();
                }
                // No state to capture for dialogs - cannot maximise etc.
            }
        }
    }
View Full Code Here

     * Cancel.  The returned value indicates which response
     * was chosen.
     */
    private static byte askSave(Frame parent, String fileName) {

        Dialog dialog = new Dialog(parent, true);
        dialog.setLayout(new GridLayout(0, 1));
       
        String pattern = ResourceUtils.getString(EditorResources.SAVE_MSG);
        String text = MessageFormat.format(pattern, new Object[] {fileName});
        dialog.add(new Label(text, Label.CENTER));
       
        Button yes = new Button(ResourceUtils.getString(EditorResources.YES));
        Button no = new Button(ResourceUtils.getString(EditorResources.NO));
        Button cancel = new Button(ResourceUtils.getString(EditorResources.CANCEL));

        Panel panel = new Panel();
        panel.add(yes);
        panel.add(no);
        panel.add(cancel);
        dialog.add(panel);

        DialogListener listener = new DialogListener(dialog, yes, no, cancel);

        dialog.setSize(220, 130);
        dialog.show();

        return listener.getState();
    }
View Full Code Here

                    renderDimensions(g, getBounds(),
                                     this.getGraphicsConfiguration());
                }
            };
        } else if (useFSDialog) {
            fsWindow = new Dialog((Frame)null, "FS Dialog on device "+dev, false,
                                 dev.getDefaultConfiguration());
            fsWindow.add(new Component() {
                public void paint(Graphics g) {
                    renderDimensions(g, getBounds(),
                                     this.getGraphicsConfiguration());
View Full Code Here

      }
      if(e.getSource() instanceof Dialog) {
        switch(e.getID()) {
          case WindowEvent.WINDOW_OPENED:
          case ComponentEvent.COMPONENT_SHOWN:
            Dialog d = (Dialog)e.getSource();
            dialogList.remove(d);
            dialogList.add(d);
            break;
          case WindowEvent.WINDOW_CLOSED:
          case ComponentEvent.COMPONENT_HIDDEN:
            dialogList.remove(e.getSource());
            break;
        }
        switch(e.getID()) {
          case WindowEvent.WINDOW_OPENED:
          case WindowEvent.WINDOW_CLOSED:
          case ComponentEvent.COMPONENT_SHOWN:
          case ComponentEvent.COMPONENT_HIDDEN:
            computeBlockedDialogs();
            isAdjusting = true;
            break;
        }
      }
      if(isAdjusting) {
        adjustNativeComponents();
      }
      // Dialogs mess the focus: when the default focusable component is not the native component,
      // clicking the native component has the effect of losing the focus of the dialog, then
      // regaining it but on the default component. Hence it is very hard to actually give focus to
      // the native component.
      // The fix is to prevent the window from being focusable for a short amount of time when it
      // loses focus. The effect is that the native component can gain focus and retargetting does
      // not happen.
      switch(e.getID()) {
        case WindowEvent.WINDOW_LOST_FOCUS:
          if(e.getSource() instanceof Dialog) {
            final Dialog d = (Dialog)e.getSource();
            if(d.getFocusableWindowState()) {
              d.setFocusableWindowState(false);
              Thread t = new Thread("Dialog focus fixer") {
                @Override
                public void run() {
                  try {
                    sleep(125);
                  } catch (InterruptedException e) {
                  }
                  SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                      d.setFocusableWindowState(true);
                    }
                  });
                }
              };
              t.setDaemon(true);
View Full Code Here

        }
      }
      if(Utils.IS_JAVA_6_OR_GREATER) {
        // Consider that last in the list block previous ones.
        for(int i=dialogList.size()-1; i>=0; i--) {
          Dialog dialog = dialogList.get(i);
          if(dialog.isVisible() && !blockedWindowSet.contains(dialog)) {
            switch(dialog.getModalityType()) {
              case DOCUMENT_MODAL:
                // Block all windows that have same owner but are not a descendant of this dialog.
                Window hierarchyOwnerWindow = dialog.getOwner();
                for(Window owner = hierarchyOwnerWindow; owner != null; owner = owner.getOwner()) {
                  hierarchyOwnerWindow = owner;
                }
                if(hierarchyOwnerWindow != null) {
                  for(Window window: windows) {
View Full Code Here

        }

        DialogDescriptor dd = new DialogDescriptor(configuror,
            ConfigurePanel.DIALOG_TITLE);
       
        Dialog dialog = TopManager.getDefault().createDialog(dd);
        dialog.show();
       
        if (dd.getValue() == DialogDescriptor.OK_OPTION) {
            try {
                ParcelDescriptor descriptor = configuror.getConfiguration();
                descriptor.write();
View Full Code Here

        }
    }

    public void handle(Callback[] callbacks) throws IOException,
            UnsupportedCallbackException {
        Dialog df = new DialogCallbackHandlerDialoge(callbacks);
        df.setModal(true);
        df.setVisible(true);
    }
View Full Code Here

        }

        DialogDescriptor dd = new DialogDescriptor(configuror,
            ConfigurePanel.DIALOG_TITLE);
       
        Dialog dialog = TopManager.getDefault().createDialog(dd);
        dialog.show();
       
        if (dd.getValue() == DialogDescriptor.OK_OPTION) {
            try {
                ParcelDescriptor descriptor = configuror.getConfiguration();
                descriptor.write();
View Full Code Here

        org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor (
            panel,
            bundle.getString ("CTL_Watch_Title") // NOI18N
        );
        dd.setHelpCtx (new HelpCtx ("debug.add.watch"));
        Dialog dialog = DialogDisplayer.getDefault ().createDialog (dd);
        dialog.setVisible(true);
        dialog.dispose ();

        if (dd.getValue() != org.openide.DialogDescriptor.OK_OPTION) return;
        String watch = textField.getText();
        if ((watch == null) || (watch.trim ().length () == 0)) {
            return;
View Full Code Here

TOP

Related Classes of java.awt.Dialog$AccessibleAWTDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.