Java event listeners. newbie

hi guys
i have this simple applet with 2 threads and a scrollpane in the first thread which scrolls some test data in a textarea.
i need to add an event listener to capture the movement of the vertical scrollbar. the examples i have seen online all use a seperate class for event listening.
i was wondering if i am able to incorporate it all into this 1 class below, or must i use a seperate event listening class?
any code would be welcome! thanks in advance.
import java.applet.Applet;
import java.awt.*;
import javax.swing.*;
public class DisplayApplet extends Applet {
     public static JTextArea data = new JTextArea("", 20,100);
     public static JScrollPane dataScroll = new JScrollPane();
     public void refreshData() {
          System.out.println("refreshing data..");
     public void scrollDown() {
          System.out.println("scrolling down..");
     public void scrollUp() {
          System.out.println("scrolling up..");
     public void start() {          
          Runnable displayThread = new Runnable() {     
               public void run() {
                    System.out.println("Hello from thread 1");                    
                    data.setFont(new Font("Courier", Font.PLAIN, 10));
                    for (int i=0;i<100;i++) {
                         data.append("test\n");
                    dataScroll = new JScrollPane(data);                    
                    DisplayApplet.this.add(dataScroll);
          Runnable dataThread = new Runnable() {
               public void run() {
                    System.out.println("Hello from thread 2");                    
          new Thread(displayThread).start();
          new Thread(dataThread).start();
}

i understand your frustration, but you must also
understand that i am a java newbie. there was a time
when you didnt know any java.I only get frustrated if people don't listen to what I say, newbie or not.
im just trying to work
my way up to your knowledge and one of my initial
tasks is to write a multithreaded application with
event listeners.So go ahead.
http://java.sun.com/docs/books/tutorial/uiswing/events/index.html
may be easy for you, but it is a
little overwhelming for me as a point of entry into
java. thats all. thats why i asked if my classes were
arranged in the correct structre. i didnt know. i
need advice. i didnt say that was what i was going to
use.
any suggestions are welcome.I provided suggestions for structure. I provided suggestions for a listener to use. What else do you want?

Similar Messages

  • Help me I'm trying to create event listeners

    I am trying to create event listeners
    Whenever any keyboard event occurs the string s gets appended by a,c
    or p.At the end of the program its supposed to print value of s
    But s always happens to null.Please tell me how to correct it....so
    that detection is possible for any case
    import java.io.*;
    import java.awt.event.*;
    public class trial {
    int x;
    public static String s;
    //OutputStream f1=new FileOutputStream("file2.txt");
    public static void keyReleased(KeyEvent e)
    s=s+"a";
    public static void keyPressed(KeyEvent e)
    s=s+"c";
    public static void keyTyped(KeyEvent e)
    s=s+"p";
    public static void main(String args[])
    throws IOException
    char c;
    BufferedReader br =new BufferedReader(new
    InputStreamReader(System.in));
    System.out.println("Entercharactes,'q' to quit.");
    do
    c=(char)br.read();
    System.out.println(c);
    while(c!='q');
    // for(int i=0;i<s.length();++i)
    System.out.println(s);

    I suggest looking at the java tutorial. Your code completely misses the mark and you need to see examples.

  • Event Listeners VS Event Functions

    I'm working on a new project at work where there's lots of
    custom objects with lots and lots of event listeners. I keep
    finding myself saying, "why didn't they just use the built in
    objects with built in event handling?". However, from what I can
    see it seems like AS3 leans heavily towards using Event Listeners
    as opposed to putting event responsibility on the object itself
    (E.G. XML.onload). Is there an advantage to this (other than making
    it more Java like?) I've always favoured keeping the responsibility
    on the object itself because it seems like one less object to keep
    track of and also makes things feel more self contained. If I have
    10 objects that fire 10 different events, I have to create 10
    different event handlers (or 10 different case statements within
    the same event handler), whereas with self event handling, I just
    code in the event function.
    Anyways, I wanted to open discussion to which method of event
    handling you prefer and why, and also what you believe the
    advantages to this. I was searching google for previous discussions
    on this but I couldn't seem to find anything, so I thought I'd get
    the ball rolling! Looking forward to reading these, try not to be
    too elitist in your posts!!

    I tried to change getFileOperation to getFileOperation2 in one of the functions as follows but same problem appeared.
    function f3 (event:MouseEvent):void
    trace("f3 triggered");
    getFileOperation2.addEventListener(ResultEvent.RESULT, f4);
    Do you have an idea how I can avoid the same function from triggering twice?? thanks a lot

  • All event listeners and models in one file?

    I have one java file for all my event listeners of a programm and one java file for all my models. Is this good?
    I create instances with new AllInOneHandler.MouseHandler() for example.
    Or should I have one file for each event and each model?

    Hi,
    you should have one file for each class or interface - this gives you best control and reusability. Also when you have javadoc-comments in it, big files with many classes in it will become hard to edit.
    When using one file for each class or interface you can import only the needed classes or interfaces instead of importing whole packages - so it is easier to see, what is exactly imported. As so a good structured application has many classes, where each of them is small (and in an own source file), you will have less problems during the evolution of your classes this way.
    If you want to group some classes, why not use sub-packages for this purpose?
    greetings Marsian

  • Translating Visual Basic Events into Java Events

    I'm in the process of porting a Visual Basic application to Java. Now, most of it is pretty straight forward, since good OO practice is evident in the original VB source. With a good dose of refactoring along the way the Java version is looking pretty good too.
    However, I'm having a problem with events. Here's a snuppet of one of a VB class that generates events and one that uses it:
    (Invoices.cls)
    -=-=-=-=-=-=-=-=-
    Event AddItem(ItemID as String)
    Event RemoveItem(ItemID as String)
    Private m_Items as Collection
    Public Sub Add(ItemID as String)
       m_Items.Add ItemID
       RaiseEvent AddItem(ItemID)
    End Sub
    Public Sub Remove(ItemID as String)
       m_Items.Remove ItemID
       RaiseEvent RemoveItem(ItemID)
    End Sub
    -=-=-=-=-=-=-=-=-and
    (OrderBook.cls)
    -=-=-=-=-=-=-=-=-
    Private WithEvents m_Invoices as Invoices
    Private Sub m_Invoices_AddItem(ItemID as String)
       CalculateTotals
    End Sub
    Private Sub m_Invoices_RemoveItem(ItemID as String)
       CalculateTotals
    End Sub
    -=-=-=-=-=-=-=-=-Can anyone give me a few pointers on what the Java equivalent to this VB code is?
    Thanks,
    Vince.

    Hi,
    There are few main things involved in a Java event delivery
    1. The event source
    2. The event listener
    3. The even data
    4. Registration
    5. The event delivery process
    I don't know the VB syntax, but any way it gives a good idea of what you wish to achieve.
    Here the Invoice class is basically the event source. And the OrderBook class is the event listener. To proceed further you will have to specify (define) the event listener first. Secondly you will have to create an event object which contains the data to be delvered via the event.
    1. Specifying the event listener interface
    public Interface ItemOperationListener
    public void itemAdded (ItemOperationEvent ioe);
    public void itemRemoved (ItemOperationEvent ioe);
    2. The event class
    public class ItemOperationEvent extends java.util.EventObject
    String item = null;
    public ItemOperationevent(Object source, String Item)
    super(source);
    this.item = item;
    public String getItem()
    return item;
    3. Creating and firing the event from the event source.
    public class Invoice
    private collection items; // any collection
    // to hold all the event listeners , this way u can define > 1
    // listeners
    javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList();
    public void addItem(String item)
    items.add(item);
    // update the listeners
    fireItemAdded(item);
    public void removeItem(String item)
    items.add(item);
    // update the listeners
    fireItemRemoved(item);
    public void addItemOperationListener(itemOperationListener ioe)
    listenerList.add(ioe);
    public void removeItemOperationListener(itemOperationListener ioe)
    listenerList.remove(ioe);
    public void fireItemAdded(String item)
    ItemOperationEvent e = null;
    Object[] listeners = listenerList.getListenerList();
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length-2; i>=0; i-=2) {
    if (listeners== ItemOperationListener.class) {
    if (e == null)
    e = new ItemOperationEvent(this,item);
    ((ItemOperationlistener)listeners[i+1]).itemAdded(e);
    public void fireItemRemoved(String item)
    ItemOperationEvent e = null;
    Object[] listeners = listenerList.getListenerList();
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length-2; i>=0; i-=2) {
    if (listeners[i] == ItemOperationListener.class) {
    if (e == null)
    e = new ItemOperationEvent(this,item);
    ((ItemOperationlistener)listeners[i+1]).itemRemoved(e);
    4. The listener and the registration .
    public class OrderBook implements ItemOperationListener
    private Invoice invoice; // invoice instance.
    public OrderBook()
    // register for event updates .
    invoice.additemOperationListener(this);
    public void itemAdded(ItemOperationEvent ioe)
    String tobeAdded = ioe.getItem();
    calculate();
    public void itemRemoved(ItemOperationEvent ioe)
    String tobeRemoved = ioe.getItem();
    calculate();
    public void calculate()
    I hope this gives a picture of the standard method of event delivery in java . However you can even follow the Observer, Observable pattern (see the documentation for java.util.Observer, Observable).
    Hope this helps,
    Manish.

  • JSP have event listeners???

    Hi Would like to check if JSP have event listeners?? Eg.Like onblur that is used to activate javascript. Instead of calling a javascript function, can it call a JSP code or function.
    Do JSP has functions like javascript?
    Also does anyone know how if javabean is able to return a value and place it in a textfield on a JSP page??
    Please help me I am going more and more headache
    as mine deadline draws near....sign :(

    No.
    JSP can have Java code as scriptlets, but tag libraries are preferred. I don't put any scriptlet code in my JSPs.
    You can add a JavaBean to page, request, session, or application scope in a JSP page and access the properties that have getters. Then you can assign the values to a text field.
    I don't know how tight your deadline is, but the best approach in my view is to use Java Standard Tag Library (JSTL). Jakarta has a free implementation. I'd also recommend reading Shawn Bayern's "JSTL In Action" book. You'll be up to speed with JSTL very quickly. It will provide a solution to what you're asking, if your deadline will allow you time to learn it. The book is very well-written and technically excellent, IMO. - MOD

  • Error trying to register a Java event listener

    I'm trying to register a java event listener in 11g with the following piece of code:
    DECLARE
    b BOOLEAN := FALSE;
    BEGIN
    b := DBMS_XDB.createFolder('/public/resconfig');
    b := DBMS_XDB.createResource(
    '/public/resconfig/hr_event.xml',
    '<ResConfig xmlns="http://xmlns.oracle.com/xdb/XDBResConfig.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/xdb/XDBResConfig.xsd
    http://xmlns.oracle.com/xdb/XDBResConfig.xsd">
    <event-listeners default-language="Java">
    <listener>
    <description>Category application</description>
    <schema>HR</schema>
    <source>xdbproject.OpenOfficeEventHandler</source>
    <language>Java</language>
    <events>
    <Post-Create/>
    <Post-LinkIn/>
    </events>
    </listener>
    </event-listeners>
    <defaultChildConfig>
    <configuration>
    <path>/public/resconfig/hr_event.xml</path>
    </configuration>
    </defaultChildConfig>
    </ResConfig>');
    END;
    This results in the following error message
    ORA-31146: Ugyldig lytterkilde HR.xdbproject.OpenOfficeEventHandler
    ORA-06512: ved "XDB.DBMS_XDB", line 174
    ORA-06512: ved line 5
    which translates to Invalid listener source.
    My class is loaded in the HR schema, and implements the XDBRepositoryEventListener
    Does anybody have a suggestion to what I'm doing wrong, or how I can find out what makes my class invalid as a listener source?

    Check if it validates against the restrictions set in the XML Schema (Appendix A, Oracle XMLDB Developers Guide):
    XDBResConfig.xsd: XML Schema for Resource Configuration
    This section presents the Oracle XML DB supplied XML schema used to configure repository resources. This is accessible in Oracle XML DB Repository at path /sys/schemas/PUBLIC/xmlns.oracle.com/xdb/XDBResConfig.xsd.
    XDBResConfig.xsd
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xmlns.oracle.com/xdb/XDBResConfig.xsd"
            xmlns:xdb="http://xmlns.oracle.com/xdb"
            xmlns:rescfg="http://xmlns.oracle.com/xdb/XDBResConfig.xsd"
            elementFormDefault="qualified" xdb:schemaOwner="XDB" version="1.0" >
      <annotation>
        <documentation>
          This XML schema declares the schema of an XDB resource configuration,
          which includes default ACL, event listeners and user configuration.
          It lists all XDB repository events that will be supported.
          Future extension can be added to support user-defined events and
          XML events.
        </documentation>
      </annotation>
      <simpleType name="language">
        <restriction base="string">
          <enumeration value="Java" />
          <enumeration value="C" />
          <enumeration value="PL/SQL" />
        </restriction>
      </simpleType>
      <complexType name = "existsNode">
         <all>
           <element name="XPath" type = "string" minOccurs="1" maxOccurs="1" />
           <element name="namespace" type = "string" minOccurs="0" maxOccurs="1" />
         </all>
      </complexType>
      <!-- listener pre-condition element  -->
      <complexType name = "condition">
         <all>
           <element name="existsNode" type = "rescfg:existsNode" minOccurs="0" maxOccurs="1" />
         </all>
      </complexType>
      <complexType name = "events">
        <all>
          <element name="Render" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-Create" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-Create" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-Delete" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-Delete" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-Update" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-Update" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-Lock" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-Lock" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-Unlock" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-Unlock" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-LinkIn" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-LinkIn" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-LinkTo" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-LinkTo" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-UnlinkIn" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-UnlinkIn" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-UnlinkFrom" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-UnlinkFrom" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-CheckIn" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-CheckIn" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-CheckOut" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-CheckOut" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-UncheckOut" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-UncheckOut" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-VersionControl" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-VersionControl" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-Open" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-Open" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Pre-InconsistentUpdate" type="string" minOccurs="0" maxOccurs="1"/>
          <element name="Post-InconsistentUpdate" type="string" minOccurs="0" maxOccurs="1"/>
        </all>
      </complexType>
      <!-- event listener element  -->
      <complexType name = "event-listener">
        <all>
          <element name="description" type = "string" minOccurs="0" maxOccurs="1"/>
          <element name="schema" type = "string" minOccurs="0" maxOccurs="1"/>
          <element name="source" type = "string" minOccurs="1" maxOccurs="1"/>
          <element name="language" type = "rescfg:language" minOccurs="0" maxOccurs="1"/>
          <element name="pre-condition" type = "rescfg:condition" minOccurs="0" maxOccurs="1"/>
          <element name="events" type = "rescfg:events" minOccurs="0" maxOccurs="1"/>
        </all>
      </complexType>
      <complexType name="event-listeners">
        <sequence>
          <element name="listener" type = "rescfg:event-listener" minOccurs="1" maxOccurs="unbounded"/>
        </sequence>
        <attribute name = "default-schema" type = "string" xdb:baseProp="true" use="optional"/>
        <attribute name = "default-language" type = "rescfg:language" xdb:baseProp="true"
                   use="optional"/>
        <attribute name = "set-invoker" type = "boolean" xdb:baseProp="true" default="false" />
      </complexType>
      <complexType name="defaultPath">
        <all>
          <element name="pre-condition" type = "rescfg:condition" minOccurs="0" maxOccurs="1"/>
          <element name="path" type="string" minOccurs="0" maxOccurs="1" xdb:transient="generated"/>
          <element name = "resolvedpath" type = "string" minOccurs="1" maxOccurs="1"
                   xdb:baseProp="true" xdb:hidden="true"/>
          <element name = "oid" type = "hexBinary" minOccurs="1" maxOccurs="1" xdb:baseProp="true"
                   xdb:hidden="true"/>
        </all>
      </complexType>
      <complexType name="defaultACL">
        <sequence>
          <element name="ACL" type="rescfg:defaultPath" minOccurs="1" maxOccurs="unbounded"/>
        </sequence>
      </complexType>
      <complexType name = "defaultConfig">
        <sequence>
          <element name="configuration" type="rescfg:defaultPath" minOccurs="1" maxOccurs="unbounded"/>
        </sequence>
      </complexType>
      <simpleType name="link-type">
        <restriction base="string">
          <enumeration value="None"/>
          <enumeration value="Hard"/>
          <enumeration value="Weak"/>
          <enumeration value="Symbolic"/>
        </restriction>
      </simpleType>
      <simpleType name="path-format">
        <restriction base="string">
          <enumeration value="OID"/>
          <enumeration value="Named"/>
        </restriction>
      </simpleType>
      <simpleType name="link-metadata">
        <restriction base="string">
          <enumeration value="None"/>
          <enumeration value="Attributes"/>
          <enumeration value="All"/>
        </restriction>
      </simpleType>
      <simpleType name="unresolved-link">
        <restriction base="string">
          <enumeration value="Error"/>
          <enumeration value="SymLink"/>
          <enumeration value="Skip"/>
        </restriction>
      </simpleType>
      <simpleType name="conflict-rule">
        <restriction base="string">
          <enumeration value="Error"/>
          <enumeration value="Overwrite"/>
          <enumeration value="Syspath"/>
        </restriction>
      </simpleType>
       <simpleType name="section-type">
         <restriction base="string">
           <enumeration value="None"/>
           <enumeration value="Fragment"/>
           <enumeration value="Document"/>
         </restriction>
       </simpleType>
      <!-- XLinkConfig complex type -->
        <complexType name="xlink-config">
         <sequence>
          <element name="LinkType" type = "rescfg:link-type"/>
          <element name="PathFormat" type = "rescfg:path-format" minOccurs="0" default="OID"/>
          <element name="LinkMetadata" type = "rescfg:link-metadata" minOccurs="0" default="None"/>
         </sequence>
         <attribute name="UnresolvedLink" type = "rescfg:unresolved-link" default="Error"/>
        </complexType>
      <!-- XIncludeConfig element -->
        <complexType name="xinclude-config">
         <sequence>
          <element name="LinkType" type = "rescfg:link-type"/>
          <element name="PathFormat" type = "rescfg:path-format" minOccurs="0" default="OID"/>
          <element name="ConflictRule" type = "rescfg:conflict-rule" minOccurs="0" default="Error"/>
         </sequence>
         <attribute name="UnresolvedLink" type = "rescfg:unresolved-link" default="Error"/>
        </complexType>
      <!-- SectionConfig element -->
      <complexType name="section-config">
       <sequence>   
        <element name="Section" maxOccurs="unbounded">
          <complexType>
            <sequence>
             <element name="sectionPath" type="string"/>
             <element name="documentPath" type="string" minOccurs="0"/>
             <element name="namespace" type="string" minOccurs="0"/>
            </sequence>
            <attribute name="type" type="rescfg:section-type" default="None"/>
          </complexType>
        </element>
       </sequence>
      </complexType>
      <!-- ContentFormat element -->
      <simpleType name="content-format" >
        <restriction base="string">
          <enumeration value="text"/>
          <enumeration value="binary"/>
        </restriction>
       </simpleType>
      <!-- resource configuration element  -->
      <complexType name = "ResConfig">
        <all>
          <element name="defaultChildConfig" type="rescfg:defaultConfig" minOccurs="0"  maxOccurs="1"/>
          <element name="defaultChildACL" type="rescfg:defaultACL" minOccurs="0" maxOccurs="1"/>
          <element name="event-listeners" type = "rescfg:event-listeners" minOccurs="0" maxOccurs="1"/>
          <element name="XLinkConfig" type="rescfg:xlink-config" minOccurs="0" maxOccurs="1"/>
          <element name="XIncludeConfig" type="rescfg:xinclude-config" minOccurs="0" maxOccurs="1"/>
          <element name="SectionConfig" type="rescfg:section-config" minOccurs="0" maxOccurs="1"/>
          <element name="ContentFormat" type="rescfg:content-format" minOccurs="0" maxOccurs="1"/>
          <!-- application data -->
          <element name="applicationData" minOccurs="0" maxOccurs="1" >
             <complexType>
               <sequence>
                 <any namespace="##other" maxOccurs="unbounded" processContents="lax"/>
               </sequence>
             </complexType>
         </element>
        </all>
        <attribute name = "enable" type = "boolean" xdb:baseProp="true" default="true" />
        <attribute name = "copy-on-inconsistent-update" type = "boolean" use="optional" />
      </complexType>
      <element name="ResConfig" type="rescfg:ResConfig" xdb:defaultTable = "XDB$RESCONFIG" />
    </schema>
    acl.xsd: XML Schema for ACLs
    This section presents the Oracle Database supplied XML schema used to represent access control lists (ACLs).
    acl.xsd
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://xmlns.oracle.com/xdb/acl.xsd" version="1.0"
            xmlns:xdb="http://xmlns.oracle.com/xdb"
            xmlns:xdbacl="http://xmlns.oracle.com/xdb/acl.xsd"
            elementFormDefault="qualified">
       <annotation>
         <documentation>
            This XML schema describes the structure of XDB ACL documents.
            Note : The "systemPrivileges" element below lists all supported
              system privileges and their aggregations.
              See dav.xsd for description of DAV privileges
            Note : The elements and attributes marked "hidden" are for
              internal use only.
         </documentation>
         <appinfo>
           <xdb:systemPrivileges>
            <xdbacl:all>
              <xdbacl:read-properties/>
              <xdbacl:read-contents/>
              <xdbacl:read-acl/>
              <xdbacl:update/>
              <xdbacl:link/>
              <xdbacl:unlink/>
              <xdbacl:unlink-from/>
              <xdbacl:write-acl-ref/>
              <xdbacl:update-acl/>
              <xdbacl:link-to/>
              <xdbacl:resolve/>
              <xdbacl:write-config/>
            </xdbacl:all>
           </xdb:systemPrivileges>
         </appinfo>
       </annotation>
      <!-- privilegeNameType (this is an emptycontent type) -->
      <complexType name = "privilegeNameType"/>
      <!-- privilegeName element
           All system and user privileges are in the substitutionGroup
           of this element.
        -->
      <element name = "privilegeName" type="xdbacl:privilegeNameType"
               xdb:defaultTable=""/>
      <!-- all system privileges in the XDB ACL namespace -->
      <element name = "read-properties" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "read-contents" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "read-acl" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "update" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "link" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "unlink" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "unlink-from" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "write-acl-ref" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "update-acl" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "link-to" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "resolve" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <element name = "all" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
      <!-- privilege element -->
      <element name = "privilege" xdb:defaultTable="">
        <complexType>
          <sequence>
            <any maxOccurs="unbounded" processContents="lax"/>
          </sequence>
        </complexType>
      </element>
      <!-- ace element -->
      <element name = "ace" xdb:defaultTable="">
        <complexType>
          <sequence>
            <element name = "grant" type = "boolean"/>
            <choice>
              <element name="invert" xdb:transient="generated">
                <complexType>
                  <sequence>
                    <element name="principal" type="string"
                             xdb:transient="generated" />
                  </sequence>
                </complexType>
              </element>
              <element name="principal" type="string" xdb:transient="generated"/>
            </choice>
            <element ref="xdbacl:privilege" minOccurs="1"/>
            <!-- "any" contain all app info for an ACE e.g.reason for creation -->
            <any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
            <!-- HIDDEN ELEMENTS -->
            <choice minOccurs="0">
              <element name = "principalID" type = "hexBinary"
                       xdb:baseProp="true" xdb:hidden="true"/>
              <element name = "principalString" type = "string"
                       xdb:baseProp="true" xdb:hidden="true"/>
            </choice>
            <element name = "flags" type = "unsignedInt" minOccurs="0"
                     xdb:baseProp="true" xdb:hidden="true"/>
          </sequence>
          <attribute name = "collection" type = "boolean"
                     xdb:transient="generated" use="optional"/>
          <attribute name = "principalFormat"
                     xdb:transient="generated" use="optional">
            <simpleType>
              <restriction base="string">
                <enumeration value="ShortName"/>
                <enumeration value="DistinguishedName"/>
                <enumeration value="GUID"/>
                <enumeration value="XSName"/>
              </restriction>   
            </simpleType>
          </attribute>
          <attribute name = "start_date" type = "dateTime" use = "optional"/>
          <attribute name = "end_date" type = "dateTime" use = "optional"/>    
        </complexType>
      </element>
      <!-- acl element -->
      <complexType name="inheritanceType">
        <attribute name="type" type="string" use="required"/>
        <attribute name="href" type="string" use="required"/>
      </complexType>
      <complexType name="aclType">
       <sequence>
        <element name = "schemaURL" type = "string" minOccurs="0"
                 xdb:transient="generated"/>
        <element name = "elementName" type = "string" minOccurs="0"
                 xdb:transient="generated"/>
        <element name = "security-class" type = "QName" minOccurs="0"/>
        <choice minOccurs="0">
          <element name="extends-from" type="xdbacl:inheritanceType"/>
          <element name="constrained-with" type="xdbacl:inheritanceType"/>
        </choice>
        <element ref = "xdbacl:ace" minOccurs="1" maxOccurs = "unbounded"/>
        <!-- this "any" contains all application specific info for an ACL,
             e.g., reason for creation  -->
        <any minOccurs="0" maxOccurs="unbounded" namespace="##other" />
        <!-- HIDDEN ELEMENTS -->
        <element name = "schemaOID" type = "hexBinary" minOccurs="0"
                 xdb:baseProp="true" xdb:hidden="true"/>
        <element name = "elementNum" type = "unsignedInt" minOccurs="0"
                 xdb:baseProp="true" xdb:hidden="true"/>
       </sequence>
       <attribute name = "shared" type = "boolean" default="true"/>
       <attribute name = "description" type = "string"/>
      </complexType>
      <complexType name="rule-based-acl">
        <complexContent>
          <extension base="xdbacl:aclType">
            <sequence>
              <element name = "param" minOccurs="0" maxOccurs="unbounded">
                <complexType>
                  <simpleContent>
                    <extension base="string">
                      <attribute name = "name" type = "string" use = "required"/>
                    </extension>
                  </simpleContent>
                </complexType>
              </element>
            </sequence>
          </extension>
        </complexContent>
      </complexType>
      <element name = "acl" type="xdbacl:aclType" xdb:defaultTable = "XDB$ACL"/>
      <element name = "write-config" type="xdbacl:privilegeNameType"
               substitutionGroup="xdbacl:privilegeName" xdb:defaultTable=""/>
    </schema>Message was edited by:
    Marco Gralike

  • How to block execution of event listeners

    Hi all,
    JDev version : 11.1.1.6
    My requirement is that I want to block all event listeners like ActionListeners, SelectionListeners, DisclosureListeners, RowDisclosure listeners when the screen is opened in readonly mode.
    I could block ActionListeners by disabling command links and command buttons etc.
    But there's no way to block SelectionListeners, DisclosureListeners, RowDisclosure listeners.
    So Is there any common code which can block all listeners?
    Or is there any EventController or something like that which will allow me to control event execution?

    I would have if it was just one screen.
    There are hundreds of screens.
    Anyways, can't I use any javascript to do this? There are some interfaces like EventListeners , classes like EventConsumer etc. Do none of them provide feature to block event listeners?

  • Using Multiple Event Listeners

    Hi,
    I have a movielcip (A) class in which I have used a Tween class effect on a child movieclip (B) scrollRect. The (B) Movieclip in turn has several movieclips whose have tween class effect being executed on thier child movieclips.
    the tweens are all unique to each movieclip
    and the event listeners are taken off once completed.
    This works all well and good in FLASH IDE...
    My problem arises when I try to view this in a browser on a Windows XP
    it doesnt work in
    Opera Version 9.63
    Firefox 2.0
    and Google Chrome 2.0
    The only browser it works fluently in is
    Internet Explorer 7.0.5
    What is happening in most cases it that the animation appears to "stick" but i think what may be happening is the listening or removal of the event listeners. The animations are left incompleted.
    Is there any rule of thumb when using multiple event listeners?
    here is a snippet of some of my code
    on click event from movieclip (A)
    private function scrollToSlidePrev(e:MouseEvent) {
                   if (((slideIndex - 1) >= 0)) {
                        nextButton.mouseEnabled = nextButton.enabled = previousButton.enabled = previousButton.mouseEnabled = false;
                        var position:Number = 0-SLIDEAREA.width;
                        var slide1:TileListSlide = slides[slideIndex] as TileListSlide;
                        var slide2:TileListSlide = slides[--slideIndex] as TileListSlide;
                        scrollSlide(position,slide1,slide2);
    tween animation in movieclip (A) on (B)
    private function scrollSlide(pos:int,slide1:TileListSlide,slide2:TileListSlide) {
                   slide1.resizeSlideTo(0.6); // execute tween on child movie clips in B
                   slide2.resizeSlideTo(1); // same as above;
                   var rect:Rectangle = sliderMc.scrollRect;
                   var tween1:Tween = new Tween(rect,"x",Regular.easeOut,rect.x,rect.x + pos,3,true);
                   tween1.addEventListener(TweenEvent.MOTION_CHANGE,setSliderScroll,false,4);
                   tween1.addEventListener(TweenEvent.MOTION_FINISH,toggleButtonEnabled,false,3);
    tween animation in movieclip (B) children
    public function resizeSlideTo(sc) {
                   var m:Matrix = tileList.transform.matrix as Matrix;
                   var p:Point = new Point (m.a, 0);
                   var tween2:Tween = new Tween(p,"x",Regular.easeOut,p.x,sc,3,true);
                   if (numericStepper != null) {
                        if (sc != 1) {
                             numericStepper.visible = false;
                             tween2.removeEventListener(TweenEvent.MOTION_FINISH,showStepper);
                        if (sc === 1) {
                             tween2.addEventListener(TweenEvent.MOTION_FINISH,showStepper,false,2);
                   tween2.addEventListener(TweenEvent.MOTION_CHANGE,setScaleOnScroll,false,3);
    here is the link
    http://visual_admin.web.aplus.net/ticker/ticker_widget.html
    the effect disables and re-enables the buttons when its done.... then the listeners are removed.
    each one with the exception cretes its own unique tween (obviously this is a custom class built as each clip)
    i really don't know what to make of it guys         

    apparantly making the tween a property of the class rather than a random variable in a function worked.....go figure

  • [JS] Basic question about event listeners and event handlers

    I am very new to the whole topic of event listeners and event handlers.  I'd run the test for the following problem myself, but I don't know where to start, and I just want to know if it's impossible -- that is, if I'm misunderstanding what event listeners and event handlers do.
    Say I have an InDesign document with a text frame that is linked to an InCopy story.  Can I use an "afterImport" event listener on the text frame to perform some action any time the link to the InCopy story gets updated?  And will the event handler have access to both the story that is imported, and the pathname of the InCopy file?
    Thanks.

    Thank you, Kasyan.
    Both of those are good solutions.
    We are currently using InDesign CS4 and InCopy CS5.  I'm hoping to get them to purchase the whole CS5 suite soon, since I'd like to start writing scripts for InDesign CS5 as soon as possible, as long as I'm going to have to be doing it in the not too distant future anyway.  The greater variety of event handlers sounds like it might be something that is crucial to the project I'm working on, so that adds to the argument for getting CS5.
    Thanks again.  You have no idea how helpful this is.  I made some promises to my boss yesterday that I later realized were  based on assumptions of mine about the InDesign/InCopy system that didn't make any sense, and I was going  to have to retract my promises.  But after reading your response I think I can still deliver, in a slightly different way that I had been thinking before.
    Richard

  • Documentation for custom event listeners

    Hi,
    I am searching in portal 8.1 documents for using custom events, coding and registering event listeners, and using them in jsp pages. So far my search has been unsuccessful.
    Can some one let me know where i find this info?
    -thanks

    Hi J, 
    Thanks for your reply.
    I didn’t find the custom work item Web Access control Official documents, but you can refer to the information in these articles(it’s same in TFS 2013):
    http://blogs.msdn.com/b/serkani/archive/2012/06/22/work-item-custom-control-development-in-tf-web-access-2012-development.aspx
    http://blogs.msdn.com/b/serkani/archive/2012/06/22/work-item-custom-control-development-in-tf-web-access-2012-deployment.aspx
    For how to debug TFS Web Access Extensions, please refer to:
    http://www.alexandervanwynsberghe.be/debugging-tfs-web-access-customizations/.
    For the custom work item Web Access control Official documents, you can
    submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Loading/Unloading a .swf that adds event listeners to the Stage

    Hi all,
    Disclaimer
    Apologies if I suck so bad at using forum search that the answer to this is on page 1 somewhere; I tried...
    Question
    I am loading and unloading a .swf to which I do not have source code access. This .swf places several event listeners on the stage, as far as I can tell. When the .swf is unloaded, the event listeners placed upon the stage still seem to be in effect. Using unloadAndStop doesn't seem to do it, and I have to target Flash Player 9, anyway, so can't really use it. Is there any other way I can keep this external .swf from holding onto my main movie's stage?
    Additional info
    All eventListeners and references being set by my code are removed.
    I've managed a little contact with the author of the .swf:
    I've requested he provide a dispose() method I can call to get all the listeners removed, and send an updated .swf.
    He's suggested that I should be able to avoid the problem by loading into a unique ApplicationDomain. I'm not terribly familiar with this, but have given it a try without much success. Is this a valid solution - can I really protect my 'stage' by properly using ApplicationDomains - or do I need to persist in trying to get a public dispose() method built in?
    Thanks in advance!
    Cheers, John

    thanks for reply sir
    sir actually, i have not any problem with loading any file but i need to go back to intro.swf file when i click on clsbtn of main.swf, i want unload the main.swf file and panel.swf file
    actually i did was, i have intro.swf file and there is button by clicking load main.swf file (where is timeline controling butons) and in the main file automatically load panel.swf file ( where is all animation)
    its all play gud , no problem
    but my problem is there is a clsbtn in main.swf file and when i click on that button everything should be unload and it should return on the previous position in intro.swf
    i hope u understand what i am trying to say

  • Add event listeners to dynamically loaded symbols?

    Hi,
    I'm trying to dynamically load different MovieClips based on user input. Several of those clips have embedded url link symbols. How can I add event listeners to the url links if the dynamically loaded MovieClip does not have an instance name? Seems like I can (right?) apply an instance name when the clip is loading, but the event listener doesn't compile because the name is not there yet, so that seems out.
    Am I on right track?

    Are you saying that you will instnatiate this symbol several times and each time url for this link is going to be different?
    There are at list two ways to deal with it.
    1. Inside symbol you can dispatch a custom event once it is clicked:
    myLink.addeventListener(MouseEvent.CLICK, onClick);
    function onClick(e:MouseEvent):void {
         dispatchEvent(new Event("linkClick"));
    Wherever you instantiate the symbol (perhaps on timeline):
    var symbolInstance:MySymbol = new MySymbol();
    symbolInstance.addEventListener("linkClick", onLinkClick);
    function onLinkClick(e:Event):void {
         // do whatever
    Second way would be to pass url value into symbol instance itself and deal with with it on a symbol level. I personally prefere way 1.

  • Spry event listeners with dynamic form elements

    Hi ,
    I am trying to implement spry event listeners with a form that has dynamic check boxes and text field name. I now i can get the elements in a var and loop through with a normal function but can this work for spry events listeners

    Short answer is yes. But I have a feeling that you need further assistance, in which case give us a URL to a page that you want to apply the event listener to.

  • [svn:osmf:] 15000: Fix for FM-447 : Adding CuePoint in TemporalFacet event listeners doesn't work

    Revision: 15000
    Revision: 15000
    Author:   [email protected]
    Date:     2010-03-24 14:01:02 -0700 (Wed, 24 Mar 2010)
    Log Message:
    Fix for FM-447 : Adding CuePoint in TemporalFacet event listeners doesn't work
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-447
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/metadata/TimelineMetadata.as

Maybe you are looking for

  • Can't delete old backup - says it is in use

    I just replaced my iPhone 4 with a 6 (yay!).  I loaded the 4 iCloud backup onto the 6 (two days ago) and now the 6 is backing up as a separate phone backup on iCloud.  I want to delete the old backup.  However, when I try to delete the old 4 backup i

  • Why do I get a "script error" message from Adobe flash player?  It is installed as a part of my browser.IE 11

    Why do I get a "script error"  from flash player when it is not installed separately?  It is part of my browser--IE 11

  • Movement Types

    Dear, Can anyone explain me the following movement types MvT     Mat. Doc.                    Item     Pstng Date           Quantity in UnE 321     4900407218     2     24.03.2009     1,024 321     4900407218     1     24.03.2009     -1,024 201     4

  • Load fail Stretagy in OWB

    Hi experts I m worry about load fail strategy in OWB. I want to handle it. Ex: suposse i am loading 100 records in my target table .And my load is fail in middle at the 90th record then my execution will be fail and none record will be insert. But i

  • Scroll bar and xml dissapeared

    Hi, I have added this to my flash code to enable html in my xml news1.main.newsmain_txt.html = true; news1.main.newsmain_txt.htmlText = _root.news2; This is the xml code i have <url><![CDATA[<a href="http://www.google.com">www.google.com</a>]]></url>