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

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

?? htmltemplatedisplay.java

?? JAVA開源LDAP瀏覽器jxplorer的源碼!
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
        }
        return true;

/*
        if (subdir == null) subdir = "";
        if (subdir.length() > 0)
            if (subdir.endsWith("/") == false)
                subdir += "/";

        if (baseURL == null) baseURL = "";
        if (baseURL.length() > 0)
            if (baseURL.endsWith("/") == false)
                baseURL += "/";

        URL url;

        String baseTemplatePath = myProperties.getProperty("dir.templates");

        String fileName = baseTemplatePath + templateURL;    //TE: gets the path & name of each template that is displayed.  I.e when a tab is clicked.

        File template = new File(fileName);

        try
        {
            htmlText = new StringBuffer(CBUtility.readTextFile(template));

            url = new URL(baseURL + subdir + templateURL);

            // parse file and set paths correctly
            htmlText = parseNewTemplate(htmlText, url);
            baseText = htmlText.toString();  // set the base template text.
        }
        catch (Exception e)
        {
            try
            {
*/
                /**
                 * 	Probably not a politically correct way to find out if there are any plugin templates..
                 *	..but that is what this is doing.  If JX can't find a template in the normal JX dir,
                 *	then this checks the plugins dir for a (temporary) template dir.  If the template still
                 *	can't be found then it displays the error message.
                 *
                 *	The template is added to the combo box without the 'templates' prefix i.e: templates/person/whatever.html
                 *	so that normal picking up of the templates can occur in respect of object class.  In other words if
                 *	there is a plugins dir of 'person' as well as the default one, JX will display the template that is
                 *	is first in ASCII order.
                 *
                 *	This assumes that the user places any templates in a zip/jar file in the following dir format...
                 *	templates/"objectclass name"/"template name.html". (replacing names in commars).
                 */
