How to handle Event in JACOB API

Hi,
I am read the outlook mail using JACOB[Java Com Bridge] API successfully, now i want to handle events for outlook mail using JACOB. and also i can able to catch the new mail event. but i am unable to catch any deleted mail and move mail from one folder to another folder. This is extremely important for my project. so any one please tell me how to handle and catch the Outlook deleted event and move event using JACOB.
Thanks in Advance,
With Regards,
Ganesh

Windows can be closed in a number of ways and the simplest way to trap them would be to handle Window Closing in code behind.
This is also the easiest way to show dialogs if that's how you wanted the warning message to appear.
This:
chxAllowToClose.IsChecked
Looks like a checkbox to me, seeing as you have IsChecked.
That presumably means you already have that bound to a viewmodel and visible to the user.
You can therefore just test that value from the view.
If you prefer to hide that instead then there are several options.
You could have a dependency property and a binding in code behind which binds to the viewmodel. Test that in your event.
Or
You could save the value when it changes to application.current.resources.  Since dependency properties and bindings are a bit wordy this is easier.
Or
You could have just a variable in the view code behind and use messenger to tell that when the value changes from the viewmodel:
http://social.technet.microsoft.com/wiki/contents/articles/26070.communicating-between-classes.aspx
Please don't forget to upvote posts which you like and mark those which answer your question.
My latest Technet article - Dynamic XAML

