Detecting changes

hi folks,
I have a swing application that has a functionality to save the input. I want to know what is the common way to detect modification of input. If there's modification, i want to prompt the user to save if he/she is closing down the app. I'm thinking about using a listener on all input components(JTextField, JList, JComboBox,JTable,JButton). But the listener would be different for each type of component, ActionListener for JButton, CaretListener for JTextField, ListSelectionListener for JList, ect. So I want to write a class that implements all these Listeners, and if any of those events is triggered, then I know there's modification been made.
My question is: is there a better/more efficient/more elegant way of detecting changes in my app?
If not, any comments on my approach?
thanks!!

You can write an unique class implementing DocumentListener, ActionListener, ItemListener, etc..
But you still have to add the listener to all the components.
I'm thinking you can write a method void register(JComponent pane) Depending on the class JTextField,JCheckBox, etc... you add the class as a DocumentListener,
as an ActionListener, etc. If the component is a container, you can recursively invoke the method
for all the children

Similar Messages

  • XY-Graph / Plot legend: How to detect changes in 2nd/3rd/4th ... legend position

    Hello,
    I have an XY-Graph with 4 plots. How can I detect, for example, the color change of the second plot in the legend. The active plot, using a property node, is always plot 0. So I am not able to detect changes in the 2nd/3rd ... plot.
    Any ideas?
    Thanks a lot.
    Best regards,
    Michael
    Solved!
    Go to Solution.

    You can do it with an event sturcture.
    Attachments:
    Plot detect.vi ‏25 KB

  • Event Structure's value change, not detecting changes when tabbing thru array of clusters

    Hi!  I have an array of clusters (int, int, string, int) control, and want to detecting changes made to the it.  I used the Event Structure's value change case on the array, it works excellent except that it'll only detect the changes when you click out of the element or press the enter key (the one by the numbers, not carriage return).  I want it to detect the changes when I tab thru the cluster or array too, but I can't figure it out... Does anyone have any ideas?
    Thanks!

    mfitzsimons wrote:
    altenbach
    Tried Value Change with my example done in 7.1 and it doesn't trgger an event.  That is why I suggested Mouse Down.
    Curious. I did a few minor edits in 8.0 before saving as 7.1, but the simple value change event got triggered just fine when the value vas terminated with a tab in 7.1. Every time.  Strange....
    Are you on 7.1 or 7.1.1? Maybe there's a difference (I am using 7.1.1).
    LabVIEW Champion . Do more with less code and in less time .

  • Detect changes in an instance

    Hello,
    how can I detect changes in an instantiated object? I could serialize the object and write it into a file. After some minutes I could write it a second time into a file. Now I could compare the two files. But I thing this is not the best way for doing this, isnt't it.
    Any suggestions?
    Thanks

    it can be of any help, here's how I implement object changes:
    /** Interface for object instances comparison */
    interface ContentComparable {
       /** Returns a string describing the object instance for comparison */
       public String getCompareString();
    /** Custom class sample */
    public class CustomClass implements ContentComparable {
       private String    customField1;
       private int       customField2;
       /** Constructor */
       private CustomClass(String field1, int field2) {
          this.customField1 = field1;
          this.customField2 = field2;
       //------------------------------------------------------------ ContentComparable ---
       /** Returns a string describing the object instance for comparison */
       public String getCompareString() {
          String content = this.getClass().getName() + "["
                           + "customField1='" + this.customField1 + "', "
                           + "customField2=" + this.customField2 + "]";
           return content;          
       /** Returns TRUE if the object is equal to an other object
        * @param   otherobj  the other object
        * @return  TRUE or FALSE
        * @see #getCompareString()
       public boolean equals(Object otherobj) {
          if (otherobj instanceof CustomClass) {
             CustomClass classobj = (CustomClass)otherobj;
             return this.getCompareString().equals(classobj.getCompareString());
          return false;
    }With that, you just have to keep a copy of the getCompareString() of the object before any changes are made.
    When you want to test changes, call this method:
       // private member to hold copy of unchanged object string
       private String oldObjectValue;
       // Returns TRUE if object has changed
       private boolean testDataChanged() {
          if (oldObjectValue == null) oldObjectValue = object.getCompareString();
          String newObjectValue = object.getCompareString();
          return !oldObjectValue.equals(newObjectValue);  
       //...Hope this helped,
    Regards.

  • Adobe Revel not detecting changes to my catalogue

    When I sign in to Adobe Revel via Elements 12 it says it is detecting changes but then does nothing; no sync'ing symbol or anything.  Any ideas?

    Hi,
    Yes I did that when it wouldn't sync and it all got uploaded.  My iPad photos sync fine so I'm thinking it may be my pc. Macafee maybe?
    Sent from my iPad

  • Elements Agent stuck on Detecting Changes in PSE13

    I am running PSE13 on a Windows 8.1 desktop.
    My photo catalogue has about 40K pictures, but only 3K have been uploaded from PSE13 to Revel.  The Elements Agent is stuck on "Detecting Changes" and not synchronizing with Revel.
    I have signed out/in within PSE13 and turned the Elements Agent off and then on.  Still no changes.
    On my desktop, I have turned off all services and startup programs except for Adobe programs.
    Looking for help.

    Thanks a lot for replying, your example is being of help but
    i think you misunderstood my post and i still have some doubts.
    More than one item can be a winner, not just one, so i will
    have to call an update for each item.
    On my fill method i have something like this:
    public List fill(List fillParameters){
    List results = new ArrayList();
    results = dao.getBids();
    results = checkWinners(results); //this function checks each
    item and sets the winner porperty to true or false.
    return results;
    So when i call on Flex DataService.fill() it obtains the list
    of bids and each has its winner property to true or false. Then i
    insert a new item and the fill method is executed again (due to
    autoRefreshFill) and winner properties is set again but the
    updateCollection message only includes the new added item, it
    doesn't check for updates.
    So now, the real deal is where would i call the updateItem to
    push the changes? Should i call the updateItem inside the
    createItem function? on the refreshFill function? inside the fill
    function?
    I have checkWinners() function which is the one i call inside
    the fill function and that sets the winner property of each item,
    should i call the DataServiceTransaction.updateItem from there? I
    have my doubts because i am calling this function inside the fill
    method.
    So it all sums up in "where should i call the updateItem?"
    Thanks for you help, hope you can help me out with this last
    issue :)

  • Detecting changes in video

    Greetings all. I'm new to video editing and Premiere.
    Is anyone aware of a plug-in or software that can detect changes in video? I have been setting up my camera to shoot lightning vids, then walking away for minutes at a time. Needless to say, the flashes can be as short as a couple of frames, and locating these extremely short sections of clips can be very time consuming when visually searching frame-by-frame.
    I would think there would be a need for something like this for not only my situation, but for nature video or surveillance. The ideal app would locate changes in the scene and mark or log the locations.
    Thanks for any advice.
    Jeff Barnett

    Ok, wise guy! Are you telling me that you wouldn't chase lightning with me just because I've been hit before? Basic math: The odds are the same for me being struck now as they were the first time when I was 9. It's not like I go out wrapped in tin foil and climb trees to catch the perfect shot!
    And I'm sorry, but I ain't 18 no more ... I'm 55. I finally realized that I'm not indestructible like I was at that age. Besides, call me a weenie, but lightning images with interesting content (cityscape and North GA mountains in the distance), shot from within a giant Faraday cage (office building), is more visually interesting than from under the eaves of an aluminum strip shopping center with a tree shrouded 7-11 in the foreground! We have lots of trees here! LOL Like I said ... never found the great shot!
    Actually, my Canon does have a pre-roll function, but only 3 seconds, if I recall correctly. Really cool feature that I've used in conjunction with my remote to record a wren repeatedly returning to feed her hatchlings in a barn.
    I've used slaves for still work, but I'm not sure if I can get one to trigger my camcorder. I would either have to have some kind of PC (flash trigger) to infrared remote converter, or one that converts to the LANC input. Maybe other options, but I haven't discovered them.
    Thanks for the info, chuckle, and vote of confidence!
    Jeff

  • Detecting changes in the replication site list

    Is there a way, when using the replication manager, to detect changes in the replication site list without having to continuously call repmgr_site_list()?
    Even if you still need to call repmgr_site_list() to determine just what changed, it would still be useful to only call it when the result would be different than the previous call.

    Currently, no. However, we are working on an enhancement for a future
    release that would include such a feature.
    Drop me an email, if you like. My address conforms to the Oracle
    convention: [email protected]
    Alan Bram
    Oracle

  • Detecting changes in database

    Hi,
    I connected to MySQL database using JDBC, displayed all data I need. But now I would like to detect changes in database (for example when somebody in network insert new row, I need get an event and then read data from database again).
    Did any body know how to detect changes in database???
    Thank you.
    Petr

    your question is too general, there are many ways of doing this. what is it you're doing?

  • What are detected changes in tfs vs 'changes'

    Hello,
    I've done a lot of changes in our tfs collection like creating different branches and renaming/moving stuff, and change our primary workspace from server to local (vs2013).
    After checking in EVERYTHING from inside VS, when I'm issuing the command 'tf status', it returns a lot of changes, and the final line tels me "0 change(s), 3858 detected change(s)"   (every change is an 'add' type) . I've never seen
    that. what does it mean, that difference betwee 'changes' and 'detected changes' ? When I check from pending changes from VS it shows ZERO changes.
    Also, I've seen that 'tf status' has a toogle '[/nodetect]' that our beloved docs at msdn do not explain, they only mention it (https://msdn.microsoft.com/en-us/library/9s5ae285.aspx)... What's the point for that option ?
    Thanks in advance,
    Roger Tranchez

    Hi Roger,
    take a look at this blog post (http://blogs.msdn.com/b/phkelley/archive/2013/05/29/server-workspaces-vs-local-workspaces.aspx)
    While edits in a local workspace can be pended implicitly just by editing the file, adds and deletes still must be explicitly pended. However, TFS version control’s workspace scanner also detects new files which are ‘candidates’ for addition, and missing
    files and folders which are candidates for deletion. The Team Explorer’s Pending Changes Page has a link which shows the number of detected adds and deletes, and provides a link to the Promote Candidate Changes dialog which can be used to pend ‘real’ adds
    or deletes on these items. This is called “promoting” the candidate adds and/or deletes – because they become real pending changes.
    Detect Changes comes from local Workspace.
    Regards,
    Daniel

  • Detecting Change in Elements between Versions of XML Doc

    Hi There
    I have a structured XML Schema based table in XMLDB 9.2.0.4 and am trying to detect when a non-repeating element off the root element changes (audit).
    I have created a row level update trigger and each time one element is changed via UPDATEXML two or three other elements are detected as changed. I am wondering if I have some sort of DOM fidelity issue here and perhaps my trigger is not the best for detecting this. we use XS:ANY elements in the XML schema and I know that there appears to be space injection into the element tag content and also extraneous namespace tags on tags in the XS:ANY elements.
    Can you give me any advice on my schema XSD and perhaps my trigger. Maybe what I am trying to do is not possible until 10g version of XMLDB.
    XSD
    ====
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Martyn J Ricks (University of Tasmania) -->
    <!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by Grant John Hyland (University of Tasmania) -->
    <xs:schema xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns="http://www.utas.edu.au/cu" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.utas.edu.au/cu" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
         <xs:element name="UnitSetYear" type="UnitSetYearType" xdb:defaultTable="CU_UNIT_SET_YEARS_XML">
              <xs:annotation>
                   <xs:documentation>Comment describing your root element</xs:documentation>
              </xs:annotation>
         </xs:element>
         <xs:complexType name="OfferedInCoursesType" xdb:SQLType="CU_UN_OFFEREDINCRSS_TYP">
              <xs:sequence>
                   <xs:element name="Course" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="OFFERED_IN_COURSE" xdb:SQLType="VARCHAR2" xdb:SQLCollType="CU_UN_OFFERED_IN_CRS_COLTYP">
                        <xs:annotation>
                             <xs:documentation>Unit set is involved in these courses, as specified in the quality assurance manual.</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:length value="3"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="RecommendedTextType" mixed="true" xdb:SQLType="CU_UN_RECOMMENDEDTEXT_TYP">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded" xdb:SQLType="VARCHAR2"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="RecommendedTextsType" xdb:SQLType="CU_UN_RECOMMENDEDTEXTS_TYP">
              <xs:sequence>
                   <xs:element name="RecommendedText" type="RecommendedTextType" minOccurs="0" maxOccurs="unbounded" xdb:SQLCollType="CU_UN_RECOMMEND_TEXT_COLTYP" xdb:SQLName="RECOMMENDED_TEXT"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="RequiredTextType" mixed="true" xdb:SQLType="CU_UN_REQUIREDTEXT_TYP">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded" xdb:SQLType="VARCHAR2"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="RequiredTextsType" xdb:SQLType="CU_UN_REQUIREDTEXTS_TYP">
              <xs:sequence>
                   <xs:element name="RequiredText" type="RequiredTextType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="REQUIRED_TEXT" xdb:SQLCollType="CU_UN_REQUIRED_TEXT_COLTYP">
                        <xs:annotation>
                             <xs:documentation>Prescribed texts</xs:documentation>
                        </xs:annotation>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="BAMajorsType" xdb:SQLType="CU_UN_BAMAJORS_TYP">
              <xs:sequence>
                   <xs:element name="BAMajor" maxOccurs="unbounded" xdb:SQLName="BA_MAJOR" xdb:SQLType="VARCHAR2" xdb:SQLCollType="CU_UN_BA_MAJORS_COLTYP">
                        <xs:annotation>
                             <xs:documentation>Majors that this unit applies to in the BA degree course</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="20"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="AssessType" mixed="true" xdb:SQLType="CU_UN_ASSESS_TYPE">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="ReqTextType" mixed="true" xdb:SQLType="CU_UN_REQTEXT_TYP">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="RequisiteType" xdb:SQLType="CU_UN_REQUISITE_TYP">
              <xs:sequence>
                   <xs:element name="ReqType" xdb:SQLName="REQUISITE_TYPE" xdb:SQLType="VARCHAR2">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="6"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="ReqText" type="ReqTextType" xdb:SQLName="REQUISITE_TEXT"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="RequisitesType" xdb:SQLType="CU_UN_REQUISITES_TYP">
              <xs:sequence>
                   <xs:element name="Requisite" type="RequisiteType" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="REQUISITE" xdb:SQLCollType="CU_UN_REQUISITE_COLTYP"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="TeachPatternType" mixed="true" xdb:SQLType="CU_UN_TEACHPATTERN_TYP">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded" xdb:SQLType="VARCHAR2"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="DescType" mixed="true" xdb:SQLType="CU_UN_DESC_TYP">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="SpecialNoteType" mixed="true" xdb:SQLType="CU_UN_SPECIALNOTE_TYP">
              <xs:sequence>
                   <xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="UnitSetYearType" xdb:SQLType="CU_UN_UNITSETYEAR_TYP">
              <xs:sequence>
                   <xs:element name="UnitSetID" xdb:SQLName="UNITSET_ID">
                        <xs:simpleType>
                             <xs:restriction base="xs:integer">
                                  <xs:minInclusive value="10000000"/>
                                  <xs:totalDigits value="8"/>
                                  <xs:fractionDigits value="0"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="Year" xdb:SQLName="YEAR">
                        <xs:annotation>
                             <xs:documentation>The academic year of the unit set</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:integer">
                                  <xs:totalDigits value="4"/>
                                  <xs:fractionDigits value="0"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="UnitSetLabel" xdb:SQLName="SET_LABEL" xdb:SQLType="VARCHAR2">
                        <xs:annotation>
                             <xs:documentation>The label that will be used as terms of reference for the unit set</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="20"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="UnitSetTitle" xdb:SQLName="UNIT_TITLE" xdb:SQLType="VARCHAR2">
                        <xs:annotation>
                             <xs:documentation>The Unit Set Title for the Year</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="100"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="Offered" xdb:SQLName="OFFERED" xdb:SQLType="VARCHAR2">
                        <xs:annotation>
                             <xs:documentation>Is the unit on offer this year (Y/N). Defaults to Y.</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:length value="1"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="SpecialNote" type="SpecialNoteType" xdb:SQLName="SPECIAL_NOTE"/>
                   <xs:element name="InWeb" xdb:SQLName="IN_WEB" xdb:SQLType="VARCHAR2">
                        <xs:annotation>
                             <xs:documentation>Should this Unit Set appear on the web.</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:length value="1"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="Desc" type="DescType" xdb:SQLName="DESCRIPTION" xdb:SQLType="CLOB">
                        <xs:annotation>
                             <xs:documentation>Short description of Unit content</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="Staff" xdb:SQLName="STAFF" xdb:SQLType="VARCHAR2">
                        <xs:annotation>
                             <xs:documentation>Staff teaching this unit.</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:maxLength value="500"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="TeachPattern" type="TeachPatternType" xdb:SQLName="TEACHING_PATTERN">
                        <xs:annotation>
                             <xs:documentation>Number of lectures , tutorials, laboratories and workshops</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="Requisites" type="RequisitesType" xdb:SQLName="REQUISITES"/>
                   <xs:element name="Assess" type="AssessType" xdb:SQLName="ASSESSMENT">
                        <xs:annotation>
                             <xs:documentation>Mode of assessment and percentages</xs:documentation>
                        </xs:annotation>
                   </xs:element>
                   <xs:element name="BAMajors" type="BAMajorsType" minOccurs="0" xdb:SQLName="BA_MAJORS"/>
                   <xs:element name="RequiredTexts" type="RequiredTextsType" xdb:SQLName="REQUIRED_TEXTS"/>
                   <xs:element name="RecommendedTexts" type="RecommendedTextsType" xdb:SQLName="RECOMMENDED_TEXTS"/>
                   <xs:element name="OfferedInCourses" type="OfferedInCoursesType" xdb:SQLName="OFFERED_IN_COURSES"/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    Trigger
    ========
    CREATE OR REPLACE TRIGGER CU_UNITSETYR_XML_AUDR_TRG
    AFTER DELETE OR UPDATE
    ON CU_UNIT_SET_YEARS_XML
    FOR EACH ROW
    DECLARE
    v_user VARCHAR2(30);
    v_old_xml_doc xmltype;
    v_new_xml_doc xmltype;
    v_old_unitset_id cu_unit_sets.unitset_id%TYPE;
    v_old_offered VARCHAR2(1);
    v_new_offered VARCHAR2(1);
    v_old_inweb VARCHAR2(1);
    v_new_inweb VARCHAR2(1);
    v_old_title VARCHAR2(100);
    v_new_title VARCHAR2(100);
    v_old_staff VARCHAR2(500);
    v_new_staff VARCHAR2(500);
    v_old_special_note xmltype;
    v_new_special_note xmltype;
    v_old_unit_desc xmltype;
    v_new_unit_desc xmltype;
    v_old_teach_pattern xmltype;
    v_new_teach_pattern xmltype;
    v_old_assess xmltype;
    v_new_assess xmltype;
    v_old_offered_in_courses xmltype;
    v_new_offered_in_courses xmltype;
    v_old_BA_Majors xmltype;
    v_new_BA_Majors xmltype;
    v_old_req_texts xmltype;
    v_new_req_texts xmltype;
    v_old_reco_texts xmltype;
    v_new_reco_texts xmltype;
    v_old_year INTEGER;
    v_mod_type VARCHAR2(1);
    BEGIN
    -- Establish the username from the CUM_PORTAL_APP context
    v_user := sys_context('CUM_PORTAL_APP','CURRENT_USER');
    IF (v_user IS NULL) THEN
    -- Means that CUM Portal App did not make the change
    v_user := USER;
    END IF;
    -- Determine modification type
    IF (updating) THEN
    v_mod_type := 'U';
    ELSIF (deleting) THEN
    v_mod_type := 'D';
    END IF;
    v_old_xml_doc := :OLD.sys_nc_rowinfo$;
    v_new_xml_doc := :NEW.sys_nc_rowinfo$;
    SELECT extractvalue(v_old_xml_doc, '/UnitSetYear/UnitSetID'),
    extractvalue(v_old_xml_doc, '/UnitSetYear/Year'),
    extractvalue(v_old_xml_doc, '/UnitSetYear/Offered'),
    extractvalue(v_new_xml_doc, '/UnitSetYear/Offered'),
    extractvalue(v_old_xml_doc, '/UnitSetYear/UnitSetTitle'),
    extractvalue(v_new_xml_doc, '/UnitSetYear/UnitSetTitle'),
    extract(v_old_xml_doc, '/UnitSetYear/SpecialNote'),
    extract(v_new_xml_doc, '/UnitSetYear/SpecialNote'),
    extract(v_old_xml_doc, '/UnitSetYear/Desc'),
    extract(v_new_xml_doc, '/UnitSetYear/Desc'),
    extractvalue(v_old_xml_doc, '/UnitSetYear/Staff'),
    extractvalue(v_new_xml_doc, '/UnitSetYear/Staff'),
    extractvalue(v_old_xml_doc, '/UnitSetYear/InWeb'),
    extractvalue(v_new_xml_doc, '/UnitSetYear/InWeb'),
    extract(v_old_xml_doc, '/UnitSetYear/TeachPattern'),
    extract(v_new_xml_doc, '/UnitSetYear/TeachPattern'),
    extract(v_old_xml_doc, '/UnitSetYear/Assess'),
    extract(v_new_xml_doc, '/UnitSetYear/Assess'),
    extract(v_old_xml_doc, '/UnitSetYear/OfferedInCourses'),
    extract(v_new_xml_doc, '/UnitSetYear/OfferedInCourses'),
    extract(v_old_xml_doc, '/UnitSetYear/BAMajors'),
    extract(v_new_xml_doc, '/UnitSetYear/BAMajors'),
    extract(v_old_xml_doc, '/UnitSetYear/RequiredTexts'),
    extract(v_new_xml_doc, '/UnitSetYear/RequiredTexts'),
    extract(v_old_xml_doc, '/UnitSetYear/RecommendedTexts'),
    extract(v_new_xml_doc, '/UnitSetYear/RecommendedTexts')
    INTO v_old_unitset_id,
    v_old_year,
    v_old_offered,
    v_new_offered,
    v_old_title,
    v_new_title,
    v_old_special_note,
    v_new_special_note,
    v_old_unit_desc,
    v_new_unit_desc,
    v_old_staff,
    v_new_staff,
    v_old_inweb,
    v_new_inweb,
    v_old_teach_pattern,
    v_new_teach_pattern,
    v_old_assess,
    v_new_assess,
    v_old_offered_in_courses,
    v_new_offered_in_courses,
    v_old_BA_Majors,
    v_new_BA_Majors,
    v_old_req_texts,
    v_new_req_texts,
    v_old_reco_texts,
    v_new_reco_texts
    FROM dual;
    IF (v_old_unitset_id IS NOT NULL AND v_old_year IS NOT NULL) THEN
    -- Had to do this to avoid problems with create resource statement which on insert appears
    -- to manifest itself as an update of a null document????
    IF (updating OR deleting) THEN
    -- Audit the XML document
    INSERT INTO cu_unit_set_years_xml_audit
    (unitset_id, YEAR, xml_doc, mod_type, mod_by, mod_date)
    VALUES
    (v_old_unitset_id,
    v_old_year,
    v_old_xml_doc.getclobval(), -- convert to clob
    v_mod_type,
    USER,
    SYSDATE);
    END IF;
    IF (updating AND v_old_offered != v_new_offered) THEN
    cu_events_pkg.log_event(p_event_type => 'USOFF',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Offered">'||v_old_offered||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_inweb != v_new_inweb) THEN
    cu_events_pkg.log_event(p_event_type => 'USINWEB',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Publish on Web">'||v_old_inweb||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_title != v_new_title) THEN
    cu_events_pkg.log_event(p_event_type => 'USTIT',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="UnitSet Title">'||v_old_title||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_special_note.getClobVal() != v_new_special_note.getClobVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USSPECN',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Special Note">'||NVL(v_old_special_note.getStringVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_unit_desc.getClobVal() != v_new_unit_desc.getClobVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USDESC',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Description">'||NVL(v_old_unit_desc.getClobVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_staff != v_new_staff) THEN
    cu_events_pkg.log_event(p_event_type => 'USSTAFF',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Staff">'||NVL(v_old_staff,'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_teach_pattern.getClobVal() != v_new_teach_pattern.getClobVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USTEACHP',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Teaching Pattern">'||NVL(v_old_teach_pattern.getClobVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_assess.getClobVal() != v_new_assess.getClobVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USASSESS',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Asessment">'||NVL(v_old_assess.getClobVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_offered_in_courses.getStringVal() != v_new_offered_in_courses.getStringVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USOFFCRS',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Offered in Courses">'||NVL(v_old_offered_in_courses.getClobVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND ((v_old_BA_Majors IS NULL) OR (v_old_BA_Majors.getStringVal() != v_new_BA_Majors.getStringVal()))) THEN
    -- Special Treatment here because the BAMajors tag is optional.
    -- If missing this causes an error with the getClobVal() method.
    IF (v_old_BA_Majors IS NULL) THEN
    cu_events_pkg.log_event(p_event_type => 'USBAMAJ',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="BAMajors">NULL</Col>
    </Row>
    </RowSet>'));
    ELSE
    cu_events_pkg.log_event(p_event_type => 'USBAMAJ',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="BAMajors">' || v_old_BA_Majors.getStringVal() ||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    END IF;
    IF (updating AND v_old_req_texts.getClobVal() != v_new_req_texts.getClobVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USREQTXT',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Required Texts">'||NVL(v_old_req_texts.getClobVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    IF (updating AND v_old_reco_texts.getClobVal() != v_new_reco_texts.getClobVal()) THEN
    cu_events_pkg.log_event(p_event_type => 'USRECOTXT',
    p_enacted_by => v_user,
    p_subject_type => 'UNITSETX',
    p_subject_id => to_char(v_old_unitset_id),
    p_subject_year => v_old_year,
    p_previous_values =>
    xmltype('<RowSet>
    <Row>
    <Col ColName="Recommended Texts">'||NVL(v_old_reco_texts.getClobVal(),'NULL')||'</Col>
    </Row>
    </RowSet>'));
    END IF;
    END IF;
    END;

    Be aware that you could also do an ALTER SESSION instead of a ALTER SYSTEM. This would prevent to shutdown the database to make the change, within the session, active.
    M

  • Detecting changes in class attributes

    Hi,
    I am trying to find the best way to do the following.
    I have a class that has multiple attributes which can be access via getters and setters. I would like to persist this object in LDAP (I have my reasons) and would like to only persist the changes. Now I would like to do a Hibernate like service, where you define the attributes etc and then access them via the class, but I would like to be able to detect when a change has been made to the attributes and only persist those changes.
    Is this possible to do? I was thinking using AOP to insert rules on the attributes at runtime and add a Map that contained the original and new value and what the change actually was i.e update, delete, add and then write the update as required.
    This is mainly for 1.4.x

    No, what I am trying to do is this.
    I have a class that I know the fields I want to track / monitor for changes, and then have a method that I can call to find out if the class is 'dirty' i.e. there has been a change to one or more of the fields I am tracking / monitoring.
    Once I know the class is dirty (it has been updated) I want to find out those fields that have changed and make a modification / addition / deletion request.
    I think AOP is the way to go, but I am not sure.....
    This is not for new object that I am not aware of, as the data has not been persisted yet. This is for new objects I construct and return to the user.
    Message was edited by:
    nirving

  • Detecting changes in form data

    Hello!
    If this is obvious, i'm seeing it (or finding the answer). Is there a simple way to detect whether someone has changed the data on a form before hitting submit?
    thanks!
    -jeff

    ok, i'm trying to think thru the logic of this but i'm not quite keeping it all together in my head. i thought i'd:
    1) set a variable when i hit the page w/ the form that includes a string concatenation of all the form fields.
    2) when the form is submitted, on the action page, i'd repeat this & compare it to the first variable i set to see if they are the same or not.
    make sense? the tricky thing is, my form page and my action page (the page i submit to) are the same. can any1 think of a way to pull this off? i'd really rather not use javascript if at all possible.
    thanks!
    -jeff

  • Detecting Changes In Clipboard Data?

    Hi, is it possible to detect when data on the clipboard has changed in Java? I am looking to generate an event or similar when something is copied.
    Thanks

    Check out the ClipboardOwner Interface. Basically if you add data to the clip board you are the owner until another application changes the data at which point you are notified of the change.

  • Detecting change of position and size of child components

    As a JavafX learning excercise I want to create a scrollable container (Scrollbox). This may not seem a difficult thing to do but I want to simulate the CSS "overflow: auto" behaviour so the scrollbars only appear when the content overflows the container.
    With the following code I can detect when the content changes and determine if scrollbars are needed, but if any of the child components are moved or resized I need to call checkOverflow again and I can't figure out the binding to do this.
    override var content on replace {
    checkOverflow();
    I may have the approach completely wrong so any help is much appreciated.
    Thanks.
    coolbeans

    This is what I have ended up with. The container will dynamically add vertical and horizontal scrollbars if any nodes in the content overflow the scrollbox container. I have also added an option to allow the scrollbox area to be scrolled by dragging the content area but if you don't like this you can turn it off. The source code is below and as this is my first look at Javafx I will be interested in any feedback.
    * ScrollBox.fx
    * Copyright 2009 Coolbeans
    package coolbeans;
    import javafx.scene.CustomNode;
    import javafx.scene.Node;
    import javafx.scene.Group;
    import javafx.scene.layout.Panel;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.control.ScrollBar;
    import javafx.scene.input.MouseEvent;
    public class ScrollBox extends CustomNode {
    //Public Properties
    public var width: Number = 300 on replace { checkControls(); };
    public var height: Number = 300 on replace { checkControls();}
    public var content:Node[];
    public var borderColor:Color = Color.LIGHTGRAY;
    public var fill:Color = Color.WHITE;
    public var allowDragScroll:Boolean = true;
    //Private Stuff
    var view: Panel;
    var saveVscrollVal: Float;
    var saveHscrollVal: Float;
    var hscroll:ScrollBar = ScrollBar {
    vertical: false;
    visible: false;
    min: 0;
    var vscroll:ScrollBar = ScrollBar {
    vertical: true;
    visible: false;
    min: 0;
    override public function create() : Node {
    Group {
    content: [
    Rectangle {
    fill: bind fill
    width: bind width - 1
    height: bind height - 1
    stroke: bind borderColor
    hscroll, vscroll,
    Group {
    content: [
    view = Panel {
    content: bind content;
    onLayout: function() : Void {
    checkControls();
    layoutX: bind -hscroll.value
    layoutY: bind -vscroll.value
    clip: Rectangle {
    width: bind if (vscroll.visible) then
    width - vscroll.width
    else width;
    height: bind if (hscroll.visible) then
    height - hscroll.height
    else height;
    onMousePressed: function( e: MouseEvent ):Void {
    saveVscrollVal = vscroll.value;
    saveHscrollVal = hscroll.value;
    onMouseDragged: function( e: MouseEvent ):Void {
    handleMouseDrag(e.dragX, e.dragY);
    clip: Rectangle { width: bind width, height: bind height}
    function checkControls() : Void {
    var maxX:Float = 0;
    var maxY:Float = 0;
    //Calculate the maximum size of the viewport
    for (c in content) {
    var b = c.boundsInLocal;
    if (b.maxX > maxX) maxX = b.maxX;
    if (b.maxY > maxY) maxY = b.maxY;
    if (maxX > width) {
    hscroll.width = width;
    hscroll.layoutY = height - hscroll.height - 1;
    hscroll.max = maxX - width;
    hscroll.visible = true;
    } else {
    hscroll.value = 0;
    hscroll.visible = false;
    if (maxY > height) {
    vscroll.height = height;
    vscroll.layoutX = width - vscroll.width - 1;
    vscroll.max = maxY - height;
    vscroll.visible = true;
    } else {
    vscroll.value = 0;
    vscroll.visible = false;
    //Make sure the scrollbars don't overlap in the bottom right corner
    if (hscroll.visible and vscroll.visible) {
    hscroll.width -= vscroll.width;
    vscroll.height -= hscroll.height;
    view.width = maxX;
    view.height = maxY;
    function handleMouseDrag(dragX:Float, dragY:Float) : Void {
    if (allowDragScroll = false) return;
    if (vscroll.visible) {
    var newpos = saveVscrollVal + -dragY;
    if (newpos < vscroll.min)
    newpos = vscroll.min
    else if (newpos > vscroll.max)
    newpos = vscroll.max;
    vscroll.value = newpos;
    if (hscroll.visible) {
    var newpos = saveHscrollVal + -dragX;
    if (newpos < hscroll.min)
    newpos = hscroll.min
    else if (newpos > hscroll.max)
    newpos = hscroll.max;
    hscroll.value = newpos;
    }

Maybe you are looking for

  • Bridge CC opens files on simple click

    Hi, The subject says it all : Bridge CC Mac (6.0.1.6) opens files on select (simple click). It is very inconvenient and I can't for the life of me find a place where to change this absurd behaviour or is it a bug ? My context : MacBook Pro late 2011,

  • I do not get full strengh from my 400n

    Hi, I do not know why but somethings my connection becomes very slow then dissconnects the after 1 mins it tries to reconnect again but after the internet is very slow. This is a dual band router. How can I fix this problem. Thanks, Message Edited by

  • Why acrobat  it is not working

    why acrobat  it is not working

  • Activation of HEMI function in UPK 3.5.1

    Hi All, I have an urgent requirement of activating HEMI support function in UPK 3.5.1. As per my understannding, HEMI is a support function which automatically links Oracle to UPK. So if a user needs help whilst navigating the system they can click o

  • Framework Order without Requisition

    Hi All, We wish to cater for the following scenario: All purchase orders require a requisition AND A framework order does not require a requistion By using the Functional Authorization for Buyer - this would mean that the Framework Order also require