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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? htmltemplatedisplay.java

?? JAVA開源LDAP瀏覽器jxplorer的源碼!
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
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.
            {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级片免费看| 无吗不卡中文字幕| 欧洲一区在线电影| 奇米在线7777在线精品| 久久九九影视网| 欧美日韩中字一区| 国产乱码精品一品二品| 精品久久久久久综合日本欧美| 99久久精品免费| 蜜臀av性久久久久蜜臀aⅴ| 亚洲天堂中文字幕| 精品理论电影在线观看| 欧美综合一区二区| 99精品久久只有精品| 久久国产精品色婷婷| 日韩综合在线视频| 亚洲免费av高清| 久久青草欧美一区二区三区| 在线播放中文一区| 91丨porny丨最新| 久久成人综合网| 亚洲成人先锋电影| 国产精品高清亚洲| 国产欧美日韩三区| 777精品伊人久久久久大香线蕉| 成人国产一区二区三区精品| 韩国精品在线观看| 亚洲高清免费一级二级三级| 国产欧美日韩精品一区| 日韩欧美的一区| 欧美亚洲动漫精品| 欧美综合色免费| 97久久精品人人爽人人爽蜜臀| 国产一区欧美一区| 久久成人久久爱| 蜜臀久久99精品久久久画质超高清 | 成人午夜视频在线| 免费成人结看片| 免费看欧美美女黄的网站| 日韩精品高清不卡| 日韩精品福利网| 丝袜美腿一区二区三区| 亚洲码国产岛国毛片在线| 亚洲欧洲av在线| 日本一区二区三区在线观看| 中文字幕电影一区| 久久蜜桃av一区二区天堂| 欧美大片一区二区三区| 在线观看91av| 日韩欧美国产一区二区在线播放| 欧美日韩亚州综合| 欧美日韩一区二区不卡| 色综合天天天天做夜夜夜夜做| 成人激情综合网站| 91蜜桃免费观看视频| 99久久精品99国产精品| www.99精品| 欧美日韩一本到| 欧美精品粉嫩高潮一区二区| 欧美一区二区精品在线| 日韩美女主播在线视频一区二区三区| 欧美日韩在线精品一区二区三区激情 | 不卡av电影在线播放| 91蜜桃婷婷狠狠久久综合9色| 91免费国产在线| 欧美日韩另类国产亚洲欧美一级| 欧美午夜不卡视频| 欧美精品三级日韩久久| 欧美精品一区二区精品网| 欧美成人欧美edvon| 精品国产精品网麻豆系列| 中文久久乱码一区二区| 成人欧美一区二区三区| 午夜精品久久久久久久久久久| 日日夜夜精品免费视频| 国产麻豆欧美日韩一区| 成人黄色777网| 欧美性生活影院| 欧美一区二区视频在线观看2020| 欧美日韩高清不卡| 久久美女高清视频| 亚洲欧美影音先锋| 艳妇臀荡乳欲伦亚洲一区| 蜜臀91精品一区二区三区| 国产一区二区三区四区五区美女| 一本久道久久综合中文字幕| 欧美区视频在线观看| 国产精品1区二区.| 亚洲成在线观看| 午夜精品在线看| 亚洲欧美精品午睡沙发| 日本一区二区三区视频视频| 国产香蕉久久精品综合网| 精品国产91亚洲一区二区三区婷婷 | 午夜视频一区在线观看| 国产一区二区剧情av在线| 成人av资源在线| 色国产精品一区在线观看| 欧美精品色综合| 久久色.com| 亚洲日本青草视频在线怡红院| 亚洲精品美国一| 久久精品av麻豆的观看方式| 色婷婷av一区二区三区软件| ww亚洲ww在线观看国产| 夜夜嗨av一区二区三区中文字幕 | 亚洲精品视频一区二区| 国产一区二区三区观看| 国内精品嫩模私拍在线| 在线一区二区观看| 中文字幕一区三区| 美脚の诱脚舐め脚责91 | 538在线一区二区精品国产| 国产精品区一区二区三区| 日韩精品亚洲一区二区三区免费| aa级大片欧美| 欧美专区日韩专区| 欧美成人一区二区三区在线观看 | 午夜一区二区三区在线观看| 成人综合婷婷国产精品久久蜜臀 | 久久在线观看免费| 亚洲免费成人av| 成人性生交大片免费| 久久综合九色综合97婷婷| 日韩黄色一级片| 91成人在线精品| 欧美国产欧美综合| 国产在线一区观看| 制服丝袜成人动漫| 性欧美大战久久久久久久久| 91网站在线播放| 欧美经典三级视频一区二区三区| 国产成人在线影院| 久久综合久久99| 五月综合激情网| 色综合久久久网| 国产精品私人自拍| 国产成人精品影院| 日韩欧美高清在线| 久久国产人妖系列| 欧美不卡一区二区三区| 日本aⅴ精品一区二区三区| 91精品国产福利在线观看| 亚洲午夜电影网| 成人av影院在线| 一区二区高清视频在线观看| www.亚洲色图.com| 成人免费在线观看入口| 91女神在线视频| 亚洲6080在线| 欧美伊人久久大香线蕉综合69| 自拍偷拍亚洲综合| 91免费看片在线观看| 亚洲免费伊人电影| 欧美久久高跟鞋激| 日韩影院在线观看| 国产日韩欧美综合一区| 国产成人免费在线| 一区二区三区日韩欧美精品 | 欧美大白屁股肥臀xxxxxx| 国内精品视频一区二区三区八戒| 欧美电影免费观看完整版| 青娱乐精品在线视频| 精品国产乱码久久久久久牛牛| 精品中文字幕一区二区| 国产精品丝袜在线| 91麻豆国产福利精品| 日韩高清在线观看| 欧美成人猛片aaaaaaa| 国产成人在线视频免费播放| 国产精品久久久久久久久快鸭 | 亚洲视频电影在线| 色94色欧美sute亚洲线路一ni| 日韩和欧美一区二区| 精品日韩99亚洲| 成人不卡免费av| 午夜婷婷国产麻豆精品| 日韩精品一区二区三区视频播放| 成人av集中营| 亚洲一级在线观看| 狠狠色丁香久久婷婷综合_中| 国产精品久久久久久久久免费桃花| 在线国产亚洲欧美| 国产一区二区三区四区五区美女 | 国产一区二区久久| 日韩一区精品视频| 亚洲愉拍自拍另类高清精品| 亚洲素人一区二区| 国产午夜精品一区二区三区嫩草| 欧美日韩在线播放三区| 99久久国产免费看| av一区二区三区四区| 日本黄色一区二区| 在线一区二区三区四区五区| 7777精品伊人久久久大香线蕉| 一本到不卡精品视频在线观看| 色噜噜狠狠成人中文综合| 一区二区三区四区乱视频| 欧美日韩一区三区四区| 成人av免费在线播放|