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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? htmltemplatedisplay.java

?? JAVA開(kāi)源LDAP瀏覽器jxplorer的源碼!
?? JAVA
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
package com.ca.directory.jxplorer.viewer;

import com.ca.commons.cbutil.*;
import com.ca.commons.naming.*;
import com.ca.directory.jxplorer.*;
import com.ca.directory.jxplorer.tree.SmartTree;

import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.logging.Logger;
import java.util.logging.Level;
import java.util.zip.ZipException;

/**
 *    Display Template handles the insertion of attribute values into
 *    an HTML template, in order to display filtered information to
 *    the user in an attractive manner.<p>
 *
 *    It also implements a simple web browser for viewing help links
 *    etc.<p>
 *
 *    Form submission is done in the @MyHTMLEditorKit class.
 */


/*  IMPLEMENTATION NOTES....
 *
 *  This is a large class, and should probably be broken up - an MVC model maybe, but
 *  at least separate the functionality families.
 *
 *  It is currently doing three separate things.
 *  A) Operating the Template Display GUI
 *  B) Keeping track of the html templates on disk, and indexing them by object class
 *  C) Parsing the html text and doing tricks (many of which may not be necessary, since they were often
 *     work arounds for buggy sun code in the good 'ol days).
 */

public class HTMLTemplateDisplay extends JPanel
        implements DataSink, PluggableEditor
{
    JScrollPane scrollDisplay;

    DataSource currentDataSource = null;

    JEditorPane editor;
    JViewport viewport; // was CBViewport
    JTextArea bloop;

    String baseText;        // the original text, formatted for html but without attribute values
    StringBuffer htmlText;  // the display text, including attributes...
//    String baseURL;			// the base file URL of the template directory location
//    String localURL;		//TE: the path to the users working dir.  Used to store the temporary templates extracted from a zip/jar.
//    URL base = null;		// the same base file URL, as a url.

    Component display;      // a display panel used for user error messages.

    public static final String DEFAULTTEXT = "<html><head><title>Default Template</title></head><body> <dxtemplate:get-all-attributes> <br> </body></html>";
    public static final String ATTRIBTAG = "<dxtemplate:";
    public static String NOVALUEFOUND;
    public static final String JPEGEXTENSION = ".jpg";    	//TE: the extenion of the temporary jpegPhotos stored locally.
    public static final String DOCEXTENSION = ".doc";	    //TE: the extenion of the temporary documents stored locally.
    public static final String XLSEXTENSION = ".xls";	    //TE: the extenion of the temporary spreadsheets stored locally.
    public static final String WAVEXTENSION = ".wav";	    //TE: the extenion of the temporary wav files stored locally.
    public static final String AVIEXTENSION = ".avi";	    //TE: the extenion of the temporary avi files stored locally.
    public static final String MIDEXTENSION = ".mid";	    //TE: the extenion of the temporary mid files stored locally.

    public static final String startFile = "start";    		// the initially displayed html page

    public static final int MAX_LEGAL_VALUE_LENGTH = 500;
    public static final String ILLEGAL_VALUE = "[ATTRIBUTE TOO LARGE TO DISPLAY]";

    public static final String DEFAULT = "defaulttemplate";         // name for default templates...

    Properties myProperties;   	// contains info about default urls and file locations.

    JToolBar toolBar;      	// the toolbar containing the list of allowed templates

    /*
     *   A bunch of variables are needed to keep track of all the available html templates,
     *   and the users state when viewing a particular template combination.
     */

    // The combo box the user uses to select a display template
    CBJComboBox viewTemplates;

    // The position in the combo box for a particular 'object class set signature' (i.e. what the user last
    // viewed for a particular object class set).  Keyed by object class signature.
    Hashtable viewTemplatesPos = new Hashtable();   	// hashtable of most-recently-used templates

    // All available templates (as File objects, keyed by lower case object class.  Defaults keyed by empty string "").
    Hashtable templates = new Hashtable(100);

    // the 'object class signature' (the object classes for a particular entry concatenated to a unique key)
    String oldObjectClassesSignature = "";

    // the base directory for all the html templates
    File baseTemplateDir;

    // the base directory for any plugin html templates
    File pluginTemplateDirectory = null;

//    String currentLDAPObjectClass = "";  		// the current object class being viewed
    DXEntry currentEntry = null;          		// the current entry being displayed.
    // (we need to remember this, because the display template changes)
    static String currentTemplateName = "";        	// the name of the currently selected template...

    public static String NODATA;  					// no data html page - not static, 'cause of internationalisation requirements...

    public boolean showHTMLErrors = true; 			// for debugging html forms.

    protected MyHyperlinkListener hyperlinkListener;
    protected MyHTMLEditorKit htmlEditorKit;

    protected boolean settingUpTemplates = false;  	// utility variable to disable combo box action listener during combo box setup.

    Vector currentBinaryAttributes = new Vector(0); // used by MyHTMLEditorKit to flag special data...

    CBResourceLoader resourceLoader = null;        	// used to load HTML templates from zip/jar files.

    protected String currentDN;    					//TE: part of the name of the temporary files that are created for jpegPhoto & audio attributes (i.e. the dn of the entry).

    SmartTree smartTree = null;

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

    /**
     *    Default Constructor for HTMLTemplateDisplay
     */

    public HTMLTemplateDisplay(Component owner, Properties props, CBResourceLoader resourceLoader)
    {
        commonConstructorCode(owner, props, resourceLoader);
        setToDefault();
    }

    protected void setToDefault()
    {
        htmlText = new StringBuffer(DEFAULTTEXT);
        baseText = new String(DEFAULTTEXT);
    }

    /**
     * <p>A bunch of vaguely hacky code to add hyperlink-like functionality to the html display</p>
     */
    class MyHyperlinkListener implements HyperlinkListener
    {
        public void hyperlinkUpdate(final HyperlinkEvent e)
        {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
            {
                SwingUtilities.invokeLater(new Runnable()
                {
                    public void run()
                    {
                        String desc = e.getDescription();

                        if (desc.toLowerCase().startsWith("dn:")) // el hack especial
                        {
                            String dn = desc.substring(desc.indexOf(":") + 1);

                            if (smartTree != null)
                            {
                                smartTree.readAndExpandDN(new DN(dn));
                            }
                        }
                        else if (desc.toLowerCase().startsWith(".." + File.separator + "temp" + File.separator + "audio" + File.separator) || desc.toLowerCase().startsWith(".." + File.separator + ".." + File.separator + "temp" + File.separator + "audio" + File.separator))	//TE: audio handler.
                        {//TE: launches audio files...
                            if (!System.getProperty("os.name").equalsIgnoreCase("SunOS"))	//TE: Check if the operating system is Sun if so don't attempt to play the audio file.
                            {
                                String path = CBCache.getAudioDirPath();
                                String audioFilePath = desc.substring(desc.indexOf("temp", desc.lastIndexOf("\"")));
                                String audioFileName = audioFilePath.substring(audioFilePath.lastIndexOf("\\"));
                                String extension = audioFileName.substring(audioFileName.indexOf("."));

                                if (extension.equalsIgnoreCase(".xxx"))
                                    CBUtility.error(CBIntText.get("Unable to play unknown audio file type"));
                                else
                                    CBLauncher.launchProgram(extension, path + audioFileName);
                            }
                        }
                        else if (desc.toLowerCase().startsWith(".." + File.separator + "temp" + File.separator) || desc.toLowerCase().startsWith(".." + File.separator + ".." + File.separator + "temp" + File.separator))	//TE: audio handler.
                        {//TE: currently launches odDocumentDOC/odSpreadSheetXLS/odMusicMID/odSoundWAV/odMovieAVI files with .doc extension...
                            if (!System.getProperty("os.name").equalsIgnoreCase("SunOS"))	//TE: Check if the operating system is Sun if so don't attempt to launch the document.
                            {
                                String path = CBCache.getDirPath();
                                String filePath = desc.substring(desc.indexOf("temp", desc.lastIndexOf("\"")));
                                String fileName = filePath.substring(filePath.indexOf("\\"));
                                String extension = fileName.substring(fileName.indexOf("."));

                                CBLauncher.launchProgram(extension, path + fileName);
                            }
                        }
                        else if (!System.getProperty("os.name").equalsIgnoreCase("SunOS") && desc.toLowerCase().startsWith("mailto"))	//TE: spawn default mail client (windows only).
                        {//TE: launches email client...
                            launchClient(desc);
                        }
                        else
                        {
                            URL url = e.getURL();

// XXX
//      Have had no end of trouble trying to do string matching of paths (shame there sin't a decent OO way of doing it with File
//      objects!).  As a result have switched everything to using 'canonical paths'... hopefully that will work :-). - CB
// XXX


//CB - base no longer used?                            if (base != null && url.getProtocol().equals("file"))  // possibly this is another template...
                            if (url.getProtocol().equals("file"))  // possibly this is another template...
                            {

                                String fullFileName = "";
                                String baseTemplateDirPath = "";
                                String pluginTemplateDirectoryPath = "";
                                try
                                {
                                // Assume this is a template, and attempt to obtain template name from url...
                                    fullFileName = new File(URLDecoder.decode(url.getFile(), "UTF-8")).getCanonicalPath(); // wierd processing to get standard file separators ('/' or '\') (needed for matching below)
                                    baseTemplateDirPath = baseTemplateDir.getCanonicalPath();
                                    if (pluginTemplateDirectory != null)
                                        pluginTemplateDirectoryPath = pluginTemplateDirectory.getCanonicalPath();
                                }
                                catch (IOException e) // not expected...
                                {
                                    log.log(Level.WARNING, "Exception trying to access HTML file urls " + url.getFile().toString(), e);
                                }
                                String fileName = "";

                                if (fullFileName.startsWith(baseTemplateDirPath))
                                {
                                    fileName = fullFileName.substring(baseTemplateDirPath.length());
                                }
//TODO: this needs to be tested -> do urls between plugin templates work...
                                else if (pluginTemplateDirectory!=null && fullFileName.startsWith(pluginTemplateDirectoryPath))
                                {
                                    fileName = fullFileName.substring(pluginTemplateDirectoryPath.length());
                                }

                                if (fileName.startsWith(File.separator))
                                    fileName = fileName.substring(1);

                                fileName = (new File(fileName)).toString();

                                if (templateExists(fileName))
                                {
                                    setNewTemplate(fileName);
                                }
                                else
                                {
                                    openPage(url);
                                }
                            }
                            else
                            {   //TE: if the user has set (via advanced options) to launch URLs in a browser...
                                if ((JXplorer.getProperty("option.url.handling")).equalsIgnoreCase("Launch"))
                                    launchClient(desc);
//TE: otherwise open it in JXplorer...
                                else
                                    openPage(url);
                            }
                        }
                    }
                });
            }
        }
    };



    /**
     *	Recreates the editor, and sets the text.
     *	@param htmlText the Text (possibly html) to display
     */

    public void setEditorText(String htmlText)
    {
        //System.out.println("-----------\n" + htmlText + "\n----------------\n");

        Dimension current = null;
        if (editor != null)  // reuse editor to avoid memory leak.
                             // TODO: figure out what the JEditorPane doco means about recreating the document
        {
            try
            {
                editor.setText(htmlText);
            }
            catch (Exception e) // can Sun write code?  No, no I don't think they can.  If the editor screws up internally, make it again.
            {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲图片欧美激情| 亚洲成人tv网| 国产亚洲成av人在线观看导航 | 欧美无砖专区一中文字| 国产麻豆精品久久一二三| 久99久精品视频免费观看| 蜜桃视频一区二区三区| 久久成人麻豆午夜电影| 久久精品国产99国产精品| 蜜桃视频第一区免费观看| 狠狠网亚洲精品| 国产精品一区二区三区99| 国产福利一区二区三区在线视频| 国产精品伊人色| 成人激情校园春色| 91啦中文在线观看| 在线观看视频一区二区| 欧美日韩亚洲国产综合| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲午夜三级在线| 午夜av一区二区| 日韩 欧美一区二区三区| 久久精品国产99国产精品| 国产在线播精品第三| 国产成人高清视频| 99精品视频一区二区三区| 欧美三级在线看| 欧美一区二区在线免费观看| 久久免费看少妇高潮| ...中文天堂在线一区| 午夜电影久久久| 国产做a爰片久久毛片| 99久久婷婷国产| 91精品久久久久久久99蜜桃| 国产色综合一区| 一区二区三区**美女毛片| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产一二精品视频| 91久久精品一区二区三区| 欧美午夜免费电影| 久久精品夜夜夜夜久久| 久久美女艺术照精彩视频福利播放| 欧美怡红院视频| 成人综合婷婷国产精品久久免费| 91视频精品在这里| 这里只有精品免费| 欧美激情一区在线| 亚洲高清不卡在线| 国产成人免费视频精品含羞草妖精| 一本色道亚洲精品aⅴ| 日韩美女一区二区三区四区| 亚洲人被黑人高潮完整版| 久久国产精品免费| 欧美在线小视频| 国产婷婷精品av在线| 午夜精品福利在线| av亚洲精华国产精华| 欧美一级国产精品| 亚洲日穴在线视频| 国产麻豆精品一区二区| 欧美制服丝袜第一页| 国产精品麻豆一区二区| 久久精品国产一区二区| 欧洲精品一区二区三区在线观看| 国产午夜三级一区二区三| 欧美a级一区二区| 国产精品伊人色| 久久天天做天天爱综合色| 日韩一区在线看| 日产欧产美韩系列久久99| 成人国产精品免费网站| 日韩欧美第一区| 亚洲国产精品精华液网站| 99久久久免费精品国产一区二区| 精品国产百合女同互慰| 婷婷亚洲久悠悠色悠在线播放| 不卡一区二区中文字幕| 日韩精品专区在线影院观看| 亚洲五月六月丁香激情| www.久久久久久久久| 国产偷国产偷亚洲高清人白洁| 久久不见久久见免费视频7| 欧美巨大另类极品videosbest | 美女国产一区二区三区| 色老头久久综合| **网站欧美大片在线观看| 国产河南妇女毛片精品久久久| 91精品国产综合久久婷婷香蕉 | 一区二区三区四区亚洲| 一区二区在线观看免费视频播放| 成人污视频在线观看| 精品理论电影在线观看 | 成人午夜在线免费| 久久日一线二线三线suv| 久久精品久久久精品美女| 日韩一区二区在线免费观看| 丝袜亚洲另类欧美综合| 精品视频1区2区3区| 一级精品视频在线观看宜春院| 99视频精品在线| 亚洲四区在线观看| 91在线观看视频| 亚洲人成小说网站色在线| 99re66热这里只有精品3直播| 国产精品剧情在线亚洲| 99国产精品99久久久久久| 国产精品国产三级国产专播品爱网 | 久久久亚洲午夜电影| 国产一区二区三区最好精华液| 欧美精品一区二区三区在线播放| 亚洲欧洲日韩一区二区三区| 日韩电影在线观看电影| 91麻豆精品91久久久久同性| 秋霞电影一区二区| 日韩精品一区二区三区在线播放| 久久精品国产**网站演员| 精品成人在线观看| 国产乱人伦偷精品视频免下载| 国产人妖乱国产精品人妖| 成人黄色av电影| 一区二区三区欧美| 欧美一区二区三区播放老司机| 精品亚洲免费视频| 日本一区免费视频| 在线免费观看日本一区| 婷婷国产v国产偷v亚洲高清| 精品久久久久久最新网址| 国产成a人亚洲精品| 亚洲三级在线免费| 欧美乱妇23p| 国产一区二区三区观看| 亚洲少妇30p| 欧美高清激情brazzers| 国产在线一区二区| 亚洲欧美经典视频| 5858s免费视频成人| 国产一区二区三区日韩| 亚洲天堂福利av| 日韩欧美一级二级| 成人免费观看av| 午夜精品久久久久久久久久久 | 亚洲成人av中文| 日韩精品一区二区三区在线观看 | 日韩精品一区二区在线观看| 国产毛片精品一区| 一区二区三区中文在线观看| 欧美一卡2卡三卡4卡5免费| 成人综合婷婷国产精品久久免费| 亚洲午夜国产一区99re久久| 亚洲精品伦理在线| 欧美精品日韩一区| 丁香五精品蜜臀久久久久99网站| 亚洲一区二区三区四区的| 久久这里只有精品首页| 欧美午夜一区二区三区免费大片| 国内精品写真在线观看 | 91亚洲永久精品| 久久爱另类一区二区小说| 亚洲丝袜美腿综合| 欧美成人精品二区三区99精品| av网站免费线看精品| 日本不卡一区二区三区| 中文字幕中文字幕一区二区| 日韩欧美一级二级| 亚洲国产精品激情在线观看| 久久久精品免费网站| 最新久久zyz资源站| 久久久久久99久久久精品网站| 91香蕉视频mp4| 精品午夜一区二区三区在线观看 | 国产精品一级二级三级| 亚洲免费在线电影| 久久久五月婷婷| 制服丝袜av成人在线看| 91婷婷韩国欧美一区二区| 国产精品综合在线视频| 蜜桃传媒麻豆第一区在线观看| 亚洲综合免费观看高清完整版在线| 久久精品人人做人人爽97| 日韩视频永久免费| 精品视频一区三区九区| 99久久精品国产麻豆演员表| 国产精品一二三四五| 男女激情视频一区| 亚洲午夜免费福利视频| 亚洲精品水蜜桃| 国产精品久久久久一区| 久久综合九色综合欧美亚洲| 日韩一区二区在线观看| 欧美日韩午夜在线| 精品视频资源站| 欧美一a一片一级一片| 在线中文字幕一区二区| 99精品视频在线免费观看| 成人国产精品免费网站| 成人小视频免费观看| 国产成人精品网址| 国产成人免费xxxxxxxx| 激情国产一区二区| 一区二区三区在线视频播放|