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

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

?? attributevaluecelleditor.java

?? JAVA開源LDAP瀏覽器jxplorer的源碼!
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.ca.directory.jxplorer.viewer.tableviewer;

import com.ca.commons.cbutil.CBIntText;
import com.ca.commons.cbutil.CBJComboBox;
import com.ca.commons.cbutil.CBUtility;
import com.ca.commons.jndi.SchemaOps;
import com.ca.commons.naming.DN;
import com.ca.commons.security.cert.CertViewer;
import com.ca.directory.jxplorer.DataSource;
import com.ca.directory.jxplorer.editor.*;

import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.lang.reflect.Constructor;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.EventObject;
import java.util.logging.Logger;
import java.util.logging.Level;

/**
 *     The cell editor that brings up the dialog.
 *     We inherit from AbstractCellEditor,
 *     even though it means we have to create a dummy
 *     check box.  Attribute Value Editor uses schema
 *     info to validate the user's input before submission...
 */
public class AttributeValueCellEditor extends AbstractCellEditor
{
    Frame owner;

    JTextField textField = new JTextField();
    JLabel label = new JLabel("");

    CBJComboBox combobox = new CBJComboBox();

    JComponent editorComponent = textField;

    abstractbinaryeditor abstractEditor = null;    // this is the display editor for binary data - e.g. the audio player, or photo viewer

    Object value;
    boolean binaryEditFlag = false;            // handle binary editing separately
    boolean specialStringEditor = false;       // handle special string stuff like postal address
    protected ClassLoader myLoader = null;     // optional extended class loader
    public DataSource datasource = null;       //TE: The syntax of the attribute.
    public DN currentDN = null;                //TE: The dn of the entry being modified.

    int lastSelectedRow = 0;                    //TE: The last selected row - which is used to set the height back to normal (16).

    public static final String BINARY_SYNTAX =              "1.3.6.1.4.1.1466.115.121.1.5";
    public static final String BOOLEAN_SYNTAX =             "1.3.6.1.4.1.1466.115.121.1.7";
    public static final String CERTIFICATE_SYNTAX =         "1.3.6.1.4.1.1466.115.121.1.8";
    public static final String GENERALIZED_TIME_SYNTAX =    "1.3.6.1.4.1.1466.115.121.1.24";
    public static final String POSTAL_ADDRESS_SYNTAX =      "1.3.6.1.4.1.1466.115.121.1.41";

    private static Logger log = Logger.getLogger(AttributeValueCellEditor.class.getName());

   /**
    *    A basic constructor, which does little except add a
    *    mouse listener to the default text field, setting the
    *    click count for 'cancel editing' to two.
    */
    public AttributeValueCellEditor(Frame parent)
    {
        owner = parent;

	//	textField.setFont(new Font("Tahoma", Font.PLAIN,11)); //TE: makes the textField same as the label - bug 3013.

		editorComponent.addMouseListener(new MouseAdapter()
        {
            public void mousePressed(MouseEvent e)
            {
//TE: I've commented this out because a double click makes the value in the cell disappear?? Bug - 3007.
//                if (e.getClickCount() == 2)
//                    cancelCellEditing();
            }
        });
    }

    //
    //  Implementing the CellEditor Interface
    //

    // implements javax.swing.table.TableCellEditor

    /**
     * Returns an awt.Component that acts as a cell editor.
     * Checks, in the following order, for a Certificate, binary syntax,
     * postalAddress, GeneralizedTime, if there are options.  If none of these
     * syntax' match then the default string editor is set.
     * This method also increases the size of the row selected so that the value
     * is easier to read.
     * @param table
     * @param value
     * @param isSelected
     * @param row
     * @param column
     * @return
     */
    public Component getTableCellEditorComponent(JTable table,
                         Object value, boolean isSelected,
                         int row, int column)
    {
        binaryEditFlag = false;
        specialStringEditor = false;

        table.setRowHeight(lastSelectedRow, 16);
        table.setRowHeight(row, 24);

        lastSelectedRow = row;

        if (value instanceof AttributeValue)
        {
            AttributeValue att = (AttributeValue) value;

            if (hasSyntax(att, CERTIFICATE_SYNTAX))			    //TE: a syntax check for Certificate.
                setCertificateEditor(att);
            else if (att.isBinary())						    //TE: binary check.
                setBinaryEditor(att);
            else if (hasSyntax(att, POSTAL_ADDRESS_SYNTAX))	    //TE: postalAddress syntax check.
                setPostalAddressEditor(att);
            else if (hasSyntax(att, GENERALIZED_TIME_SYNTAX))   //TE: generalizedTime syntax check.
                setGeneralizedTimeEditor(att);
            else if (hasSyntax(att, BOOLEAN_SYNTAX))	        //TE: boolean syntax check.
                setBooleanEditor(att);
            else if (att.hasOptions())      				    // there are suggested possible values
                setOptions(att);
            else
                setString(att);

            setCellEditorValue(att);
        }
        return editorComponent;
    }