/*
                String temp = new String(resourceLoader.getResource("templates/" + templateURL));	//TE: read the html template from the zip/jar file.

                templateURL = "temp" + File.separator + templateURL;			//TE: add the prefix so the HTML file can be found in the zip/jar file.

                htmlText = new StringBuffer(temp);
                //TODO: get Trudi to explain how this works?
                url = new URL(JXplorer.getFileURL(localURL) + templateURL);		//TE: point to the templates dir in the plugins dir rather than the one in JX.

                // parse file and set paths correctly
                htmlText = parseNewTemplate(htmlText, url);	//TE: parse as normal.
                baseText = htmlText.toString(); 			//TE: important to set this so JX knows where to find any images etc that are referenced by the HTML template.
            }
            catch (Exception ee)
            {
                return CBUtility.error(display, CBIntText.get("Can't find html template! ") + fileName, e);
            }
        }

        return true;
*/
    }


    /*    Pre-parses the html file, doing hack workarounds to make images
     *    work under broken Java 1.2.0 swing.
     *
     *    All this could be done more aesthetically using the HTMLEditorKit...
     *    But we're on a deadline, and it doesn't seem to work properly; so
     *    we'll hack it by hand for the time being... Especially since the
     *    *(&^ swing HTMLDocument documentBase property doesn't seem to
     *    work for generated documents (i.e. you can't set it!) so we need
     *    to stick in fully qualified base refs to things like images etc...
     */

    public StringBuffer parseNewTemplate(StringBuffer templateText, URL url)
    {
        // XXX DANGER WILL ROBINSON
        // XXX INCREDIBLY SCREWED SUN URL HANDLING
        // XXX file:// HIGHLY UNRELIABLE
        //
        // bottom code is carefully hacked to produce a base url reference
        // that may work on solaris under jre 1.3 as well as normal NT.
        // This can be very easily messed up (for example by naively using
        // suns URL class as a constructor).  Be carefull.

        String baseTagURL = url.getPath();

        // note - force use of 'file://' prefix.  URL constructed version would only
        // have file: prefix, ommitting double slash.  While both versions may work,
        // it seems to be variable...

        //XXX should we be trying to do something clever with the File.toURL() method here?

        baseTagURL = "file://" + baseTagURL.substring(0, baseTagURL.lastIndexOf('/') + 1);

        int headPos = templateText.toString().indexOf("<head>");

        String baseTag = "\n<base href=\"" + baseTagURL + "\">\n";

        templateText.insert(headPos + 7, baseTag);	//TE: was templateText.insert(headPos+6, baseTag); ??? html = <html <base href...> >
        // System.out.println(templateText);
        return templateText;
    }

    /**
     *    Returns a template file given the root path and name of the file.
     *
     *    @param fileNameAndPath the name and path, but <b>not</b> the extension,
     *                           of the template file
     *
     *    @return the File object found.  This may be null, or may not exist; these
     *            conditions must be checked for.
     */

    public File getTemplateFile(String fileNameAndPath)
    {
        String fileName = fileNameAndPath + ".html";
        File templateFile = new File(fileName);
        if (templateFile.exists() == false)    // check file exists, try '.htm' ext. if not
            templateFile = new File(fileNameAndPath + ".htm");
        return templateFile;
    }


    public String[] getObjectClasses(DXAttributes atts)
    {
        try
        {
            Attribute a = atts.getAllObjectClasses();

            if (a == null) return new String[]{};

            DXNamingEnumeration en = new DXNamingEnumeration(a.getAll());
            en.sort();    // alphabetacize.

            String[] ret = en.toStringArray();

            return ret;
        }
        catch (NamingException e)
        {
            log.warning("unable to read object classes in AttributeDisplay: " + e.toString());
        }
        return null;
    }

    /**
     *    Concatenates a string array of alphabetically ordered object Classes into
     *    one long string, providing a unique String for this combination of classes.
     *
     */

    public String getObjectClassSignature(String[] objectClasses)
    {
        String ret = "";
        if (objectClasses == null) return "";
        for (int i = 0; i < objectClasses.length; i++)
            ret += objectClasses[i];
        return ret;
    }


    /**
     *    Checks if the list of object classes has changed.  If it has,
     *    reset the 'oldClassSignature' and return true, otherwise return
     *    false.
     */

    public boolean objectClassesChanged(String classesSignature)
    {
        return !((oldObjectClassesSignature != null) && (oldObjectClassesSignature.equals(classesSignature)));
    }


    public void displayEntry(DXEntry entry, DataSource formDataSource)
    {
        if (entry == null || entry.size() == 0)
        {
            setEditorText(NODATA);
            return;
        }

        currentDataSource = formDataSource;  // used by form submission handler in MyHTMLEditorKit.

        currentEntry = entry;

        String[] objectClasses = getObjectClasses(entry);
        if (objectClasses == null)
        {
            log.warning("unable to find any object classes for " + entry.getDN().toString());
            setEditorText(NODATA);
            return;
        }

        setupTemplates(objectClasses, entry);  // change templates if necessary...


        if (entry == null)
        {
            CBUtility.error(this, CBIntText.get("Error. No data for this node!"), null);
            setEditorText(NODATA);
            return;
        }
        displayData(entry);
    }

    /**
     *    Takes a list of object classes, and if the object classes to display have
     *    changed modifies the list of available templates to display only appropriate
     *    templates.
     */
    void setupTemplates(String[] objectClasses, DXEntry entry)
    {
        String objectClassesSignature = getObjectClassSignature(objectClasses);

        // change the template viewing combo box to a new set of templates, if objectClass has changed
        if (objectClassesChanged(objectClassesSignature))
        {
            // remember the current menu position for later
            viewTemplatesPos.put(oldObjectClassesSignature, new Integer(viewTemplates.getSelectedIndex()));
            oldObjectClassesSignature = objectClassesSignature;

            // disable combo box action listener using flag
            settingUpTemplates = true;

            // clear all existing combo box templates
            viewTemplates.removeAllItems();

            // read the list of new templates for the particular object classes this entry has.
            String[] templates = readTemplateNames(objectClasses);

            if ((templates == null) || (templates.length == 0))
            // make sure that we found some!  (We *should* find at least the default templates)
                log.warning("No templates found for objectClasses " + objectClassesSignature);
            else
            {
                // load the combo box with the listed templates, in the order we got them from readTemplateNames
                for (int i = 0; i < templates.length; i++)
                    viewTemplates.addItem(templates[i]);


                if (viewTemplatesPos.containsKey(objectClassesSignature))
                {
                    // If we've viewed this object class set before, try to use the same template as last time.
                    int indexPos = ((Integer) viewTemplatesPos.get(objectClassesSignature)).intValue();
                    if (indexPos < templates.length)
                        viewTemplates.setSelectedIndex(indexPos);
                }
                else
                {
                    // if we *haven't* viewed this object class set before...
                    // ... set the combo box to show the first option ('all') by default
                    viewTemplates.setSelectedIndex(0);

                    // ... and try to set the view to the most specific available template
                    attemptToSetOCSpecificTemplate(entry, templates);
                }
                String templateName = viewTemplates.getSelectedItem().toString();
                openNewTemplate(templateName);
            }
            settingUpTemplates = false;		// re-enable combo box action listener
        }
    }

    /**
     *    This attempts to match a list of template names with the deepest possible
     *    object class.
     */

    protected void attemptToSetOCSpecificTemplate(DXAttributes entry, String[] templates)
    {
        //String baseOC = ((DXAttributes)entry).getBaseObjectClass();
        Vector ocs = (entry).getOrderedOCs();

        for (int i = 0; i < ocs.size(); i++)
        {
            String oc = ((String) ocs.get(i)).toLowerCase();
            for (int j = 0; j < templates.length; j++)
            {
                String template = templates[j].toLowerCase();
                if (template.startsWith(oc))
                {
                    settingUpTemplates = true;
                    viewTemplates.setSelectedIndex(j);
                    settingUpTemplates = false;
                    return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二三区精品| 国产精品久久久久久久久免费樱桃| 精品国精品国产尤物美女| 国产人久久人人人人爽| 午夜精品在线视频一区| 成人中文字幕合集| 日韩手机在线导航| 亚洲无线码一区二区三区| 成人一区二区三区中文字幕| 欧美福利一区二区| 亚洲精品水蜜桃| www.亚洲在线| 国产精品天美传媒| 黄页视频在线91| 91精品国产一区二区三区蜜臀| 亚洲视频网在线直播| 国产盗摄女厕一区二区三区| 日韩欧美www| 日本成人在线一区| 欧美日韩视频在线观看一区二区三区 | 日本韩国视频一区二区| 国产欧美精品日韩区二区麻豆天美| 免费一级片91| 欧美一卡2卡三卡4卡5免费| 亚洲国产一区二区在线播放| 91女神在线视频| 亚洲视频在线观看一区| 99久久久久免费精品国产| 国产精品欧美极品| 成人高清伦理免费影院在线观看| 日本一区二区视频在线| 国产成人精品一区二| 欧美激情综合五月色丁香小说| 国产成人精品aa毛片| 亚洲国产经典视频| www.av精品| 亚洲乱码国产乱码精品精98午夜 | 亚洲图片激情小说| 成人国产精品免费| 国产偷v国产偷v亚洲高清| 国产成人免费网站| 久久亚洲捆绑美女| 国产美女娇喘av呻吟久久| 久久久久国产一区二区三区四区| 国产精品一区二区三区四区| 欧美国产日韩亚洲一区| 91年精品国产| 日日夜夜精品视频天天综合网| 欧美一二三区在线观看| 国产成人自拍在线| 亚洲免费观看高清完整版在线| 欧美亚洲综合一区| 久久国内精品视频| 中文字幕av一区二区三区| 91丨九色丨黑人外教| 亚洲国产成人精品视频| 精品福利一区二区三区| 国产91精品一区二区麻豆网站| 樱花影视一区二区| 欧美一区二区三区小说| 成人午夜又粗又硬又大| 亚洲动漫第一页| 久久久精品日韩欧美| 在线亚洲一区观看| 国内国产精品久久| 伊人开心综合网| ww亚洲ww在线观看国产| 欧美性生活一区| 国产成人精品一区二区三区网站观看| 亚洲精品视频自拍| 26uuu久久天堂性欧美| 91行情网站电视在线观看高清版| 久久激情五月婷婷| 亚洲天堂中文字幕| 久久午夜电影网| 欧美日韩一级二级| 懂色一区二区三区免费观看| 日韩黄色免费电影| 亚洲私人影院在线观看| 久久综合久久鬼色中文字| 91福利精品视频| 成人午夜免费视频| 精品一区二区三区在线观看国产| 亚洲免费观看高清| 中文字幕精品综合| 日韩视频一区在线观看| 欧美性猛交一区二区三区精品| 国产一区 二区 三区一级| 亚洲va在线va天堂| 亚洲欧洲av色图| 国产日韩高清在线| 欧美成人video| 91精品国产色综合久久久蜜香臀| 99精品在线免费| 国产福利电影一区二区三区| 久久国产福利国产秒拍| 午夜亚洲国产au精品一区二区| 1000部国产精品成人观看| 国产欧美日产一区| 久久免费看少妇高潮| 欧美色爱综合网| 色94色欧美sute亚洲13| 91亚洲精华国产精华精华液| 国产成人免费视频精品含羞草妖精| 美女免费视频一区| 天天影视涩香欲综合网| 亚洲444eee在线观看| 依依成人精品视频| 亚洲精品视频观看| 亚洲免费观看高清完整版在线观看 | 毛片一区二区三区| 日韩电影一区二区三区| 午夜精品久久久久久久久久久| 亚洲精品国产品国语在线app| 亚洲欧美一区二区三区国产精品| 国产精品午夜在线观看| 国产日产欧美一区| 欧美激情一区二区在线| 国产精品午夜在线观看| 国产精品久久午夜| 亚洲欧美日韩国产另类专区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 日本一区二区在线不卡| 中文字幕欧美一区| 一区二区在线看| 性做久久久久久| 免费在线看成人av| 国产精品白丝jk白祙喷水网站| 国产精品白丝av| 不卡影院免费观看| 色哟哟亚洲精品| 欧美人与z0zoxxxx视频| 精品乱人伦一区二区三区| 欧美激情一区二区三区四区 | 日本视频中文字幕一区二区三区| 人禽交欧美网站| 国产一区二区免费看| 丰满少妇在线播放bd日韩电影| 99精品国产热久久91蜜凸| 欧美性猛交xxxx黑人交| 日韩精品一区二区三区四区视频| 久久网站最新地址| 亚洲精品免费电影| 秋霞午夜av一区二区三区| 国产精品1024| 在线免费精品视频| 日韩欧美一二三区| 亚洲视频免费在线观看| 免费观看久久久4p| 成人黄色免费短视频| 欧美日本在线播放| 日本一区二区三区dvd视频在线| 亚洲精品免费一二三区| 狠狠色综合色综合网络| 91极品视觉盛宴| 久久久久97国产精华液好用吗| 亚洲精品第1页| 国产美女一区二区| 91精品免费在线观看| 中文字幕不卡一区| 青青草成人在线观看| a4yy欧美一区二区三区| 日韩精品一区二区三区视频| 亚洲精品乱码久久久久| 成人免费视频免费观看| 欧美日韩国产综合草草| 国产精品全国免费观看高清 | 成人国产精品免费观看动漫| 欧美一级艳片视频免费观看| 自拍偷在线精品自拍偷无码专区 | 国产一区不卡视频| 欧美日韩国产a| 国产精品少妇自拍| 极品销魂美女一区二区三区| 欧美日本一区二区| 亚洲色图欧美偷拍| 成+人+亚洲+综合天堂| 欧美精品一区二| 最新国产の精品合集bt伙计| 国产一区二区三区精品视频| 日韩一区二区三区av| 玉米视频成人免费看| 成人国产精品免费网站| 久久欧美一区二区| 麻豆一区二区三区| 91精品国产免费| 午夜亚洲福利老司机| 欧美日韩一区二区三区视频 | 国产精品无遮挡| 国产麻豆一精品一av一免费| 欧美成va人片在线观看| 热久久一区二区| 日韩欧美国产系列| 天堂精品中文字幕在线| 欧美日韩成人综合在线一区二区| 亚洲国产成人av网| 欧美综合欧美视频| 图片区小说区国产精品视频| 欧洲精品视频在线观看| 亚洲sss视频在线视频|