亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jlistbinding.java

?? java屬性邦定的(JSR-295)的一個實現
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Copyright (C) 2007 Sun Microsystems, Inc. All rights reserved. Use is
 * subject to license terms.
 */

package org.jdesktop.swingbinding;

import javax.swing.*;
import javax.swing.event.*;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jdesktop.beansbinding.AutoBinding;
import org.jdesktop.beansbinding.ObjectProperty;
import org.jdesktop.beansbinding.Property;
import org.jdesktop.beansbinding.PropertyStateEvent;
import org.jdesktop.beansbinding.PropertyStateListener;
import org.jdesktop.swingbinding.impl.AbstractColumnBinding;
import org.jdesktop.swingbinding.impl.ListBindingManager;
import static org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.*;

/**
 * Binds a {@code List} of objects to act as the elements of a {@code JList}.
 * Each object in the source {@code List} provides one element in the {@code JList}.
 * By setting a {@link org.jdesktop.swingbinding.JListBinding.DetailBinding DetailBinding}
 * you can specify the property to use to derive each list element from its
 * corresponding object in the source {@code List}. The default {@code DetailBinding} uses
 * the objects directly. Instances of {@code JListBinding} are obtained by
 * calling one of the {@code createJListBinding} methods in the {@code SwingBindings}
 * class.
 * <p>
 * Here is an example of creating a binding from a {@code List} of {@code Person}
 * objects to a {@code JList}:
 * <p>
 * <pre><code>
 *    // create the person list
 *    List<Person> people = createPersonList();
 *
 *    // create the binding from List to JList
 *    JListBinding lb = SwingBindings.createJListBinding(READ, people, jList);
 *
 *    // define the property to be used to derive list elements
 *    ELProperty fullNameP = ELProperty.create("${firstName} ${lastName}");
 *
 *    // add the detail binding
 *    lb.setDetailBinding(fullNameP);
 *
 *    // realize the binding
 *    lb.bind();
 * </code></pre>
 * <p>
 * The {@code JList} target of a {@code JListBinding} acts as a live view of
 * the objects in the source {@code List}, regardless of the update strategy (the
 * meaning of the update strategy is <a href="#CLARIFICATION">clarified later</a>
 * in this document). {@code JListBinding} listens to the property specified for
 * any {@code DetailBinding}, for all objects in the {@code List}, and updates
 * the values displayed in the {@code JList} in response to change. If the
 * {@code List} is an instance of {@code ObservableList}, then changes to the
 * {@code List} contents (such as adding, removing or replacing an object) are
 * also reflected in the {@code JList}. <b>Important:</b> Changing the contents
 * of a non-observable {@code List} while it is participating in a
 * {@code JListBinding} is unsupported, resulting in undefined behavior and
 * possible exceptions.
 * <p>
 * <a name="CLARIFICATION">{@code JListBinding} requires</a>
 * extra clarification on the operation of the
 * {@code refresh} and {@code save} methods and the meaning of the update
 * strategy. The target property of a {@code JListBinding} is not the
 * target {@code JList} property provided in the constructor, but rather a
 * private synthetic property representing the {@code List} of objects to show
 * in the target {@code JList}. This synthetic property is readable/writeable
 * only when the {@code JListBinding} is bound and the target {@code JList}
 * property is readable with a {@code non-null} value.
 * <p>
 * It is this private synthetic property on which the {@code refresh} and
 * {@code save} methods operate; meaning that these methods simply cause syncing
 * between the value of the source {@code List} property and the value of the
 * synthetic target property (representing the {@code List} to be shown in the
 * target {@code JList}). These methods do not, therefore, have anything to do
 * with refreshing <i>values</i> in the {@code JList}. Likewise, the update
 * strategy, which simply controls when {@code refresh} and {@code save} are
 * automatically called, also has nothing to do with refreshing <i>values</i>
 * in the {@code JList}.
 * <p>
 * <b>Note:</b> At the current time, the {@code READ_WRITE} update strategy
 * is not useful for {@code JListBinding}. To prevent unwanted confusion,
 * {@code READ_WRITE} is translated to {@code READ} by {@code JListBinding's}
 * constructor.
 * <p>
 * {@code JListBinding} works by installing a custom model on the target
 * {@code JList}, as appropriate, to represent the source {@code List}. The
 * model is installed on a target {@code JList} with the first succesful call
 * to {@code refresh} with that {@code JList} as the target. Subsequent calls
 * to {@code refresh} update the elements in this already-installed model.
 * The model is uninstalled from a target {@code JList} when either the
 * {@code JListBinding} is unbound or when the target {@code JList} property
 * changes to no longer represent that {@code JList}. Note: When the model is
 * uninstalled from a {@code JList}, it is replaced with a {@code DefaultListModel},
 * in order to leave the {@code JList} functional.
 * <p>
 * Some of the above is easier to understand with an example. Let's consider
 * a {@code JListBinding} ({@code binding}), with update strategy
 * {@code READ}, between a property representing a {@code List} ({@code listP})
 * and a property representing a {@code JList} ({@code jListP}). {@code listP}
 * and {@code jListP} both start off readable, referring to a {@code non-null}
 * {@code List} and {@code non-null} {@code JList} respectively. Let's look at
 * what happens for each of a sequence of events:
 * <p>
 * <table border=1>
 *   <tr><th>Sequence</th><th>Event</th><th>Result</th></tr>
 *   <tr valign="baseline">
 *     <td align="center">1</td>
 *     <td>explicit call to {@code binding.bind()}</td>
 *     <td>
 *         - synthetic target property becomes readable/writeable
 *         <br>
 *         - {@code refresh()} is called
 *         <br>
 *         - model is installed on target {@code JList}, representing list of objects
 *     </td>
 *   </tr>
 *   <tr valign="baseline">
 *     <td align="center">2</td>
 *     <td>{@code listP} changes to a new {@code List}</td>
 *     <td>
 *         - {@code refresh()} is called
 *         <br>
 *         - model is updated with new list of objects
 *     </td>
 *   </tr>
 *   <tr valign="baseline">
 *     <td align="center"><a name="STEP3" href="#NOTICE">3</a></td>
 *     <td>{@code jListP} changes to a new {@code JList}</td>
 *     <td>
 *         - model is uninstalled from old {@code JList}
 *     </td>
 *   </tr>
 *   <tr valign="baseline">
 *     <td align="center">4</td>
 *     <td>explicit call to {@code binding.refresh()}</td>
 *     <td>
 *         - model is installed on target {@code JList}, representing list of objects
 *     </td>
 *   </tr>
 *   <tr valign="baseline">
 *     <td align="center">5</td>
 *     <td>{@code listP} changes to a new {@code List}</td>
 *     <td>
 *         - {@code refresh()} is called
 *         <br>
 *         - model is updated with new list of objects
 *     </td>
 *   </tr>
 *   <tr valign="baseline">
 *     <td align="center">6</td>
 *     <td>explicit call to {@code binding.unbind()}</td>
 *     <td>
 *         - model is uninstalled from target {@code JList}
 *     </td>
 *   </tr>
 * </table>
 * <p>
 * <a name="NOTICE">Notice</a> that in <a href="#STEP3">step 3</a>, when the value
 * of the {@code JList} property changed, the new {@code JList} did not
 * automatically get the model with the elements applied to it. A change to the
 * target value should not cause an {@code AutoBinding} to sync the target from
 * the source. Step 4 forces a sync by explicitly calling {@code refresh}.
 * Alternatively, it could be caused by any other action that results
 * in a {@code refresh} (for example, the source property changing value, or an
 * explicit call to {@code unbind} followed by {@code bind}).
 * <p>
 * {@code DetailBindings} are managed by the {@code JList}. They are not
 * to be explicitly bound, unbound, added to a {@code BindingGroup}, or accessed
 * in a way that is not allowed for a managed binding.
 * <p>
 * In addition to binding the elements of a {@code JList}, it is possible to
 * bind to the selection of a {@code JList}. When binding to the selection of a {@code JList}
 * backed by a {@code JListBinding}, the selection is always in terms of elements
 * from the source {@code List}, regardless of any {@code DetailBinding} specified.
 * See the list of <a href="package-summary.html#SWING_PROPS">
 * interesting swing properties</a> in the package summary for more details.
 *
 * @param <E> the type of elements in the source {@code List}
 * @param <SS> the type of source object (on which the source property resolves to {@code List})
 * @param <TS> the type of target object (on which the target property resolves to {@code JList})
 *
 * @author Shannon Hickey
 */