   /**
    *	Checks if the attribute value's syntax matches the given syntax.
    *	@param att the attribute value for example, 'Fred' from 'cn=Fred'.
    *	@param syntax the syntax to check against for example, '1.3.6.1.4.1.1466.115.121.1.8'.
	*	@return true if the syntaxes match false otherwise.
	*/
	public boolean hasSyntax(AttributeValue att, String syntax)
	{
		String attSyntax = getAttributeSyntax(att);
	   	return (attSyntax != null && attSyntax.indexOf(syntax) > -1);
	}

   /**
    *   Sets the certificate editor in the table cell whose attribute is
    *   a certificate ["1.3.6.1.4.1.1466.115.121.1.8"].
    *   @param att the attribute value to be set in the editor.
    */
    private void setCertificateEditor(AttributeValue att)
    {
        CertViewer.CertAndFileName returnVal = CertViewer.editCertificate(owner, att.getValue());
        X509Certificate cert = returnVal.cert;
        if (cert != null)
        {
            try
            {
                byte[] newData = cert.getEncoded();
                if (Arrays.equals(newData, att.getValue()) == false)
                    att.setValue(newData);
            }
            catch(Exception e)
            {
                CBUtility.error(CBIntText.get("Error: unable to modify certificate."), e);
            }
        }

        binaryEditFlag = true;

        if (att.isEmpty())
        {
            label.setText(" ");
        }
        else
        {
            label.setText(CBIntText.get("(non string data)"));
        }

        editorComponent = label;
    }

   /**
    *   Sets the string in the table cell whose attribute is
    *   a string (does a check for the length of a string also and if
    *   the string is longer than 100 it sets the large string editor).
    *   @param att the attribute value to be set in the editor.
    */
    private void setString(AttributeValue att)
    {
        String textValue = att.toString();
        if (textValue.length() > 100) // arbitrary long display limit...
        {
            setLargeStringEditor(att);
        }
        else
        {
            textValue = textValue.trim();  // XXX trim off extra space that may be there for swing printing hack...

            textField.setText(textValue);

            editorComponent = textField;
        }
    }

   /**
    *   Sets the large string editor in the table cell whose attribute value is
    *   a string longer than 100 chars.
    *   @param att the attribute value to be set in the editor.
    */
    private void setLargeStringEditor(AttributeValue att)
    {
        largestringeditor lse = new largestringeditor(owner, att);
        specialStringEditor = true;
        CBUtility.center(lse, owner);
        lse.setVisible(true);
        label.setText(att.getStringValue().substring(0,100));
        editorComponent = label;
    }

   /**
    *   Sets a combo box in the table cell whose attribute could have
    *   suggested possible values.
    *   @param att the attribute value to be set in the editor.
    */
    private void setOptions(AttributeValue att)
    {
        combobox.removeAllItems();
        String[] ops = att.getOptions();
        for (int i=0; i<ops.length; i++)
            combobox.addItem(ops[i]);
        editorComponent = combobox;
    }

   /**
    *   Sets the binary editor in the table cell whose attribute is
    *   a binary.
    *   @param att the attribute value to be set in the editor.
    */
    private void setBinaryEditor(AttributeValue att)
    {
        startBinaryEditor(att); 					// runs modal dialog binary editor
        binaryEditFlag = true;

        if (att.isEmpty())
        {
            label.setText(" ");
        }
        else
        {
            label.setText(CBIntText.get("(non string data)"));
        }

        editorComponent = label;
    }

