Examples of ComboBoxProcessor


Examples of org.sodbeans.controller.impl.processors.ComboBoxProcessor

    @SuppressWarnings("empty-statement")
    protected SpeechProcessor getKeyEventProcessor() {
        if (box == null)
            return new NullProcessor();

        ComboBoxProcessor proc = new ComboBoxProcessor();
        Object o = box.getSelectedItem();
        String sayString = null;
        Accessible acc = null;

        proc.setKeyEvent(true);

        if(box.getAccessibleContext() != null &&
                box.getAccessibleContext().getAccessibleSelection() != null &&
                box.getAccessibleContext().getAccessibleSelection().getAccessibleSelection(0) != null)
            acc = box.getAccessibleContext().getAccessibleSelection().getAccessibleSelection(0);
        else if(o != null)
            sayString = o.toString();

        if(acc != null) {
             sayString = acc.getAccessibleContext().getAccessibleName();
        }
        else if(o instanceof FileFilter) {
            FileFilter file = (FileFilter) o;
            sayString = file.getDescription();

            //speakString = classReflection(o,"javax.swing.filechooser.FileFilter","getDescription");
        }
        //Our combobox is most likely a Win32ShellFolder, do some
        //Java reflection.
        else if(o instanceof sun.awt.shell.ShellFolder) {
            //preferable as it accounts
            sun.awt.shell.ShellFolder folder = (sun.awt.shell.ShellFolder)o;
            sayString = folder.getDisplayName();

            //just in case, hold on to this
            //speakString = classReflection(o,"sun.awt.shell.Win32ShellFolder2","getDisplayName");
        }
        else if(o instanceof SourceGroup) {
            SourceGroup group = (SourceGroup)o;
            sayString = group.getDisplayName();
        }
        else if(o instanceof Project) {
            Project proj = (Project) o;
            ProjectInformation info = proj.getLookup().lookup(ProjectInformation.class);
            sayString = info.getDisplayName();
        }

        if(sayString != null) {//null values for separators?
             proc.setText(sayString);
        }
        else {
            proc.setSeparator(true);
        }

        return proc;
    }
View Full Code Here

Examples of org.sodbeans.controller.impl.processors.ComboBoxProcessor

    @Override
    protected SpeechProcessor getFocusEventProcessor() {
        if (box == null)
            return new NullProcessor();

        ComboBoxProcessor proc = new ComboBoxProcessor();
        proc.setKeyEvent(false);
        String accessibleDesc = null;
        String name = null;

        accessibleDesc = box.getAccessibleContext().getAccessibleDescription();
        name = box.getAccessibleContext().getAccessibleName();

        if(accessibleDesc != null)
            proc.setText(accessibleDesc);
        else if (name != null)
            proc.setText(name);
        else if(box.getName() != null)
            proc.setText(box.getName());

        return proc;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.