java.awt.ItemSelectable Java Examples

The following examples show how to use java.awt.ItemSelectable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CheckBoxNodeEditor.java    From ET_Redux with Apache License 2.0 6 votes vote down vote up
/**
 *
 * @param tree
 * @param value
 * @param selected
 * @param expanded
 * @param leaf
 * @param row
 * @return
 */
@Override
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected,
        boolean expanded, boolean leaf, int row) {

    Component editor = renderer.getTreeCellRendererComponent(tree, value, true, expanded, leaf,
            row, true);

    ItemListener itemListener = (ItemEvent itemEvent) -> {
        if (stopCellEditing()) {
            fireEditingStopped();
        }
    };
    if (editor instanceof JCheckBox) {
        ((ItemSelectable) editor).addItemListener(itemListener);
    }
    return editor;
}
 
Example #2
Source File: Transfer.java    From evosql with Apache License 2.0 5 votes vote down vote up
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
 
Example #3
Source File: BasicSearchForm.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    ItemSelectable is = e.getItemSelectable();
    if (is == matchCase) {
        matchCaseChanged();
    } else if (is == textToFindType) {
        regexpChanged();
    }
}
 
Example #4
Source File: ItemEvent.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #5
Source File: ItemEvent.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #6
Source File: ItemEvent.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #7
Source File: ItemEvent.java    From Java8CN with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #8
Source File: ItemEvent.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #9
Source File: ItemEvent.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #10
Source File: ItemEvent.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #11
Source File: ItemEvent.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #12
Source File: ItemEvent.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #13
Source File: ItemEvent.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #14
Source File: ItemEvent.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #15
Source File: ItemEvent.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #16
Source File: ItemEvent.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #17
Source File: ItemEvent.java    From jdk8u-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #18
Source File: ItemEvent.java    From jdk-1.7-annotated with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #19
Source File: ItemEvent.java    From jdk-1.7-annotated with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #20
Source File: ItemEvent.java    From jdk8u-dev-jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #21
Source File: ItemEvent.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #22
Source File: ItemEvent.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #23
Source File: ItemEvent.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #24
Source File: ItemEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #25
Source File: ItemEvent.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #26
Source File: ItemEvent.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #27
Source File: ItemEvent.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #28
Source File: ItemEvent.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}
 
Example #29
Source File: ItemEvent.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the originator of the event.
 *
 * @return the ItemSelectable object that originated the event.
 */
public ItemSelectable getItemSelectable() {
    return (ItemSelectable)source;
}
 
Example #30
Source File: ItemEvent.java    From JDKSourceCode1.8 with MIT License 2 votes vote down vote up
/**
 * Constructs an <code>ItemEvent</code> object.
 * <p> This method throws an
 * <code>IllegalArgumentException</code> if <code>source</code>
 * is <code>null</code>.
 *
 * @param source The <code>ItemSelectable</code> object
 *               that originated the event
 * @param id           The integer that identifies the event type.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @param item   An object -- the item affected by the event
 * @param stateChange  An integer that indicates whether the item was
 *               selected or deselected.
 *                     For information on allowable values, see
 *                     the class description for {@link ItemEvent}
 * @throws IllegalArgumentException if <code>source</code> is null
 * @see #getItemSelectable()
 * @see #getID()
 * @see #getStateChange()
 */
public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
    super(source, id);
    this.item = item;
    this.stateChange = stateChange;
}