Catch KM Events

Hi all
I have to catch some of the KM resource events - create and delete new resources. I am quite new in this area. I havent written any repository service previously.
I found the following code in forum.
<i>public class MyEventReceiver implements IResourceEventReceiver {
    public MyEventReceiver() {
     IResourceEventBroker broker = resource.getRepositoryManager().getEventBroker();
        broker.register(this, IResourceEvent.RENAME_EVENT, IEventBroker.PRIO_MIN, true);
    public void received(IEvent event) {
     if( event instanceof IResourceEvent ) {
      IResourceEvent resourceEvent = (IResourceEvent)event;
      IResource resource = resourceEvent.getResource();
}</i>
But it doesnt tell which kind of project I should create. Also regarding <b>resource</b> object , I guess its the folder/file on which we need to catch event. But for  that we need IUser object to create Resource Context. So pls tell also how to get it.
If anyone can provide simple complete example, Please do so.
Points will be definitely awarded for helpful answers.

Hi Detlev
I tested following code: I uploaded the PAR in portal.
Under Respository Services I can see the name of the class.
What I wanted was that if some file gets created somewhere , then delete the folder /documents/Test/Certificates.
But its not working. Please guide..
<i>import java.io.File;
import java.util.Collection;
import java.util.Iterator;
// implements IMyNewRepositoryService interface
  Note: IReconfigurable and IResourceEventReceiver interfaces are optional
public class EventCatcher extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
  private static final String TYPE = "EventCatcher";
  private Collection repositoryManagers;
  public EventCatcher() {
    super();
    // Do not add code here. Add it to startUpImpl() instead
  public String getServiceType() {
    return EventCatcher.TYPE;
  protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
    // implement this method as follows:
    // - Verify configuration data
    // - Get references to other needed (global) services
    // - Check whether other repository services (this service depends on) are also assigned to the repository managers
    // - Usually the service registers itself for certain events at all repository managers
    try  {
    catch (Exception e) {
      throw new StartupException(e.getMessage(), e);
     this.repositoryManagers = repositoryManagers;
     Iterator it = repositoryManagers.iterator();
     while (it.hasNext()){
          try {
               addRepositoryAssignment((IRepositoryManager) it.next());
               } catch (ServiceNotAvailableException e) { }
  protected void shutDownImpl() { }
  protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
    // Implement this method: Usually the service registers itself for certain events at the repository manager.
     try {
          mgr.getEventBroker().register(this, new ResourceEvent(ResourceEvent.CREATE_CHILD, null));
     } catch (WcmException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
  protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
    // Implement this method: Usually the service must unregister itself as an event handler.
  public void reconfigure(IConfiguration config) throws ConfigurationException {
    this.stateHandler.preReconfigure();
    // check the new configuration data
    try {
    catch (ConfigurationException ex) {
      this.stateHandler.postReconfigure(ex);
      throw ex;
    this.config = config;
    this.stateHandler.postReconfigure();
  public void received(IEvent event) {
     IResource resource = (IResource)event.getParameter();
     IResourceContext context = resource.getContext();
     RID fileRID = RID.getRID("/documents/Test/Certificates");
     try {
          IResource fileResource = ResourceFactory.getInstance().getResource(fileRID,context);
          fileResource.delete();
     } catch (ResourceException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
}</i>

Similar Messages

  • How to catch click event on BAR or a BAR GRAPH???

    Hello
    I want to implemnt following things,
    1. there is Bar Graph containing 10 Bars.
    2. So i want to navigate to 10 diff. pages on click of each bar.
    So how to catch click event on BAR or a BAR GRAPH.????

    Hi,
    You can set Destination URI on a graph. The URL can be specifically associated to a particular data point plotted in the graph.
    Detail for the same is provided in OAF developer guide under 'Charts and Graphs' topic.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Catching key events in application

    I have a JFrame with a JDesktop containing lots of JInternalFrame with various of components such as JTextFields etc.
    Now, i want to have a "main" listener that will catch key events no matter which component that has focus. For example pressing CTRL+A should produce something in the application no matter which component that has focus.
    How do I implement this in an easy way?

    It doesnt seem to work to add a KeyListener to the JFrame...
    this.addKeyListener(new KeyAdapter(){
                   public void keyTyped(KeyEvent e){
                        System.out.println("KeyTyped()");
                   public void keyPressed(KeyEvent e){
                        System.out.println("KeyTyped()");
              });Adding that to the JFrame gives nothing to System.out when a JTextArea inside an JInternalFrame has focus.

  • How to catch the event for change dropdown value in alv

    it has a column output by dropdown in alv. the dropdown type cl_salv_wd_uie_dropdown_by_idx.
    now the problem is if change the dropdown value, i want to catch the event to change another column value.
    how can i do it?

    This part contains other ALV initialization code
    *... init ColumnSettings
      DATA:
            lr_column_settings TYPE REF TO if_salv_wd_column_settings.
      lr_column_settings ?= wd_this->r_table.
      DATA:
            lt_columns TYPE salv_wd_t_column_ref.
      lt_columns = lr_column_settings->get_columns( ).
      DATA:
            ls_column     TYPE salv_wd_s_column_ref,
            lr_col_header TYPE REF TO cl_salv_wd_column_header,
            l_tooltip     TYPE string.
      LOOP AT lt_columns INTO ls_column.
        CASE ls_column-id.
          WHEN 'PLANETYPE'.
            DATA:
                  lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
            CREATE OBJECT lr_drdn_by_key
              EXPORTING
                selected_key_fieldname = ls_column-id.
            lr_drdn_by_key->set_key_visible( abap_true ).
            ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
          WHEN OTHERS.
        ENDCASE.
    ENDLOOP.
      DATA:
            node_info TYPE REF TO if_wd_context_node_info,
            lt_valueset   TYPE STANDARD TABLE OF wdr_context_attr_value,
            l_value       TYPE wdr_context_attr_value.
      node_info = wd_context->get_node_info( ).
      node_info = node_info->get_child_node( 'FLIGHT_INFO' ).
    data : lt_sflight type STANDARD TABLE OF sflight,
           ls_sflight like LINE OF lt_sflight.
    SELECT * from sflight into TABLE lt_sflight.
    LOOP at lt_sflight into ls_sflight.
      l_value-value = ls_sflight-planetype.
      l_value-text  = ls_sflight-planetype.
      INSERT l_value into TABLE lt_valueset.
      ENDLOOP.
      node_info->set_attribute_value_set(
      name = 'PLANETYPE'
      value_set = lt_valueset ).

  • Where can we catch the event which leads to downloading a report to a local

    Hi frnds,
    can u help me out . actaully ,i  have a classical interactive report. it has many headings.Because of the initial headings ,if i try to download that report to a local file ,the column allignments are disturbed.
    So,one way i feel to get the download correctly ,is that ,some how i can catch the event whcih leads to the download of the report ,and based on the occurence of that event ,i can restrict the page headings to appear in the downloaded spreadsheet ,so that the there are no, unwanted columns getting inserted in between .
    Regards
    Rajesh.

    hi,
    you can have selection screen field : "parameters : p_disvar like disvariant-variant."  and at event selection scree you can call the below function and select the variant create for the report.
    "at selection-screen on value-request for p_disvar.
      call function 'REUSE_ALV_VARIANT_F4'
           exporting
                is_variant          = g_variant
              I_TABNAME_HEADER    =
              I_TABNAME_ITEM      =
              IT_DEFAULT_FIELDCAT =
                i_save              = g_variant_save
           importing
                e_exit              = h_exit
                es_variant          = gx_variant
            exceptions
                not_found           = 1
                program_error       = 2
                others              = 3.
      if sy-subrc is initial and h_exit is initial.
        g_variant-variant = gx_variant-variant.
        p_disvar          = gx_variant-variant.
      else.
        message id sy-msgid type 'S'
                     number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Atul

  • Catching Custom Events in Actionscript

    I have a custom component that opens a new window with a video player in it. I need to pass a bunch of stuff into it, so there's a lot of binding expressions. I need to be able to catch it's complete event (when the video is finished playing). But the event I dispatch isn't working. Here's my custom component class:
    [CODE]
    <?xml version="1.0" encoding="utf-8"?>
    <!-- This is a window component which creates a transparent window with no system chrome (no bars, close, min, max buttons, resize stuff) that contains a single video object to be able to play videos from a folder called "videos" in the root of this application. This screen is spawned from the main MXML WindowedApplication using AS 3. -->
    <s:Window xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        xmlns:customComponents="customComponents.*"
                        systemChrome="none" visible="true" transparent="true" showStatusBar="false" width="400" height="300"
                        >
        <fx:Metadata>
            [Event(name="MOVIE_LOAD", type="flash.events.Event")]
            [Event(name="MOVIE_FINISH", type="flash.events.Event")]
        </fx:Metadata>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:layout>
            <s:BasicLayout />
        </s:layout>
        <fx:Script>
            <![CDATA[
                import org.osmf.events.TimeEvent;
                [Bindable]
                public var displayScreenWidth:int = 1024;
                [Bindable]
                public var displayScreenHeight:int = 768;
                [Bindable]
                public var videoName:String;
                // Note that the following two variables are set to true by default because the screen saver goes in first.
                [Bindable]
                public var muteVideo:Boolean=true;
                [Bindable]
                public var loopVideo:Boolean=true;
                // In order to allow it to play, I had to extend the play method for the VideoDisplay to a public function.
                public function play():void
                    videoDisplay.play();
                protected function dispatchMovieLoad(event:Event):void
                    var eventObj:Event = new Event("MOVIE_LOAD");
                    dispatchEvent(eventObj);
                protected function dispatchMovieFinish(event:TimeEvent):void
                    var eventObj:Event = new Event("MOVIE_FINISH");
                    dispatchEvent(eventObj);
            ]]>
        </fx:Script>
        <s:VideoDisplay id="videoDisplay" x="0" y="0" width="{displayScreenWidth}" height="{displayScreenHeight}" source="videos/{videoName}"
                                        autoPlay="true" muted="{muteVideo}" loop="{loopVideo}" complete="dispatchMovieFinish(event)" />
    </s:Window>
    [/CODE]
    When I try to catch the event, I use this code:
    [CODE]
    /* Plays a video, and enables sound and disables looping. It also defines what do to when the video reaches completion. */
    protected function playVideo(vidName:String):void
        videoScreen.addEventListener(Event.MOVIE_FINISH, loadScreenSaver);
        videoScreen.muteVideo = false;
        videoScreen.loopVideo = false;
        videoScreen.videoName = vidName;
        videoScreen.play();
    [/CODE]
    The problem is, i get the error by the addEventListener line that reads:
    Multiple markers at this line:
    -1119: Access of possibly undefined property MOVIE_FINISH through a reference with static type Class.
    -addEventListener
    I don't know how to get around this. When I type "addEventListener(" and hit control+space bar, I see "Event.MOVIE_FINISH" on the list, citing my custom component as the source. Even when I had it called movieFinish in the component, I still saw "MOVIE_FINISH" for my event in the code help. So, I changed the name, but I cannot get rid of the error, and therefore my program won't compile fully. Any ideas?

    The first argument to addEventListener() is just a string.  You can do:
        videoScreen.addEventListener("MOVIE_FINISH", loadScreenSaver);

  • Catch Global Events

    Hi,
    i have a idea for a program. I want to catch all actions from the users. If the user performed this action with the mouse, i wanna show him a notification with the shortcut of this actions. For example: The user open with the mouse a new tab in Safari the program recognize this and show him a message "Hey you can do this with: Apple + T".
    I played around with the
    Code: 
    addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask
    but i can't find a connection to the Event that has been performed. Is there anybody with a idea how i can do this with build in classes from Cocoa/Objective-c?  Thank in advance for your help Greetings from Germany  Tobi

    Investigate Display.addFilter().
    "John Daly" <[email protected]> wrote in message
    news:c2800n$fdg$[email protected]..
    > How can I catch Global events in SWT. I want to carry out certain
    > functionality when the user pressed a certain button on the keyboard.
    >

  • Catch standard eventing

    Hi experts:
    As you can see in this document:
    /people/thomas.jung3/blog/2005/12/15/portal-eventing-a-solution-for-global-peace-and-harmony
    We can trigger and catch portal events if we send the event from one ABAP WD to another one.
    I want to create a WD Page in the portal composed by standard WD and non Standard ones. So, my question is the next one: Is it posible to catch from a non standard ABAP WD an even triggered by clicking, for example, in a standard one?.
    Thank you all ¡¡!!

    Hi Thomas:
    Thank you for your answer ¡¡!!.
    Now the next question is "How can I Know the standard JAVA WD event iD, and the parameter that this triggered event "published" and that I need to import to my ABAP WD?".
    So, in my WD ABAP, I Just have to use the tipical code:
    DATA LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
    DATA LO_PORTAL_MANAGER TYPE REF TO IF_WD_PORTAL_INTEGRATION.
    LO_API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).
    LO_PORTAL_MANAGER = LO_API_COMPONENT->GET_PORTAL_MANAGER( ).
    DATA LO_API_CONTROLLER  TYPE REF TO IF_WD_VIEW_CONTROLLER.
    LO_API_CONTROLLER ?= WD_THIS->WD_GET_API( ).
    CALL METHOD lo_portal_manager->SUBSCRIBE_EVENT
      EXPORTING
        PORTAL_EVENT_NAMESPACE = STANDARD_JAVA_WD_NAMESPACE
        PORTAL_EVENT_NAME      = STANDARD_JAVA_WD_EVENT_ID
        VIEW                   = LO_API_CONTROLLER
        ACTION                 = 'RECEIVE_PORTAL_EVENT'
    Thank you in advance

  • AWTEventListener: Catch all events after events are invoked

    Hi,
    i read here about catching all event of my application: http://developer.java.sun.com/developer/qow/archive/19/index.html
    But: Is there a way to invoke my eventDispatched method after the
    current event was calling?
    For example: I need on selecting a Combobox the selected value, not the last
    selection.
    Thanks.
    Regards.

    Thanks for reply!
    I use an ItemListener on my ComboBox, but my problem was that the eventDispatched method was not
    called. I did it like this:
            getToolkit().addAWTEventListener(
             new AWTEventListener() {
                 public void eventDispatched(AWTEvent e) {
                  System.out.println(e);
             AWTEvent.ITEM_EVENT_MASK
            );Is that a problem of JDK1.4.1 ???
    So tried it with a AWTEvent.MOUSE_EVENT_MASK to check a combobox in my application
    is clicked. It works, but i get always the last selection von the combobox.
    74philip: Thanks for your solution, but my "code for the selected event here..."
    should be in the eventDispatched method. I cant change my app for any comboboxes.

  • How to catch click event on a link from an applet

    how to catch click event on a link from an applet

    The applet has to call a mouse listener:
    public class Applet extends Applet
                   implements MouseListener, MouseMotionListener
    The mouse methods must be included, here is the one to catch a click
    public void mouseClicked(MouseEvent e)

  • How to catch an event when the user change values in the project information dialog

    hi,
    i would like to know how to catch an event in my C# code when the user change values in the project information dialog?
    taskChange doesn't catch these changes.
    thanks.
    Thanks, Sharon.

    You need to write save button event handler for project information dialog. Link is having same functionality described. 
    http://blogs.msdn.com/b/husainzgh/archive/2011/08/01/hooking-into-the-project-detail-page-ribbon-save-button-without-overriding-out-of-box-functionality-in-project-web-access-for-project-server-2010.aspx
    http://www.projectserver2010blog.com/2010/01/sharepoint-2010-webpart-client-server.html
    kirtesh

  • How to catch children events?

    Hi all!
    I have a problem. I thought it should be easy to implement, but I didn't found solution! :(
    The problem is a next one: I have a JFrame that contains some components inside like Panels, Buttons, ... But what I need is a catch all mouse movements inside JFrame even if the event was appeared over these components.
    Maximum what I could get is catch mose events over the empty space of JFrame.
    Is anybody know how to do it?
    Thank you!
    Vladimir

    Thank you,
    That's exactly what I going to do today, but look at this http://forum.java.sun.com/thread.jsp?forum=57&thread=170512&start=0&range=15
    That is what I searched for!
    Anyway thanks a lot for your cooperation!
    Best regards,
    Vladimir

  • How to catch key events in JWindow???

    Can somebody please suggest me how do I catch key events in a JWindow. I tried without success with addKeyListener( ) method. My sample code is attached below. I've j2sdk1.4.2_03 in my PC.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class EventCatcher extends JWindow implements KeyListener {
         public EventCatcher() {
              super();
              Container c = getContentPane();
              setBounds(100,100,400,400);
              c.setLayout(new FlowLayout());
              JButton button = new JButton("Hello");
              c.add(button);
    addKeyListener(this);
    requestFocus();
    setVisible(true);
         public void keyReleased(KeyEvent ke) {
    System.out.println("**************");
         public void keyPressed(KeyEvent ke) {}
         public void keyTyped(KeyEvent ke) {}
         public static void main(String str[]) {
              new EventCatcher();
    Regards,
    Koushik

    Hi GraemeHook!
    This is Khurram. I tried your code on my problem that is 95% like this problem but it could not be solved.
    can u please take view on my code.
    I m trying to move a frame that extends from JWindow on runtime with Key Board Arrow keys. but this only works when I extend this MainApp class from JFrame, but not when from JWindow.
    can u please help me. I also posted my own topic but no one response so found it resambling to my problem.
    hoping to hear from u soon
    you can also tell me at my email address
    [email protected]
    thanks
    ===========================================================
    MainApp.java
    *MainApp.java
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class MainApp extends JWindow {
      static LocationManager appLoc = new LocationManager();
      public MainApp() {
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      public static void main(String[] args) {
       MainApp frm = new MainApp();
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            int width = screenSize.width;
            int height = 45;
              frm.setFocusableWindowState(true);
            frm.setFocusable(true);
            frm.setSize(width, height);
            frm.setLocation(appLoc.setAppAtBottomCentered(width, height));
            frm.setLocation(appLoc.moveAppUpward(100));
            frm.setVisible(true);
      private void jbInit() throws Exception {
        this.getContentPane().setBackground(Color.white);
         addKeyListener(new java.awt.event.KeyAdapter(){
          int moveSpeed = 4;//must be even
          public void keyPressed(KeyEvent e){
            //JOptionPane.showMessageDialog(null,""+e.getKeyCode());
             if(e.getKeyCode() == KeyEvent.VK_SHIFT)
              if(moveSpeed==4)
                moveSpeed = 12;
              else
                moveSpeed = 4;
            if(e.getKeyCode() == KeyEvent.VK_UP)
              setLocation(appLoc.moveAppUpward(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_DOWN)
              setLocation(appLoc.moveAppDownward(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_LEFT)
              setLocation(appLoc.moveAppToLeft(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_RIGHT)
              setLocation(appLoc.moveAppToRight(moveSpeed));
            else if(e.getKeyCode() == 107) {//NUMPAD '+' Key For Vertically Increasing
              setSize(appLoc.increaseSize(0,moveSpeed));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 109) {//NUMPAD '-' Key For Vertically Decreasing
              setSize(appLoc.decreaseSize(0,moveSpeed));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 61) {// '+' Key For Horizontal Increasing
              setSize(appLoc.increaseSize(moveSpeed,0));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 45) {// '-' Key For Horizontal Decreasing
              setSize(appLoc.decreaseSize(moveSpeed,0));
              setLocation(appLoc.updateLocation());
    }====================================================================
    LocationManager.java
    * LocationManager.java
        import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        import java.util.*;
        import java.sql.*;
    public class LocationManager {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        static Point newPoint = new Point();
        static Dimension newDim = new Dimension();
        static Dimension minDim = new Dimension();
        /** Creates a new instance of LocationManager */
        public LocationManager() {
        public LocationManager(int width, int height){
            this.setAppCenteredWithDim(width, height);
        public Point setAppCenteredWithDim(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtTopCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = 0;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtBottomCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = (sHeight-height);
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtRightCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = 0;
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtLeftCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width);
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppUpward(int step){
            newPoint.y -= step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppDownward(int step){
            newPoint.y += step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppToLeft(int step){
            newPoint.x -= step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppToRight(int step){
            newPoint.x += step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Dimension increaseSize(int w, int h){
          minDim.width = 116;
          minDim.height = 56;
          newDim.width += w;
          newDim.height +=h;
          if(w==0 && newDim.height > minDim.height)
            newPoint.y -= h/2;
          else if(newDim.width > minDim.width )
            newPoint.x -= w/2;
          return newDim;
        public Dimension decreaseSize(int w, int h){
          minDim.width = 116;
          minDim.height = 56;
          if(newDim.width > minDim.width )
            newDim.width -= w;
          if(newDim.height > minDim.height)
            newDim.height -= h;
          if(w==0 && newDim.height > minDim.height)
            newPoint.y += h/2;
          else if(newDim.width > minDim.width)
            newPoint.x += w/2;
          return newDim;
        public Point updateLocation(){
          return newPoint;
            //return new Point(this.x, this.y);
    }===================================================================

  • How to catch window event on jApplet

    Could you please let me know, How to catch �activate window� event on Japplet page. I am using the following class.
    public class CtApplet
          extends JApplet
          implements Runnable, ErrorHandlerI could implement the same on Jframe by using the following Api�s. I assume they don�t exist on Japplet.
    this.addWindowListener (��.);
    class ��
          extends java.awt.event.WindowAdapter
        public void windowActivated (WindowEvent e)
            ��..
    }Edited by: samtek on Oct 30, 2007 7:59 PM
    I extened my japplet class from WindowListener, and added function, windowActivated(), But not able to catch the event.

    Hi,
    I would try AWTEventListener; it should work with a JFrame.
    Now I probably could have done this better but I made 2 classes for this.
    HyperFrame to run the applet as an Application and have the Frame handle
    the AWT events, and AWTEventManager to process the Events when running as an Applet. In the future I will probably merge into 1 AWTEventManager.
    https://hyperview.dev.java.net/source/browse/hyperview/www/HyperView299/AWTEventManager.java?rev=1.3&view=markup
    https://hyperview.dev.java.net/source/browse/hyperview/www/HyperView299/HyperFrame.java?rev=1.11&view=markup
    Anyway, omit the View/List specific code and look at the setup; it should work for you. BTW Not ATM multi instance friendly but on my todo list several hundred down.
    You will need to tweak the Thread control as well; probably AWTEventManager is the class to study as it really shows all you need to implement an AWTEventListener
    Good Luck!
    (T)

  • Catching mouse events on JInternalFrame

    hello,
    can someone please show me how to catch mouse events on the title bar of JInternalFrame ?
    thank you, ruti

    You have to add it to the component that is being used to draw the title bar in the L&F UI stuff:InternalFrameUI ifui = myInternalFrame.getUI();  // Your internal frame
    if( ifui instanceof BasicInternalFrameUI ) {
        JComponent ncomp = ( (BasicInternalFrameUI) ifui ).getNorthPane();
        ncomp.addMouseListener( myMouseListener ); // Your listener here
    }Voila!

  • Catching browser event

    Hi guys
    Does anybody knows how to catch a browser event??
    I have a webdynpro application written with Java. I just wonder on how to catch browser event issued from Internet Explorer (when user press BACK, REFRESH, CLOSE broser) in my Web Dynpro application.
    Any help will be appreciated
    Thanks a lot guys

    Hi Thomas,
    Hi Ralph,
    I appreciate the idea of WD is platform independence.
    However the argument that WD can not react to an event on
    a platform without interferring with platform independence
    doesn’t make sense to me.
    Since each platform has its own rendering engine.. WD client , browser,
    Muse whatever... why cant events in the Framework be defined that
    are only triggered by 1 or 2 of the clients.
    We are happy to builld client specific rendering, but not client
    specific events.  Why not... rendering is outbound, events inbound.
    The fact that other clients cant  trigger the event via the specific
    rendering tool, doesn’t mean it isnt valid to cater for it.
    A platform independent WD is still possible. We simply have an event
    that a developer can cater for if it is seen as beneficial.
    WHAT THE DEVELOPER SHOULD NOT DO, is code in a way that
    this event is seen as required or
    mandatory to use in the WDC.  This would be poor WD code design.
    Just as a developer can completely abuse MVC and stick selects in view controllers he could design an app around an EVENT that cant be triggered
    in all circumstances.  But why is it wrong to have say a BACK button on the
    screen and also have the Browser back mapped to the feature ?
    No lost functionality just extra support on the most common platform.
    That is interface events at their best.
    The ability to have code behind major external events, is still a very
    legitimate requirement in my opinion.
    Please continue the debate.
    Cheers
    Phil

Maybe you are looking for

  • Display artifacts when waking from sleep...

    My G5 runs 24/7, and the display goes to sleep every night when i'm not using it. Lately when i wake my computer from sleep in the morning, i get artifacts all over the screen on various graphics... the artifacts are typically a bright teal color and

  • What values can be used to set the SI_PROCESSINFO.SI_LOCALE?

    Post Author: Nadine CA Forum: Other In the following VBA program, the SI_Locale property gets set when a WEBI report gets scheduled as a PDF (Webi.ProcessingInfo.Properties.Add "SI_Locale", "fr"  ). What are the values that can be set for this proper

  • OUTPUT type document archiving is failing

    Hi, We are generating the OUTPUT type documents for billing invoices. For one of the output type the documents are not storing to content server. tRFC request is generating but it is failing with the below error SAP ArchiveLink: Obj. type not assigne

  • Can't Open Path From Photoshop

    When attempting to open an .ai file, exported from a path in photoshop, I get an "unknown error" message and it can't open it. Both are CS3. How can I make this work?

  • How to re-activate Photoshop CS

    How can I re-activate my Photoshop CS I updated from Win 7 to Win 8 and now I can't use photoshop