Similar Messages

  • How to handle Events in OO abap.

    Hii all as im new to SAP and  ABAP , i want to know , what are events all about and how to handle events?
    Like how to guide double click to call a transaction , or to create a hot sopt and then , calling the transaction...........
    Please Help.

    Hi Chandan,
    possibly you are not just new to ABAP but new to obeject oriented programming in general. In oo, you use events to trigger methods that are registered as 'listeners' for the event.
    As I have no idea on your current knowledge, I don't know what I could recommend to start with.
    My personal approach is first to have a task I want to complete and then find and understand the methods to get there.
    Regards,
    Clemens

  • How to handle events in webdynpro abap

    Hi,
    can any body explain how to handle the events in webdynpro abap.
    i want to know some concepts in general.
    Thanks,

    Hi Mahesh,
    you can create event handlers under the actions tab in you view. evry event handler has an importing parameter wdevent of type ref to cl_wd_custom_event.
    you can also create events in your component controller and they can be handled within your views
    check cl_wd_custom_event class for details about what all information you get when an event occurs.
    for further details you can check out the following links
    http://help.sap.com/saphelp_nw04s/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a9/c751415e3b6532e10000000a1550b0/frameset.htm
    also you can try the tutorial at the following link for further clarity
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2eb11b59-0a01-0010-dfa3-8292abdf9c4f
    Regards,
    Shweta
    Message was edited by:
            Shweta R Shanbhag

  • How to handle event when the user closing the browser (Urgent Please)

    Hi,
    How to handle the event when user closes the browser....
    i want to display some alter message when user trying to close the browser...
    Please can any one help me how i have to do this...........
    Thanks.

    Finally got this working. You cannot use the stop() or destroy methods. By the time they are called all database connections are gone and you will get a null pointer exception.
    You will have to use the onBeforeUnload method in the html file that calls the applet and use JavaScript to call the save method in java which saves the document:
    <SCRIPT LANGUAGE="JScript" TYPE="text/javascript">
    function Save()
    //i call the applets doSave() method from here in which i save all
    //changes to the database
    top.Tree.document.TestApplet.doSave();
    //this will invoke the default IE message for closing the window
    //when user clicks on the x in the browser
    message = "Your document has been saved."
    return message;
    window.onbeforeunload=Save;
    </SCRIPT>
    //the applets doSave()
    public void doSave()
    //this frame provides user with the message that document is being
    //saved
    final JFrame frame = new JFrame("Saving");
    JPanel contentPane = new JPanel();
    JLabel label = new JLabel(" Please wait, saving document...");
    frame.getContentPane().add(label,BorderLayout.CENTER);
    frame.setSize(250, 100);
    frame.setLocation(300, 400);
    frame.setResizable(false);
    frame.setVisible(true);
    frame.addWindowListener(new WindowAdapter()
    //the frame is just for user's information, so prevent user from
    //closing it or iconifying it.
    public void windowClosing(WindowEvent e)
    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    public void windowIconified(WindowEvent e)
    frame.setState(frame.NORMAL);
    //call my saveDocument() method that saves everything to the database.
    editorModule.saveDocument();
    //System.out.println("finished calling saving document");
    //once the saving is done the frame with the message disappears
    frame.setVisible(false);
    //System.out.println("setting frame to false");
    //I also had an exit button in my applet, that would perform the same task, however now with the above onBeforeUnload method, the exit message would appear twice, so had to modify my exit button action performed, so that if the exitbutton was clicked the onbeforeunload method would get passed a null value and not do anything.
    private void exitButton_actionPerformed()
    if (DEBUG) System.out.println("Calling exit");
    doSave();
    window.eval("this.onbeforeunload=null;");
    window.eval("top.close();");
    //continue from here if user cancels the closing of the window
    window.eval("this.onbeforeunload=doSave;");
    window.eval("top.focus()");
    window.eval("document.TestApplet.requestFocus()");
    homePanel.requestFocus();
    }

  • How to handle events in Swng

    Hi!
    I would like to know which one of the following is the best way to handle events in Swing application.
    Method 1
    Write annonymus inner classes in the same class
    Method 2
    =======
    Write a seperate class which extends the adapter class of the event handling and create an object of that in the main class and assign it to the components with addActionHandler() method.
    I am trying to use the second one and I have the following design issue.
    I have a class frmMain.java in which I have a frame and to that frame I am adding a panel which consists of 'N' No. of components.
    I want to make this panel added to the frame when I click on a menu item (login) and want to remove the panel from frame when I click on a menu item(logout).
    I have a main class called Application.java where I create the object of my frame(frmMain.java).
    Thanks in advance,
    AV

    1. Your JFrame is now subject to receive action events from anywhere. You will have to be more careful that you respond only to the right events.
    2. If you have a lot of possible consequences to an event(for example, based on button pressed), you'll need a long if...then...else statement to determine what to do based on the source of the event.
    3. With individual ActionListener classes, it's easier to add the same listener to multiple components and no need to worry about source.
    4. Kind of the same thing: With individual classes, the event and its consequences are so tightly coupled.
    End preaching....basically, my style boils down to what I call the tool set vs Swiss army knife rule. Java seems designed around the concept of a large number of specific purpose classes vs a smaller number of multi purpose classes and I think its a design methodology that makes sense, because I believe strongly in functional isolation in my code.

  • How to handle events between two custom components?

    Hi ,
         i want to handle events between two custom components, example if an event is generated in one custom component ,and i want to handle it any where in the application.....can any one suggest me any tutorial or meterial in this concept...
    thanks

    Events don't really go sideways in ActionScript by default. They bubble upward. If you want to send an event sideways, you will probably have to coordinate with something higher up in the event hierarchy. You can send the event to a common ancestor, and then pass it down the hierarchy as a method argument.
    Another option is to use a framework that supports Injection. There are a number around these days. The one I'm most familiar with is Mate, which allows you to handle events and inject data in MXML. Mate is meant to be used as an MVC framework, and you may want to look into it if your application is complex, but you can also use it to coordinate global event handling if you don't need that level of structure.

  • How to handle events when artboard list change in Illustrator?

    It is very strange for me, but AIEvent has no event type for handle artboard list change events.
    http://cssdk.host.adobe.com/sdk/1.5/docs/WebHelp/references/cshalib/com/adobe/cshostadapte r/AIEvent.html
    May be there are any ideas how to get artboard events: "add", "delete", "reorder" 

    Well, the right event type is AIEvent.DOCUMENT_CROP_AREA_MODIFIED. It is very usefull to play with EventWatcher example from Remote Creative Suite SDK Examples.

  • How to handle event structures for two buttons and two counters.

         *I have two buttons A and B, and have to compare the difference in hits between them.  So do I place an event structure within a while loop for each button (2 buttons, 2 event structures, 2 while loops), or does it need to be one event structure with cases for both buttons whithin one while loop? 
         *How do I pass the values of buttons A and B's hit counters out of the while loop in order to calculate the differences between them after each increment, not just the final count after the stop button is hit? 
         *How would I make one stop button work to handle both buttons A and B?   I tried to place the actual stop button in one button A's structure and its global in B's structure, but It wont seem to let me use a local variable for a latchable control
    Checker

    You should probably have not started a new thread and waited until your question in the original thread was answered. You can modify altenbach's example for a second button. You have a single event structure with a new event for the second button. You have a second shift register to track the number of times the second button is pressed. Inside the while loop but outside the event structure, you just have a subtract function in or to report the difference. do not modify the posted example for the stop button. It works perfectly as is.

  • How to handle event in MVVM ?

    Hi everyone ,
    I'm currently learning to use MVVM model , about command handling, it's ok for me now. But , about Event handling, it causes me some difficulties. 
    Can anyone help me to solve this problem : I have a window and I want to handle the its Closing event . For example, when the window is closing , if the bool chxAllowToClose.IsChecked = true , the window can be closed, vice versa, the window will display a
    warning message : "Please check the checkbox" and then prevent the close operation 
    Thank you

    Windows can be closed in a number of ways and the simplest way to trap them would be to handle Window Closing in code behind.
    This is also the easiest way to show dialogs if that's how you wanted the warning message to appear.
    This:
    chxAllowToClose.IsChecked
    Looks like a checkbox to me, seeing as you have IsChecked.
    That presumably means you already have that bound to a viewmodel and visible to the user.
    You can therefore just test that value from the view.
    If you prefer to hide that instead then there are several options.
    You could have a dependency property and a binding in code behind which binds to the viewmodel. Test that in your event.
    Or
    You could save the value when it changes to application.current.resources.  Since dependency properties and bindings are a bit wordy this is easier.
    Or
    You could have just a variable in the view code behind and use messenger to tell that when the value changes from the viewmodel:
    http://social.technet.microsoft.com/wiki/contents/articles/26070.communicating-between-classes.aspx
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • How to handle event "DB_EVENT_PANIC" on replica

    Hi BDB experts,
    I am writing db HA application based on bdb version 4.6.21. Two daemons run on two machines, one as master which will read/write db, one as backup will only read db. It seems backup will sometimes get event "DB_EVENT_PANIC" for reasons I didn't know. What should I do on receiving such event? Should the daemon exit and run then open env again for recovery? Can one process reopen the environment for recovery without exit first?
    Another question is unrelated to the issue above: if use bdb ha(base api), can there be 3 processes, process1 is neither master or client but just writing db,  process2 is as rep master that open the same env(just for ha, will not write db), process3 is client that connects to master to get db synced?
    Thanks,
    Min

    That is, if in ha environment and N processes would write db, each process should establish a connection with the replica and would send ha msg to the replica when it writes db, right?
    It is said "Subsequent replication processes must at least call the DB_ENV->rep_set_transport method.
    Yes, each process should establish a connection to the replica. Each process also needs the DB_ENV->rep_set_transport call so that it will invoke your application's send function to send each HA message to the replica.
    Those processes may call the DB_ENV->rep_start method", I am confused that why rep_start is not a must. Because if rep_start is not called, bdb will not start ha threads and the process can't send msg to replica, right?
    I am assuming from your earlier information that you are using Base API calls. The Base API calls do not create their own threads. When using the Base API, it is the application's responsibility to create and manage its own threads.
    One possible way to design an application is to have a main replication process on the master that calls rep_set_transport and rep_start and creates one or more threads to handle all incoming messages from other sites.
    In this design, there can be N additional processes on the master that perform database writes which only need to send the logging information about these writes to the other sites. The call to rep_set_transport provides the information needed to do this so there is no need for these N additional processes to call rep_start. Our documentation is allowing for cases like this.
    You do not have to design your application this way and you can make rep_start calls in more than one process as long as they each supply the same DB_REP_CLIENT or DB_REP_MASTER value.
    If my understanding is right, for the N processes ha case, there is a question below:
    each process used to be single threaded, and run a few seconds then exit after finishes its task. Will the main thread get notified for which event from bdb that indicates sync to replica is done? As the process is not a daemon, I am afraid if it exits as former logic, bdb ha thread may not finish sync.
    This is a reason to consider a design with a main replication process that remains running and handles all incoming messages. Then you can have multiple additional short-lived processes that perform database writes and exit.
    If your application cannot follow this model, then you will need to design your application to make sure each process survives long enough to get whatever synchronization from the replica it requires. You should look at the Reference Guide sections "Building the communications infrastructure" and "Transactional guarantees" for more details.
    Just out of curiosity, why are you using 4.6? That is not a very recent release.
    Paula Bingham
    Oracle

  • How to handle events in J Table (Enter event)

    I created a J Table having multiple rows and columns. I want to have the event to happen on second column, on entering the code on first column, and then pressing ENTER.
    Eg:
    first column i enter code : say A010
    In the code master, the description matching the above code is "HIGH TENSION CABLE".
    When I enter "A010" in the first column and press "ENTER", i want the description to appear in the second column i.e. HIGH TENSION CABLE (by referring the code master, which I already created).
    How this can be handled. Please help me with the code/suggestions. As this urgently required for me in a project, I request the FORUM to help at the earliest.
    Thanking you in advance.
    PS: I shall appreciate if the reply is also sent to my email id: "[email protected]".
    N Murali

    This code would do your work
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class TestTable
        private JTable table;
        private AbstractTableModel model;
        private DefaultTableModel defaultModel;
        private JScrollPane jsp;
        public TestTable()
            table = new JTable();
            defaultModel = new DefaultTableModel(10,5);
            setModel(defaultModel);
            jsp = new JScrollPane(table);
            hookSetTextOnEnter();
        protected void hookSetTextOnEnter()
            String actionName = "selectNextRowCell";
            final Action enterAction = table.getActionMap().get(actionName);
            Action myAction = new AbstractAction()
                public void actionPerformed(ActionEvent e)
                    int row = table.getSelectedRow();
                    int column = table.getSelectedColumn();
                    System.out.println(" SELECTING NEXT ROW "+row+""+column);
                    if(row != -1 && column == 2 )
                        Object value = table.getValueAt(row,column);
                        if(value != null && value.toString().equals("A010"))
                        table.setValueAt("HIGH TENSION CABEL",row,column+1);
                    enterAction.actionPerformed(e);
            table.getActionMap().put(actionName,myAction);
        public void setModel(TableModel model)
            table.setModel(model);
        public JScrollPane getScrollPane()
            return jsp;
        public JTable getTable()
            return table;
        public static void main(String[] args)
            TestTable tt = new TestTable();
            JFrame frame = new JFrame("Test Table");
            frame.getContentPane().add(tt.getScrollPane());
            frame.pack();
            frame.setVisible(true);
    }------- Unformatted Version------------
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class TestTable
    private JTable table;
    private AbstractTableModel model;
    private DefaultTableModel defaultModel;
    private JScrollPane jsp;
    public TestTable()
    table = new JTable();
    defaultModel = new DefaultTableModel(10,5);
    setModel(defaultModel);
    jsp = new JScrollPane(table);
    hookSetTextOnEnter();
    protected void hookSetTextOnEnter()
    String actionName = "selectNextRowCell";
    final Action enterAction = table.getActionMap().get(actionName);
    Action myAction = new AbstractAction()
    public void actionPerformed(ActionEvent e)
    int row = table.getSelectedRow();
    int column = table.getSelectedColumn();
    System.out.println(" SELECTING NEXT ROW "+row+""+column);
    if(row != -1 && column == 2 )
    Object value = table.getValueAt(row,column);
    if(value != null && value.toString().equals("A010"))
    table.setValueAt("HIGH TENSION CABEL",row,column+1);
    enterAction.actionPerformed(e);
    table.getActionMap().put(actionName,myAction);
    public void setModel(TableModel model)
    table.setModel(model);
    public JScrollPane getScrollPane()
    return jsp;
    public JTable getTable()
    return table;
    public static void main(String[] args)
    TestTable tt = new TestTable();
    JFrame frame = new JFrame("Test Table");
    frame.getContentPane().add(tt.getScrollPane());
    frame.pack();
    frame.setVisible(true);
    Thanks,
    Kalyan

  • How to handle events occuring on different items in a tree control

    I am developing a small application in which I need to display different panels when user clicks on a tree control item....how to make it display a panel inside a parent panel when a user clicks an item in a tree control....any help would be greatly appreciated. thank you
    If you are young work to Learn, not to earn.

    The tree control can handle several events that you can rely on to handle user interaction. I suggest you take a llok at treeevent.prj example that comes with CVI. In your situation, one possible event to handle is EVENT_SELECTION_CHANGE, that marks the operation the user does when clicking on a new tree item.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to Handle Events for JOptionPane buttons?

    Hi All,
    I need a help...
    I am trying to develop a simple SWING application that consists of multiple elements (mainly text fields) and a Submit button. On pressing Submit button, it should validate all the fields and then do something else. But if some fields are left blank, then it should give a pop-up message and on clicking the OK button on the pop-up message, the focus should go to that text field which is left null.
    The problem is I am not able to understand how to Capture this OK button click-event of the pop-up message. I mean how to do something when the OK/Cancle button of the pop-up window is clicked.
    Please Help me.
    Thanks in Advance,
    Ujjal

    As already pointed out, JOptionPane has some static methods which show a dialog, and return an int, or a string. The whole point of this class is to remove the need for any event handling by the developer, that is, you simply call the showDialog method or whatever, and it returns a value telling you, for example, which button was pressed - no need for action listeners at all. The result of the showDialog method (or whichever you use) tells you which button was pressed. Check the javadocs for JOptionPane for details of several constants that indicate which button was pressed
    The class exists to make simple dialogs trivial to generate - you're overcomplicating things!

  • How to Handle events from audioplayer by ADF ObjectMedia Component

    Hi,
    In My application Having a ADF ObjectMedia Component for the audio play,
    My requirement is to handle the events from the Player,i.e Need to get an
    event when the user pause the player,can i get the event in backing bean.or else please help me in any other way to get the requirement asap.
    Thanking you....

    Hi,
    assume the media player most likely is a browser plugin. Question: Does the media plugin raise events ?
    If the media player has a JavaScript API that allows you to call a JavaScript function then you found a gate open to publish the event to the JSF application
    So as a todo for you: Check with the media player vendor if there exist a JavAScript API or any other sort of eventing.
    Frank

  • How jslider  handle event?

    Hi evry body, i am writting a code to display a jslider, my question is how to make the jslider handle right arrow key and left arrow key event without using KeyListener?

    Thank you for reply, i made jslider work with keylistener. But i have example that work without keylistener and in my code it doesn't, i don't understand what happens.

Maybe you are looking for