   /**
    *   Sets the generalized time editor in the table cell whose attribute is
    *   a generalizedTime ["1.3.6.1.4.1.1466.115.121.1.24"].
    *   @param att the attribute value to be set in the editor.
    */
    private void setGeneralizedTimeEditor(AttributeValue att)
    {
        generalizedtimeeditor timeEditor = null;

        if (att==null)
        {
            timeEditor = new generalizedtimeeditor(owner,"", true);
        }
        else
        {
            timeEditor = new generalizedtimeeditor(owner, att.toString(), true);
        }

        specialStringEditor = true;
        CBUtility.center(timeEditor, owner);    	//TE: centres the attribute editor.
        timeEditor.setStringValue(att);
        timeEditor.setVisible(true);

        if (att.isEmpty())
        {
            label.setText(" ");
        }
        else
        {
            label.setText(att.getStringValue());    //TE: sets the table label to reflect the changes.
        }

        editorComponent = label;
    }

   /**
    *   Sets the postal address editor in the table cell whose attribute is
    *   a postalAddress ["1.3.6.1.4.1.1466.115.121.1.41"].
    *   @param att the attribute value to be set in the editor.
    */
    private void setPostalAddressEditor(AttributeValue att)
    {
        postaladdresseditor postalEditor = new postaladdresseditor(owner, att);
        specialStringEditor = true;
        CBUtility.center(postalEditor, owner);    	//TE: centres the attribute editor.
        postalEditor.setStringValue(att);
        postalEditor.setVisible(true);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品aⅴ在线视频| 视频在线观看一区二区三区| 99久久精品久久久久久清纯| 免费精品99久久国产综合精品| 亚洲精品网站在线观看| 国产精品久久久久久久久晋中| 精品成人一区二区| 欧美变态口味重另类| 日韩一级片在线观看| 欧美电影一区二区三区| 欧美日韩国产小视频| 欧美吻胸吃奶大尺度电影| 欧美老女人在线| 日韩精品一区二区在线| 国产精品美女久久久久久久| 国产精品成人一区二区艾草 | 欧美性一二三区| 欧美日韩极品在线观看一区| 91精品国产乱| 亚洲一区视频在线观看视频| 日韩二区三区在线观看| 国产成人在线视频网站| 成人美女视频在线观看18| 91国产丝袜在线播放| 26uuu欧美日本| 亚洲女人的天堂| 九色porny丨国产精品| 色综合天天性综合| 51精品国自产在线| 亚洲女女做受ⅹxx高潮| 狠狠色综合色综合网络| 欧美日本在线视频| 一区二区不卡在线播放 | 国产高清亚洲一区| 欧美人xxxx| 亚洲高清免费观看 | 欧美性受极品xxxx喷水| 欧美一级片免费看| 亚洲一区二区高清| 北条麻妃一区二区三区| 国产日韩欧美不卡| 国产suv精品一区二区883| 欧美一级免费大片| 一区二区三区在线视频观看58| 国产高清在线精品| 精品国产乱码久久久久久闺蜜| 日韩国产一区二| 欧美精品国产精品| 蜜臀va亚洲va欧美va天堂| 91小视频免费观看| 尤物在线观看一区| 制服丝袜亚洲色图| 午夜私人影院久久久久| 91精品福利视频| 一区二区视频免费在线观看| 在线影视一区二区三区| 亚洲欧洲精品一区二区精品久久久 | 99久久精品国产毛片| 亚洲少妇30p| 欧美日韩性生活| 麻豆成人在线观看| 中文字幕佐山爱一区二区免费| 波多野结衣一区二区三区| 亚洲自拍偷拍网站| 久久久久99精品国产片| 欧美日韩亚州综合| 国产精品自拍毛片| 亚欧色一区w666天堂| 久久综合色综合88| 欧美日韩一卡二卡| 成人av网址在线观看| 亚洲国产精品嫩草影院| 精品国产乱码久久久久久蜜臀 | 七七婷婷婷婷精品国产| 亚洲欧美国产三级| 欧美成va人片在线观看| 不卡的电影网站| 狠狠色丁香婷综合久久| 亚洲国产综合在线| 日韩欧美区一区二| 欧美亚洲动漫制服丝袜| 99久久精品99国产精品| 麻豆一区二区三| 亚洲一区二区av在线| 国产精品国产自产拍高清av| 精品三级在线观看| 日韩欧美中文一区| 欧美精品三级日韩久久| 成人av动漫在线| 国产精品系列在线观看| 国产精品99久久久久久似苏梦涵| 激情久久五月天| 成人免费的视频| www.亚洲色图| 91精彩视频在线| 欧美一区二区视频免费观看| 日韩一级二级三级精品视频| 欧美日韩国产小视频在线观看| 欧美色大人视频| 日韩精品一区二区三区老鸭窝| 7777精品伊人久久久大香线蕉| 欧美色区777第一页| 一本到不卡精品视频在线观看| 94-欧美-setu| 欧美性色综合网| 欧美成人在线直播| 国产日韩精品久久久| xnxx国产精品| 亚洲一线二线三线久久久| 一区二区三区 在线观看视频| |精品福利一区二区三区| 亚洲一级电影视频| 国产91在线看| 欧美综合色免费| 久久久.com| 性做久久久久久久免费看| 成人免费视频视频在线观看免费 | 国产精品久久久久毛片软件| 中文字幕免费不卡| 日韩欧美专区在线| 亚洲欧美成aⅴ人在线观看| 精品一区二区三区在线播放| 91免费看`日韩一区二区| 91精品国产麻豆| 尤物av一区二区| 97久久精品人人做人人爽50路| 9191精品国产综合久久久久久| 久久久国产精品麻豆| 高清国产午夜精品久久久久久| 国产日韩成人精品| voyeur盗摄精品| 洋洋av久久久久久久一区| 欧美疯狂性受xxxxx喷水图片| 视频精品一区二区| 久久―日本道色综合久久| 国内精品伊人久久久久av一坑| 欧美精品一区二区三区在线| 高清不卡在线观看| 一区二区三区精品视频| 欧美一卡二卡三卡| 成人一区二区三区中文字幕| 亚洲男人天堂一区| 精品国产污网站| 一本高清dvd不卡在线观看| 亚洲国产精品尤物yw在线观看| 欧美一级专区免费大片| 在线观看一区不卡| 国产成人在线视频免费播放| 亚洲电影在线播放| 国产亚洲精品中文字幕| 欧美亚洲禁片免费| 成人白浆超碰人人人人| 免费观看91视频大全| 亚洲色图20p| 久久视频一区二区| 欧美另类一区二区三区| eeuss鲁一区二区三区| 免费三级欧美电影| 亚洲国产精品一区二区www在线 | 日韩av一二三| 国产精品区一区二区三区| 欧美v国产在线一区二区三区| 91猫先生在线| 91蝌蚪porny| 99这里只有久久精品视频| 国产精品一卡二卡在线观看| 免费成人美女在线观看.| 亚洲成人久久影院| 午夜精品久久久| 五月激情综合婷婷| 婷婷开心久久网| 日韩电影网1区2区| 久久精品99久久久| 国产精品自拍一区| www.亚洲在线| 欧美日韩在线观看一区二区| 欧美日韩久久不卡| 日韩精品综合一本久道在线视频| 91精品国产综合久久久久久久久久| 337p亚洲精品色噜噜| 国产亚洲成av人在线观看导航| 欧美日韩一区二区电影| 欧美mv日韩mv亚洲| 在线一区二区三区四区五区| 国产成人福利片| 欧美日韩dvd在线观看| 亚洲精品免费看| 国产成人自拍网| 国产午夜三级一区二区三| 亚洲精品久久久久久国产精华液| 日本麻豆一区二区三区视频| 成人精品视频一区二区三区| 777午夜精品视频在线播放| 中文字幕一区二| 国内精品视频666| 欧美丰满嫩嫩电影| 亚洲综合在线免费观看| 国产v综合v亚洲欧| 亚洲精品一区二区三区蜜桃下载| 午夜视频在线观看一区|