public final class JListBinding<E, SS, TS> extends AutoBinding<SS, List<E>, TS, List> {

    private Property<TS, ? extends JList> listP;
    private ElementsProperty<TS> elementsP;
    private Handler handler = new Handler();
    private JList list;
    private BindingListModel model;
    private DetailBinding detailBinding;

    /**
     * Constructs an instance of {@code JListBinding}.
     *
     * @param strategy the update strategy
     * @param sourceObject the source object
     * @param sourceListProperty a property on the source object that resolves to the {@code List} of elements
     * @param targetObject the target object
     * @param targetJListProperty a property on the target object that resolves to a {@code JList}
     * @param name a name for the {@code JListBinding}
     * @throws IllegalArgumentException if the source property or target property is {@code null}
     */
    protected JListBinding(UpdateStrategy strategy, SS sourceObject, Property<SS, List<E>> sourceListProperty, TS targetObject, Property<TS, ? extends JList> targetJListProperty, String name) {
        super(strategy == READ_WRITE ? READ : strategy,
              sourceObject, sourceListProperty, targetObject, new ElementsProperty<TS>(), name);

        if (targetJListProperty == null) {
            throw new IllegalArgumentException("target JList property can't be null");
        }

        listP = targetJListProperty;
        elementsP = (ElementsProperty<TS>)getTargetProperty();
        setDetailBinding(null);
    }

