Package org.jitterbit.ui.selection

Examples of org.jitterbit.ui.selection.IndexedSelection


     * are deletable according to {@link #canRowBeDeleted(int) canRowBeDeleted}.
     *
     */
    @Override
    protected final void handleSelectionChange() {
        IndexedSelection sel = getSelection();
        if (sel.isEmpty()) {
            setEnabled(false);
        }
        else {
            setEnabled(areAllSelectedRowsDeletable(sel));
        }
View Full Code Here


    protected final void handleSelectionChange() {
        setEnabled(getSelectedTestResult() != null);
    }

    private EntityTestResult getSelectedTestResult() {
        IndexedSelection sel = (IndexedSelection) getSelection();
        if (sel.size() != 1) {
            return null;
        }
        Object head = sel.head();
        return (head instanceof EntityTestResult) ? (EntityTestResult) head : null;
    }
View Full Code Here

            }
        });
    }

    private WsdlFile getSelectedFile() {
        IndexedSelection selection = wsdlList.getSelection();
        Object selected = selection.head();
        return (selected instanceof WsdlFileListItem) ? ((WsdlFileListItem) selected).file : null;
    }
View Full Code Here

    public void setSelectedEditor(Editor e) {
        editorList.setSelectedEditor(e);
    }

    public Editor getSelectedEditor() {
        IndexedSelection sel = editorList.getSelection();
        return sel.isEmpty() ? null : (Editor) sel.head();
    }
View Full Code Here

    private final class SelectionRouter implements SelectionListener {

        @Override
        public void selectionChanged(SelectionChangedEvent evt) {
            IndexedSelection sel = (IndexedSelection) evt.getSelection();
            if (!sel.isEmpty()) {
                Editor editor = (Editor) sel.head();
                fireTemporarySelection(editor);
            }
        }
View Full Code Here

            }
        });
    }
   
    public DriverDescriptor getSelectedDriver() {
        IndexedSelection selection = list.getSelection();
        Object o = selection.head();
        if (o instanceof DriverDescriptorUi) {
            return ((DriverDescriptorUi) o).getDriver();
        }
        return null;
    }
View Full Code Here

            }
        }

        private List<InvalidMapping> removeSelectedRows() {
            List<InvalidMapping> removed = Lists.newArrayList();
            IndexedSelection sel = (IndexedSelection) getSelection();
            int[] indeces = sel.indeces();
            for (int n = indeces.length - 1; n >= 0; --n) {
                int row = indeces[n];
                removed.add(tableModel.getRowObjectAt(row));
                tableModel.deleteRow(row);
            }
View Full Code Here

        list.setSelectionMode(mode);
    }
   
    @Override
    public LdapStructureAttribute[] getSelectedAttributes() {
        IndexedSelection sel = list.getSelection();
        if (sel.isEmpty()) {
            return new LdapStructureAttribute[0];
        }
        List<LdapStructureAttribute> attrs = new ArrayList<LdapStructureAttribute>();
        for (Object o : sel.items()) {
            if (o instanceof LdapStructureAttribute) {
                attrs.add((LdapStructureAttribute) o);
            }
        }
        return attrs.toArray(new LdapStructureAttribute[attrs.size()]);
View Full Code Here

        fireCancelled();
        hide();
    }

    private void finalSelectionMade() {
        IndexedSelection selection = itemList.getSelection();
        hide();
        int index = selection.headIndex();
        T object = (index >= 0 ? items[index] : null);
        for (ListSelectorWindowListener<T> lst : listeners) {
            lst.done(object);
        }
    }
View Full Code Here

        }
        this.mode = mode;
    }

    private void ensureSingleSelection() {
        IndexedSelection sel = selSource.getSelection();
        if (sel.size() > 1) {
            selSource.setSelection(SelectionFactory.newIndexedSelection(sel.head(), sel.headIndex()));
        }
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.ui.selection.IndexedSelection

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.