Multiple events on same object

I am using SWT.
I have a sash that seperates a tree and a browser and I need to be able to do the following...
Drag the sash to any location within the view.
Double click the sash to hide the contents on the left of the sash (make it return to 0 x cord.). When the sash is double clicked again, the sash will return to whatever x coordinate that it was drug too or return to it's original cord. from the FormLayout.
I can do either fine, but I can't do both. When I do a sys.out.print and double-click the sash, it returns...
13
13
8
13 = SelectionEvent, 8 = MouseDoubleClick
This means that MouseDoubleClick is itself a SelectionEvent. Is there a way that they can coexist?

You might have better luck asking this in an SWT forum instead of in a Sun forum, since SWT doesn't have anything to do with AWT or Swing.

Similar Messages

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • Selecting multiple grants on same object

    Hi,
    (The following SQl will be ran on 9i, 10g and 11g database versions)
    Im trying produce a list of directory grants that are the same from 2 different users (but only display the details of grants from one user)
    to clarify....
    lets say we have 100 directories, and 2 users that have granted permissions on them, User A and User B.
    Permissions can be granted on a directory by just user A, just user B or the same permission granted on the same directory by users A and B.
    I want to produce a list that shows details of directories where user A and user B have granted the same permission (but in the list only display details of user A's grants)
    so the following SQL will give me all directory permissions granted by user A
    select p.table_name,p.grantee,p.owner,p.grantor,p.privilege, o.object_type
         from dba_tab_privs p
         inner join dba_objects o
         on o.object_name = p.table_name
         where o.object_type = 'DIRECTORY'
         and p.grantor = 'USERA';
    so i want to produce the same list of grants by just USERA but only if those directories have also been granted the same permission by USERB
    any ideas of the easiest way to do this?
    Thanks

    Not sure what you mean:
    SQL> create user u1 identified by u1;
    User created.
    SQL> create user u2 identified by u2;
    User created.
    SQL> grant create session,create any directory to u1;
    Grant succeeded.
    SQL> grant create session,create any directory to u2;
    Grant succeeded.
    SQL> connect u1/u1
    Connected.
    SQL> create directory D1 as 'C:\Temp';
    Directory created.
    SQL> grant read on directory d1 to scott;
    Grant succeeded.
    SQL> grant read on directory d1 to u2 with grant option;
    Grant succeeded.
    SQL> connect u2/u2
    Connected.
    SQL> grant read on directory d1 to scott;
    Grant succeeded.
    SQL> connect scott
    Enter password: *****
    Connected.
    select  p.table_name,
             p.grantee,
             p.owner,
             p.privilege,
             o.object_type
       from      dba_tab_privs p
             inner join
                 dba_objects o
               on o.object_name = p.table_name
       where o.object_type = 'DIRECTORY'
       and p.grantor = 'U1'
    intersect
    select  p.table_name,
             p.grantee,
             p.owner,
             p.privilege,
             o.object_type
       from      dba_tab_privs p
             inner join
                 dba_objects o
               on o.object_name = p.table_name
       where o.object_type = 'DIRECTORY'
       and p.grantor = 'U2'
    TABLE_NAME                     GRANTEE                        OWNER
    PRIVILEGE                                OBJECT_TYPE
    D1                             SCOTT                          SYS
    READ                                     DIRECTORY
    SQL> SY.

  • Can we have multiple transports for the same object.

    Hi guys,
    Can we have multiple transports for same object in dev system. Can anyone tell me how can this be done.
    Thanks

    Its not possible for the same development object. Only 1 person can access an object at a time and if mutiple users modify an object new TASKs are created under the same TRANSPORT.
    Only after releasing the tr you can create a new tr on the same object.
    Message was edited by:
            Abhishek Jolly

  • How do I use multiple classes to access the same object?

    This should be staightforward. I have and object and I have multiple GUIs which operate on the same object. Do all the classes creating the GUIs need to be inner classes of the data class? I hope this question makes sense.
    Thanks,
    Mike

    public final class SingletonClass {
    private static SingletonClass instance;
    private int lastIndex = 10;
    public final static SingletonClass getInstance()
    if (instance == null) instance = new SingletoClass();
    return instance;
    public int getLastIndex() {
    return lastIndex;
    }1) This won't work since one could create a new SingletonClass. You need to add a private constructor. Also, because the constructor is private the class doesn't have to be final.
    2) Your design isn't thread-safe. You need to synchronize the access to the shared variable instance.
    public class SingletonClass {
        private static SingletonClass instance;
        private static Object mutex = new Object( );
        private int lastIndex = 10;
        private SingletonClass() { }
        public static SingletonClass getInstance() {
            synchronized (mutex) {
                if (instance == null) {
                    instance = new SingletonClass();
            return instance;
        public int getLastIndex() {
            return lastIndex;
    }if you are going to create an instance of SingletonClass anyway then I suggest you do it when the class is loaded. This way you don't need synchronization.
    public class SingletonClass {
        private static SingletonClass instance=new SingletonClass();
        private int lastIndex = 10;
        private SingletonClass() { }
        public static SingletonClass getInstance() {
            return instance;
        public int getLastIndex() {
            return lastIndex;
    }If you don't really need an object, then you could just make getLastIndex() and lastIndex static and not use the singleton pattern at all.
    public class SingletonClass {
        private static int lastIndex = 10;
        private SingletonClass() { }
        public static int getLastIndex() {
            return lastIndex;
    }- Marcus

  • Multiple Transports for the Same Object.

    I have ABAP program 123 and I make a change, create transport A and release the transport. I do not request transport A go to production.
    I then modify ABAP program 123 again, create transport B and release the transport. I do not request transport B go to production.
    Now I request transport A go to production.
    Can someone explain to me why the changes in transport B are included when transport A is moved to production?
    I thought each transport would be at its own change level.
    Thank-you.

    I can guarantee all of you that when Transport A was moved, it contained changes that were made in Transport B.
    Surely you understand that Thomas is correct and that there's a logical reason, not related to transport layer configuration, for the issue?   You CAN have multiple transports open for the same object without a lock by forcing it but check the dates as already suggested...

  • Can I have multiple event structures with the same event cases?

    Hello, 
    I'm doing an application that reproduces the front panel of the HP6675A power supply. To achieve this, I have done a state machine with different states
    (initialize, measures, voltage, current, ocp, ov, store, recall, etc). In each state, should have an event structure that catches the events of the buttons, like for example: if the current state is the Voltage mode and the user press the current button the next state will be the Current mode. For this in each state of the state machine should be the same event structure with the same events.
    My problem is that the Vi doesn't work properly when I have multiple event structures with the same event cases. There are some possibily to do this, and how? Or is impossible to have multiple events? I have been reading some posts, but I don't find solutions. 
    Any help is appreciated.
    Thank you very much.
    Solved!
    Go to Solution.

    natasftw wrote:
    Or as others mentioned, make two parallel loops.  In one loop, have your state machine.  In the other, have just the Event Handler.  Pass the events from the handler to the state machine by way of queues.
    A proper state machine will not need the second loop.  The "Wait For Event" or "Idle" state (whatever you want to call it) is all you really need in order to catch the user button presses.  The setup is almost there.  Maybe add a shift register to keep track of which state to go to in the case of a timeout on the Event Structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Does QueueSender send same object multiple times to the Queue

    Hi ,
    Does the QueueSender sends the same message object multiple times to the queue ?If so then the same will be send multiple times right. why do the client retain same object for long time if the expiry time is 0, Please some one help on this .
    Thanks
    Maruti

    Little_Pale_Face wrote:
    Michel,
    Just to clarify, I can drag duplicates to an album but it only appears once - so it's not actually adding to the album. The question, as I understand it, is that PSE doesn't warn you whereas it use to in PSE 3..
    Ok, that clear now.
    If I remember correctly, the format of the database for PSE was changed around version 4. So the error message that Beachcomber was seeing may have been generated by the old database system.
    Version 4 used Microsoft Access as the database engine, not sure about version 5. Anyway I am sure that from version 6, the sqlite database engine was used.

  • The same Object Version Number for the same person id multiple times

    Hello all,
    I am currently facing an issue with HRMS tables and the object version number for employees. I am trying to write a report but due to the same object version number for the same person appearing in several row i am getting duplicate information. For example,
    person id 91 object version number 32 is on 4 rows and i have no idea why...help please guys, I'm at a lost so far 50 people are facing the same issue.

    Hi Baal666bobo,
    The person table is date-tracked, so the PK has effective start and end dates as well.
    Get the correct record with sysdate(or any particular date) and then check the OVN.
    Cheers,
    Vignesh

  • Multiple inserts for the same object

    We have observed that in certain cases, the same object is attempted to be inserted twice, resulting in Primary Key violation.
    Here is one example -
    A(1->1)B, unidirectional, A has the foreign key to B
    new B
    copyB = register(B) (also assign sequence number)
    new A1, A2
    A1.set(copyB), A2.set(copyB)
    register(A1), register(A2)(also assign sequence number)
    commit
    it tries to insert the same B twice.
    any clues whats wrong here?
    thanks

    Any chance your 1:1 from A to B is marked as privately-owned?
    This would indicate to TopLink that the object in each relationship is unique and should be inserted.
    Doug

  • Multiple Transports included in different ChaRM tickets on same objects

    Hi Experts,
    We have ChaRM tickets created for different business CRs, and often a same object has to be changed for different CRs. A question is that is there a way of checking if an object is included in more than one different transports under different ChaRM tickets? How can we best organise the order of the ChaRM tickets so that there will not be a collision?
    Many thanks for your insights shared!
    BR Li Li

    Hi Experts,
    We have ChaRM tickets created for different business CRs, and often a same object has to be changed for different CRs. A question is that is there a way of checking if an object is included in more than one different transports under different ChaRM tickets? How can we best organise the order of the ChaRM tickets so that there will not be a collision?
    Many thanks for your insights shared!
    BR Li Li

  • Is it possible to handle multiple events using Jscript for a button in Apex

    Hi,
    I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
    2. display a set of values on 'mouse over' that button.
    I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
    Thanks in advance,
    gsachidh

    Hi Gsachidh,
    well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
    A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
    Target set to => URL
    URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
    Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
    Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
    Simon
    Message was edited by:
    S1M0N

  • Events in Abap Objects

    What are events. how to create and handle this events.

    HI,
    By triggering an event, an object or a class announces a change of state, or that a certain state has been achieved.Events link objects or classes more loosely than direct method calls do. Method calls establish precisely when and in which statement sequence the method is called. However, with events, the reaction of the object to the event is determined by the triggering of the event itself.
    Events are most often used in GUI implementations.Other external object models, such as COM, ActiveX Controls etc, also provide events.
    At the moment of implementation, a class defines its instance events (using the statement EVENTS) and static events (using the statement CLASS-EVENTS)
    Classes or their instances that receive a message when an event is triggered at runtime and want to react to this event define event handler methods.
    Statement : (CLASS-)METHODS  | FOR ALL INSTANCES.
    Every object that has defined events has an internal table: the handler table. All objects that have registered for events are entered in this table together with their event handler methods.Objects that have registered themselves for an event that is still “live” also remain “live”. The methods of these objects are called when the event is triggered, even if they can no longer be reached using main memory references.
    If several objects have registered themselves for an event, then the sequence in which the event handler methods are called is not defined, that is, there is no guaranteed algorithm for the sequence in which the event handler methods are called.
    If a new event handler is registered in an event handler method for an event that has just been triggered, then this event handler is added to the end of the sequence and is then also executed when its turn comes.
    If an existing event handler is deregistered in an event handler method, then this handler is deleted from the event handler method sequence.
    Events are also subject to the visibility concept and can therefore be either public, protected or private. Visibility establishes authorization for event handling :
         all users
         only users within that class or its subclasses
         only users in that class.
    Event handler methods also have visibility characteristics. Event handler methods, however, can only have the same visibility or more restricted visibility than the events they refer to.
    The visibility of event handler methods establishes authorization for SET-HANDLER statements: SET HANDLER statements can be made
         anywhere
         in that class and its subclasses
         only in that class
    Regards,
    Balaji Reddy G
    **Rewards if answers are useful

  • Multiple copies of same database on a 2 node RAC server - How to merge ?

    I currently have multiple copies of the same database running on a 2 node Rac system. I am looking for a way to combine them into 1 large database but keeping the data separate.
    The databases are copies of production for testing, development and a yearly "historical" databases .
    All the databases are created from production, and generally have the same schema's , tables, procedures, etc however may be different versions and need to be.
    Is There a way to use one large database and logically split all the different versions of the same objects into their own space in one database ? The structure cannot change as the database is for a 3rd party's Forms application the relies on the objects not changing names etc.
    Ideally I am looking for a solution that will allow the forms application to connect to "test" and "historical" copies of our production database separately in the same database container.
    Thanks for any direction.

    I currently have multiple copies of the same database running on a 2 node Rac system. I am looking for a way to combine them into 1 large database but keeping the data separate.
    The databases are copies of production for testing, development and a yearly "historical" databases .
    All the databases are created from production, and generally have the same schema's , tables, procedures, etc however may be different versions and need to be.
    Is There a way to use one large database and logically split all the different versions of the same objects into their own space in one database ? The structure cannot change as the database is for a 3rd party's Forms application the relies on the objects not changing names etc.
    Ideally I am looking for a solution that will allow the forms application to connect to "test" and "historical" copies of our production database separately in the same database container.
    Thanks for any direction.

  • How to restrict login for multiple users having same Role

    Our Web Application is deployed on Tomcat 5.5
    The requirement is ?
    There are roles in application like "operator", "admin"?
    There are multiple users created for each of the above role.
    When one user of "operator" role is logged in, then
    It should not allow to login for another user of "operator" role.
    Also, if user did not log out & application gets close, then
    It should not allow to login for another user of "operator" role.
    Also, it should not allow to login for multiple requests of same user
    (using another browser instance...)
    Is it possible using session object?
    But, using session object, it will create separate objects for different users,
    So here I will not be able to restrict session object creation rolewise.
    Also, how to retrieve these multiple session objects created for different users on server?
    If anyone is having the solution please reply as soon as possible,
    Thank you.

    To tell you the truth, this is a stupid requirement. It must be an extremely fragile application.
    In any case, you will have to write your stuff for that. Probably a filter that on login, logout, and session expiration checks, makes, or removes entries in a DB (using a synchronized resource to prevent race conditions) or possibly even simply in an application context object.

Maybe you are looking for

  • Help for ipod touch not recognized by itunes

    I am posting this to try to help others who have N ipod touch and windows is showing as a digital camera and itunes does not recognize after updating to 8.2.1. I tried EVERYTHING (uninstalling itunes, reinstalling, downgrading itunes, removing pics o

  • Procurement profile not available

    Hi,, I am receiving the message 'Procurement profile 01 not available' when I am trying to create a Purchase Requisition. Pls guide me regarding what is missing there in order to create a Preq. Regards Alexander

  • Date Modified in Finder does not update immediately

    I am finding that the Date Modified value takes several minutes to update in my Finder window when I've modified, saved and closed a particular file. Is there any particular reason for Finder not reflecting the the modified value immediately or any s

  • Know pictures that are used in imovie HD

    I want to know if there is a way to know which pictures you allready used when using an ipphoto album in imovie. Example: I am doing a movie in imovie and aI already organized all the pictures I want to use in an album in iphoto. I am dragging them i

  • Color beach balling forever

    color just beach balls now after the 1.0.1 upgrade .... anyone having this issue? I've restarted and same same thing. Getting pretty bummed ..... any ideas?