    protected void bindImpl() {
        elementsP.setAccessible(isListAccessible());
        listP.addPropertyStateListener(getTargetObject(), handler);
        elementsP.addPropertyStateListener(null, handler);
        super.bindImpl();
    }

    protected void unbindImpl() {
        elementsP.removePropertyStateListener(null, handler);
        listP.removePropertyStateListener(getTargetObject(), handler);
        elementsP.setAccessible(false);
        cleanupForLast();
        super.unbindImpl();
    }

    private boolean isListAccessible() {
        return listP.isReadable(getTargetObject()) && listP.getValue(getTargetObject()) != null;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品tushy高清| 精品一区二区三区在线视频| 欧美一级一区二区| 国产91色综合久久免费分享| 亚洲第一精品在线| 国产日韩欧美一区二区三区综合| 欧美日韩电影一区| 日本道免费精品一区二区三区| 极品美女销魂一区二区三区免费 | 久久久久久亚洲综合影院红桃| 色偷偷一区二区三区| 国产激情一区二区三区四区| 全部av―极品视觉盛宴亚洲| 一区二区在线免费| 中文字幕一区二区三中文字幕| 日韩你懂的电影在线观看| 日本伦理一区二区| 91在线观看污| 成人h版在线观看| 国产一区二区福利视频| 免费观看91视频大全| 亚洲二区视频在线| 亚洲人成网站在线| 欧美激情艳妇裸体舞| 成人av在线一区二区| 国内欧美视频一区二区| 亚洲成a人片综合在线| 国产精品久久久久影院| 精品精品欲导航| 欧美日韩黄色影视| 91在线视频官网| 国产精品99久久久久| 青青草原综合久久大伊人精品优势 | 欧美精品一区二区三区四区 | 一本久久综合亚洲鲁鲁五月天 | 日韩精品一二三四| 亚洲欧洲日产国码二区| 精品日产卡一卡二卡麻豆| 91视频一区二区| 精品一区二区三区蜜桃| 亚洲综合色婷婷| 精品日韩在线一区| 成人午夜激情在线| 美女脱光内衣内裤视频久久网站 | 亚洲女人****多毛耸耸8| 日韩精品专区在线| 日韩一区二区免费视频| 欧美电影在线免费观看| 精品视频色一区| 色一情一伦一子一伦一区| 成人av午夜影院| 丁香婷婷综合色啪| 国产精品99久久久久久似苏梦涵| 韩国女主播一区二区三区| 麻豆国产一区二区| 美女www一区二区| 日韩制服丝袜先锋影音| 亚洲成人资源网| 亚洲va欧美va人人爽| 亚洲国产欧美日韩另类综合| 亚洲美女电影在线| 亚洲欧美日韩国产另类专区| 中文字幕亚洲成人| 亚洲天堂免费在线观看视频| 亚洲欧美二区三区| 亚洲不卡av一区二区三区| 一区二区三区在线免费播放| 亚洲综合在线免费观看| 有码一区二区三区| 亚洲chinese男男1069| 日韩精品成人一区二区三区| 五月天一区二区三区| 亚洲不卡一区二区三区| 青青草97国产精品免费观看无弹窗版| 日本成人中文字幕| 久久精品国内一区二区三区| 国产在线播精品第三| 国产91在线观看丝袜| 色综合久久中文字幕综合网| 欧美日韩在线三级| 欧美一二三在线| 久久久蜜桃精品| 国产精品免费av| 一区二区三区免费观看| 日韩高清中文字幕一区| 国内精品国产成人国产三级粉色| 黑人巨大精品欧美黑白配亚洲| 国产中文字幕精品| 成人性视频免费网站| 欧美日韩美少妇| 欧美xingq一区二区| 国产精品国产三级国产普通话蜜臀 | 理论片日本一区| 国产不卡视频在线播放| 欧洲国内综合视频| 日韩午夜在线播放| 国产精品免费网站在线观看| 亚洲最色的网站| 精品亚洲国产成人av制服丝袜 | 三级欧美在线一区| 国产精品一区在线观看你懂的| 91啪在线观看| 欧美大尺度电影在线| 国产精品久久久一本精品 | 国产·精品毛片| 欧美三级电影网站| 久久在线观看免费| 亚洲综合色区另类av| 国产一区二区三区蝌蚪| 色94色欧美sute亚洲线路一ni| 91精品国产美女浴室洗澡无遮挡| 国产欧美一区二区精品秋霞影院| 亚洲一区二区精品视频| 国产精品一线二线三线| 欧美精三区欧美精三区| 日本一区二区免费在线| 日韩电影在线观看网站| 成人动漫av在线| 91精品国产综合久久香蕉的特点 | 欧美精品久久99| 国产精品成人在线观看| 另类小说视频一区二区| 在线观看日韩av先锋影音电影院| 欧美va在线播放| 亚洲免费观看在线视频| 激情综合亚洲精品| 4438亚洲最大| 午夜精品一区二区三区免费视频| 成人av网站在线| 久久久久国产精品麻豆ai换脸| 五月婷婷综合激情| 日本高清不卡视频| 日韩一区欧美一区| 国产成人综合在线播放| 这里只有精品视频在线观看| 亚洲欧美偷拍三级| 成人av资源下载| 久久综合九色综合欧美98| 日韩在线一二三区| 欧美日韩国产综合视频在线观看| 久久久久久电影| 日本亚洲电影天堂| 日韩精品综合一本久道在线视频| 久久精品999| 欧美激情一区二区三区蜜桃视频| 高清国产一区二区三区| 国产精品国产自产拍高清av王其| 97久久超碰国产精品电影| 夜夜夜精品看看| 色综合久久天天| 国产精品免费免费| 色哟哟精品一区| 一区二区高清在线| 日本电影欧美片| 亚洲一区在线观看视频| 欧亚一区二区三区| 亚洲狠狠爱一区二区三区| 色狠狠桃花综合| 亚洲成a人在线观看| 欧美日韩国产中文| 日韩高清一区在线| 一区二区三区日韩欧美| 欧美视频在线播放| 午夜电影一区二区| 欧美一区二区久久久| 亚洲自拍欧美精品| 色av成人天堂桃色av| 一区二区三区电影在线播| 成人免费高清在线| 亚洲视频一区二区在线| 色婷婷综合久久久久中文 | 欧美一区三区二区| 久久精品国产精品亚洲红杏| 中国av一区二区三区| 国产乱子轮精品视频| 久久亚洲综合色| av男人天堂一区| 一区二区三区四区亚洲| 欧美剧情片在线观看| 国产麻豆9l精品三级站| 欧美日韩一级二级三级| 久久精品国产澳门| 国产视频一区二区在线| 91女厕偷拍女厕偷拍高清| 亚洲国产精品综合小说图片区| 69久久99精品久久久久婷婷| 三级成人在线视频| 国内精品久久久久影院薰衣草| 国产成a人亚洲| 日韩欧美国产一区二区三区 | 久久精品欧美一区二区三区不卡| 亚洲小说春色综合另类电影| 国产成人在线看| 日韩欧美激情四射| 一级特黄大欧美久久久| 成人黄色一级视频| 精品999在线播放| 日韩精品色哟哟| 91久久一区二区| 天天综合网 天天综合色|