当前位置: 首页>>代码示例>>Java>>正文


Java Event.getCurrentTarget方法代码示例

本文整理汇总了Java中org.w3c.dom.events.Event.getCurrentTarget方法的典型用法代码示例。如果您正苦于以下问题:Java Event.getCurrentTarget方法的具体用法?Java Event.getCurrentTarget怎么用?Java Event.getCurrentTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.w3c.dom.events.Event的用法示例。


在下文中一共展示了Event.getCurrentTarget方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
/**
 * Handles the event.
 */
public void handleEvent(Event evt) {
    EventTarget target = evt.getTarget();
    if (target != evt.getCurrentTarget()) {
        return;
    }

    MutationEvent mevt = (MutationEvent) evt;
    if (mevt.getAttrName().equals(XBL_REF_ATTRIBUTE)) {
        Element defRef = (Element) target;
        removeDefinitionRef(defRef);
        if (mevt.getNewValue().length() == 0) {
            XBLOMDefinitionElement def
                = (XBLOMDefinitionElement) defRef;
            String ns = def.getElementNamespaceURI();
            String ln = def.getElementLocalName();
            addDefinition(ns, ln,
                          (XBLOMDefinitionElement) defRef, null);
        } else {
            addDefinitionRef(defRef);
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:26,代码来源:DefaultXBLManager.java

示例2: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
    if (!(evt instanceof AbstractEvent)) return;
    final AbstractEvent ae = (AbstractEvent)evt;

    List l = ae.getDefaultActions();
    if (l != null) {
        Iterator i = l.iterator();
        while (i.hasNext()) {
            Object o = i.next();
            if (o instanceof AnchorDefaultActionable)
                return; // only one anchor in default list...
        }
    }


    SVGAElement elt = (SVGAElement)evt.getCurrentTarget();
    ae.addDefaultAction(new AnchorDefaultActionable
                        (elt, userAgent, holder));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:SVGAElementBridge.java

示例3: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
    // XXX for some reason, sometimes if refactoring is done while an XML phadhail is
    // expanded, some infinite loop occurs and this method is called repeatedly
    try {
        Element parent = (Element)evt.getCurrentTarget();
        if (logger.isLoggable(Level.FINER)) {
            logger.log(Level.FINER, "ElementLook: event on {0}: {1}; co={2}", new Object[] {parent.getTagName(), evt, getChildObjects(parent, null)});
        }
        fireChange(parent, Look.GET_CHILD_OBJECTS | Look.GET_DISPLAY_NAME);
    } catch (RuntimeException e) {
        e.printStackTrace();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ElementLook.java

示例4: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
@Override public void handleEvent(Event event) {
    HTMLAnchorElement anchorElement = (HTMLAnchorElement) event.getCurrentTarget();
    String href = anchorElement.getHref();

    if (Desktop.isDesktopSupported()) {
        openLinkInSystemBrowser(href);
    } else {
        LOGGER.warning("OS does not support desktop operations like browsing. Cannot open link '{" + href + "}'.");
    }

    event.preventDefault();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:HyperlinkRedirectListener.java

示例5: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
    HTMLAnchorElement anchorElement = (HTMLAnchorElement)event.getCurrentTarget();
    String href = anchorElement.getHref();

    if (isDesktopSupported()) {
        openLinkInSystemBrowser(href);
    } else {
        Log.warn(APPLICATION, "OS does not support desktop operations like browsing. Cannot open link '"+href+"'!");
    }

    event.preventDefault();
}
 
开发者ID:tbressler,项目名称:waterrower-workout,代码行数:14,代码来源:HyperlinkRedirectListener.java

示例6: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
/**
 * Runs the script.
 */
public void handleEvent(Event evt) {
    Element elt = (Element)evt.getCurrentTarget();
    // Evaluate the script
    String script = elt.getAttributeNS(null, attribute);
    if (script.length() == 0)
        return;

    DocumentLoader dl = bridgeContext.getDocumentLoader();
    SVGDocument d = (SVGDocument)elt.getOwnerDocument();
    int line = dl.getLineNumber(elt);
    final String desc = Messages.formatMessage
        (EVENT_SCRIPT_DESCRIPTION,
         new Object [] {d.getURL(), attribute, new Integer(line)});

    // Find the scripting language
    Element e = elt;
    while (e != null &&
           (!SVGConstants.SVG_NAMESPACE_URI.equals
            (e.getNamespaceURI()) ||
            !SVGConstants.SVG_SVG_TAG.equals(e.getLocalName()))) {
        e = SVGUtilities.getParentElement(e);
    }
    if (e == null)
        return;

    String lang = e.getAttributeNS
        (null, SVGConstants.SVG_CONTENT_SCRIPT_TYPE_ATTRIBUTE);

    runEventHandler(script, evt, lang, desc);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:34,代码来源:ScriptingEnvironment.java

示例7: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
/**
 * Runs the script.
 */
public void handleEvent(Event evt) {
    Element elt = (Element)evt.getCurrentTarget();
    // Evaluate the script
    String script = handlerElement.getTextContent();
    if (script.length() == 0)
        return;

    DocumentLoader dl = bridgeContext.getDocumentLoader();
    AbstractDocument d
        = (AbstractDocument) handlerElement.getOwnerDocument();
    int line = dl.getLineNumber(handlerElement);
    final String desc = Messages.formatMessage
        (HANDLER_SCRIPT_DESCRIPTION,
         new Object [] {d.getDocumentURI(),
                        eventNamespaceURI,
                        eventType,
                        new Integer(line)});

    // Find the scripting language
    String lang = handlerElement.getAttributeNS
        (null, SVGConstants.SVG_CONTENT_SCRIPT_TYPE_ATTRIBUTE);
    if (lang.length() == 0) {
        Element e = elt;
        while (e != null &&
               (!SVGConstants.SVG_NAMESPACE_URI.equals
                (e.getNamespaceURI()) ||
                !SVGConstants.SVG_SVG_TAG.equals(e.getLocalName()))) {
            e = SVGUtilities.getParentElement(e);
        }
        if (e == null)
            return;

        lang = e.getAttributeNS
            (null, SVGConstants.SVG_CONTENT_SCRIPT_TYPE_ATTRIBUTE);
    }

    runEventHandler(script, evt, lang, desc);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:42,代码来源:SVG12ScriptingEnvironment.java

示例8: handleEvent

import org.w3c.dom.events.Event; //导入方法依赖的package包/类
public void handleEvent(Event evt) {
    //
    // Only modify the cursor if the current target's (i.e., the <use>) cursor 
    // property is *not* 'auto'.
    //
    Element currentTarget = (Element)evt.getCurrentTarget();

    if (!CSSUtilities.isAutoCursor(currentTarget)) {
        Cursor cursor;
        cursor = CSSUtilities.convertCursor(currentTarget, ctx);
        if (cursor != null) {
            ctx.getUserAgent().setSVGCursor(cursor);
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:16,代码来源:SVGUseElementBridge.java


注:本文中的org.w3c.dom.events.Event.getCurrentTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。